Sending strings with variable values not working for me
mkleynhans
Posts: 78
Hi Guys,
I am writing commando code for controlling an AMX Tango DAS-T0808 unit due to needing to group multiple rooms and use the same input but am having a problem with one small section..
Basically when muting, I am trying to store the current parsed volume level for the room in a new int value
called LoungeMuteLevel which seems to be working when looking at it in debug. When I call the mute, this
value becomes the same as the iRoom1Volume value and the rooms mute. The problem arises when
I send the value for LoungeMuteLevel back to the rooms when unmuting. It seems to send a very low value
like 0-7 which seems to be the ascii representation of my stored value. The value for mute is 101 and lowest volume is 100, highest is 0 or 1..
I am using code along the following lines;
DEFINE_CALL 'Lounge Mute'
{
SEND_STRING dvTango_232,"'MGVL1',$0a"; //This parses for the volume value
WAIT 1
{
LoungeMuteLevel = iRoom1Volume //copy room volume level to lounge mute level
SEND_STRING dvTango_232,"'MSVL1,101',$0a" //send mute level to room 1
WAIT 2
{
SEND_STRING dvTango_232,"'MSVL2,101',$0a" //send mute level to room 2
LoungeMute = 1 //room is now muted
}
}
}
DEFINE_CALL 'Lounge unMute'
{
SEND_STRING dvTango_232,"'MSVL1,',LoungeMuteLevel,$0a" //send original volume value back to rm1
WAIT 2
{
SEND_STRING dvTango_232,"'MSVL2,',LoungeMuteLevel,$0a" //send orig volume value back to rm 2
LoungeMute = 0 //room is unmuted
}
}
I have tried hextoi(LoungeMuteLevel) and atoi(LoungeMuteLevel) but the compiler moans about
a type mismatch..
Any ideas where Im going wrong?
I am writing commando code for controlling an AMX Tango DAS-T0808 unit due to needing to group multiple rooms and use the same input but am having a problem with one small section..
Basically when muting, I am trying to store the current parsed volume level for the room in a new int value
called LoungeMuteLevel which seems to be working when looking at it in debug. When I call the mute, this
value becomes the same as the iRoom1Volume value and the rooms mute. The problem arises when
I send the value for LoungeMuteLevel back to the rooms when unmuting. It seems to send a very low value
like 0-7 which seems to be the ascii representation of my stored value. The value for mute is 101 and lowest volume is 100, highest is 0 or 1..
I am using code along the following lines;
DEFINE_CALL 'Lounge Mute'
{
SEND_STRING dvTango_232,"'MGVL1',$0a"; //This parses for the volume value
WAIT 1
{
LoungeMuteLevel = iRoom1Volume //copy room volume level to lounge mute level
SEND_STRING dvTango_232,"'MSVL1,101',$0a" //send mute level to room 1
WAIT 2
{
SEND_STRING dvTango_232,"'MSVL2,101',$0a" //send mute level to room 2
LoungeMute = 1 //room is now muted
}
}
}
DEFINE_CALL 'Lounge unMute'
{
SEND_STRING dvTango_232,"'MSVL1,',LoungeMuteLevel,$0a" //send original volume value back to rm1
WAIT 2
{
SEND_STRING dvTango_232,"'MSVL2,',LoungeMuteLevel,$0a" //send orig volume value back to rm 2
LoungeMute = 0 //room is unmuted
}
}
I have tried hextoi(LoungeMuteLevel) and atoi(LoungeMuteLevel) but the compiler moans about
a type mismatch..
Any ideas where Im going wrong?
0
Comments
I am really thick when it comes to working out what char, integers etc. are so really appreciate the help.
Job Done )