How can I feedback the RS-232 response to TouchPanel?
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"
DEFINE_EVENT DATA_EVENT [dvDEVICE]//RESPONSE STRINGS RECEIVED FROM DEVICE { STRING: { stack_var char cur_cmd[18] sRESPONSE_QEUE="sRESPONSE_QEUE,data.text" send_string 0,"'From data event in module for dvDEVICE: sRESPONSE QEUE =', sRESPONSE_QEUE,' DATA.TEXT = ', data.text" } }--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
button_event[dvTP,nSelectInputx] { push: { IF(!nPwrStat) { send_command dvDevice,"'turn it on',13" //if it's not on, turn it on nPwrStat = 1 //you can control this parameter with queries and responses if the device supports it nWarmed = 0 wait 300 // wait until the device is ready to handle an input change -- maybe 30 sec for a projector { nWarmed = 1 } } wait_until nWarmed { send_command dvDevice,"'Select Desired Input',13" } } }I've not tested the above, but it should give you the idea.