Trouble with my Mute/Volume feedback & such
gerladvon
Posts: 8
Greetings,
I just completed programming on my first NetLinx system. Everything is working well except my Mute/Volume feedback and functions. Here's a description of what's happening:
PUSH MUTE:
- CHANNEL MUTES; BUTTON SHOWS 'ON' STATE
PUSH MUTE AGAIN:
- CHANNEL UNMUTES; BUTTON STILL SHOWS 'ON' STATE
PUSH MUTE A 3RD TIME:
- NO CHANGE IN DEVICE VOLUME OR BARGRAPH; BUTTON STILL SHOWS 'ON' STATE
PUSH VOL UP OR DOWN WHILE 'LOCKED UP':
- VOL LEVELS RESPOND ACCORDINGLY. MUTE BUTTON SHOWS 'OFF' STATE
^^^^^^^^^^^^^^^^^^^^^^^^^
Here's all the pertinent code to one of the volume channels (there are 3, all acting alike):
DEFINE_DEVICE
dvVOL1 = 325:1:0
DEFINE_VARIABLE
CHAR nGRNlevel
DEFINE_MUTUALLY_EXCLUSIVE
([dvVOL1,4]..[dvVOL1,6])([dvVOL1,7]..[dvVOL1,9])([dvVOL2,1]..[dvVOL2,3])
DEFINE_CALL 'SYSTEM POWER ON'
{
-snip-
{
SEND_COMMAND dvVOL1, 'P0L70%'
SEND_COMMAND dvVOL1, 'P0R70'
}
-snip-
}
DEFINE_START
CREATE_LEVEL dvVOL1,1, nGRNlevel
DEFINE_EVENT
BUTTON_EVENT[dvTP,41]
{
PUSH:
{
OFF[dvVOL1,6]
TO[dvVol1,4]
}
}
BUTTON_EVENT[dvTP,42]
{
PUSH:
{
TO[dvVOL1,5]
}
}
BUTTON_EVENT[dvTP,43]
{
PUSH:
{
[dvVOL1,6] = (![dvVOL1,6])
}
}
LEVEL_EVENT[dvVOL1,1]
{
LEVEL.VALUE = nGRNlevel
SEND_LEVEL dvTP,1,nGRNlevel
}
DEFINE_PROGRAM
SYSTEM_CALL[1] 'VOL1' (dvTP,41,42,43,dvVOL1,4,5,6)
Any help would be greatly appreciated.
JB
I just completed programming on my first NetLinx system. Everything is working well except my Mute/Volume feedback and functions. Here's a description of what's happening:
PUSH MUTE:
- CHANNEL MUTES; BUTTON SHOWS 'ON' STATE
PUSH MUTE AGAIN:
- CHANNEL UNMUTES; BUTTON STILL SHOWS 'ON' STATE
PUSH MUTE A 3RD TIME:
- NO CHANGE IN DEVICE VOLUME OR BARGRAPH; BUTTON STILL SHOWS 'ON' STATE
PUSH VOL UP OR DOWN WHILE 'LOCKED UP':
- VOL LEVELS RESPOND ACCORDINGLY. MUTE BUTTON SHOWS 'OFF' STATE
^^^^^^^^^^^^^^^^^^^^^^^^^
Here's all the pertinent code to one of the volume channels (there are 3, all acting alike):
DEFINE_DEVICE
dvVOL1 = 325:1:0
DEFINE_VARIABLE
CHAR nGRNlevel
DEFINE_MUTUALLY_EXCLUSIVE
([dvVOL1,4]..[dvVOL1,6])([dvVOL1,7]..[dvVOL1,9])([dvVOL2,1]..[dvVOL2,3])
DEFINE_CALL 'SYSTEM POWER ON'
{
-snip-
{
SEND_COMMAND dvVOL1, 'P0L70%'
SEND_COMMAND dvVOL1, 'P0R70'
}
-snip-
}
DEFINE_START
CREATE_LEVEL dvVOL1,1, nGRNlevel
DEFINE_EVENT
BUTTON_EVENT[dvTP,41]
{
PUSH:
{
OFF[dvVOL1,6]
TO[dvVol1,4]
}
}
BUTTON_EVENT[dvTP,42]
{
PUSH:
{
TO[dvVOL1,5]
}
}
BUTTON_EVENT[dvTP,43]
{
PUSH:
{
[dvVOL1,6] = (![dvVOL1,6])
}
}
LEVEL_EVENT[dvVOL1,1]
{
LEVEL.VALUE = nGRNlevel
SEND_LEVEL dvTP,1,nGRNlevel
}
DEFINE_PROGRAM
SYSTEM_CALL[1] 'VOL1' (dvTP,41,42,43,dvVOL1,4,5,6)
Any help would be greatly appreciated.
JB
0
Comments
If you have BUTTON_EVENT for a given dev/chan in your program, a PUSH/RELEASE in mainline for the same dev/chan will be flat out ignored. In this case that translates to non-functioning system calls.
Now, just to get funky, you CAN put those system call lines in your BUTTON_EVENT / PUSH: and RELEASE: handlers. It's ugly, but it works. It's because of the ugly part that I try to avoid them at all costs.
- Chip