Question: How to Sense if a device is connected or not.
[Deleted User]
Posts: 0
I'm trying to get status information on whether my projecter is online or offline. Offline being someone has disconnect the cable.
I tried using ONLINE: and OFFLINE: Syntax but that didn't seem to work. I then tried using a conditional statement but only the ONLINE: code worked. For some reason I cannot sense when the projector's RS232 cable is not connected.
Please see attached Test project file.
Help would be greatly appreciated as I have been trying for some time now and cannot seem to get this to work.
Thanks in advance...
I tried using ONLINE: and OFFLINE: Syntax but that didn't seem to work. I then tried using a conditional statement but only the ONLINE: code worked. For some reason I cannot sense when the projector's RS232 cable is not connected.
Please see attached Test project file.
Help would be greatly appreciated as I have been trying for some time now and cannot seem to get this to work.
Thanks in advance...
0
Comments
So you have to keep polling - asking the projector if it is still there, as vining said. Identify a command which provides some sort of status reply and send it every n seconds. If you don't get a reply, it's not there any more.
Note however that some projectors go dumb during their warm-up and cool-down cycles and might give a spurious lack of response.
If the device holds CTS (DTE pin 8, DCE pin 7) high permanently as most serial devices do, then if you send the command 'CTSPSH' to the serial port, channel 255 wil give you the status of the port.
As a test to see if it works set the feedback to link with an IO, then watch the LED go on and off when you plug and unplug it.
Here's an exampe: You need to check that the pin stays high on system stanby.