
Prefiere el consumo de lo Hecho en México
BúsquedaHagamos que México crezca..
![]() Prefiere el consumo de lo Hecho en México Posts Recientes
Conversación |
Printing with Zebra Technologies RW-420 Printer and Symbol Motorola MC70 Mobile Terminal using Bluetooth connections..
http://www.opennetcf.com/FreeSoftware/OpenNETCFIOSerial/tabid/252/Default.aspx Then using the library I make a light class to print CPCL Code in Zebra RW 420. The Bluetooth connection between the RW420 and MC70 was successfully, Creating a Serial Com Port in ther mobile terminal with Windows Mobile 2005. Only I need Label Vista for Zebra to configure the properties of serial port of the mobile printer. If anyboy have any problem using RW420 printer, I put the code of my class, only you will need add the class in a namespace:
class Zebra { OpenNETCF.IO.Serial.Port Serial; string status; string status_error; string receive_data; public Zebra() { status = ""; status_error = ""; receive_data = ""; } public Boolean OpenPort(string portName) { StatusClean(); OpenNETCF.IO.Serial.HandshakeNone portSettings = new OpenNETCF.IO.Serial.HandshakeNone(); Serial = new OpenNETCF.IO.Serial.Port(portName, portSettings); Serial.DataReceived += new OpenNETCF.IO.Serial.Port.CommEvent(dataReceived); Serial.RThreshold = 1; Serial.InputLen = 30; Serial.SThreshold = 1; Serial.Settings.BaudRate = OpenNETCF.IO.Serial.BaudRates.CBR_57600; Serial.Settings.Parity = OpenNETCF.IO.Serial.Parity.none; Serial.Settings.StopBits = OpenNETCF.IO.Serial.StopBits.one; Serial.Settings.ByteSize = 8; if (!Serial.IsOpen) { try { Serial.Open(); status = "Port opened"; return true; } catch (Exception ex) { status_error = "Error in port opening"; return false; } } else { return true; } } /// <summary> /// Close Serial Port /// </summary> public void ClosePort() { StatusClean(); try { status = "Serial Port closed successfully"; Serial.Close(); } catch { status_error = "Seial Port not closed"; } } /// <summary> /// Send a string to the Serial Port /// </summary> /// <param name="cmd"></param> public void SendCmd(string cmd) { StatusClean(); if (Serial != null) { if (Serial.IsOpen) { try { Serial.Output = StrToByteArray(cmd); } catch (Exception ex) { status_error = ex.Message.ToString(); } } } else { status_error = "Port is not opened"; } } /// <summary> /// Allow to know the incoming string from serial port /// </summary> /// <param name="s"></param> /// <param name="e"></param> public void ReceivedData(object s, EventArgs e) { byte[] inputData = new byte[30]; inputData = Serial.Input; string displayString = Encoding.ASCII.GetString(inputData, 0, inputData.Length); receive_data += displayString; } //________________________ /// <summary> /// Convert a string to byte array /// </summary> /// <param name="str"></param> /// <returns></returns> public static byte[] StrToByteArray(string str) { System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); return encoding.GetBytes(str); } /// <summary> /// Clean the status properties /// </summary> private void StatusClean(){ status_error = ""; status_error = ""; status = ""; }
//Create the property in your class private Zebra ZebraPrinter; // call to the constructor ZebraPrinter = new Zebra(); //And execute the OpenPort Method given the Serial Port of your Connection if (ZebraPrinter.OpenPort("COM4") == true) { //If the connection is successfully then send the string to Serial Port ZebraPrinter.SendCmd("! 0 200 200 800 1\r\nLABEL\r\nCONTRAST 0\r\nTONE 0\r\nSPEED 3\r\nPAGE-WIDTH 240\r\nBAR-SENSE\r\nTEXT90 4 3 36 288 .88\r\nTEXT90 5 2 163 273 SWEATSHIRT\r\nVBARCODE UPCA 2 1 45 139 576 04364503284\r\nTEXT90 7 0 191 511 043645032841\r\nTEXT90 5 0 4 524 COMPARE AT\r\nTEXT90 4 0 30 508 $ 30.00\r\nTEXT90 5 0 115 575 ZD-180-KL\r\nTEXT90 5 2 119 269 ALL COTTON\r\nTEXT90 7 0 114 389 01/17/98\r\nTEXT90 0 0 208 173 EA00-732-00560\r\nTEXT90 5 0 82 519 ELSEWHERE\r\nBOX 189 358 217 527 1\r\nPRINT\r\n"); } //Close the POrt when you finish to send data to the Zebra Printer ZebraPrinter.closePort(); My English suck.. but I need to practice it... #2 Re: Printing with Zebra Technologies RW-420 Printer and Symbol Motorola MC70 Mobile Terminal using Bluetooth connections..yo tambien quisiera el proyecto para probarlo, Interensante aplicacion. [ Responder (0) ]
#3 Re: Printing with Zebra Technologies RW-420 Printer and Symbol Motorola MC70 Mobile Terminal using Bluetooth connections..Hoola! Acabo de leer tu articulo, me parece buenisimo. Yo estoy desarrollando una aplicacion que mande a imprimir desde un MC70 a una Zebra MC320 pero lo estoy haciendo en Java. Sabes de alguna libreria que me pueda ayudar a lograr la conexion con bluetooth? intente JSR82 pero parece que no la soporta. [ Responder (0) ]
#4 Re: Printing with Zebra Technologies RW-420 Printer and Symbol Motorola MC70 Mobile Terminal using Bluetooth connections..
Javier Vargas, <E-Mail> / 8 November, 7:54am
Hola estoy tratando de hacer lo mismo pero con una zebra ql320, mi aplicacion me arroja un erro error: "CreateFile Failed: 55". Que creen que pueda ser? [ Responder (0) ]
#5 Re: Printing with Zebra Technologies RW-420 Printer and Symbol Motorola MC70 Mobile Terminal using Bluetooth connections..Todo eso va bien, pero... alguien puede decirme como conectar la PDA a la Impresora??? Porque la detecta como un Device y hasta ahi bien, le asiguno un puerto desde la PDA y bien también pero al transferir un simple fichero txt plano desde la PDA no encuentra a la impresora. Y si que esa visible que la he configurado yo. [ Responder (0) ]
#6 Re:Printing with Zebra Technologies RW-420 Printer and Symbol Motorola MC70 Mobile Terminal using Bluetooth connections..Hola que tal interesante el articulo, pero tengo una pregunta este agarra los puertos COM solamente o tambien se puede por bluetooth , o de plano el bluetooth lo maneja como puerto COM gracias ojala y me puedas respoder [ Responder (0) ]
#7 Re:Printing with Zebra Technologies RW-420 Printer and Symbol Motorola MC70 Mobile Terminal using Bluetooth connections..Cuándo usas bluetooth, tienes que crear un puerto COM Virtual con la conexión bluetooth y es la manera como funcionaría esta impresora con cualquier dispositivo que tenga conexión inalámbrica bluetooh. [ Responder (0) ]
#8 Re:Printing with Zebra Technologies RW-420 Printer and Symbol Motorola MC70 Mobile Terminal using Bluetooth connections..
Mariano A Ludueña., <E-Mail> / 10 August, 6:16pm
Hola, yo estoy programando para una Zebra RW420, con un dispositivo movil SYMBOL MC9090-G, con windows mobile, y por medio de bluetooth quiero enviar un codigo CPCL para imprimir una etiqueta simple. Configure el bloetooth, le asocie un puerto com, lo pairee, y con la libreria del compact framework 2.0 de puerto serie intente enviar el codigo, pero sin resultados. Alguna idea ? Gracias !. [ Responder (0) ]
#9 Re:Printing with Zebra Technologies RW-420 Printer and Symbol Motorola MC70 Mobile Terminal using Bluetooth connections..Tienes que configurar la velocidad, paridad, bit de parada y control de flujo en la impresora RW 420 y esos mismos datos deben estar en la configuración del puerto COM virtual de la conexión bluetooth de la MC9090. [ Responder (1) ]
#9.1 Re:Re:Printing with Zebra Technologies RW-420 Printer and Symbol Motorola MC70 Mobile Terminal using Bluetooth connections..hola, me fue muy util, por fin logre imprimir, pero tendras alguna breve explicacion de la funcion Send? para modificar la estructura de la etiqueta.. pasa que ademas al mandar 1, la impresora jala 4 etiquetas.. no sé que parametro cambiar o como solucionarlo.. gracias [ Responder (0) ]
#10 Re:Printing with Zebra Technologies RW-420 Printer and Symbol Motorola MC70 Mobile Terminal using Bluetooth connections..La función send lo único es enviar datos al puero serial, imagino que te refieres al código que se envía, ese es código CPCL, busca en google o en la página de zebra el manual sobre el lenguaje CPCL para que tengas una idea más clara de como se parametriza esta información saludos. [ Responder (0) ]
Dejar un comentario
Fuentes XML de comentario: RSS | Atom
Estadísticas de visitantes174765 |
Nube de EtiquetasEventosEncuestaComentarios Recientes
|
#1 Re: Printing with Zebra Technologies RW-420 Printer and Symbol Motorola MC70 Mobile Terminal using Bluetooth connections..
Se ve muy interesante, me podrian enviar el proyecto para probarlo. GRACIAS