Home AMX User Forum NetLinx Studio

VSS2 Programing

Here's my code and my issue:

IF ([VSS2,1]) // If the BluRay got turned on....
{
SEND_STRING PROJECTOR, "':POWR1',$0D" // Projector ON
}

{
{
SEND_STRING X_10,'A1N' // Lights ON
WAIT 30
ON [23,22]
NOWORK = 1
}
{
SEND_STRING PROJECTOR, "':IDVI',$0D" //Change Projector Input to DVI
SEND_STRING RECEIVER, "'SIBD',$0D" // Turn Denon ON to BluRay input
PROJECTOR_INPUT = 2
DVD_PAUSE = 1
}

}

My Denon A/V receiver and projector are controlled by RS-232 and the VSS syncs on green when the BluRay turns on.When the I/O comes on, everything works but the program constantly sends the commands over & over, thereby I have no control to the projector and receiver. How do I write the code so I regain control to the projector and the A/V receiver.

Thanks

Comments

  • viningvining Posts: 4,368
    Is this code in the button/channel event tied to the VSS's IO or in define_program section? If in the define_program section move it to the IO event handler instead so it only runs when the IO's state changes.
  • dsmithdsmith Posts: 30
    Yes, it is tied to the VSS IO and I did have it the DEFINE_PROGRAM section. So I would move to the DEFINE_EVENT section?
  • HedbergHedberg Posts: 671
    You have a VSS connected to an IO channel and when the sensor detects video sync it turns the IO channel on. There are two ways that you can handle this with an event -- either a button event or a channel event. When a normally configured io channel changes state from off to on, it generates a button press and it's feedback channel turns on. That's why you can use but the push: handler of the button event or the on: handler of a channel event; your choice.

    When the VSS goes from detecting to not detecting, the state will turn to off and it will generate a button release. You can use the release: handler of the button event or the off: handler of the channel event to do important stuff when the video sync stops.

    Look in the programming documentation to see how to code your button events and channel events. It's just about the most basic skill you need to acquire to effectively program your Netlinx master.
  • dsmithdsmith Posts: 30
    Thanks viving and Hedberg,

    After I made a channel event, everything works the way I want it.

    Thanks again, dsmith
Sign In or Register to comment.