Home AMX User Forum NetLinx Studio

Code sends three IR Pulses, Controller only 2. Ideas?

Running the most basic of codes you could ever imagine, but having an issue where the controller doesn't seem to be doing what I think. And well, since the controller is smarter then me I must have fussed something up.

Trying to control a Gefen VGA 4x4 matrix switcher using IR. Basically when the a button is pushed on the Metreau keypad the NI-700 should send three IR pulses. But only two are being sent.

I have tried increasing the wait time between pulses. Even tried increasing the pulse time. Still, only two signals sent. Confirmed by the device only switching two outputs and the IR light on the controller only lighting up twice.

Here is a copy of the most recent revision:

BUTTON_EVENT [KP,5] (*Gefen guest computer input*)
{
Push:
{
SEND_STRING Proj,"Proj_VGA"
Wait 10
Pulse [geffen,2]
Wait 100
Pulse [geffen,6]
Wait 100
Pulse [geffen,10]
}
}

The first and third pulses are going through. The middle is not. And I have proved it isn't the middle one is bad as I have swapped 2, 6, and 10 around. The middle pulse is always the one lost. Again, the wait time between has been increased to an obscene number, I kept working it higher, to see if they were just to close together. No difference.

And yes I know, one two many F's in Gefen. Least of my worries right now. Ideas? Anyone run in to this before?

Thank you for reading and in advance for any thoughts.

Comments

  • kennethkkennethk Posts: 86
    Try tweeking at the wait times.

    The second and third pulses are both being triggered after 10 seconds.
  • tweekendtweekend Posts: 15
    Thank you Thank you Thank you.

    Bouncing between 5 different projects I missed that. I knew it would be something I messed up and completely idiotic.

    Thanks and that works perfectly now.
  • a_riot42a_riot42 Posts: 1,624
    tweekend wrote: »
    Here is a copy of the most recent revision:
    BUTTON_EVENT	[KP,5]                                  (*Gefen guest computer input*)
    {
        Push: 
    	{
    	    SEND_STRING Proj,"Proj_VGA"
    	    Wait 10	
    	    Pulse [geffen,2]
    	    Wait 100
    	    Pulse [geffen,6]
    	    Wait 100
    	    Pulse [geffen,10]
    	}
    }
    

    This has caught everyone up at some point I'm sure. If you want to do this you need parentheses. A wait doesn't create a delay in code execution, it just schedules an event in the future so the second and third pulses are being scheduled at the same time, so it isn't working. Simply adding parentheses will fix it since they will then get scheduled sequentially rather than immediately.

    BUTTON_EVENT	[KP,5]                                  (*Gefen guest computer input*)
    {
        Push: 
        {
           SEND_STRING Proj,"Proj_VGA"
    
           Wait 10	
           {
               Pulse [geffen,2]
    	   
               Wait 100
    	   {
                   Pulse [geffen,6]
    	 
                   Wait 100
    	       {
                     Pulse [geffen,10]
    	        }
                 }
             }
    }
    

    Paul
  • champchamp Posts: 261
    For a bit of IR pulse management consider using send commands.
    // at the online event
    SEND_COMMAND IR_1,"'CTON',5" // Sets the on time of each IR pulse to 1/2 second.
    SEND_COMMAND IR_1,"'CTOF',10" //Sets the off time between each IR pulse to 1 second.
    SEND_COMMAND IR_1,"'XCHM 3'" // Sets the IR_1 device's extended channel command to mode 2: [x][x][x]
    // at the push
    SEND_COMMAND IR_1,"'XCH 343'" // Transmits the IR code as 3-4-3.
    
Sign In or Register to comment.