Home AMX Forum NetLinx Studio
Options

problem with wait command

Need help?

I have a problem with a wait comando on a NI700, and a Rel_230 axlink

When i run the program everthing works fine only after de wait ther is something wrong.

the last 3 comandos dont work. ( switch of Zon 1 to 3)

When i take out the wait it works fine again.

What do i wrong.


Push [vdvMIO_2, 91]//projector off
{
send_string vdvprojector,"$3A,$50,$4F,$57,$52,$30,$0D" //Power Projector Off
send_command vdvMIO_2,"'Page-Main'"
off[dvIO, 2]
on[vdvMIO_2, 91]
off[dvREL_230, Scherm_down]
on[dvREL_230, Scherm_up]
on[dvREL_230, Zon_richting]
on[dvREL_230, Zon_1]
on[dvREL_230, Zon_2]
on[dvREL_230, Zon_3]
wait 350 //here is the wait and the problem.
off[dvREL_230, Scherm_up]
off[dvREL_230, Zon_1]
off[dvREL_230, Zon_2]
off[dvREL_230, Zon_3]
}

Comments

  • Spire_JeffSpire_Jeff Formerly Caffeinated Programmer
    Push [vdvMIO_2, 91]//projector off
    	 {
    	 send_string vdvprojector,"$3A,$50,$4F,$57,$52,$30,$0D"	//Power Projector Off
    	 send_command vdvMIO_2,"'Page-Main'"
    	 off[dvIO, 2]
    	 on[vdvMIO_2, 91]
    	 off[dvREL_230, Scherm_down]
    	 on[dvREL_230, Scherm_up]
    	 on[dvREL_230, Zon_richting]
    	 pulse[dvREL_230, Zon_1]
    	 pulse[dvREL_230, Zon_2]
    	 pulse[dvREL_230, Zon_3]
    	 wait 350                                               //here is the wait and the problem.
    	 off[dvREL_230, Scherm_up]	
    	 }
    

    Try that. I am not sure why the wait would break the functionality, but this should avoid the problem.

    Jeff
  • jjamesjjames AMX Sustaining Engineer
    Silly question, but just want to cover the obvious . . . Zon_1, Zon_2 and Zon_3 are all constants, correct? Or at the very least variables, that don't get changed. And to clarify, you do want Zon_1 through Zon_3 to fire immediately and not 35 seconds later?
  • dchristodchristo Junior Member
    You'll need curly braces around the wait if you expect all of those statements to be delayed... otherwise only the first statement after the wait is delayed.
    Push [vdvMIO_2, 91]//projector off
    {
    send_string vdvprojector,"$3A,$50,$4F,$57,$52,$30,$0D" //Power Projector Off
    send_command vdvMIO_2,"'Page-Main'"
    off[dvIO, 2]
    on[vdvMIO_2, 91]
    off[dvREL_230, Scherm_down]
    on[dvREL_230, Scherm_up]
    on[dvREL_230, Zon_richting]
    on[dvREL_230, Zon_1]
    on[dvREL_230, Zon_2]
    on[dvREL_230, Zon_3]
    wait 350 //here is the wait and the problem.
    {
       off[dvREL_230, Scherm_up] 
       off[dvREL_230, Zon_1]
       off[dvREL_230, Zon_2]
       off[dvREL_230, Zon_3]
    }
    }
    
Sign In or Register to comment.