Module or 232 implementation?
DanRessler
Posts: 18
Hi Folks,
New to AMX programming, but not new to programming in general. Anyway, I'm starting coding on a system that controls a pair of Key Digital 4x1 switchers. I'm using the AMX module, and so far it's worked pretty well ... with one exception. I can't figure out a way to do error checking on whether the KD is connected to or online on the port. I've put some test variables in code, and the DATA_EVENT online: gets triggered upon startup, even if if there is nothing connected to the port. The offline: never gets triggered, whether it starts out disconnecter or if I actually powerdown or unplug the switcher from the port.
I'm new to 232, so am I just not thinking about this correctly? If I send-command to a port that has nothing attached to it, I get no RX response, so no data event to check. I'm thinking about this the same way I'd check any database call for a bad return code in a business application.
If I'm failing to explain this clearly or to the right level of detail, please let me know. Thanks in advance for your help!
Dan
New to AMX programming, but not new to programming in general. Anyway, I'm starting coding on a system that controls a pair of Key Digital 4x1 switchers. I'm using the AMX module, and so far it's worked pretty well ... with one exception. I can't figure out a way to do error checking on whether the KD is connected to or online on the port. I've put some test variables in code, and the DATA_EVENT online: gets triggered upon startup, even if if there is nothing connected to the port. The offline: never gets triggered, whether it starts out disconnecter or if I actually powerdown or unplug the switcher from the port.
I'm new to 232, so am I just not thinking about this correctly? If I send-command to a port that has nothing attached to it, I get no RX response, so no data event to check. I'm thinking about this the same way I'd check any database call for a bad return code in a business application.
If I'm failing to explain this clearly or to the right level of detail, please let me know. Thanks in advance for your help!
Dan
0
Comments
I took a quick look at the owners manual for the 4X1 HDMI switch.
The only feedback I see is a query for status which prints the IO status.
This feedback comes from sending the ascii "s" query. This print is almost certainly ascii characters.
When the serial port comes online send the string "P1" to the switcher. This will assure that the switcher is on. Insert a WAIT then send the string "s". This will send back the IO status. You can then decide what you would like to do with the incoming string under the STRING: event handler of the DATA_EVENT. You can parse it or simply look to see if you received data to know you are connected.
SEND_COMMAND is used to configure the RS-232 port (baud rate, flow control, etc.) If you want to send data out the RS-232 port to your external device you will need to use SEND_STRING.
HTH
If that's the way, then I should be able to set up an initialization check to make sure I have everything. Then I can check through the switchers to make sure that they have everything. Sorry if this is circular ... long day!
Dan
... or, I could set up a buffer for both and check each individual buffer.
That would be the other way to do it.
Have fun.
Jeff
Jeff
Dan