How can I feedback the RS-232 response to TouchPanel?
winstonma
Posts: 45
I want to feedback the RS-232 response from the devices (Projector for example). Where should I read the RS-232 response message?
Sample code would help a lot. Thanks
Sample code would help a lot. Thanks
0
Comments
{
ONLINE:
{
SEND_COMMAND dvMLPreAmp,'SET BAUD 38400,E,8,1' // according to your device
}
STRING:
{
char cLCD_DATA[64];
cLCD_DATA= DATA.TEXT
// do what ever you like with the text...
}
}
Also, a useful tool is to use commands like SEND_STRING 0, " (*stuff to send to screen here*) ". Outputs from this command will show up in the diagnostics tab. I use it a lot when parsing response strings to make sure I'm getting the expected result.
EXAMPLES:
SEND_STRING 0,"'Command Received O.K.;'"
SEND_STRING 0,"'sRESPONSE_QEUE = ',sRESPONSE"
SEND_STRING 0,"'SPACKETTYPE =',sPACKET_TYPE"
--John
ex.
SEND_COMMAND dvTP,"'@TXT',1,'STRING = ', sRESPONSE_STRING"
--John
Or you can use the ^TXT command (G4 command)
SEND_COMMAND dvTP, "'^TXT-1,0,RESPONSE STRING = ',sRESPONSE_STRING"
--John
I've not tested the above, but it should give you the idea.