Home AMX User Forum NetLinx Studio

AMX and Electrovoice N8000 feedback

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?

Comments

  • Joe HebertJoe Hebert Posts: 2,159
    After the line:

    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
  • I offer you a unit with N8000, good luck
    MODULE_NAME='ElecrovoiceN8000_module' (DEV dvEV, DEV dvTP_EV)
    (*&#1052;&#1086;&#1076;&#1091;&#1083;&#1100;  &#1088;&#1072;&#1073;&#1086;&#1090;&#1099; &#1089; &#1091;&#1089;&#1090;&#1088;&#1086;&#1081;&#1089;&#1090;&#1074;&#1086;&#1084; EV N8000*)
    (***********************************************************)
    (***********************************************************)
    (*  FILE_LAST_MODIFIED_ON: 04/04/2006  AT: 11:33:16        *)
    (***********************************************************)
    (* System Type : NetLinx                                   *)
    (***********************************************************)
    (* REV HISTORY:                                            *)
    (***********************************************************)
    (*
        $History: $
    *)    
    (***********************************************************)
    (*          DEVICE NUMBER DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_DEVICE
    dvIPClientEV = 0:3:0
    (***********************************************************)
    (*               CONSTANT DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_CONSTANT
    nIPPort = 23
    INTEGER	 VOLUME_TIMELINE_ID = 1
    LONG 	 VOLUME_POLL_TIME = 50000 //50&#1089;&#1077;&#1082;
    (***********************************************************)
    (*              DATA TYPE DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_TYPE
    
    structure t_S1MicInMute
    {
        integer IDX1
        integer IDX2
        integer IDX3
        integer IDX4
        integer IDX5
        integer IDX6
        integer IDX7
        integer IDX8
    }
    
    structure t_S1MicInGain
    {
        sinteger IDX1
        sinteger IDX2
        sinteger IDX3
        sinteger IDX4
        sinteger IDX5
        sinteger IDX6
        sinteger IDX7
        sinteger IDX8
    }
    structure t_S2AnalogOutMute
    {
        integer IDX1
        integer IDX2
        integer IDX3
        integer IDX4
        integer IDX5
        integer IDX6
        integer IDX7
        integer IDX8
    }
    structure t_S2AnalogOutGain
    {
        sinteger IDX1
        sinteger IDX2
        sinteger IDX3
        sinteger IDX4
        sinteger IDX5
        sinteger IDX6
        sinteger IDX7
        sinteger IDX8
    }
    structure t_S3AnalogInMute
    {
        integer IDX1
        integer IDX2
        integer IDX3
        integer IDX4
        integer IDX5
        integer IDX6
        integer IDX7
        integer IDX8
    }
    structure t_S3AnalogInGain
    {
        sinteger IDX1
        sinteger IDX2
        sinteger IDX3
        sinteger IDX4
        sinteger IDX5
        sinteger IDX6
        sinteger IDX7
        sinteger IDX8
    }
    structure t_S4AnalogOutMute
    {
        integer IDX1
        integer IDX2
        integer IDX3
        integer IDX4
        integer IDX5
        integer IDX6
        integer IDX7
        integer IDX8
    }
    structure t_S4AnalogOutGain
    {
        sinteger IDX1
        sinteger IDX2
        sinteger IDX3
        sinteger IDX4
        sinteger IDX5
        sinteger IDX6
        sinteger IDX7
        sinteger IDX8
    }
    (***********************************************************)
    (*               VARIABLE DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_VARIABLE
    
    LONG 	 		lPROJ_TIME_ARRAY[10]
    
    t_S1MicInMute 		S1MicInMute
    t_S2AnalogOutMute 	S2AnalogOutMute
    t_S3AnalogInMute 	S3AnalogInMute
    t_S4AnalogOutMute 	S4AnalogOutMute
    
    t_S1MicInGain 		S1MicInGain
    t_S2AnalogOutGain 	S2AnalogOutGain
    t_S3AnalogInGain 	S3AnalogInGain
    t_S4AnalogOutGain 	S4AnalogOutGain
    
    integer btnS1MicInMute[] =
    		    {
    			11,
    			12,
    			13,
    			14,
    			15,
    			16,
    			17,
    			18
    		    }
    integer btnS2AnalogOutMute[] =
    		    {
    			21,
    			22,
    			23,
    			24,
    			25,
    			26,
    			27,
    			28
    		    }
    integer btnS3AnalogInMute[] =
    		    {
    			31,
    			32,
    			33,
    			34,
    			35,
    			36,
    			37,
    			38
    		    }
    integer btnS4AnalogOutMute[] =
    		    {
    			41,
    			42,
    			43,
    			44,
    			45,
    			46,
    			47,
    			48
    		    }
    
    integer btnLvlS1MicInGain[] =
    		    {
    			11,
    			12,
    			13,
    			14,
    			15,
    			16,
    			17,
    			18
    		    }
    integer btnLvlS2AnalogOutGain[] =
    		    {
    			21,
    			22,
    			23,
    			24,
    			25,
    			26,
    			27,
    			28
    		    }
    integer btnLvlS3AnalogInGain[] =
    		    {
    			31,
    			32,
    			33,
    			34,
    			35,
    			36,
    			37,
    			38
    		    }
    integer btnLvlS4AnalogOutGain[] =
    		    {
    			41,
    			42,
    			43,
    			44,
    			45,
    			46,
    			47,
    			48
    		    }
    char EV_buffer[255]
    integer inputID
    char testDataText[255]
    char bufferDataText[255]
    char buffer_Data_EV[255]
    integer onlineEV = 0
    
    //volatile slong result_IP_CLIENT_OPEN = 0
    
    integer resolutionSendCommand = 0
    sinteger inttest
    char chartest[255]
    char IntText[255]
    char IntText1[255]
    char IntText2[255]
    char IntText3[255]
    char IntText4[255]
    
    DEFINE_FUNCTION fnClearBufferEV ()
    {
        EV_buffer = ''
    }
    
    DEFINE_FUNCTION fnRequestS3AnalogINMute ()
    {
        WAIT 10 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/MUTE/IDX1 ?',$0D"
        WAIT 20 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/MUTE/IDX2 ?',$0D"
        WAIT 30 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/MUTE/IDX3 ?',$0D"
        WAIT 40 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/MUTE/IDX4 ?',$0D"
        WAIT 50 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/MUTE/IDX5 ?',$0D"
        WAIT 60 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/MUTE/IDX6 ?',$0D"
        WAIT 70 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/MUTE/IDX7 ?',$0D"
        WAIT 80 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/MUTE/IDX8 ?',$0D"
    }
    DEFINE_FUNCTION fnRequestS3AnalogINGain ()
    {
        WAIT 10 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/GAIN/IDX1 ?',$0D"
        WAIT 20 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/GAIN/IDX2 ?',$0D"
        WAIT 30 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/GAIN/IDX3 ?',$0D"
        WAIT 40 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/GAIN/IDX4 ?',$0D"
        WAIT 50 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/GAIN/IDX5 ?',$0D"
        WAIT 60 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/GAIN/IDX6 ?',$0D"
        WAIT 70 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/GAIN/IDX7 ?',$0D"
        WAIT 80 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/GAIN/IDX8 ?',$0D"
    }
    DEFINE_FUNCTION fnRequestS1MicINMute ()
    {
        WAIT 10 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/MUTE/IDX1 ?',$0D"
        WAIT 20 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/MUTE/IDX2 ?',$0D"
        WAIT 30 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/MUTE/IDX3 ?',$0D"
        WAIT 40 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/MUTE/IDX4 ?',$0D"
        WAIT 50 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/MUTE/IDX5 ?',$0D"
        WAIT 60 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/MUTE/IDX6 ?',$0D"
        WAIT 70 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/MUTE/IDX7 ?',$0D"
        WAIT 80 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/MUTE/IDX8 ?',$0D"
    }
    
    DEFINE_FUNCTION fnRequestS1MicINGain ()
    {
        WAIT 10 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/GAIN/IDX1 ?',$0D"
        WAIT 20 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/GAIN/IDX2 ?',$0D"
        WAIT 30 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/GAIN/IDX3 ?',$0D"
        WAIT 40 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/GAIN/IDX4 ?',$0D"
        WAIT 50 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/GAIN/IDX5 ?',$0D"
        WAIT 60 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/GAIN/IDX6 ?',$0D"
        WAIT 70 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/GAIN/IDX7 ?',$0D"
        WAIT 80 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/GAIN/IDX8 ?',$0D"
    }
    
    DEFINE_FUNCTION fnRequestS2AnalogOutMute ()
    {
        WAIT 10 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/MUTE/IDX1 ?',$0D"
        WAIT 20 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/MUTE/IDX2 ?',$0D"
        WAIT 30 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/MUTE/IDX3 ?',$0D"
        WAIT 40 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/MUTE/IDX4 ?',$0D"
        WAIT 50 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/MUTE/IDX5 ?',$0D"
        WAIT 60 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/MUTE/IDX6 ?',$0D"
        WAIT 70 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/MUTE/IDX7 ?',$0D"
        WAIT 80 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/MUTE/IDX8 ?',$0D"
    }
    
    DEFINE_FUNCTION fnRequestS2AnalogOutGain ()
    {
        WAIT 10 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/GAIN/IDX1 ?',$0D"
        WAIT 20 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/GAIN/IDX2 ?',$0D"
        WAIT 30 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/GAIN/IDX3 ?',$0D"
        WAIT 40 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/GAIN/IDX4 ?',$0D"
        WAIT 50 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/GAIN/IDX5 ?',$0D"
        WAIT 60 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/GAIN/IDX6 ?',$0D"
        WAIT 70 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/GAIN/IDX7 ?',$0D"
        WAIT 80 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/GAIN/IDX8 ?',$0D"
    }
    DEFINE_FUNCTION fnRequestS4AnalogOutMute ()
    {
        WAIT 10 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/MUTE/IDX1 ?',$0D"
        WAIT 20 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/MUTE/IDX2 ?',$0D"
        WAIT 30 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/MUTE/IDX3 ?',$0D"
        WAIT 40 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/MUTE/IDX4 ?',$0D"
        WAIT 50 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/MUTE/IDX5 ?',$0D"
        WAIT 60 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/MUTE/IDX6 ?',$0D"
        WAIT 70 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/MUTE/IDX7 ?',$0D"
        WAIT 80 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/MUTE/IDX8 ?',$0D"
    }
    
    DEFINE_FUNCTION fnRequestS4AnalogOutGain ()
    {
        WAIT 10 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/GAIN/IDX1 ?',$0D"
        WAIT 20 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/GAIN/IDX2 ?',$0D"
        WAIT 30 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/GAIN/IDX3 ?',$0D"
        WAIT 40 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/GAIN/IDX4 ?',$0D"
        WAIT 50 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/GAIN/IDX5 ?',$0D"
        WAIT 60 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/GAIN/IDX6 ?',$0D"
        WAIT 70 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/GAIN/IDX7 ?',$0D"
        WAIT 80 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/GAIN/IDX8 ?',$0D"
    }
    DEFINE_FUNCTION fnParserEV(char bufferDataText[255])
    {
    	    STACK_VAR integer IDX_Count
    	    FOR (IDX_Count = 1; IDX_Count <= 8; IDX_Count++)
    	    {	    
    		IF (FIND_STRING(bufferDataText,"'/ANALOGMICIN_1/MUTE/IDX',itoa(IDX_Count),' 1'",1))
    		{
    		    IF (IDX_Count == 1) S1MicInMute.IDX1 = 1
    		    IF (IDX_Count == 2) S1MicInMute.IDX2 = 1
    		    IF (IDX_Count == 3) S1MicInMute.IDX3 = 1
    		    IF (IDX_Count == 4) S1MicInMute.IDX4 = 1
    		    IF (IDX_Count == 5) S1MicInMute.IDX5 = 1
    		    IF (IDX_Count == 6) S1MicInMute.IDX6 = 1
    		    IF (IDX_Count == 7) S1MicInMute.IDX7 = 1
    		    IF (IDX_Count == 8) S1MicInMute.IDX8 = 1
    		    fnClearBufferEV ()
    		}
    	    }
    	    
    	    FOR (IDX_Count = 1; IDX_Count <= 8; IDX_Count++)
    	    {			
    		IF (FIND_STRING(bufferDataText,"'/ANALOGMICIN_1/MUTE/IDX',itoa(IDX_Count),' 0'",1))
    		{
    		    IF (IDX_Count == 1) S1MicInMute.IDX1 = 0
    		    IF (IDX_Count == 2) S1MicInMute.IDX2 = 0
    		    IF (IDX_Count == 3) S1MicInMute.IDX3 = 0
    		    IF (IDX_Count == 4) S1MicInMute.IDX4 = 0
    		    IF (IDX_Count == 5) S1MicInMute.IDX5 = 0
    		    IF (IDX_Count == 6) S1MicInMute.IDX6 = 0
    		    IF (IDX_Count == 7) S1MicInMute.IDX7 = 0
    		    IF (IDX_Count == 8) S1MicInMute.IDX8 = 0
    		    fnClearBufferEV ()
    		}
    	    }
    	    
    	    FOR (IDX_Count = 1; IDX_Count <= 8; IDX_Count++)
    	    {			
    		IF (FIND_STRING(bufferDataText,"'/ANALOGOUT_2/MUTE/IDX',itoa(IDX_Count),' 1'",1))
    		{
    		    IF (IDX_Count == 1) S2AnalogOutMute.IDX1 = 1
    		    IF (IDX_Count == 2) S2AnalogOutMute.IDX2 = 1
    		    IF (IDX_Count == 3) S2AnalogOutMute.IDX3 = 1
    		    IF (IDX_Count == 4) S2AnalogOutMute.IDX4 = 1
    		    IF (IDX_Count == 5) S2AnalogOutMute.IDX5 = 1
    		    IF (IDX_Count == 6) S2AnalogOutMute.IDX6 = 1
    		    IF (IDX_Count == 7) S2AnalogOutMute.IDX7 = 1
    		    IF (IDX_Count == 8) S2AnalogOutMute.IDX8 = 1
    		    fnClearBufferEV ()
    		}
    	    }
    	    
    	    FOR (IDX_Count = 1; IDX_Count <= 8; IDX_Count++)
    	    {			
    		IF (FIND_STRING(bufferDataText,"'/ANALOGOUT_2/MUTE/IDX',itoa(IDX_Count),' 0'",1))
    		{
    		    IF (IDX_Count == 1) S2AnalogOutMute.IDX1 = 0
    		    IF (IDX_Count == 2) S2AnalogOutMute.IDX2 = 0
    		    IF (IDX_Count == 3) S2AnalogOutMute.IDX3 = 0
    		    IF (IDX_Count == 4) S2AnalogOutMute.IDX4 = 0
    		    IF (IDX_Count == 5) S2AnalogOutMute.IDX5 = 0
    		    IF (IDX_Count == 6) S2AnalogOutMute.IDX6 = 0
    		    IF (IDX_Count == 7) S2AnalogOutMute.IDX7 = 0
    		    IF (IDX_Count == 8) S2AnalogOutMute.IDX8 = 0
    		    fnClearBufferEV ()
    		}
    	    }
    	    
    	    FOR (IDX_Count = 1; IDX_Count <= 8; IDX_Count++)
    	    {			
    		IF (FIND_STRING(bufferDataText,"'/ANALOGIN_1/MUTE/IDX',itoa(IDX_Count),' 1'",1))
    		{
    		    IF (IDX_Count == 1) S3AnalogInMute.IDX1 = 1
    		    IF (IDX_Count == 2) S3AnalogInMute.IDX2 = 1
    		    IF (IDX_Count == 3) S3AnalogInMute.IDX3 = 1
    		    IF (IDX_Count == 4) S3AnalogInMute.IDX4 = 1
    		    IF (IDX_Count == 5) S3AnalogInMute.IDX5 = 1
    		    IF (IDX_Count == 6) S3AnalogInMute.IDX6 = 1
    		    IF (IDX_Count == 7) S3AnalogInMute.IDX7 = 1
    		    IF (IDX_Count == 8) S3AnalogInMute.IDX8 = 1
    		    fnClearBufferEV ()
    		}
    	    }
    	    
    	    FOR (IDX_Count = 1; IDX_Count <= 8; IDX_Count++)
    	    {			
    		IF (FIND_STRING(bufferDataText,"'/ANALOGIN_1/MUTE/IDX',itoa(IDX_Count),' 0'",1))
    		{
    		    IF (IDX_Count == 1) S3AnalogInMute.IDX1 = 0
    		    IF (IDX_Count == 2) S3AnalogInMute.IDX2 = 0
    		    IF (IDX_Count == 3) S3AnalogInMute.IDX3 = 0
    		    IF (IDX_Count == 4) S3AnalogInMute.IDX4 = 0
    		    IF (IDX_Count == 5) S3AnalogInMute.IDX5 = 0
    		    IF (IDX_Count == 6) S3AnalogInMute.IDX6 = 0
    		    IF (IDX_Count == 7) S3AnalogInMute.IDX7 = 0
    		    IF (IDX_Count == 8) S3AnalogInMute.IDX8 = 0
    		    fnClearBufferEV ()
    		}
    	    }
    	    
    	    FOR (IDX_Count = 1; IDX_Count <= 8; IDX_Count++)
    	    {			
    		IF (FIND_STRING(bufferDataText,"'/ANALOGOUT_1/MUTE/IDX',itoa(IDX_Count),' 1'",1))
    		{
    		    IF (IDX_Count == 1) S4AnalogOutMute.IDX1 = 1
    		    IF (IDX_Count == 2) S4AnalogOutMute.IDX2 = 1
    		    IF (IDX_Count == 3) S4AnalogOutMute.IDX3 = 1
    		    IF (IDX_Count == 4) S4AnalogOutMute.IDX4 = 1
    		    IF (IDX_Count == 5) S4AnalogOutMute.IDX5 = 1
    		    IF (IDX_Count == 6) S4AnalogOutMute.IDX6 = 1
    		    IF (IDX_Count == 7) S4AnalogOutMute.IDX7 = 1
    		    IF (IDX_Count == 8) S4AnalogOutMute.IDX8 = 1
    		    fnClearBufferEV ()
    		}
    	    }
    	    
    	    FOR (IDX_Count = 1; IDX_Count <= 8; IDX_Count++)
    	    {			
    		IF (FIND_STRING(bufferDataText,"'/ANALOGOUT_1/MUTE/IDX',itoa(IDX_Count),' 0'",1))
    		{
    		    IF (IDX_Count == 1) S4AnalogOutMute.IDX1 = 0
    		    IF (IDX_Count == 2) S4AnalogOutMute.IDX2 = 0
    		    IF (IDX_Count == 3) S4AnalogOutMute.IDX3 = 0
    		    IF (IDX_Count == 4) S4AnalogOutMute.IDX4 = 0
    		    IF (IDX_Count == 5) S4AnalogOutMute.IDX5 = 0
    		    IF (IDX_Count == 6) S4AnalogOutMute.IDX6 = 0
    		    IF (IDX_Count == 7) S4AnalogOutMute.IDX7 = 0
    		    IF (IDX_Count == 8) S4AnalogOutMute.IDX8 = 0
    		    fnClearBufferEV ()
    		}
    	    }
    
    	    ////////////////////////////////////////////////////////////////
    	    //GAIN
    	    ////////////////////////////////////////////////////////////////
    	    
    	    FOR (IDX_Count = 1; IDX_Count <= 8; IDX_Count++)
    	    {
    	    IF (FIND_STRING(bufferDataText,"'/ANALOGMICIN_1/GAIN/IDX',itoa(IDX_Count),' '",1))
    	    {
    	     
    		IF (FIND_STRING(bufferDataText,"'/ANALOGMICIN_1/GAIN/IDX',itoa(IDX_Count),' ?'",1))
    		{
    		    
    		}
    		ELSE
    		{
    		    REMOVE_STRING(bufferDataText,"'/ANALOGMICIN_1/GAIN/IDX',itoa(IDX_Count),' '",1)
    		    REMOVE_STRING(bufferDataText,"$0D",length_string(bufferDataText)-1)
    		    if (IDX_Count = 1) S1MicInGain.IDX1 = atol(bufferDataText)
    		    if (IDX_Count = 2) S1MicInGain.IDX2 = atol(bufferDataText)
    		    if (IDX_Count = 3) S1MicInGain.IDX3 = atol(bufferDataText)
    		    if (IDX_Count = 4) S1MicInGain.IDX4 = atol(bufferDataText)
    		    if (IDX_Count = 5) S1MicInGain.IDX5 = atol(bufferDataText)
    		    if (IDX_Count = 6) S1MicInGain.IDX6 = atol(bufferDataText)
    		    if (IDX_Count = 7) S1MicInGain.IDX7 = atol(bufferDataText)
    		    if (IDX_Count = 8) S1MicInGain.IDX8 = atol(bufferDataText)
    		    SEND_COMMAND dvTP_EV, "'^TXT-1',itoa(IDX_Count),',0,',bufferDataText"
    		    fnClearBufferEV ()
    		}
    	    }
    	    }
    	    FOR (IDX_Count = 1; IDX_Count <= 8; IDX_Count++)
    	    {
    	    IF (FIND_STRING(bufferDataText,"'/ANALOGOUT_2/GAIN/IDX',itoa(IDX_Count),' '",1))
    	    {
    	     
    		IF (FIND_STRING(bufferDataText,"'/ANALOGOUT_2/GAIN/IDX',itoa(IDX_Count),' ?'",1))
    		{
    		    
    		}
    		ELSE
    		{
    		    REMOVE_STRING(bufferDataText,"'/ANALOGOUT_2/GAIN/IDX',itoa(IDX_Count),' '",1)
    		    REMOVE_STRING(bufferDataText,"$0D",length_string(bufferDataText)-1)
    		    if (IDX_Count = 1) S2AnalogOutGain.IDX1 = atol(bufferDataText)
    		    if (IDX_Count = 2) S2AnalogOutGain.IDX2 = atol(bufferDataText)
    		    if (IDX_Count = 3) S2AnalogOutGain.IDX3 = atol(bufferDataText)
    		    if (IDX_Count = 4) S2AnalogOutGain.IDX4 = atol(bufferDataText)
    		    if (IDX_Count = 5) S2AnalogOutGain.IDX5 = atol(bufferDataText)
    		    if (IDX_Count = 6) S2AnalogOutGain.IDX6 = atol(bufferDataText)
    		    if (IDX_Count = 7) S2AnalogOutGain.IDX7 = atol(bufferDataText)
    		    if (IDX_Count = 8) S2AnalogOutGain.IDX8 = atol(bufferDataText)
    		    SEND_COMMAND dvTP_EV, "'^TXT-2',itoa(IDX_Count),',0,',bufferDataText"
    		    fnClearBufferEV ()
    		}
    	    }
    	    }
    	    FOR (IDX_Count = 1; IDX_Count <= 8; IDX_Count++)
    	    {
    	    IF (FIND_STRING(bufferDataText,"'/ANALOGIN_1/GAIN/IDX',itoa(IDX_Count),' '",1))
    	    {
    	     
    		IF (FIND_STRING(bufferDataText,"'/ANALOGIN_1/GAIN/IDX',itoa(IDX_Count),' ?'",1))
    		{
    		    
    		}
    		ELSE
    		{
    		    REMOVE_STRING(bufferDataText,"'/ANALOGIN_1/GAIN/IDX',itoa(IDX_Count),' '",1)
    		    REMOVE_STRING(bufferDataText,"$0D",length_string(bufferDataText)-1)
    		    if (IDX_Count = 1) S3AnalogInGain.IDX1 = atol(bufferDataText)
    		    if (IDX_Count = 2) S3AnalogInGain.IDX2 = atol(bufferDataText)
    		    if (IDX_Count = 3) S3AnalogInGain.IDX3 = atol(bufferDataText)
    		    if (IDX_Count = 4) S3AnalogInGain.IDX4 = atol(bufferDataText)
    		    if (IDX_Count = 5) S3AnalogInGain.IDX5 = atol(bufferDataText)
    		    if (IDX_Count = 6) S3AnalogInGain.IDX6 = atol(bufferDataText)
    		    if (IDX_Count = 7) S3AnalogInGain.IDX7 = atol(bufferDataText)
    		    if (IDX_Count = 8) S3AnalogInGain.IDX8 = atol(bufferDataText)
    		    SEND_COMMAND dvTP_EV, "'^TXT-3',itoa(IDX_Count),',0,',bufferDataText"
    		    fnClearBufferEV ()
    		}
    	    }
    	    }
    	    FOR (IDX_Count = 1; IDX_Count <= 8; IDX_Count++)
    	    {
    	    IF (FIND_STRING(bufferDataText,"'/ANALOGOUT_1/GAIN/IDX',itoa(IDX_Count),' '",1))
    	    {
    	     
    		IF (FIND_STRING(bufferDataText,"'/ANALOGOUT_1/GAIN/IDX',itoa(IDX_Count),' ?'",1))
    		{
    		    
    		}
    		ELSE
    		{
    		    REMOVE_STRING(bufferDataText,"'/ANALOGOUT_1/GAIN/IDX',itoa(IDX_Count),' '",1)
    		    REMOVE_STRING(bufferDataText,"$0D",length_string(bufferDataText)-1)
    		    if (IDX_Count = 1) S4AnalogOutGain.IDX1 = atol(bufferDataText)
    		    if (IDX_Count = 2) S4AnalogOutGain.IDX2 = atol(bufferDataText)
    		    if (IDX_Count = 3) S4AnalogOutGain.IDX3 = atol(bufferDataText)
    		    if (IDX_Count = 4) S4AnalogOutGain.IDX4 = atol(bufferDataText)
    		    if (IDX_Count = 5) S4AnalogOutGain.IDX5 = atol(bufferDataText)
    		    if (IDX_Count = 6) S4AnalogOutGain.IDX6 = atol(bufferDataText)
    		    if (IDX_Count = 7) S4AnalogOutGain.IDX7 = atol(bufferDataText)
    		    if (IDX_Count = 8) S4AnalogOutGain.IDX8 = atol(bufferDataText)
    		    SEND_COMMAND dvTP_EV, "'^TXT-4',itoa(IDX_Count),',0,',bufferDataText"
    		    fnClearBufferEV ()
    		}
    	    }
    	    }
    }
    
    
    
    (***********************************************************)
    (*               LATCHING DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_LATCHING
    
    (***********************************************************)
    (*       MUTUALLY EXCLUSIVE DEFINITIONS GO BELOW           *)
    (***********************************************************)
    DEFINE_MUTUALLY_EXCLUSIVE
    
    (***********************************************************)
    (*        SUBROUTINE/FUNCTION DEFINITIONS GO BELOW         *)
    (***********************************************************)
    (* EXAMPLE: DEFINE_FUNCTION <RETURN_TYPE> <NAME> (<PARAMETERS>) *)
    (* EXAMPLE: DEFINE_CALL '<NAME>' (<PARAMETERS>) *)
    
    (***********************************************************)
    (*                STARTUP CODE GOES BELOW                  *)
    (***********************************************************)
    DEFINE_START
    
    SEND_COMMAND dvEV, "'SET BAUD 19200,N,8,1,485 DISABLE'"
    //WAIT 10 SEND_STRING dvEV,"'parser -f',$0D"
    create_buffer dvEV, EV_buffer
    
    //wait 50
    //result_IP_CLIENT_OPEN = IP_CLIENT_OPEN (3,'10.0.6.1',nIPPort,1)
    (***********************************************************)
    (*                THE EVENTS GO BELOW                      *)
    (***********************************************************)
    DEFINE_EVENT
    
    TIMELINE_EVENT[VOLUME_TIMELINE_ID] //////////////////// VOLUME POLL QUERY*)
    {
        SWITCH(Timeline.Sequence)
        {
    	CASE 1:
    	{
    	    //fnRequestS1MicINGain()
    	}
        }
    }
    
    DATA_EVENT[dvEV]  
    {
        ONLINE:
        {
    	onlineEV = 1
    	lPROJ_TIME_ARRAY[1]= VOLUME_POLL_TIME
    	TIMELINE_CREATE(VOLUME_TIMELINE_ID,lPROJ_TIME_ARRAY,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT)
        }
        STRING:
        {
    	
    	send_string 5001:0:0, "'buf-',EV_buffer"
    	buffer_Data_EV = EV_buffer
    	IF (FIND_STRING(EV_buffer,"'N8000 command mode entered'",1))
    	{
    	    fnClearBufferEV ()
    	}
    	WHILE (FIND_STRING(EV_buffer,"$0D,$0A",1))
    	{
    	    buffer_Data_EV = remove_string (EV_buffer, "$0D,$0A",1)
    	    fnParserEV(buffer_Data_EV)
    	}  
        }
    }
    
    BUTTON_EVENT [dvTP_EV,btnS1MicInMute]
    {
        PUSH:
        {
    	stack_var integer btnID
    	btnID = button.input.channel
    	IF ((btnID >= 11) && (btnID <= 18))
    	{
    	    btnID = btnID - 10
    	    IF ([dvTP_EV, button.input.channel]==0)
    	    {
    		SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/MUTE/IDX',itoa(btnID),' 1',$0D"
    	    }
    	    ELSE
    	    {
    		SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/MUTE/IDX',itoa(btnID),' 0',$0D"
    	    }
    	    
    	}
        }
    }
    
    BUTTON_EVENT [dvTP_EV,btnS2AnalogOutMute]
    {
        PUSH:
        {
    	stack_var integer btnID
    	btnID = button.input.channel
    	IF ((btnID >= 21) && (btnID <= 28))
    	{
    	    btnID = btnID - 20
    	    IF ([dvTP_EV,button.input.channel]==0)
    	    {
    		SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/MUTE/IDX',itoa(btnID),' 1',$0D"
    	    }
    	    ELSE
    	    {
    		SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/MUTE/IDX',itoa(btnID),' 0',$0D"
    	    }
    	    
    	}
        }
    }
    BUTTON_EVENT [dvTP_EV,btnS3AnalogInMute]
    {
        PUSH:
        {
    	stack_var integer btnID
    	btnID = button.input.channel
    	IF ((btnID >= 31) && (btnID <= 38))
    	{
    	    btnID = btnID - 30
    	    IF ([dvTP_EV, button.input.channel]==0)
    	    {
    		SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/MUTE/IDX',itoa(btnID),' 1',$0D"
    	    }
    	    ELSE
    	    {
    		SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/MUTE/IDX',itoa(btnID),' 0',$0D"
    	    }
    	    
    	}
        }
    }
    BUTTON_EVENT [dvTP_EV,btnS4AnalogOutMute]
    {
        PUSH:
        {
    	stack_var integer btnID
    	btnID = button.input.channel
    	IF ((btnID >= 41) && (btnID <= 48))
    	{
    	    btnID = btnID - 40
    	    IF ([dvTP_EV, button.input.channel]==0)
    	    {
    		SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/MUTE/IDX',itoa(btnID),' 1',$0D"
    	    }
    	    ELSE
    	    {
    		SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/MUTE/IDX',itoa(btnID),' 0',$0D"
    	    }
    	    
    	}
        }
    }
    BUTTON_EVENT [dvTP_EV,1]
    {
        PUSH:
        {
    	fnRequestS1MicINGain()
    	wait 90 fnRequestS2AnalogOutGain()
    	wait 180 fnRequestS3AnalogINGain()
    	wait 270 fnRequestS4AnalogOutGain()
        }
    }    
    LEVEL_EVENT[dvTP_EV, btnLvlS1MicInGain]
    {
        inputID = level.input.level
        inputID = inputID - 10
        wait 10 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGMICIN_1/GAIN/IDX',itoa(inputID),' ',itoa(level.value),$0D"
    }
    LEVEL_EVENT[dvTP_EV, btnLvlS2AnalogOutGain]
    {
        inputID = level.input.level
        inputID = inputID - 20
        wait 10 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_2/GAIN/IDX',itoa(inputID),' ',itoa(level.value),$0D"
    }
    LEVEL_EVENT[dvTP_EV, btnLvlS3AnalogInGain]
    {
        inputID = level.input.level
        inputID = inputID - 30
        wait 10 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGIN_1/GAIN/IDX',itoa(inputID),' ',itoa(level.value),$0D"
    }
    LEVEL_EVENT[dvTP_EV, btnLvlS4AnalogOutGain]
    {
        inputID = level.input.level
        inputID = inputID - 40
        wait 10 SEND_STRING dvEV,"'/PARAM/DSP/ANALOGOUT_1/GAIN/IDX',itoa(inputID),' ',itoa(level.value),$0D"
    }
    (***********************************************************)
    (*            THE ACTUAL PROGRAM GOES BELOW                *)
    (***********************************************************)
    DEFINE_PROGRAM
    
    [dvTP_EV, 11] = S1MicInMute.IDX1
    [dvTP_EV, 12] = S1MicInMute.IDX2
    [dvTP_EV, 13] = S1MicInMute.IDX3
    [dvTP_EV, 14] = S1MicInMute.IDX4
    [dvTP_EV, 15] = S1MicInMute.IDX5
    [dvTP_EV, 16] = S1MicInMute.IDX6
    [dvTP_EV, 17] = S1MicInMute.IDX7
    [dvTP_EV, 18] = S1MicInMute.IDX8
    
    [dvTP_EV, 21] = S2AnalogOutMute.IDX1
    [dvTP_EV, 22] = S2AnalogOutMute.IDX2
    [dvTP_EV, 23] = S2AnalogOutMute.IDX3
    [dvTP_EV, 24] = S2AnalogOutMute.IDX4
    [dvTP_EV, 25] = S2AnalogOutMute.IDX5
    [dvTP_EV, 26] = S2AnalogOutMute.IDX6
    [dvTP_EV, 27] = S2AnalogOutMute.IDX7
    [dvTP_EV, 28] = S2AnalogOutMute.IDX8
    
    [dvTP_EV, 31] = S3AnalogInMute.IDX1
    [dvTP_EV, 32] = S3AnalogInMute.IDX2
    [dvTP_EV, 33] = S3AnalogInMute.IDX3
    [dvTP_EV, 34] = S3AnalogInMute.IDX4
    [dvTP_EV, 35] = S3AnalogInMute.IDX5
    [dvTP_EV, 36] = S3AnalogInMute.IDX6
    [dvTP_EV, 37] = S3AnalogInMute.IDX7
    [dvTP_EV, 38] = S3AnalogInMute.IDX8
    
    [dvTP_EV, 41] = S4AnalogOutMute.IDX1
    [dvTP_EV, 42] = S4AnalogOutMute.IDX2
    [dvTP_EV, 43] = S4AnalogOutMute.IDX3
    [dvTP_EV, 44] = S4AnalogOutMute.IDX4
    [dvTP_EV, 45] = S4AnalogOutMute.IDX5
    [dvTP_EV, 46] = S4AnalogOutMute.IDX6
    [dvTP_EV, 47] = S4AnalogOutMute.IDX7
    [dvTP_EV, 48] = S4AnalogOutMute.IDX8
    
    (***********************************************************)
    (*                     END OF PROGRAM                      *)
    (*        DO NOT PUT ANY CODE BELOW THIS COMMENT           *)
    (***********************************************************)
    
    
Sign In or Register to comment.