Send_string 0,
Binu
Junior Member
Can any one explain the use of SEND_STRING 0, ?xxxxx?
What the situation to use this?????
What the situation to use this?????
Comments
-
Binu wrote:Can any one explain the use of SEND_STRING 0, ?xxxxx?
What the situation to use this?????
Usage of this is mostly for debugging.
a SEND_STRING 0,"'Hello World',13,10" will output the 'Hello World' to programming port, so you can view it with RS232 Terminal or Telnet.
To see that SEND_STRING 0,".." you have to enable message output by terminal command:
MSG ON<enter> -> turns on master runtime messages and the SEND_STRING 0 thing
MSG ON 2<enter> -> no master runtime messages but SEND_STRING 0
Hope this helps, -
This is an extemely handy debugging tool, and I use it extensively. Often, I'll link it to a virtual device channel, so I can turn it on and off at will. I will often go as far as to create a Telnet interface to make it easier to check on a remote system that will report what the system is doing. I will generally echo whatever I send to or recieve from a serial port to this as well (again, tied to a channel or variable to turn it off when I'm not debugging), so I can see if devices are doing as expected. Here's a little snippet from a Telent session using send_string 0 on a system attached to an InFocus projector:
As you can see, I can tell what commands I have sent to the projector, how the module actually sent it, and what the response was. If you interperse your main code with little notifications that identify what actions are taking place (like "Boardroom panel requested projector One to Computer Two input"), it can be very helpful figuring out what went wrong if anything does ... especially if you are logging on to the system remotely and can't actualy see what is happening.send command 33001, "'debug=1'"
>(0000119560) Received projector command: DEBUG=1
(0000129791) Sending to projector: (PWR?)
(0000129926) Received from projector: (PWR?)
(0000129933) Received from projector: (0-1,1)
(0000129934) Power Data: 1)
(0000134791) Sending to projector: (ARZ?)
(0000134933) Received from projector: (ARZ?)
(0000134940) Received from projector: (0-2,0)
(0000134942) Aspect Data: 0)
(0000137794) Sending to projector: (LMP?)
(0000137931) Received from projector: (LMP?)
(0000137938) Received from projector: (0-32766,94)
(0000137940) Lamp Data: 94) -
I like to create a function that I send all my debug info to which also includes the __LINE__ info, this can be very useful if you start using a lot of debugs.
DEFINE_FUNCTION fnDEBUG(CHAR MSG[], INTEGER nLINE) { SEND_STRING 0, "'DEBUG MSG: ', MSG, ' -- LINE:', ITOA(nLINE)"; } fnDEBUG("ITOA(nCMD)", __LINE__);
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