Kramer switcher programming
[Deleted User]
Posts: 0
Hello. I'm trying to write a test program for Kramer vs808xl matrix switcher, and there is a problematic piece of code:
DEFINE_DEVICE dvSwitcher = 5001:1:1 //1-st rs-232 port dvDebug = 0:0:0 //debug device ... DATA_EVENT DATA_EVENT [dvSwitcher] { COMMAND: { SEND_STRING dvDebug,"'SWITCHER COMMAND EVENT OCCURED'" } STRING: { SEND_STRING dvDebug,"'SWITCHER STRING EVENT OCCURED'" } ONLINE: { SEND_STRING dvDebug,"'SWITCHER DEVICE IS ONLINE'" } OFFLINE: { SEND_STRING dvDebug,"'SWITCHER DEVICE IS OFFLINE'" } ONERROR: { SEND_STRING dvDebug,"'SWITCHER ERROR OCCURED'" } }So, i think, when master makes SEND_STRING to or receives data from switcher, DATA_EVENT should be generated, and it should be visible in Diagnostics window (all notifications and diagnostic messages turned on). But Diagnostics window remains blank. What can be wrong?
0
Comments
P.S. Maybe it would be useful to add that my main purpose is to learn how to receive data from switcher by means of rs-232 port interface. But by now i can't even watch data transmittion with NetLinx (switcher works well when i send_string's to it).
I don't really use the diagnostic window much, I use Telnet - but when you telnet in, you must type in "msg on" in order to see the send_strings to device 0. Perhaps there is a similar required mechanism for the diagnostic window, I don't know what it is though.
Strings TO rs232 will not generate DATA_EVENTs, but only data received.
This is some kind of typical rs232 handling. This example is based on the RS232 protcol of Panasonic VCRs.
It depends on the protocol how to keep the WHILE alive and how to parse the data.
No required mechanism other than pushing the little hammer icon in.
The switcher may not be sending anything back to you or there might be something wrong with the receive pin on the cable. For learning purposes here is one way to see the STRING handler fire for DATA_EVENT[dvSwitcher]:
1) Remove the cable that connects Netlinx to the switcher and attach a loopback to pins 2 and 3 of the RS-232 port. You just need to short pins 2 & 3 together with a piece of wire.
2) Enable Netlinx Internal Diagnostics Messages.
3) Fire off the code that sends data to the switcher. When you do the data will be transmitted out of and looped back into your RS-232 port and ?SWITCHER STRING EVENT OCCURRED? will be printed to the Diagnostics window.
4) Change
SEND_STRING dvDebug,'SWITCHER STRING EVENT OCCURRED?
To:
SEND_STRING dvDebug,??SWITCHER STRING EVENT OCCURRED: ?,DATA.TEXT?
5) Fire of the code that sends the data to the switcher and the data you sent (and then received) will be logged into the Diagnostic window.
From there you can add variables to the code to hold that data you receive. And/or you can use CREATE_BUFFER to capture the data for you.
If you want to see the ONLINE: handler for DATA_EVENT[dvSwitcher] get printed to the Diagnostics window try changing:
SEND_STRING dvDebug,"'SWITCHER DEVICE IS ONLINE'"
To:
WAIT 100 SEND_STRING dvDebug,"'SWITCHER DEVICE IS ONLINE'"
You may not be seeing the ONLINE handler being fired because it may have already happened before you were able to enable the internal messages after the master reboots. This gives you an extra 10 seconds to get it to see it captured.
Hope some of this is useful. Good luck.