L
Lonifasiko
Hi,
I must communicate my PDA with a device via serial communication. The
device brings a cable ready for that, and in order to provide a seriaI
port to my PDA, I bought this cable:
http://www.cablematic.com/index.php?_cl_id=1&fam=128&p=25&pp=&mode=1&id=90&fam=128&pag=2&p=25
Well, I have some specifications from my manufacturer. They are related
for device-PC (not PDA) communication via serial port, but I suppose
they will be the same for device-PDA coomunication. I sum up them:
Baud Rate = 9600 bps Data Bits = 8
Stop Bits = 1 Parity = none
Flow Control = None Com Port = port utilized (I'm trying with "COM1")
And here are another conditions:
1. The computer must assert (apply a positive RS-232 voltage to) RTS
and/or DTR. Either or
both of these signals supply power to the cable circuitry.
2. The computer may leave RTS "open" but may not drive it to a negative
RS-232 level.
3. The computer communications port must be set to 9600 baud, 8 data
bits, no parity, and one
stop bit.
I've been able to open the serial port on COM1, and send a command
specified by the manufacturer (no error indeed) that should wake up the
device, but I'm not seeing any result on the device's screen.
I've carefully followed the manufacturer's specifications and I'm using
CF 2.0 with System.IO.Ports.SerialPort class. This is my code:
-------------------------------------------------------------------------
SerialPort sp = new SerialPort();
sp.BaudRate = 9600;
sp.StopBits = StopBits.One;
sp.Parity = Parity.None;
sp.DataBits = 8;
sp.PortName = "COM1";
sp.RtsEnable = true;
sp.DtrEnable = true;
//sp.Encoding = Encoding.ASCII;
//sp.Handshake = Handshake.None;
try
{
sp.DataReceived += new
SerialDataReceivedEventHandler(this.ReceiveData);
sp.ErrorReceived += new
SerialErrorReceivedEventHandler(this.ErrorInSerialCommunication);
sp.WriteTimeout =
System.IO.Ports.SerialPort.InfiniteTimeout;
sp.Open();
sp.WriteLine("DMP");
MessageBox.Show("Command sent");
}
catch (Exception exc)
{
MessageBox.Show(exc.Message);
}
private void ReceiveData(Object sender, SerialDataReceivedEventArgs e)
{
MessageBox.Show("Receive Data");
}
-----------------------------------------------------------------------------------------
Hope you can see something that is not letting me communicate properly
with the device.
Thanks very much in advance.
I must communicate my PDA with a device via serial communication. The
device brings a cable ready for that, and in order to provide a seriaI
port to my PDA, I bought this cable:
http://www.cablematic.com/index.php?_cl_id=1&fam=128&p=25&pp=&mode=1&id=90&fam=128&pag=2&p=25
Well, I have some specifications from my manufacturer. They are related
for device-PC (not PDA) communication via serial port, but I suppose
they will be the same for device-PDA coomunication. I sum up them:
Baud Rate = 9600 bps Data Bits = 8
Stop Bits = 1 Parity = none
Flow Control = None Com Port = port utilized (I'm trying with "COM1")
And here are another conditions:
1. The computer must assert (apply a positive RS-232 voltage to) RTS
and/or DTR. Either or
both of these signals supply power to the cable circuitry.
2. The computer may leave RTS "open" but may not drive it to a negative
RS-232 level.
3. The computer communications port must be set to 9600 baud, 8 data
bits, no parity, and one
stop bit.
I've been able to open the serial port on COM1, and send a command
specified by the manufacturer (no error indeed) that should wake up the
device, but I'm not seeing any result on the device's screen.
I've carefully followed the manufacturer's specifications and I'm using
CF 2.0 with System.IO.Ports.SerialPort class. This is my code:
-------------------------------------------------------------------------
SerialPort sp = new SerialPort();
sp.BaudRate = 9600;
sp.StopBits = StopBits.One;
sp.Parity = Parity.None;
sp.DataBits = 8;
sp.PortName = "COM1";
sp.RtsEnable = true;
sp.DtrEnable = true;
//sp.Encoding = Encoding.ASCII;
//sp.Handshake = Handshake.None;
try
{
sp.DataReceived += new
SerialDataReceivedEventHandler(this.ReceiveData);
sp.ErrorReceived += new
SerialErrorReceivedEventHandler(this.ErrorInSerialCommunication);
sp.WriteTimeout =
System.IO.Ports.SerialPort.InfiniteTimeout;
sp.Open();
sp.WriteLine("DMP");
MessageBox.Show("Command sent");
}
catch (Exception exc)
{
MessageBox.Show(exc.Message);
}
private void ReceiveData(Object sender, SerialDataReceivedEventArgs e)
{
MessageBox.Show("Receive Data");
}
-----------------------------------------------------------------------------------------
Hope you can see something that is not letting me communicate properly
with the device.
Thanks very much in advance.