Advertisement
danielcomcom

Print Label using ZPL code and FlexsQ5

Dec 19th, 2022
845
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. let printLabel = 0;
  3.  
  4. //ZPL Code to print
  5. let zpl = "^XA^PW600^LL400^PON^FO100,75^A0N,50,50^FDHello!  My Name is^FS^FO120,150^A0N,85,85^FB380,1,20,C,0^FDFlexSCADA^FS^FO120,230^A0N,85,85^FB380,1,20,C,0^FDFlexsQ5^FS^FlexSCADA,FlexsQ5^FS^FO30,30^GB550,350,2,B,2^FS^FO150,340^A0N,30,30^FDZebra Technical Support^FS^FO550,150^A0B,20,20^FDwww.zebra.com^XZ";
  6.  
  7. //URL for Printer ***Update with IP of Printer***
  8. let url = "http://172.16.0.22/pstprnt";
  9.  
  10. while(run()){
  11.  
  12.   if(printLabel === 0){ //Only print a label if this variable is = to 0
  13.    //Send ZPL Code to Printer
  14.     let res = http.req(url,zpl,1000,false);
  15.     //Log results of Request
  16.     print("POST TEST: Received from server",JSON.stringify(res));
  17.     printLabel = 1; // Set this variable to 1 so we don't get any more labels
  18.   }
  19.   waitMS(10000);
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement