lighting problem
udi
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?
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?
0
Comments
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?
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.
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?
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.
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?