Home AMX User Forum NetLinx Studio

lighting problem

udiudi Posts: 107
I have a problem in controlling the lighting.
I have connection between the AMX device (ni-3000) and a light device via R232 communication.
When there is a network communication while I am sending commands to the AMX device to turn on and off the light it works OK. But sometimes when the network is disconnected from all sorts of reasons, number of lighting channels turn off. Although no shutdown command was sent.
What could be the problem?

Comments

  • PhreaKPhreaK Posts: 966
    What lighting system are you using?
  • viningvining Posts: 4,368
    If TP's are falling offline when this happens and you have levels tied from these panels to the master that in turn set lighting levels then every TP offline will send the master those levels with a "0" value. If this could be your problem then there are simple fixes to resolve it. You can use virtuals to handle your levels since they never fall offline or assign a channel number to the bargraph and on a push set a variable like "nTakeLVL" to 1 reset to 0 on channel release. Now in your level event qualify the level event with "nTakeLVL". Basically if there's been no push to set the flag ignore the level change.
  • udiudi Posts: 107
    vining wrote: »
    . You can use virtuals to handle your levels since they never fall offline or assign a channel number to the bargraph and on a push set a variable like "nTakeLVL" to 1 reset to 0 on channel release. Now in your level event qualify the level event with "nTakeLVL". Basically if there's been no push to set the flag ignore the level change.

    BUTTON_EVENT[dvPanels,nLVL_BTN]
    {
    PUSH:
    {
    nTakeVOLLVL=1
    }
    RELEASE:
    {
    nTakeVOLLVL=0
    }
    }
    I did like you say but the bar is still going to value "0", when the panel is offline.
    Here is example that I wrote according to your example:
    LEVEL_EVENT[dvTP_1,nLVL_BTN]
    {
    STACK_VAR INTEGER index
    index=GET_LAST(nLVL_BTN)
    SET_PULSE_TIME(2)
    if(nTakeVOLLVL=0)// Check to see if the device is in fact online)
    {
    SWITCH(nLVL_BTN[index])
    {
    CASE LVL_BTN_RCV1:
    {
    SEND_COMMAND dvTP_1, "'@PPF-TV_MUTE_RCV1'"
    IF(LEVEL.VALUE>97)//MVMAX 17DB
    {
    SEND_STRING 0,"LEVEL.VALUE"
    SEND_STRING 0,"'MVMAX',13"
    SEND_STRING dvDenonA1,"'MV97',13"
    }
    ELSE
    SEND_STRING dvDenonA1,"'MV',ITOA(LEVEL.VALUE),13"
    }
    CASE LVL_BTN_RCV2:
    {
    SEND_COMMAND dvTP_1, "'@PPF-TV_MUTE_RCV2'"
    IF(LEVEL.VALUE>97)//MVMAX 17DB
    {
    SEND_STRING 0,"LEVEL.VALUE"
    SEND_STRING 0,"'MVMAX',13"
    SEND_STRING dvDenon4308,"'MV97',13"
    }
    ELSE
    SEND_STRING dvDenon4308,"'MV',ITOA(LEVEL.VALUE),13"
    }//END CASE
    }//END IF
    ELSE
    SEND_STRING 0,'OFFLINE'
    }

    These are a volume buttons and when the dvTP is offline the bar go to zero.
    What could be the problem do I need to wrote anything else?
    Another strange thing is that the if need to be if(nTakeVOLLVL=1) and not if(nTakeVOLLVL=0), but when i wrote the first if the he always return the OFFLINE string that means he going to the else condition. and if i wrote the second if he goes to the if condition.
    From what I know is supposed to be upside down or I'm missing something?
  • viningvining Posts: 4,368
    LEVEL_EVENT[dvTP_1,nLVL_BTN]
         
         {
         STACK_VAR INTEGER index
         index=GET_LAST(nLVL_BTN)
         SET_PULSE_TIME(2) ;
         
         if(nTakeVOLLVL=0)// Check to see if the device is in fact online) 
    	  {
    	  SWITCH(nLVL_BTN[index])
    	       {
    	       CASE LVL_BTN_RCV1:
    		    {
    		    SEND_COMMAND dvTP_1, "'@PPF-TV_MUTE_RCV1'"
    		    IF(LEVEL.VALUE>97)//MVMAX 17DB
    			 {
    			 SEND_STRING 0,"LEVEL.VALUE"
    			 SEND_STRING 0,"'MVMAX',13"
    			 SEND_STRING dvDenonA1,"'MV97',13"
    
    You should be using:
    if(nTakeVOLLVL) or if(nTakeVOLLVL==1)//  (doesn't actually need to be double == but it's a clearer meaning)
    
    Using = 0 won't prevent the level from changing during offline events but it also won't allow your levels to change when the bargraph is actually pushed.

    What's with the set pulse time in the code? You're sending serial strings so set pulse time has no affect and since it's a global command you might be screwing somethine else up down the road. As a generally rule when you use set_pulse_time in a block of code you immediately set it back to 5 (default) before exiting the block that required the change. In this case you don't need it so just get rid of it.
  • udiudi Posts: 107
    vining wrote: »
    You should be using:
    [code]
    if(nTakeVOLLVL) or if(nTakeVOLLVL==1)//  (doesn't actually need to be double == but it's a clearer meaning)
    
    Using = 0 won't prevent the level from changing during offline events but it also won't allow your levels to change when the bargraph is actually pushed.
    .

    if I am doing the if(nTakeVOLLVL) or if(nTakeVOLLVL==1) when I am pushing the bargraph he entered to the else condition (I don't know why it should be reversed). why is that?
    In addition, why when it is offline the bargragh still goes to value =0 I do not understand?
  • viningvining Posts: 4,368
    If you push the bargraph with channel the channel triggers a push setting nTake to 1 and immediately after, that level value is sent from the TP to the master. Since nTake is now 1 your conditional is TRUE and the incoming level event will be processed. You then remove your finger, releasing the channel and nTake goes low so any levels sent to the master without the corresponding channel push will be ignored.

    Basically when an offline event occurs there's no channel push so nTake is and remains at 0 so the level event doesn't get processed when the TP sends a level value of 0 to the master because it went offline. This actually happens when the panel returns online and updates the master not offline.
  • udiudi Posts: 107
    udi wrote: »
    if I am doing the if(nTakeVOLLVL) or if(nTakeVOLLVL==1) when I am pushing the bargraph he entered to the else condition (I don't know why it should be reversed). why is that?

    I did not understand why it works for me reverse when if am doing if(nTakeVOLLVL=0) when I push the bargraph he is doing the commands and the volume going up. but when I am doing if(nTakeVOLLVL) when I push the bargraph he is doing the else command.
    Also if I understand correctly when the TP if offline the bargraph value will be anyway 0 or I can do somthing or I can do something so he did not drop to zero like saving the last value before he went offline and when he is offline do a wait command and then sending the value to the bargraph?
Sign In or Register to comment.