How can I feedback the RS-232 response to TouchPanel?
winstonma
Junior Member
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
Comments
-
I suggest that you look in the code that I sent you yesterday.
-
DATA_EVENT[dvMLPreAmp] // your rs232 device
{
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...
}
} -
You can monitor the response strings from a device using Netlinx Studio. Enable diagnostics and enable notifications. While these are turned on you'll be able to see strings being returned (except if the device returns a $00, then the rest of the string after the 'null' won't show).
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 -
In re-reading your question, it looks like you're trying to send the device response to the touchpanel. If you're trying to send to the touchpanel, then you'll need to create a button in the touchpanel with an address port and address code. Then you could use a SEND_COMMAND to send the string to the button you created on the touchpanel.
ex.
SEND_COMMAND dvTP,"'@TXT',1,'STRING = ', sRESPONSE_STRING"
--John -
Or use ^TXT
Or you can use the ^TXT command (G4 command)
SEND_COMMAND dvTP, "'^TXT-1,0,RESPONSE STRING = ',sRESPONSE_STRING"
--John -
Not trying to hijack the thread but how could you use the feedback string to condition a particular sequence in a macro? For example send the power command plus the input command if the device is off but only the input if it is on.
-
something like:
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. -
Thanks for the input.
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums