Serial Port sending data problem


kanber

Recommended Posts

Hi,

Please find attached file. I am trying to sent a string with serial port."010202360003000000000000000000000366\161"

if I sent manuel on monitor Screen with sent button everthing is working.

Tx: 010202$00030000000000000000000003B\161

Rx: 0102060000000000000000000000000003f\130

But on main page also I put a button and when I press that button on monitor screen I see;

Tx: \01\02\02\36\00\03\00\00\00\00\00\00\00\00\00\00\03\66\\161

Rx: 0102060000000000000000000000000003f\1300102060000000000000000000000000003f\130

there are always two "\". it must be only one "\".

what is the problem?

CS_S

post-1585-1283758488_thumb.jpg

CP25HabFile.ddp

Link to comment
Share on other sites

\ notation only applies in the monitor window. If you are going to use write() from a string, you have to have the actual binary characters, generated usually using chr() or chra(). If you have a string of binary characters, I suggest chra(). Something like:

chra({1,2,2,36,0,3,0,0,0,0,0,0,0,0,0,0,3,66,161})

I'm assuming of course that what you typed in the forum and what actually appeared in your post are different. The forum software tends to pull out all \'s

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.