Home AMX User Forum NetLinx Studio

Question: How to Sense if a device is connected or not.

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...

Comments

  • viningvining Posts: 4,368
    What kind of cable are you talking about. If it's power use a current sensor (PCS) if video use a video sensor (VSS). How are you connected and communicating with it IR or RS232. If RS232 you can poll it for status every x seconds or minutes or hours.
  • I'm controlling the projector via RS232: I think I was polling it correctly please review the file I attached. The problem I'm having is when it is connect I am getting notified. When the RS232 cable is unplugged I am not getting notified. Any suggestions?
  • The projector is not an "AMX device" as such. It does not go on and off line and provide notifications. The "AMX device" involved here is the serial port, and you will usually only see it go online after a reboot, and never go offline.

    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.
  • champchamp Posts: 261
    If you just want to see if it's plugged in and power is connected...

    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:
    DEFINE_DEVICE
    dvSERIAL_1 = 5001:1:1
    dvIO = 5001:17:1
    
    DEFINE_EVENT
    DATA_EVENT[dvSERIAL_1]
    {
      ONLINE: SEND_COMMAND dvSERIAL_1, 'CTSPSH'
    }
    
    DEFINE_PROGRAM
    [dvIO, 1] = [dvSERIAL_1, 255]
    
    You need to check that the pin stays high on system stanby.
Sign In or Register to comment.