AMX and Electrovoice N8000 feedback
RogerS
Posts: 9
Hi
First time poster so not 100% sure this is correct place to post.
I have a problem with getting correct feedback from a N8000.
I have 16 microphones that each has it own mute button and trying to make 1 data_event for them all so i dont have to make 16 find_string for each of my 16 buttons.
The problem might be how i try to parse it but not sure.
To poll if a channel is muted or unmuted i send the string:
"/Param/Dsp/Matrix_1/mutein/Idx10 ?" where 10 is the channel.
The N8000 returns this string when i poll the N8000 on "channel" 10:
"/Param/Dsp/Matrix_1/mutein/Idx10 1" where 10 is the "channel" in the N8000 matrix it has muted/unmuted and the last number is wether it is muted (1) or unmuted (0)
What i am trying to do is extract the "10" and "1" so i have which channel and if it is muted or unmuted.
DEFINE_VARIABLE
integer levelFromEVSpace = 0
char levelFromEV[5] = ''
integer muteUnmute = 0
DATA_EVENT[dvEV8000]
{
ONLINE:
{
SEND_COMMAND dvEV8000, "'SET BAUD 19200,8,N,1'"
//wait 100 SEND_COMMAND dvEV8000, "'*** <device> command mode entered ***'"
}
string:
{
if (find_string(data.text,'/Param/Dsp/Matrix_1/mutein/Idx',1)) { //trying to make 1 find_string for all mute buttons
if (find_string(data.text,'?',1)) {} //so you don't parse the question since N8000 have echo on
else {
dataFromEV = DATA.TEXT
remove_string(dataFromEV,'/Param/Dsp/Matrix_1/mutein/Idx',1) //to remove unusefull info
levelFromEVSpace = find_string(dataFromEV,' ',1) //finds the position of the space between channel and wether it is muted or not
if (levelFromEVSpace == 2) { //if channel is under 10
levelFromEV = left_string(dataFromEV,1)
}
else if (levelFromEVSpace == 3) { //if channel is above 10
levelFromEV = left_string(dataFromEV,2)
}
muteUnmute = atoi(right_string(dataFromEV,1)) //wether it is muted or not
}
}
}
}
The problem is that at the end the string levelFromEV is "49,49" for the channel 10 example and "50" to "59" for any channel under 9. I'm not sure where 49.49 comes from.
Can anyone see any errors that i missed or any tips or tricks you have?
Or do i simpy have to add 1 find_string for each of my microphones?
First time poster so not 100% sure this is correct place to post.
I have a problem with getting correct feedback from a N8000.
I have 16 microphones that each has it own mute button and trying to make 1 data_event for them all so i dont have to make 16 find_string for each of my 16 buttons.
The problem might be how i try to parse it but not sure.
To poll if a channel is muted or unmuted i send the string:
"/Param/Dsp/Matrix_1/mutein/Idx10 ?" where 10 is the channel.
The N8000 returns this string when i poll the N8000 on "channel" 10:
"/Param/Dsp/Matrix_1/mutein/Idx10 1" where 10 is the "channel" in the N8000 matrix it has muted/unmuted and the last number is wether it is muted (1) or unmuted (0)
What i am trying to do is extract the "10" and "1" so i have which channel and if it is muted or unmuted.
DEFINE_VARIABLE
integer levelFromEVSpace = 0
char levelFromEV[5] = ''
integer muteUnmute = 0
DATA_EVENT[dvEV8000]
{
ONLINE:
{
SEND_COMMAND dvEV8000, "'SET BAUD 19200,8,N,1'"
//wait 100 SEND_COMMAND dvEV8000, "'*** <device> command mode entered ***'"
}
string:
{
if (find_string(data.text,'/Param/Dsp/Matrix_1/mutein/Idx',1)) { //trying to make 1 find_string for all mute buttons
if (find_string(data.text,'?',1)) {} //so you don't parse the question since N8000 have echo on
else {
dataFromEV = DATA.TEXT
remove_string(dataFromEV,'/Param/Dsp/Matrix_1/mutein/Idx',1) //to remove unusefull info
levelFromEVSpace = find_string(dataFromEV,' ',1) //finds the position of the space between channel and wether it is muted or not
if (levelFromEVSpace == 2) { //if channel is under 10
levelFromEV = left_string(dataFromEV,1)
}
else if (levelFromEVSpace == 3) { //if channel is above 10
levelFromEV = left_string(dataFromEV,2)
}
muteUnmute = atoi(right_string(dataFromEV,1)) //wether it is muted or not
}
}
}
}
The problem is that at the end the string levelFromEV is "49,49" for the channel 10 example and "50" to "59" for any channel under 9. I'm not sure where 49.49 comes from.
Can anyone see any errors that i missed or any tips or tricks you have?
Or do i simpy have to add 1 find_string for each of my microphones?
0
Comments
remove_string(dataFromEV,'/Param/Dsp/Matrix_1/mutein/Idx',1) //to remove unusefull info
The remaining string in your example is:
’10 1’
Do an ATOI on that string and it will return the channel number of 10 in decimal.
Do a remove_string up to the space.
And then do an ATOI on the remaining string and that will return the mute value of 1 in decimal.
When doing an ATOI conversion it’s always safest to wrap the string in double quotes.
Netlinx doesn’t handle 1 character arrays very well and the double quotes fixes that.
ASCII 0-9 = Decimal 48-57