Home AMX User Forum NetLinx Studio

i need help converting Axcess to Netlinx

i am dealing with code that came from an old Axcent3 Pro controller and now reloading it into an NI-4100 controller. i am still not very good at putting the brackets in the right spots. any tips on what i should do to convert these push_events(in the Define_Program section) to button_events(in the Define_Event) section?




(**************** VIDCON SECTION *********************)

PUSH[dvTP,21]                     (* JUDGE IS HERE! *)
  {
  JUDGE_MODE = 1
  MODE = 1
  SEND_COMMAND dvTP,'PAGE-JUDGE IS HERE'
  CALL 'JUDGE IS HERE'
  //ON[dvCAM_RELAY,1]
  WAIT 10 PULSE[dvCAM_1,10]
  SEND_STRING dvMVP, "'52.'"                              (* AV SWITCH *)
  ON[dvTP,71]
  ON[dvTP,81]
  OFF[dvTP,72]
  OFF[dvTP,73]
  OFF[dvTP,74]
  OFF[dvTP,75]
  }
PUSH[dvTP,22]                     (* JUDGE IS NOT HERE! *)
  {
  JUDGE_MODE = 2
  MODE = 1
  SEND_COMMAND dvTP,'PAGE-JUDGE IS NOT HERE'
  CALL 'JUDGE IS NOT HERE'
  //ON[dvCAM_RELAY,2]
  WAIT 10 PULSE[dvCAM_1,10]
  SEND_STRING dvMVP, "'52.'"                              (* AV SWITCH *)
  ON[dvTP,72]
  ON[dvTP,81]
  OFF[dvTP,71]
  OFF[dvTP,73]
  OFF[dvTP,74]
  OFF[dvTP,75]
  }
	
(*** CAMERA CONTROL ***)

IF(MODE = 1)
   {
   PUSH[dvTP,61]
     {
     TO[dvTP,61]
     TO[dvCAM_1,CAM_UP]
     }
   PUSH[dvTP,62]
     {
     TO[dvTP,62]
     TO[dvCAM_1,CAM_DN]
     }
   PUSH[dvTP,63]
     {
     TO[dvTP,63]
     TO[dvCAM_1,CAM_RT]
     }
   PUSH[dvTP,64]
     {
     TO[dvTP,64]
     TO[dvCAM_1,CAM_LT]
     }
   PUSH[dvTP,65]
     {
     TO[dvTP,65]
     TO[dvCAM_1,CAM_ZOOM_IN]
     }
   PUSH[dvTP,66]
     {
     TO[dvTP,66]
     TO[dvCAM_1,CAM_ZOOM_OUT]
     }
    }
 ELSE IF(MODE>1)
   IF(61<=PUSH_CHANNEL&&PUSH_CHANNEL<=66)
   {
   SEND_COMMAND dvTP,'@PPN-SET CAM'
   }

(****************** POLYCOM REMOTE EMULATION ***********************)
SET_PULSE_TIME(3)

IF((130 <= PUSH_CHANNEL AND PUSH_CHANNEL <= 139))
  PULSE[dvTP,PUSH_CHANNEL]

IF((146 <= PUSH_CHANNEL AND PUSH_CHANNEL <= 159))
  PULSE[dvTP,PUSH_CHANNEL]

PUSH[dvTP,130]           (* CALL/ HANGUP *)
  {
  TO[dvPOLYCOM,43]
  }
PUSH[dvTP,131]           (* AUTO *)
  TO[dvPOLYCOM,44]
PUSH[dvTP,132]           (* NEAR *)
  TO[dvPOLYCOM,45]
PUSH[dvTP,133]           (* FAR *)
  TO[dvPOLYCOM,46]
PUSH[dvTP,134]           (* SLIDES *)
  TO[dvPOLYCOM,47]
PUSH[dvTP,135]           (* CURSOR UP *)
  TO[dvPOLYCOM,48]
PUSH[dvTP,137]           (* CURSOR DN *)
  TO[dvPOLYCOM,49]
PUSH[dvTP,139]           (* CURSOR RIGHT *)
  TO[dvPOLYCOM,50]
PUSH[dvTP,138]           (* CURSOR LEFT *)
  TO[dvPOLYCOM,51]
PUSH[dvTP,136]           (* SELECT *)
  TO[dvPOLYCOM,52]
PUSH[dvTP,155]           (* STAR *)
  TO[dvPOLYCOM,56]
PUSH[dvTP,157]           (* # *)
  TO[dvPOLYCOM,57]
PUSH[dvTP,159]           (* INFO *)
  TO[dvPOLYCOM,59]
PUSH[dvTP,158]           (* MENU *)
  TO[dvPOLYCOM,58]

(*************************** SINGLE MODE *********************)

PUSH[dvTP,81]
  {
  IF(JUDGE_MODE = 2)   (* JUDGE IS NOT HERE *)
   {
   MODE = SINGLE
   ON[dvCAM_2,11]
  WAIT 10 PULSE[dvCAM_1,10]
   ON[dvTP,81]
   SEND_STRING dvMVP, '52.'    (* MVP PRESET *)
       SEND_STRING dvROUTER,'2*1%'           (* LECTERN CAM BY DEFAULT *)
       ON[dvTP,72]
   OFF[dvTP,71]
   OFF[dvTP,73]
   OFF[dvTP,74]
   OFF[dvTP,75]
   }
  ELSE IF(JUDGE_MODE = 1)   (* JUDGE IS HERE *)
   {
   MODE = SINGLE
   ON[dvCAM_1,10]
  WAIT 10 PULSE[dvCAM_1,10]
   ON[dvTP,81]
   SEND_STRING dvMVP, '52.'    (* MVP PRESET *)
       SEND_STRING dvROUTER,'1*1%'           (* JUDGECAM BY DEFAULT *)
       ON[dvTP,71]
   OFF[dvTP,73]
   OFF[dvTP,72]
   OFF[dvTP,74]
   OFF[dvTP,75]
   }
   }
IF(MODE = SINGLE)
  {
  IF(71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)
    {
    ON[dvTP,PUSH_CHANNEL]
    CAMERA = (PUSH_CHANNEL - 70)
    ON[dvCAM_1,CAMERA]
  WAIT 10 PULSE[dvCAM_1,10]
    }

  PUSH[dvTP,71]
       {
       SEND_STRING dvROUTER,'1*1%'
       OFF[dvTP,72]
       OFF[dvTP,73]
       OFF[dvTP,74]
       OFF[dvTP,75]
       }
  PUSH[dvTP,72]
       {
       SEND_STRING dvROUTER,'2*1%'
       OFF[dvTP,71]
       OFF[dvTP,73]
       OFF[dvTP,74]
       OFF[dvTP,75]
       }
  PUSH[dvTP,73]
       {
       SEND_STRING dvROUTER,'3*1%'
       OFF[dvTP,71]
       OFF[dvTP,72]
       OFF[dvTP,74]
       OFF[dvTP,75]
       }
  PUSH[dvTP,74]
       {
       SEND_STRING dvROUTER,'4*1%'
       OFF[dvTP,71]
       OFF[dvTP,72]
       OFF[dvTP,73]
       OFF[dvTP,75]
       }
  PUSH[dvTP,75]
       {
       SEND_STRING dvROUTER, '5*1%'
       OFF[dvTP,71]
       OFF[dvTP,72]
       OFF[dvTP,73]
       OFF[dvTP,74]
       }
    }
(************************ DUAL MODE ***********************)
PUSH[dvTP,82]
{
 IF(JUDGE_MODE = 2)      (* JUDGE NOT HERE *)
  {
  ON[dvTP,82]
  MODE = DUAL
 (* SEND_STRING MVP, '3.'     (* MVP PRESET *)*)
  SEND_STRING dvMVP, '62.'     (* MVP PRESET *)
      SEND_STRING dvROUTER, '2*1!' (* INPUT 1 *)
      WAIT 1 SEND_STRING dvROUTER, '5*2!' (* INPUT 1 *)
   OFF[dvTP,71]
   ON[dvTP,72]
   OFF[dvTP,73]
   OFF[dvTP,74]
   ON[dvTP,75]
  }
 ELSE IF(JUDGE_MODE = 1)      (* JUDGE HERE *)
  {
  ON[dvTP,82]
  MODE = DUAL
  SEND_STRING dvMVP, '62.'     (* MVP PRESET *)
      SEND_STRING dvROUTER, '1*1!' (* INPUT 1 *)
      WAIT 1 SEND_STRING dvROUTER, '2*2!' (* INPUT 1 *)
   ON[dvTP,71]
   ON[dvTP,72]
   OFF[dvTP,73]
   OFF[dvTP,74]
   OFF[dvTP,75]
  }
}

IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75) AND (MODE = DUAL))
  SEND_STRING dvMVP, '62.'     (* MVP PRESET *)


IF(MODE = DUAL)
{
  PUSH[dvTP,71]                          (* JUDGE CAM *)
     {
      JUDGE_LAST_CAM = 1
      SEND_STRING dvROUTER, '1*1!' (* INPUT 1 *)
      SEND_STRING 0, '1*1!' (* INPUT 1 *)
      WAIT 5 LECTERN_LAST_CAM = 0
      WAIT 5 WITNESS_LAST_CAM = 0
      WAIT 5 EAST_LAST_CAM = 0
      WAIT 5 WEST_LAST_CAM = 0
      ON[dvTP,71]
      OFF[dvTP,72]
      OFF[dvTP,73]
      OFF[dvTP,74]
      OFF[dvTP,75]
      }
  PUSH[dvTP,72]                          (* LECTERN CAM *)
     {
      LECTERN_LAST_CAM = 1
      SEND_STRING dvROUTER, '2*1!' (* INPUT 1 *)
      SEND_STRING 0, '2*1!' (* INPUT 1 *)
      WAIT 5 JUDGE_LAST_CAM = 0
      WAIT 5 WITNESS_LAST_CAM = 0
      WAIT 5 EAST_LAST_CAM = 0
      WAIT 5 WEST_LAST_CAM = 0
      ON[dvTP,72]
      OFF[dvTP,71]
      OFF[dvTP,73]
      OFF[dvTP,74]
      OFF[dvTP,75]
      }
  PUSH[dvTP,73]                          (* WITNESS CAM *)
     {
      WITNESS_LAST_CAM = 1
      SEND_STRING dvROUTER, '3*1!' (* INPUT 1 *)
      WAIT 5 JUDGE_LAST_CAM = 0
      WAIT 5 LECTERN_LAST_CAM = 0
      WAIT 5 EAST_LAST_CAM = 0
      WAIT 5 WEST_LAST_CAM = 0
      ON[dvTP,73]
      OFF[dvTP,71]
      OFF[dvTP,72]
      OFF[dvTP,74]
      OFF[dvTP,75]
      }
  PUSH[dvTP,74]                         (* EAST ATT *)
     {
      EAST_LAST_CAM = 1
      SEND_STRING dvROUTER, '4*1!' (* INPUT 1 *)
      WAIT 5 JUDGE_LAST_CAM = 0
      WAIT 5 LECTERN_LAST_CAM = 0
      WAIT 5 WITNESS_LAST_CAM = 0
      WAIT 5 WEST_LAST_CAM = 0
      ON[dvTP,74]
      OFF[dvTP,71]
      OFF[dvTP,73]
      OFF[dvTP,72]
      OFF[dvTP,75]
      }
  PUSH[dvTP,75]                        (* WEST *)
     {
      WEST_LAST_CAM = 1
      SEND_STRING dvROUTER, '5*1!' (* INPUT 1 *)
      WAIT 5 JUDGE_LAST_CAM = 0
      WAIT 5 LECTERN_LAST_CAM = 0
      WAIT 5 WITNESS_LAST_CAM = 0
      WAIT 5 EAST_LAST_CAM = 0
      ON[dvTP,75]
      OFF[dvTP,71]
      OFF[dvTP,73]
      OFF[dvTP,74]
      OFF[dvTP,72]
      }

IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>71))  (* JUDGE *)
{
  IF(JUDGE_LAST_CAM)
		{
			JUDGE_NEXT_TO_LAST = 1
			WAIT 10 JUDGE_NEXT_TO_LAST = 0
			WAIT 10 JUDGE_LAST_CAM = 0
		}
}
IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>72))  (* LECTERN *)
{
  IF(LECTERN_LAST_CAM)
		{
			LECTERN_NEXT_TO_LAST = 1
			WAIT 10 LECTERN_NEXT_TO_LAST = 0
			WAIT 10 LECTERN_LAST_CAM = 0
		}
}
IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>73))  (* WITNESS *)
{
  IF(WITNESS_LAST_CAM)
		{
			WITNESS_NEXT_TO_LAST = 1
			WAIT 10 WITNESS_NEXT_TO_LAST = 0
			WAIT 10 WITNESS_LAST_CAM = 0
		}
}
IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>74))  (* EAST *)
{
  IF(EAST_LAST_CAM)
		{
			EAST_NEXT_TO_LAST = 1
			WAIT 10 EAST_NEXT_TO_LAST = 0
			WAIT 10 EAST_LAST_CAM = 0
		}
}
IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>75))  (* WEST *)
{
  IF(WEST_LAST_CAM)
		{
			WEST_NEXT_TO_LAST = 1
			WAIT 10 WEST_NEXT_TO_LAST = 0
			WAIT 10 WEST_LAST_CAM = 0
		}
}

IF(71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)
  WAIT 1 SELECT
   {
		ACTIVE(JUDGE_NEXT_TO_LAST):
      {
      SEND_STRING dvROUTER, '1*2!' (* INPUT 1 *)
      SEND_STRING 0, '1*2!' (* INPUT 1 *)
      ON[dvTP,71]
      }
		ACTIVE(LECTERN_NEXT_TO_LAST):
      {
      SEND_STRING dvROUTER, '2*2!' (* INPUT 1 *)
      SEND_STRING 0, '2*2!' (* INPUT 1 *)
      ON[dvTP,72]
      }
		ACTIVE(WITNESS_NEXT_TO_LAST):
      {
      SEND_STRING dvROUTER, '3*2!' (* INPUT 1 *)
      ON[dvTP,73]
      }
		ACTIVE(EAST_NEXT_TO_LAST):
      {
      SEND_STRING dvROUTER, '4*2!' (* INPUT 1 *)
      ON[dvTP,74]
      }
		ACTIVE(WEST_NEXT_TO_LAST):
      {
      SEND_STRING dvROUTER, '5*2!' (* INPUT 1 *)
      ON[dvTP,75]
      }
    }
  }


(************************ TRIPLE MODE ***********************)
PUSH[dvTP,83]
  {
  IF(JUDGE_MODE = 2)           (* JUDGE NOT HERE *)
  {
  ON[dvTP,83]
  MODE = TRIPLE
  SEND_STRING dvMVP, '59.'     (* MVP PRESET *)
      SEND_STRING dvROUTER, '4*1!' (* INPUT 1 *)
      WAIT 1 SEND_STRING dvROUTER, '5*2!' (* INPUT 1 *)
      WAIT 2 SEND_STRING dvROUTER, '2*3!' (* INPUT 1 *)
   OFF[dvTP,71]
   ON[dvTP,72]
   OFF[dvTP,73]
   ON[dvTP,74]
   ON[dvTP,75]
  }
  ELSE IF(JUDGE_MODE = 1)           (* JUDGE HERE *)
  {
  ON[dvTP,83]
  MODE = TRIPLE
  SEND_STRING dvMVP, '59.'     (* MVP PRESET *)
      SEND_STRING dvROUTER, '1*3!' (* INPUT 1 *)
      WAIT 1 SEND_STRING dvROUTER, '2*1!' (* INPUT 1 *)
      WAIT 2 SEND_STRING dvROUTER, '5*2!' (* INPUT 1 *)
   ON[dvTP,71]
   ON[dvTP,72]
   OFF[dvTP,73]
   OFF[dvTP,74]
   ON[dvTP,75]
  }
  }


IF(MODE = TRIPLE)
{
         (**************** LAST CAM ***************)
  PUSH[dvTP,71]                          (* JUDGE CAM *)
     {
      JUDGE_LAST_CAM = 1
      ON[dvTP,71]
      SEND_STRING dvROUTER, '1*1!' (* INPUT 1 *)
      WAIT 10 LECTERN_LAST_CAM = 0
      OFF[dvTP,72]
      WAIT 10 WITNESS_LAST_CAM = 0
      OFF[dvTP,73]
      WAIT 10 EAST_LAST_CAM = 0
      OFF[dvTP,74]
      WAIT 10 WEST_LAST_CAM = 0
      OFF[dvTP,75]
      }
  PUSH[dvTP,72]                          (* LECTERN CAM *)
     {
      LECTERN_LAST_CAM = 1
      ON[dvTP,72]
      SEND_STRING dvROUTER, '2*1!' (* INPUT 1 *)
      WAIT 10 JUDGE_LAST_CAM = 0
      OFF[dvTP,71]
      WAIT 10 WITNESS_LAST_CAM = 0
      OFF[dvTP,73]
      WAIT 10 EAST_LAST_CAM = 0
      OFF[dvTP,74]
      WAIT 10 WEST_LAST_CAM = 0
      OFF[dvTP,75]
      }
  PUSH[dvTP,73]                          (* WITNESS CAM *)
     {
      WITNESS_LAST_CAM = 1
      ON[dvTP,73]
      SEND_STRING dvROUTER, '3*1!' (* INPUT 1 *)
      WAIT 10 JUDGE_LAST_CAM = 0
      OFF[dvTP,71]
      WAIT 10 LECTERN_LAST_CAM = 0
      OFF[dvTP,72]
      WAIT 10 EAST_LAST_CAM = 0
      OFF[dvTP,74]
      WAIT 10 WEST_LAST_CAM = 0
      OFF[dvTP,75]
      }
  PUSH[dvTP,74]                         (* EAST ATT *)
     {
      EAST_LAST_CAM = 1
      ON[dvTP,74]
      SEND_STRING dvROUTER, '4*1!' (* INPUT 1 *)
      WAIT 10 JUDGE_LAST_CAM = 0
      OFF[dvTP,71]
      WAIT 10 LECTERN_LAST_CAM = 0
      OFF[dvTP,73]
      WAIT 10 WITNESS_LAST_CAM = 0
      OFF[dvTP,72]
      WAIT 10 WEST_LAST_CAM = 0
      OFF[dvTP,75]
      }
  PUSH[dvTP,75]                        (* WEST *)
     {
      WEST_LAST_CAM = 1
      ON[dvTP,75]
      SEND_STRING dvROUTER, '5*1!' (* INPUT 1 *)
      WAIT 10 JUDGE_LAST_CAM = 0
      OFF[dvTP,71]
      WAIT 10 LECTERN_LAST_CAM = 0
      OFF[dvTP,73]
      WAIT 10 WITNESS_LAST_CAM = 0
      OFF[dvTP,72]
      WAIT 10 EAST_LAST_CAM = 0
      OFF[dvTP,74]
      }
}
(************************** NEXT TO LAST *******************)

IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>71)&&(MODE = 3))  (* JUDGE *)
  IF(JUDGE_LAST_CAM)
     {
     WAIT 1 JUDGE_NEXT_TO_LAST = 1
     }

IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>72)&&(MODE = 3))  (* LECTERN *)
  IF(LECTERN_LAST_CAM)
     {
     WAIT 1 LECTERN_NEXT_TO_LAST = 1
     }

IF((72<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>73)&&(MODE = 3))  (* WITNESS *)
  IF(WITNESS_LAST_CAM)
     {
     WAIT 1 WITNESS_NEXT_TO_LAST = 1
     }
IF((72<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>74)&&(MODE = 3))  (* EAST *)
  IF(EAST_LAST_CAM)
     {
     WAIT 1 EAST_NEXT_TO_LAST = 1
     }
IF((72<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>75)&&(MODE = 3))  (* WEST *)
  IF(WEST_LAST_CAM)
     {
     WAIT 1 WEST_NEXT_TO_LAST = 1
     }

(******************** THIRD TO LAST *********************)

IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(MODE = 3))
  {
  SELECT
   {
   ACTIVE(JUDGE_NEXT_TO_LAST):
     {
     JUDGE_THIRD_TO_LAST = 1
     JUDGE_NEXT_TO_LAST = 0
     WAIT 10 JUDGE_THIRD_TO_LAST = 0
     }
   ACTIVE(LECTERN_NEXT_TO_LAST):
     {
     LECTERN_THIRD_TO_LAST = 1
     LECTERN_NEXT_TO_LAST = 0
     WAIT 10 LECTERN_THIRD_TO_LAST = 0
     }
   ACTIVE(WITNESS_NEXT_TO_LAST):
      {
     WITNESS_THIRD_TO_LAST = 1
     WITNESS_NEXT_TO_LAST = 0
     WAIT 10 WITNESS_THIRD_TO_LAST = 0
      }
   ACTIVE(EAST_NEXT_TO_LAST):
      {
     EAST_THIRD_TO_LAST = 1
     EAST_NEXT_TO_LAST = 0
     WAIT 10 EAST_THIRD_TO_LAST = 0
      }
   ACTIVE(WEST_NEXT_TO_LAST):
      {
     WEST_THIRD_TO_LAST = 1
     WEST_NEXT_TO_LAST = 0
     WAIT 10 WEST_THIRD_TO_LAST = 0
      }
		}
	}


IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(MODE = 3))
{
  WAIT 5 SELECT
	{
   ACTIVE(JUDGE_NEXT_TO_LAST):
		{
		WAIT 2 SEND_STRING dvROUTER, '1*2!' (* INPUT 1 *)
		ON[dvTP,71]
		}
   ACTIVE(LECTERN_NEXT_TO_LAST):
		{
		WAIT 2 SEND_STRING dvROUTER, '2*2!' (* INPUT 1 *)
		ON[dvTP,72]
		}
   ACTIVE(WITNESS_NEXT_TO_LAST):
		{
		WAIT 2 SEND_STRING dvROUTER, '3*2!' (* INPUT 1 *)
		ON[dvTP,73]
		}
   ACTIVE(EAST_NEXT_TO_LAST):
		{
		WAIT 2 SEND_STRING dvROUTER, '4*2!' (* INPUT 1 *)
		ON[dvTP,74]
		}
   ACTIVE(WEST_NEXT_TO_LAST):
		{
		WAIT 2 SEND_STRING dvROUTER, '5*2!' (* INPUT 1 *)
		ON[dvTP,75]
		}
	}
}

IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(MODE = 3))
{
  WAIT 5 SELECT
	{
   ACTIVE(JUDGE_THIRD_TO_LAST):
		{
		WAIT 1 SEND_STRING dvROUTER, '1*3!'
		ON[dvTP,71]
		}
   ACTIVE(LECTERN_THIRD_TO_LAST):
		{
		WAIT 1 SEND_STRING dvROUTER, '2*3!'
		ON[dvTP,72]
		}
   ACTIVE(WITNESS_THIRD_TO_LAST):
		{
		WAIT 1 SEND_STRING dvROUTER, '3*3!'
		ON[dvTP,73]
		}
   ACTIVE(EAST_THIRD_TO_LAST):
		{
		WAIT 1 SEND_STRING dvROUTER, '4*3!'
		ON[dvTP,74]
		}
   ACTIVE(WEST_THIRD_TO_LAST):
		{
		WAIT 1 SEND_STRING dvROUTER, '5*3!'
		ON[dvTP,75]
		}
	}
}
(******************** QUAD MODES ***********************)
IF(JUDGE_MODE = 2)   (* JUDGE IS NOT HERE *)
  {
   PUSH[dvTP,84]
		{
     ON[dvTP,84]
     MODE = QUAD
     SEND_STRING dvMVP, '51.'     (* MVP PRESET *)
      ON[dvTP,72]
      ON[dvTP,73]
      ON[dvTP,74]
      ON[dvTP,75]
      SEND_STRING dvROUTER, '4*1!'
      WAIT 1 SEND_STRING dvROUTER, '5*2!'
      WAIT 2 SEND_STRING dvROUTER, '2*3!'
      WAIT 3 SEND_STRING dvROUTER, '3*4!'
		}
	}

IF(JUDGE_MODE = 1)   (* JUDGE IS HERE *)
  {
		PUSH[dvTP,84]
		{
     ON[dvTP,84]
     MODE = QUAD
     SEND_STRING dvMVP, '1.'     (* MVP PRESET *)
      ON[dvTP,71]
      ON[dvTP,72]
      OFF[dvTP,73]
      ON[dvTP,74]
      ON[dvTP,75]
      SEND_STRING dvROUTER, '1*1!'
      WAIT 1 SEND_STRING dvROUTER, '2*2!'
      WAIT 2 SEND_STRING dvROUTER, '5*3!'
      WAIT 3 SEND_STRING dvROUTER, '4*4!'
		}
		
		PUSH[dvTP,73]                   (* WITNESS ODD CAMERA OUT *)
		{
			ON[dvTP,73]
			OFF[dvTP,74]
			SEND_STRING dvROUTER, '3*4!'
		}
		
		PUSH[dvTP,74]                   (* ODD CAMERA OUT *)
		{
			ON[dvTP,74]
			OFF[dvTP,73]
			SEND_STRING dvROUTER, '4*4!'
		}
	}

PUSH[dvTP,233]
  {
		PULSE[dvPOLYCOM,WAKEUP3]         (* TURN PIP ON *)
		WAIT 300 PULSE[dvPOLYCOM,WAKEUP]          (* TURN PIP OFF *)
  }





Comments

  • Spire_JeffSpire_Jeff Posts: 1,917
    1. Find and replace 'PUSH[' with 'BUTTON_EVENT['
    2. Change the '{' immediately following the new BUTTON_EVENT[xx,xx] statement to be '{ <CR> push:{' (Replace <CR> with the enter key so it is on a new line).
    3. Put your cursor on the second { you added. It should turn red. scroll down until you see the matching brace. Add another } on a new line after that brace.


    From a quick glance, that should convert everything to button_events. Ohhh, make sure that this occurs in the define_event section, not the define_program section.

    Jeff
  • Spire_Jeff wrote: »
    1. Find and replace 'PUSH[' with 'BUTTON_EVENT['
    2. Change the '{' immediately following the new BUTTON_EVENT[xx,xx] statement to be '{ <CR> push:{' (Replace <CR> with the enter key so it is on a new line).
    3. Put your cursor on the second { you added. It should turn red. scroll down until you see the matching brace. Add another } on a new line after that brace.


    From a quick glance, that should convert everything to button_events. Ohhh, make sure that this occurs in the define_event section, not the define_program section.

    Jeff

    thanks for the tips! i been leaving off an extra set of brackets that was giving me errors while compiling.
  • i have converted half of the axcent code and moved it to the define_event section. the other half in the define_program section i am having problems converting the code with the IF and ELSE IF statements. i have tried doing it the way i did the first half but kept getting errors while trying to compile and build active system.
    PUSH[dvTP,81]
      {
      IF(JUDGE_MODE = 2)   (* JUDGE IS NOT HERE *)
       {
       MODE = SINGLE
       ON[dvCAM_2,11]
      WAIT 10 PULSE[dvCAM_1,10]
       ON[dvTP,81]
       SEND_STRING dvMVP, '52.'    (* MVP PRESET *)
           SEND_STRING dvROUTER,'2*1%'           (* LECTERN CAM BY DEFAULT *)
           ON[dvTP,72]
       OFF[dvTP,71]
       OFF[dvTP,73]
       OFF[dvTP,74]
       OFF[dvTP,75]
       }
      ELSE IF(JUDGE_MODE = 1)   (* JUDGE IS HERE *)
       {
       MODE = SINGLE
       ON[dvCAM_1,10]
      WAIT 10 PULSE[dvCAM_1,10]
       ON[dvTP,81]
       SEND_STRING dvMVP, '52.'    (* MVP PRESET *)
           SEND_STRING dvROUTER,'1*1%'           (* JUDGECAM BY DEFAULT *)
           ON[dvTP,71]
       OFF[dvTP,73]
       OFF[dvTP,72]
       OFF[dvTP,74]
       OFF[dvTP,75]
       }
       }
    IF(MODE = SINGLE)
      {
      IF(71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)
        {
        ON[dvTP,PUSH_CHANNEL]
        CAMERA = (PUSH_CHANNEL - 70)
        ON[dvCAM_1,CAMERA]
      WAIT 10 PULSE[dvCAM_1,10]
        }
    
      PUSH[dvTP,71]
           {
           SEND_STRING dvROUTER,'1*1%'
           OFF[dvTP,72]
           OFF[dvTP,73]
           OFF[dvTP,74]
           OFF[dvTP,75]
           }
      PUSH[dvTP,72]
           {
           SEND_STRING dvROUTER,'2*1%'
           OFF[dvTP,71]
           OFF[dvTP,73]
           OFF[dvTP,74]
           OFF[dvTP,75]
           }
      PUSH[dvTP,73]
           {
           SEND_STRING dvROUTER,'3*1%'
           OFF[dvTP,71]
           OFF[dvTP,72]
           OFF[dvTP,74]
           OFF[dvTP,75]
           }
      PUSH[dvTP,74]
           {
           SEND_STRING dvROUTER,'4*1%'
           OFF[dvTP,71]
           OFF[dvTP,72]
           OFF[dvTP,73]
           OFF[dvTP,75]
           }
      PUSH[dvTP,75]
           {
           SEND_STRING dvROUTER, '5*1%'
           OFF[dvTP,71]
           OFF[dvTP,72]
           OFF[dvTP,73]
           OFF[dvTP,74]
           }
        }
    (************************ DUAL MODE ***********************)
    PUSH[dvTP,82]
    {
     IF(JUDGE_MODE = 2)      (* JUDGE NOT HERE *)
      {
      ON[dvTP,82]
      MODE = DUAL
     (* SEND_STRING MVP, '3.'     (* MVP PRESET *)*)
      SEND_STRING dvMVP, '62.'     (* MVP PRESET *)
          SEND_STRING dvROUTER, '2*1!' (* INPUT 1 *)
          WAIT 1 SEND_STRING dvROUTER, '5*2!' (* INPUT 1 *)
       OFF[dvTP,71]
       ON[dvTP,72]
       OFF[dvTP,73]
       OFF[dvTP,74]
       ON[dvTP,75]
      }
     ELSE IF(JUDGE_MODE = 1)      (* JUDGE HERE *)
      {
      ON[dvTP,82]
      MODE = DUAL
      SEND_STRING dvMVP, '62.'     (* MVP PRESET *)
          SEND_STRING dvROUTER, '1*1!' (* INPUT 1 *)
          WAIT 1 SEND_STRING dvROUTER, '2*2!' (* INPUT 1 *)
       ON[dvTP,71]
       ON[dvTP,72]
       OFF[dvTP,73]
       OFF[dvTP,74]
       OFF[dvTP,75]
      }
    }
    
    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75) AND (MODE = DUAL))
      SEND_STRING dvMVP, '62.'     (* MVP PRESET *)
    
    
    IF(MODE = DUAL)
    {
      PUSH[dvTP,71]                          (* JUDGE CAM *)
         {
          JUDGE_LAST_CAM = 1
          SEND_STRING dvROUTER, '1*1!' (* INPUT 1 *)
          SEND_STRING 0, '1*1!' (* INPUT 1 *)
          WAIT 5 LECTERN_LAST_CAM = 0
          WAIT 5 WITNESS_LAST_CAM = 0
          WAIT 5 EAST_LAST_CAM = 0
          WAIT 5 WEST_LAST_CAM = 0
          ON[dvTP,71]
          OFF[dvTP,72]
          OFF[dvTP,73]
          OFF[dvTP,74]
          OFF[dvTP,75]
          }
      PUSH[dvTP,72]                          (* LECTERN CAM *)
         {
          LECTERN_LAST_CAM = 1
          SEND_STRING dvROUTER, '2*1!' (* INPUT 1 *)
          SEND_STRING 0, '2*1!' (* INPUT 1 *)
          WAIT 5 JUDGE_LAST_CAM = 0
          WAIT 5 WITNESS_LAST_CAM = 0
          WAIT 5 EAST_LAST_CAM = 0
          WAIT 5 WEST_LAST_CAM = 0
          ON[dvTP,72]
          OFF[dvTP,71]
          OFF[dvTP,73]
          OFF[dvTP,74]
          OFF[dvTP,75]
          }
      PUSH[dvTP,73]                          (* WITNESS CAM *)
         {
          WITNESS_LAST_CAM = 1
          SEND_STRING dvROUTER, '3*1!' (* INPUT 1 *)
          WAIT 5 JUDGE_LAST_CAM = 0
          WAIT 5 LECTERN_LAST_CAM = 0
          WAIT 5 EAST_LAST_CAM = 0
          WAIT 5 WEST_LAST_CAM = 0
          ON[dvTP,73]
          OFF[dvTP,71]
          OFF[dvTP,72]
          OFF[dvTP,74]
          OFF[dvTP,75]
          }
      PUSH[dvTP,74]                         (* EAST ATT *)
         {
          EAST_LAST_CAM = 1
          SEND_STRING dvROUTER, '4*1!' (* INPUT 1 *)
          WAIT 5 JUDGE_LAST_CAM = 0
          WAIT 5 LECTERN_LAST_CAM = 0
          WAIT 5 WITNESS_LAST_CAM = 0
          WAIT 5 WEST_LAST_CAM = 0
          ON[dvTP,74]
          OFF[dvTP,71]
          OFF[dvTP,73]
          OFF[dvTP,72]
          OFF[dvTP,75]
          }
      PUSH[dvTP,75]                        (* WEST *)
         {
          WEST_LAST_CAM = 1
          SEND_STRING dvROUTER, '5*1!' (* INPUT 1 *)
          WAIT 5 JUDGE_LAST_CAM = 0
          WAIT 5 LECTERN_LAST_CAM = 0
          WAIT 5 WITNESS_LAST_CAM = 0
          WAIT 5 EAST_LAST_CAM = 0
          ON[dvTP,75]
          OFF[dvTP,71]
          OFF[dvTP,73]
          OFF[dvTP,74]
          OFF[dvTP,72]
          }
    
    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>71))  (* JUDGE *)
    {
      IF(JUDGE_LAST_CAM)
    		{
    			JUDGE_NEXT_TO_LAST = 1
    			WAIT 10 JUDGE_NEXT_TO_LAST = 0
    			WAIT 10 JUDGE_LAST_CAM = 0
    		}
    }
    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>72))  (* LECTERN *)
    {
      IF(LECTERN_LAST_CAM)
    		{
    			LECTERN_NEXT_TO_LAST = 1
    			WAIT 10 LECTERN_NEXT_TO_LAST = 0
    			WAIT 10 LECTERN_LAST_CAM = 0
    		}
    }
    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>73))  (* WITNESS *)
    {
      IF(WITNESS_LAST_CAM)
    		{
    			WITNESS_NEXT_TO_LAST = 1
    			WAIT 10 WITNESS_NEXT_TO_LAST = 0
    			WAIT 10 WITNESS_LAST_CAM = 0
    		}
    }
    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>74))  (* EAST *)
    {
      IF(EAST_LAST_CAM)
    		{
    			EAST_NEXT_TO_LAST = 1
    			WAIT 10 EAST_NEXT_TO_LAST = 0
    			WAIT 10 EAST_LAST_CAM = 0
    		}
    }
    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>75))  (* WEST *)
    {
      IF(WEST_LAST_CAM)
    		{
    			WEST_NEXT_TO_LAST = 1
    			WAIT 10 WEST_NEXT_TO_LAST = 0
    			WAIT 10 WEST_LAST_CAM = 0
    		}
    }
    
    IF(71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)
      WAIT 1 SELECT
       {
    		ACTIVE(JUDGE_NEXT_TO_LAST):
          {
          SEND_STRING dvROUTER, '1*2!' (* INPUT 1 *)
          SEND_STRING 0, '1*2!' (* INPUT 1 *)
          ON[dvTP,71]
          }
    		ACTIVE(LECTERN_NEXT_TO_LAST):
          {
          SEND_STRING dvROUTER, '2*2!' (* INPUT 1 *)
          SEND_STRING 0, '2*2!' (* INPUT 1 *)
          ON[dvTP,72]
          }
    		ACTIVE(WITNESS_NEXT_TO_LAST):
          {
          SEND_STRING dvROUTER, '3*2!' (* INPUT 1 *)
          ON[dvTP,73]
          }
    		ACTIVE(EAST_NEXT_TO_LAST):
          {
          SEND_STRING dvROUTER, '4*2!' (* INPUT 1 *)
          ON[dvTP,74]
          }
    		ACTIVE(WEST_NEXT_TO_LAST):
          {
          SEND_STRING dvROUTER, '5*2!' (* INPUT 1 *)
          ON[dvTP,75]
          }
        }
      }
    
    
    (************************ TRIPLE MODE ***********************)
    PUSH[dvTP,83]
      {
      IF(JUDGE_MODE = 2)           (* JUDGE NOT HERE *)
      {
      ON[dvTP,83]
      MODE = TRIPLE
      SEND_STRING dvMVP, '59.'     (* MVP PRESET *)
          SEND_STRING dvROUTER, '4*1!' (* INPUT 1 *)
          WAIT 1 SEND_STRING dvROUTER, '5*2!' (* INPUT 1 *)
          WAIT 2 SEND_STRING dvROUTER, '2*3!' (* INPUT 1 *)
       OFF[dvTP,71]
       ON[dvTP,72]
       OFF[dvTP,73]
       ON[dvTP,74]
       ON[dvTP,75]
      }
      ELSE IF(JUDGE_MODE = 1)           (* JUDGE HERE *)
      {
      ON[dvTP,83]
      MODE = TRIPLE
      SEND_STRING dvMVP, '59.'     (* MVP PRESET *)
          SEND_STRING dvROUTER, '1*3!' (* INPUT 1 *)
          WAIT 1 SEND_STRING dvROUTER, '2*1!' (* INPUT 1 *)
          WAIT 2 SEND_STRING dvROUTER, '5*2!' (* INPUT 1 *)
       ON[dvTP,71]
       ON[dvTP,72]
       OFF[dvTP,73]
       OFF[dvTP,74]
       ON[dvTP,75]
      }
      }
    
    
    IF(MODE = TRIPLE)
    {
             (**************** LAST CAM ***************)
      PUSH[dvTP,71]                          (* JUDGE CAM *)
         {
          JUDGE_LAST_CAM = 1
          ON[dvTP,71]
          SEND_STRING dvROUTER, '1*1!' (* INPUT 1 *)
          WAIT 10 LECTERN_LAST_CAM = 0
          OFF[dvTP,72]
          WAIT 10 WITNESS_LAST_CAM = 0
          OFF[dvTP,73]
          WAIT 10 EAST_LAST_CAM = 0
          OFF[dvTP,74]
          WAIT 10 WEST_LAST_CAM = 0
          OFF[dvTP,75]
          }
      PUSH[dvTP,72]                          (* LECTERN CAM *)
         {
          LECTERN_LAST_CAM = 1
          ON[dvTP,72]
          SEND_STRING dvROUTER, '2*1!' (* INPUT 1 *)
          WAIT 10 JUDGE_LAST_CAM = 0
          OFF[dvTP,71]
          WAIT 10 WITNESS_LAST_CAM = 0
          OFF[dvTP,73]
          WAIT 10 EAST_LAST_CAM = 0
          OFF[dvTP,74]
          WAIT 10 WEST_LAST_CAM = 0
          OFF[dvTP,75]
          }
      PUSH[dvTP,73]                          (* WITNESS CAM *)
         {
          WITNESS_LAST_CAM = 1
          ON[dvTP,73]
          SEND_STRING dvROUTER, '3*1!' (* INPUT 1 *)
          WAIT 10 JUDGE_LAST_CAM = 0
          OFF[dvTP,71]
          WAIT 10 LECTERN_LAST_CAM = 0
          OFF[dvTP,72]
          WAIT 10 EAST_LAST_CAM = 0
          OFF[dvTP,74]
          WAIT 10 WEST_LAST_CAM = 0
          OFF[dvTP,75]
          }
      PUSH[dvTP,74]                         (* EAST ATT *)
         {
          EAST_LAST_CAM = 1
          ON[dvTP,74]
          SEND_STRING dvROUTER, '4*1!' (* INPUT 1 *)
          WAIT 10 JUDGE_LAST_CAM = 0
          OFF[dvTP,71]
          WAIT 10 LECTERN_LAST_CAM = 0
          OFF[dvTP,73]
          WAIT 10 WITNESS_LAST_CAM = 0
          OFF[dvTP,72]
          WAIT 10 WEST_LAST_CAM = 0
          OFF[dvTP,75]
          }
      PUSH[dvTP,75]                        (* WEST *)
         {
          WEST_LAST_CAM = 1
          ON[dvTP,75]
          SEND_STRING dvROUTER, '5*1!' (* INPUT 1 *)
          WAIT 10 JUDGE_LAST_CAM = 0
          OFF[dvTP,71]
          WAIT 10 LECTERN_LAST_CAM = 0
          OFF[dvTP,73]
          WAIT 10 WITNESS_LAST_CAM = 0
          OFF[dvTP,72]
          WAIT 10 EAST_LAST_CAM = 0
          OFF[dvTP,74]
          }
    }
    (************************** NEXT TO LAST *******************)
    
    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>71)&&(MODE = 3))  (* JUDGE *)
      IF(JUDGE_LAST_CAM)
         {
         WAIT 1 JUDGE_NEXT_TO_LAST = 1
         }
    
    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>72)&&(MODE = 3))  (* LECTERN *)
      IF(LECTERN_LAST_CAM)
         {
         WAIT 1 LECTERN_NEXT_TO_LAST = 1
         }
    
    IF((72<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>73)&&(MODE = 3))  (* WITNESS *)
      IF(WITNESS_LAST_CAM)
         {
         WAIT 1 WITNESS_NEXT_TO_LAST = 1
         }
    IF((72<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>74)&&(MODE = 3))  (* EAST *)
      IF(EAST_LAST_CAM)
         {
         WAIT 1 EAST_NEXT_TO_LAST = 1
         }
    IF((72<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>75)&&(MODE = 3))  (* WEST *)
      IF(WEST_LAST_CAM)
         {
         WAIT 1 WEST_NEXT_TO_LAST = 1
         }
    
    (******************** THIRD TO LAST *********************)
    
    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(MODE = 3))
      {
      SELECT
       {
       ACTIVE(JUDGE_NEXT_TO_LAST):
         {
         JUDGE_THIRD_TO_LAST = 1
         JUDGE_NEXT_TO_LAST = 0
         WAIT 10 JUDGE_THIRD_TO_LAST = 0
         }
       ACTIVE(LECTERN_NEXT_TO_LAST):
         {
         LECTERN_THIRD_TO_LAST = 1
         LECTERN_NEXT_TO_LAST = 0
         WAIT 10 LECTERN_THIRD_TO_LAST = 0
         }
       ACTIVE(WITNESS_NEXT_TO_LAST):
          {
         WITNESS_THIRD_TO_LAST = 1
         WITNESS_NEXT_TO_LAST = 0
         WAIT 10 WITNESS_THIRD_TO_LAST = 0
          }
       ACTIVE(EAST_NEXT_TO_LAST):
          {
         EAST_THIRD_TO_LAST = 1
         EAST_NEXT_TO_LAST = 0
         WAIT 10 EAST_THIRD_TO_LAST = 0
          }
       ACTIVE(WEST_NEXT_TO_LAST):
          {
         WEST_THIRD_TO_LAST = 1
         WEST_NEXT_TO_LAST = 0
         WAIT 10 WEST_THIRD_TO_LAST = 0
          }
    		}
    	}
    
    
    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(MODE = 3))
    {
      WAIT 5 SELECT
    	{
       ACTIVE(JUDGE_NEXT_TO_LAST):
    		{
    		WAIT 2 SEND_STRING dvROUTER, '1*2!' (* INPUT 1 *)
    		ON[dvTP,71]
    		}
       ACTIVE(LECTERN_NEXT_TO_LAST):
    		{
    		WAIT 2 SEND_STRING dvROUTER, '2*2!' (* INPUT 1 *)
    		ON[dvTP,72]
    		}
       ACTIVE(WITNESS_NEXT_TO_LAST):
    		{
    		WAIT 2 SEND_STRING dvROUTER, '3*2!' (* INPUT 1 *)
    		ON[dvTP,73]
    		}
       ACTIVE(EAST_NEXT_TO_LAST):
    		{
    		WAIT 2 SEND_STRING dvROUTER, '4*2!' (* INPUT 1 *)
    		ON[dvTP,74]
    		}
       ACTIVE(WEST_NEXT_TO_LAST):
    		{
    		WAIT 2 SEND_STRING dvROUTER, '5*2!' (* INPUT 1 *)
    		ON[dvTP,75]
    		}
    	}
    }
    
    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(MODE = 3))
    {
      WAIT 5 SELECT
    	{
       ACTIVE(JUDGE_THIRD_TO_LAST):
    		{
    		WAIT 1 SEND_STRING dvROUTER, '1*3!'
    		ON[dvTP,71]
    		}
       ACTIVE(LECTERN_THIRD_TO_LAST):
    		{
    		WAIT 1 SEND_STRING dvROUTER, '2*3!'
    		ON[dvTP,72]
    		}
       ACTIVE(WITNESS_THIRD_TO_LAST):
    		{
    		WAIT 1 SEND_STRING dvROUTER, '3*3!'
    		ON[dvTP,73]
    		}
       ACTIVE(EAST_THIRD_TO_LAST):
    		{
    		WAIT 1 SEND_STRING dvROUTER, '4*3!'
    		ON[dvTP,74]
    		}
       ACTIVE(WEST_THIRD_TO_LAST):
    		{
    		WAIT 1 SEND_STRING dvROUTER, '5*3!'
    		ON[dvTP,75]
    		}
    	}
    }
    (******************** QUAD MODES ***********************)
    IF(JUDGE_MODE = 2)   (* JUDGE IS NOT HERE *)
      {
       PUSH[dvTP,84]
    		{
         ON[dvTP,84]
         MODE = QUAD
         SEND_STRING dvMVP, '51.'     (* MVP PRESET *)
          ON[dvTP,72]
          ON[dvTP,73]
          ON[dvTP,74]
          ON[dvTP,75]
          SEND_STRING dvROUTER, '4*1!'
          WAIT 1 SEND_STRING dvROUTER, '5*2!'
          WAIT 2 SEND_STRING dvROUTER, '2*3!'
          WAIT 3 SEND_STRING dvROUTER, '3*4!'
    		}
    	}
    
    IF(JUDGE_MODE = 1)   (* JUDGE IS HERE *)
      {
    		PUSH[dvTP,84]
    		{
         ON[dvTP,84]
         MODE = QUAD
         SEND_STRING dvMVP, '1.'     (* MVP PRESET *)
          ON[dvTP,71]
          ON[dvTP,72]
          OFF[dvTP,73]
          ON[dvTP,74]
          ON[dvTP,75]
          SEND_STRING dvROUTER, '1*1!'
          WAIT 1 SEND_STRING dvROUTER, '2*2!'
          WAIT 2 SEND_STRING dvROUTER, '5*3!'
          WAIT 3 SEND_STRING dvROUTER, '4*4!'
    		}
    		
    		PUSH[dvTP,73]                   (* WITNESS ODD CAMERA OUT *)
    		{
    			ON[dvTP,73]
    			OFF[dvTP,74]
    			SEND_STRING dvROUTER, '3*4!'
    		}
    		
    		PUSH[dvTP,74]                   (* ODD CAMERA OUT *)
    		{
    			ON[dvTP,74]
    			OFF[dvTP,73]
    			SEND_STRING dvROUTER, '4*4!'
    		}
    	}
    
  • this section:
    (*************************** SINGLE MODE *********************)
    
    BUTTON_EVENT[dvTP,81]
    {
    	PUSH:
    	{
    		IF(JUDGE_MODE = 2)   (* JUDGE IS NOT HERE *)
    		{
    		MODE = SINGLE
    		ON[dvCAM_2,11]
    		WAIT 10 PULSE[dvCAM_1,10]
    		ON[dvTP,81]
    		SEND_STRING dvMVP, '52.'    (* MVP PRESET *)
    		SEND_STRING dvROUTER,'2*1&#37;'           (* LECTERN CAM BY DEFAULT *)
    		ON[dvTP,72]
    		OFF[dvTP,71]
    		OFF[dvTP,73]
    		OFF[dvTP,74]
    		OFF[dvTP,75]
    		}
    		ELSE IF(JUDGE_MODE = 1)   (* JUDGE IS HERE *)
    		{
    		MODE = SINGLE
    		ON[dvCAM_1,10]
    		WAIT 10 PULSE[dvCAM_1,10]
    		ON[dvTP,81]
    		SEND_STRING dvMVP, '52.'    (* MVP PRESET *)
    		SEND_STRING dvROUTER,'1*1%'           (* JUDGECAM BY DEFAULT *)
    		ON[dvTP,71]
    		OFF[dvTP,73]
    		OFF[dvTP,72]
    		OFF[dvTP,74]
    		OFF[dvTP,75]
    		}
    	}
    		IF(MODE = SINGLE)
    	{
    		IF(71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)
    		{
    		ON[dvTP,PUSH_CHANNEL]
    		CAMERA = (PUSH_CHANNEL - 70)
    		ON[dvCAM_1,CAMERA]
    		WAIT 10 PULSE[dvCAM_1,10]
    		}
    		BUTTON_EVENT[dvTP,71]
    		{
    			PUSH:
    			{
    			SEND_STRING dvROUTER,'1*1%'
    			OFF[dvTP,72]
    			OFF[dvTP,73]
    			OFF[dvTP,74]
    			OFF[dvTP,75]
    			}
    		}
    		BUTTON_EVENT[dvTP,72]
    		{
    			PUSH:
    			{
    			SEND_STRING dvROUTER,'2*1%'
    			OFF[dvTP,71]
    			OFF[dvTP,73]
    			OFF[dvTP,74]
    			OFF[dvTP,75]
    			}
    		}
    		BUTTON_EVENT[dvTP,73]
    		{
    			PUSH:
    			{
    			SEND_STRING dvROUTER,'3*1%'
    			OFF[dvTP,71]
    			OFF[dvTP,72]
    			OFF[dvTP,74]
    			OFF[dvTP,75]
    			}
    		}
    		BUTTON_EVENT[dvTP,74]
    		{
    			PUSH:
    			{
    			SEND_STRING dvROUTER,'4*1%'
    			OFF[dvTP,71]
    			OFF[dvTP,72]
    			OFF[dvTP,73]
    			OFF[dvTP,75]
    			}
    		}
    		BUTTON_EVENT[dvTP,75]
    		{
    			PUSH:
    			{
    			SEND_STRING dvROUTER, '5*1%'
    			OFF[dvTP,71]
    			OFF[dvTP,72]
    			OFF[dvTP,73]
    			OFF[dvTP,74]
    			}
    		}
    	}
    }
    

    gives me an error here:
    IF(MODE = SINGLE)
    
  • jweatherjweather Posts: 320
    If the line you get an error on looks okay, start looking at the lines above it.

    In this case, you need to match up your curly braces { }.

    Still need a hint? The line above IF (MODE = SINGLE) is closing the PUSH: { event. Remove that extra close bracket.

    This isn't something that's different from Axcess to NetLinx, by the way. In fact, it looks more like a copy-and-paste error. You can't have BUTTON_EVENTs inside another BUTTON_EVENT, for one thing.
  • edgelitocedgelitoc Posts: 160
    playskool1 wrote: »
    this section:
    (*************************** SINGLE MODE *********************)
    
    BUTTON_EVENT[dvTP,81]
    {
    	PUSH:
    	{
    		IF(JUDGE_MODE = 2)   (* JUDGE IS NOT HERE *)
    		{
    		MODE = SINGLE
    		ON[dvCAM_2,11]
    		WAIT 10 PULSE[dvCAM_1,10]
    		ON[dvTP,81]
    		SEND_STRING dvMVP, '52.'    (* MVP PRESET *)
    		SEND_STRING dvROUTER,'2*1%'           (* LECTERN CAM BY DEFAULT *)
    		ON[dvTP,72]
    		OFF[dvTP,71]
    		OFF[dvTP,73]
    		OFF[dvTP,74]
    		OFF[dvTP,75]
    		}
    		ELSE IF(JUDGE_MODE = 1)   (* JUDGE IS HERE *)
    		{
    		MODE = SINGLE
    		ON[dvCAM_1,10]
    		WAIT 10 PULSE[dvCAM_1,10]
    		ON[dvTP,81]
    		SEND_STRING dvMVP, '52.'    (* MVP PRESET *)
    		SEND_STRING dvROUTER,'1*1%'           (* JUDGECAM BY DEFAULT *)
    		ON[dvTP,71]
    		OFF[dvTP,73]
    		OFF[dvTP,72]
    		OFF[dvTP,74]
    		OFF[dvTP,75]
    		}
    	}
    		IF(MODE = SINGLE)
    	{
    		IF(71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)
    		{
    		ON[dvTP,PUSH_CHANNEL]
    		CAMERA = (PUSH_CHANNEL - 70)
    		ON[dvCAM_1,CAMERA]
    		WAIT 10 PULSE[dvCAM_1,10]
    		}
    		BUTTON_EVENT[dvTP,71]
    		{
    			PUSH:
    			{
    			SEND_STRING dvROUTER,'1*1%'
    			OFF[dvTP,72]
    			OFF[dvTP,73]
    			OFF[dvTP,74]
    			OFF[dvTP,75]
    			}
    		}
    		BUTTON_EVENT[dvTP,72]
    		{
    			PUSH:
    			{
    			SEND_STRING dvROUTER,'2*1%'
    			OFF[dvTP,71]
    			OFF[dvTP,73]
    			OFF[dvTP,74]
    			OFF[dvTP,75]
    			}
    		}
    		BUTTON_EVENT[dvTP,73]
    		{
    			PUSH:
    			{
    			SEND_STRING dvROUTER,'3*1%'
    			OFF[dvTP,71]
    			OFF[dvTP,72]
    			OFF[dvTP,74]
    			OFF[dvTP,75]
    			}
    		}
    		BUTTON_EVENT[dvTP,74]
    		{
    			PUSH:
    			{
    			SEND_STRING dvROUTER,'4*1%'
    			OFF[dvTP,71]
    			OFF[dvTP,72]
    			OFF[dvTP,73]
    			OFF[dvTP,75]
    			}
    		}
    		BUTTON_EVENT[dvTP,75]
    		{
    			PUSH:
    			{
    			SEND_STRING dvROUTER, '5*1%'
    			OFF[dvTP,71]
    			OFF[dvTP,72]
    			OFF[dvTP,73]
    			OFF[dvTP,74]
    			}
    		}
    	}
    }
    

    gives me an error here:
    IF(MODE = SINGLE)
    

    you do select active statement or switch case statement on button events that were inside
  • edgelitocedgelitoc Posts: 160
    here is your code I compiled with 0 errors

    BUTTON_EVENT [dvTP,21]
    {
    PUSH: (* JUDGE IS HERE! *)
    {
    JUDGE_MODE = 1
    MODE = 1
    SEND_COMMAND dvTP,'PAGE-JUDGE IS HERE'
    //CALL 'JUDGE IS HERE'
    //ON[dvCAM_RELAY,1]
    WAIT 10 PULSE[dvCAM_1,10]
    SEND_STRING dvMVP, "'52.'" (* AV SWITCH *)
    ON[dvTP,71]
    ON[dvTP,81]
    OFF[dvTP,72]
    OFF[dvTP,73]
    OFF[dvTP,74]
    OFF[dvTP,75]
    }
    }

    BUTTON_EVENT [dvTP,22]
    {
    PUSH: (* JUDGE IS NOT HERE! *)
    {
    JUDGE_MODE = 2
    MODE = 1
    SEND_COMMAND dvTP,'PAGE-JUDGE IS NOT HERE'
    //CALL 'JUDGE IS NOT HERE'
    //ON[dvCAM_RELAY,2]
    WAIT 10 PULSE[dvCAM_1,10]
    SEND_STRING dvMVP, "'52.'" (* AV SWITCH *)
    ON[dvTP,72]
    ON[dvTP,81]
    OFF[dvTP,71]
    OFF[dvTP,73]
    OFF[dvTP,74]
    OFF[dvTP,75]



    IF (MODE = 1) (*** CAMERA CONTROL ***)
    {
    SELECT
    {
    ACTIVE (BUTTON.INPUT.CHANNEL = 61):
    {
    TO[dvTP,61]
    TO[dvCAM_1,CAM_UP]
    }
    ACTIVE (BUTTON.INPUT.CHANNEL = 62):
    {
    TO[dvTP,62]
    TO[dvCAM_1,CAM_DN]
    }
    ACTIVE (BUTTON.INPUT.CHANNEL = 63):
    {
    TO[dvTP,63]
    TO[dvCAM_1,CAM_RT]
    }
    ACTIVE (BUTTON.INPUT.CHANNEL = 64):
    {
    TO[dvTP,64]
    TO[dvCAM_1,CAM_LT]
    }
    ACTIVE (BUTTON.INPUT.CHANNEL = 64):
    {
    TO[dvTP,65]
    TO[dvCAM_1,CAM_ZOOM_IN]
    }
    ACTIVE (BUTTON.INPUT.CHANNEL = 64):
    {
    TO[dvTP,66]
    TO[dvCAM_1,CAM_ZOOM_OUT]
    }
    }
    SELECT
    {
    ACTIVE(MODE>1):
    {
    SELECT
    {
    ACTIVE(61<=PUSH_CHANNEL&&PUSH_CHANNEL<=66):
    {
    SEND_COMMAND dvTP,'@PPN-SET CAM'
    }
    }
    }
    }
    }
    }
    }

    BUTTON_EVENT [dvTP,81]
    {
    PUSH:
    {
    IF(JUDGE_MODE = 2) (* JUDGE IS NOT HERE *)
    {
    MODE = SINGLE
    ON[dvCAM_2,11]
    WAIT 10 PULSE[dvCAM_1,10]
    ON[dvTP,81]
    SEND_STRING dvMVP, '52.' (* MVP PRESET *)
    SEND_STRING dvROUTER,'2*1%' (* LECTERN CAM BY DEFAULT *)
    ON[dvTP,72]
    OFF[dvTP,71]
    OFF[dvTP,73]
    OFF[dvTP,74]
    OFF[dvTP,75]
    }
    ELSE IF(JUDGE_MODE = 1) (* JUDGE IS HERE *)
    {
    MODE = SINGLE
    ON[dvCAM_1,10]
    WAIT 10 PULSE[dvCAM_1,10]
    ON[dvTP,81]
    SEND_STRING dvMVP, '52.' (* MVP PRESET *)
    SEND_STRING dvROUTER,'1*1%' (* JUDGECAM BY DEFAULT *)
    ON[dvTP,71]
    OFF[dvTP,73]
    OFF[dvTP,72]
    OFF[dvTP,74]
    OFF[dvTP,75]
    }
    IF(MODE = SINGLE)
    {
    IF(71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)
    {
    ON[dvTP,PUSH_CHANNEL]
    CAMERA = (PUSH_CHANNEL - 70)
    ON[dvCAM_1,CAMERA]
    WAIT 10 PULSE[dvCAM_1,10]
    }
    }
    }
    }

    BUTTON_EVENT [dvTP,71]
    {
    PUSH:
    {
    SEND_STRING dvROUTER,'1*1%'
    OFF[dvTP,72]
    OFF[dvTP,73]
    OFF[dvTP,74]
    OFF[dvTP,75]
    }
    }
    BUTTON_EVENT [dvTP,72]
    {
    PUSH:
    {
    SEND_STRING dvROUTER,'2*1%'
    OFF[dvTP,71]
    OFF[dvTP,73]
    OFF[dvTP,74]
    OFF[dvTP,75]
    }
    }

    BUTTON_EVENT [dvTP,73]
    {
    PUSH:
    {
    SEND_STRING dvROUTER,'3*1%'
    OFF[dvTP,71]
    OFF[dvTP,72]
    OFF[dvTP,74]
    OFF[dvTP,75]
    }
    }

    BUTTON_EVENT [dvTP,74]
    {
    PUSH:
    {
    SEND_STRING dvROUTER,'4*1%'
    OFF[dvTP,71]
    OFF[dvTP,72]
    OFF[dvTP,73]
    OFF[dvTP,75]
    }
    }
    BUTTON_EVENT [dvTP,75]
    {
    PUSH:
    {
    SEND_STRING dvROUTER, '5*1%'
    OFF[dvTP,71]
    OFF[dvTP,72]
    OFF[dvTP,73]
    OFF[dvTP,74]
    }
    }

    (************************ DUAL MODE ***********************)

    BUTTON_EVENT [dvTP,82]
    {
    PUSH:
    {
    IF(JUDGE_MODE = 2) (* JUDGE NOT HERE *)
    {
    ON[dvTP,82]
    MODE = DUAL
    (* SEND_STRING MVP, '3.' (* MVP PRESET *)*)
    SEND_STRING dvMVP, '62.' (* MVP PRESET *)
    SEND_STRING dvROUTER, '2*1!' (* INPUT 1 *)
    WAIT 1 SEND_STRING dvROUTER, '5*2!' (* INPUT 1 *)
    OFF[dvTP,71]
    ON[dvTP,72]
    OFF[dvTP,73]
    OFF[dvTP,74]
    ON[dvTP,75]
    }
    ELSE IF(JUDGE_MODE = 1) (* JUDGE HERE *)
    {
    ON[dvTP,82]
    MODE = DUAL
    SEND_STRING dvMVP, '62.' (* MVP PRESET *)
    SEND_STRING dvROUTER, '1*1!' (* INPUT 1 *)
    WAIT 1 SEND_STRING dvROUTER, '2*2!' (* INPUT 1 *)
    ON[dvTP,71]
    ON[dvTP,72]
    OFF[dvTP,73]
    OFF[dvTP,74]
    OFF[dvTP,75]
    }
    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75) AND (MODE = DUAL))
    SEND_STRING dvMVP, '62.' (* MVP PRESET *)

    }
    }
    BUTTON_EVENT [dvTP,71]
    {
    PUSH:
    {
    IF(MODE = DUAL) (* JUDGE CAM *)
    {
    JUDGE_LAST_CAM = 1
    SEND_STRING dvROUTER, '1*1!' (* INPUT 1 *)
    SEND_STRING 0, '1*1!' (* INPUT 1 *)
    WAIT 5 LECTERN_LAST_CAM = 0
    WAIT 5 WITNESS_LAST_CAM = 0
    WAIT 5 EAST_LAST_CAM = 0
    WAIT 5 WEST_LAST_CAM = 0
    ON[dvTP,71]
    OFF[dvTP,72]
    OFF[dvTP,73]
    OFF[dvTP,74]
    OFF[dvTP,75]
    }
    }
    }

    BUTTON_EVENT [dvTP,72]
    {
    PUSH: (* LECTERN CAM *)
    {
    LECTERN_LAST_CAM = 1
    SEND_STRING dvROUTER, '2*1!' (* INPUT 1 *)
    SEND_STRING 0, '2*1!' (* INPUT 1 *)
    WAIT 5 JUDGE_LAST_CAM = 0
    WAIT 5 WITNESS_LAST_CAM = 0
    WAIT 5 EAST_LAST_CAM = 0
    WAIT 5 WEST_LAST_CAM = 0
    ON[dvTP,72]
    OFF[dvTP,71]
    OFF[dvTP,73]
    OFF[dvTP,74]
    OFF[dvTP,75]
    }
    }

    BUTTON_EVENT [dvTP,73]
    {
    PUSH: (* WITNESS CAM *)
    {
    WITNESS_LAST_CAM = 1
    SEND_STRING dvROUTER, '3*1!' (* INPUT 1 *)
    WAIT 5 JUDGE_LAST_CAM = 0
    WAIT 5 LECTERN_LAST_CAM = 0
    WAIT 5 EAST_LAST_CAM = 0
    WAIT 5 WEST_LAST_CAM = 0
    ON[dvTP,73]
    OFF[dvTP,71]
    OFF[dvTP,72]
    OFF[dvTP,74]
    OFF[dvTP,75]
    }
    }

    BUTTON_EVENT [dvTP,74]
    {
    PUSH: (* EAST ATT *)
    {
    EAST_LAST_CAM = 1
    SEND_STRING dvROUTER, '4*1!' (* INPUT 1 *)
    WAIT 5 JUDGE_LAST_CAM = 0
    WAIT 5 LECTERN_LAST_CAM = 0
    WAIT 5 WITNESS_LAST_CAM = 0
    WAIT 5 WEST_LAST_CAM = 0
    ON[dvTP,74]
    OFF[dvTP,71]
    OFF[dvTP,73]
    OFF[dvTP,72]
    OFF[dvTP,75]
    }
    }

    BUTTON_EVENT [dvTP,75]
    {
    PUSH : (* WEST *)
    {
    WEST_LAST_CAM = 1
    SEND_STRING dvROUTER, '5*1!' (* INPUT 1 *)
    WAIT 5 JUDGE_LAST_CAM = 0
    WAIT 5 LECTERN_LAST_CAM = 0
    WAIT 5 WITNESS_LAST_CAM = 0
    WAIT 5 EAST_LAST_CAM = 0
    ON[dvTP,75]
    OFF[dvTP,71]
    OFF[dvTP,73]
    OFF[dvTP,74]
    OFF[dvTP,72]

    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>71)) (* JUDGE *)
    {
    IF(JUDGE_LAST_CAM)
    {
    JUDGE_NEXT_TO_LAST = 1
    WAIT 10 JUDGE_NEXT_TO_LAST = 0
    WAIT 10 JUDGE_LAST_CAM = 0
    }
    }
    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>72)) (* LECTERN *)
    {
    IF(LECTERN_LAST_CAM)
    {
    LECTERN_NEXT_TO_LAST = 1
    WAIT 10 LECTERN_NEXT_TO_LAST = 0
    WAIT 10 LECTERN_LAST_CAM = 0
    }
    }
    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>73)) (* WITNESS *)
    {
    IF(WITNESS_LAST_CAM)
    {
    WITNESS_NEXT_TO_LAST = 1
    WAIT 10 WITNESS_NEXT_TO_LAST = 0
    WAIT 10 WITNESS_LAST_CAM = 0
    }
    }
    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>74)) (* EAST *)
    {
    IF(EAST_LAST_CAM)
    {
    EAST_NEXT_TO_LAST = 1
    WAIT 10 EAST_NEXT_TO_LAST = 0
    WAIT 10 EAST_LAST_CAM = 0
    }
    }
    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>75)) (* WEST *)
    {
    IF(WEST_LAST_CAM)
    {
    WEST_NEXT_TO_LAST = 1
    WAIT 10 WEST_NEXT_TO_LAST = 0
    WAIT 10 WEST_LAST_CAM = 0
    }
    }
    IF(71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)
    WAIT 1 SELECT
    {
    ACTIVE(JUDGE_NEXT_TO_LAST):
    {
    SEND_STRING dvROUTER, '1*2!' (* INPUT 1 *)
    SEND_STRING 0, '1*2!' (* INPUT 1 *)
    ON[dvTP,71]
    }
    ACTIVE(LECTERN_NEXT_TO_LAST):
    {
    SEND_STRING dvROUTER, '2*2!' (* INPUT 1 *)
    SEND_STRING 0, '2*2!' (* INPUT 1 *)
    ON[dvTP,72]
    }
    ACTIVE(WITNESS_NEXT_TO_LAST):
    {
    SEND_STRING dvROUTER, '3*2!' (* INPUT 1 *)
    ON[dvTP,73]
    }
    ACTIVE(EAST_NEXT_TO_LAST):
    {
    SEND_STRING dvROUTER, '4*2!' (* INPUT 1 *)
    ON[dvTP,74]
    }
    ACTIVE(WEST_NEXT_TO_LAST):
    {
    SEND_STRING dvROUTER, '5*2!' (* INPUT 1 *)
    ON[dvTP,75]
    }
    }
    }
    }


    (************************ TRIPLE MODE ***********************)
    BUTTON_EVENT [dvTP,83]
    {
    PUSH:
    {
    IF(JUDGE_MODE = 2) (* JUDGE NOT HERE *)
    {
    ON[dvTP,83]
    MODE = TRIPLE
    SEND_STRING dvMVP, '59.' (* MVP PRESET *)
    SEND_STRING dvROUTER, '4*1!' (* INPUT 1 *)
    WAIT 1 SEND_STRING dvROUTER, '5*2!' (* INPUT 1 *)
    WAIT 2 SEND_STRING dvROUTER, '2*3!' (* INPUT 1 *)
    OFF[dvTP,71]
    ON[dvTP,72]
    OFF[dvTP,73]
    ON[dvTP,74]
    ON[dvTP,75]
    }
    ELSE IF(JUDGE_MODE = 1) (* JUDGE HERE *)
    {
    ON[dvTP,83]
    MODE = TRIPLE
    SEND_STRING dvMVP, '59.' (* MVP PRESET *)
    SEND_STRING dvROUTER, '1*3!' (* INPUT 1 *)
    WAIT 1 SEND_STRING dvROUTER, '2*1!' (* INPUT 1 *)
    WAIT 2 SEND_STRING dvROUTER, '5*2!' (* INPUT 1 *)
    ON[dvTP,71]
    ON[dvTP,72]
    OFF[dvTP,73]
    OFF[dvTP,74]
    ON[dvTP,75]
    }
    }
    }

    BUTTON_EVENT [dvTP,71]
    {
    (**************** LAST CAM ***************)
    PUSH:
    {
    IF(MODE = TRIPLE) (* JUDGE CAM *)
    {
    JUDGE_LAST_CAM = 1
    ON[dvTP,71]
    SEND_STRING dvROUTER, '1*1!' (* INPUT 1 *)
    WAIT 10 LECTERN_LAST_CAM = 0
    OFF[dvTP,72]
    WAIT 10 WITNESS_LAST_CAM = 0
    OFF[dvTP,73]
    WAIT 10 EAST_LAST_CAM = 0
    OFF[dvTP,74]
    WAIT 10 WEST_LAST_CAM = 0
    OFF[dvTP,75]
    }
    }
    }

    BUTTON_EVENT [dvTP,72]
    {
    PUSH: (* LECTERN CAM *)
    {
    LECTERN_LAST_CAM = 1
    ON[dvTP,72]
    SEND_STRING dvROUTER, '2*1!' (* INPUT 1 *)
    WAIT 10 JUDGE_LAST_CAM = 0
    OFF[dvTP,71]
    WAIT 10 WITNESS_LAST_CAM = 0
    OFF[dvTP,73]
    WAIT 10 EAST_LAST_CAM = 0
    OFF[dvTP,74]
    WAIT 10 WEST_LAST_CAM = 0
    OFF[dvTP,75]
    }
    }

    BUTTON_EVENT [dvTP,73]
    {
    PUSH: (* WITNESS CAM *)
    {
    WITNESS_LAST_CAM = 1
    ON[dvTP,73]
    SEND_STRING dvROUTER, '3*1!' (* INPUT 1 *)
    WAIT 10 JUDGE_LAST_CAM = 0
    OFF[dvTP,71]
    WAIT 10 LECTERN_LAST_CAM = 0
    OFF[dvTP,72]
    WAIT 10 EAST_LAST_CAM = 0
    OFF[dvTP,74]
    WAIT 10 WEST_LAST_CAM = 0
    OFF[dvTP,75]
    }
    }

    BUTTON_EVENT [dvTP,74]
    {
    PUSH : (* EAST ATT *)
    {
    EAST_LAST_CAM = 1
    ON[dvTP,74]
    SEND_STRING dvROUTER, '4*1!' (* INPUT 1 *)
    WAIT 10 JUDGE_LAST_CAM = 0
    OFF[dvTP,71]
    WAIT 10 LECTERN_LAST_CAM = 0
    OFF[dvTP,73]
    WAIT 10 WITNESS_LAST_CAM = 0
    OFF[dvTP,72]
    WAIT 10 WEST_LAST_CAM = 0
    OFF[dvTP,75]
    }
    }

    BUTTON_EVENT [dvTP,75]
    {
    PUSH: (* WEST *)
    {
    WEST_LAST_CAM = 1
    ON[dvTP,75]
    SEND_STRING dvROUTER, '5*1!' (* INPUT 1 *)
    WAIT 10 JUDGE_LAST_CAM = 0
    OFF[dvTP,71]
    WAIT 10 LECTERN_LAST_CAM = 0
    OFF[dvTP,73]
    WAIT 10 WITNESS_LAST_CAM = 0
    OFF[dvTP,72]
    WAIT 10 EAST_LAST_CAM = 0
    OFF[dvTP,74]

    (************************** NEXT TO LAST *******************)

    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>71)&&(MODE = 3)) (* JUDGE *)
    IF(JUDGE_LAST_CAM)
    {
    WAIT 1 JUDGE_NEXT_TO_LAST = 1
    }

    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>72)&&(MODE = 3)) (* LECTERN *)
    IF(LECTERN_LAST_CAM)
    {
    WAIT 1 LECTERN_NEXT_TO_LAST = 1
    }

    IF((72<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>73)&&(MODE = 3)) (* WITNESS *)
    IF(WITNESS_LAST_CAM)
    {
    WAIT 1 WITNESS_NEXT_TO_LAST = 1
    }
    IF((72<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>74)&&(MODE = 3)) (* EAST *)
    IF(EAST_LAST_CAM)
    {
    WAIT 1 EAST_NEXT_TO_LAST = 1
    }
    IF((72<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(PUSH_CHANNEL<>75)&&(MODE = 3)) (* WEST *)
    IF(WEST_LAST_CAM)
    {
    WAIT 1 WEST_NEXT_TO_LAST = 1
    }

    (******************** THIRD TO LAST *********************)

    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(MODE = 3))
    {
    SELECT
    {
    ACTIVE(JUDGE_NEXT_TO_LAST):
    {
    JUDGE_THIRD_TO_LAST = 1
    JUDGE_NEXT_TO_LAST = 0
    WAIT 10 JUDGE_THIRD_TO_LAST = 0
    }
    ACTIVE(LECTERN_NEXT_TO_LAST):
    {
    LECTERN_THIRD_TO_LAST = 1
    LECTERN_NEXT_TO_LAST = 0
    WAIT 10 LECTERN_THIRD_TO_LAST = 0
    }
    ACTIVE(WITNESS_NEXT_TO_LAST):
    {
    WITNESS_THIRD_TO_LAST = 1
    WITNESS_NEXT_TO_LAST = 0
    WAIT 10 WITNESS_THIRD_TO_LAST = 0
    }
    ACTIVE(EAST_NEXT_TO_LAST):
    {
    EAST_THIRD_TO_LAST = 1
    EAST_NEXT_TO_LAST = 0
    WAIT 10 EAST_THIRD_TO_LAST = 0
    }
    ACTIVE(WEST_NEXT_TO_LAST):
    {
    WEST_THIRD_TO_LAST = 1
    WEST_NEXT_TO_LAST = 0
    WAIT 10 WEST_THIRD_TO_LAST = 0
    }
    }
    }


    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(MODE = 3))
    {
    WAIT 5 SELECT
    {
    ACTIVE(JUDGE_NEXT_TO_LAST):
    {
    WAIT 2 SEND_STRING dvROUTER, '1*2!' (* INPUT 1 *)
    ON[dvTP,71]
    }
    ACTIVE(LECTERN_NEXT_TO_LAST):
    {
    WAIT 2 SEND_STRING dvROUTER, '2*2!' (* INPUT 1 *)
    ON[dvTP,72]
    }
    ACTIVE(WITNESS_NEXT_TO_LAST):
    {
    WAIT 2 SEND_STRING dvROUTER, '3*2!' (* INPUT 1 *)
    ON[dvTP,73]
    }
    ACTIVE(EAST_NEXT_TO_LAST):
    {
    WAIT 2 SEND_STRING dvROUTER, '4*2!' (* INPUT 1 *)
    ON[dvTP,74]
    }
    ACTIVE(WEST_NEXT_TO_LAST):
    {
    WAIT 2 SEND_STRING dvROUTER, '5*2!' (* INPUT 1 *)
    ON[dvTP,75]
    }
    }
    }

    IF((71<=PUSH_CHANNEL&&PUSH_CHANNEL<=75)&&(MODE = 3))
    {
    WAIT 5 SELECT
    {
    ACTIVE(JUDGE_THIRD_TO_LAST):
    {
    WAIT 1 SEND_STRING dvROUTER, '1*3!'
    ON[dvTP,71]
    }
    ACTIVE(LECTERN_THIRD_TO_LAST):
    {
    WAIT 1 SEND_STRING dvROUTER, '2*3!'
    ON[dvTP,72]
    }
    ACTIVE(WITNESS_THIRD_TO_LAST):
    {
    WAIT 1 SEND_STRING dvROUTER, '3*3!'
    ON[dvTP,73]
    }
    ACTIVE(EAST_THIRD_TO_LAST):
    {
    WAIT 1 SEND_STRING dvROUTER, '4*3!'
    ON[dvTP,74]
    }
    ACTIVE(WEST_THIRD_TO_LAST):
    {
    WAIT 1 SEND_STRING dvROUTER, '5*3!'
    ON[dvTP,75]
    }
    }
    }
    }
    }
    (******************** QUAD MODES ***********************)

    BUTTON_EVENT [dvTP,84]
    {
    PUSH:
    {
    IF(JUDGE_MODE = 2) (* JUDGE IS NOT HERE *)
    {
    ON[dvTP,84]
    MODE = QUAD
    SEND_STRING dvMVP, '51.' (* MVP PRESET *)
    ON[dvTP,72]
    ON[dvTP,73]
    ON[dvTP,74]
    ON[dvTP,75]
    SEND_STRING dvROUTER, '4*1!'
    WAIT 1 SEND_STRING dvROUTER, '5*2!'
    WAIT 2 SEND_STRING dvROUTER, '2*3!'
    WAIT 3 SEND_STRING dvROUTER, '3*4!'
    }
    }
    }


    BUTTON_EVENT [dvTP,84]
    {
    PUSH :
    {
    IF(JUDGE_MODE = 1) (* JUDGE IS HERE *)
    {
    ON[dvTP,84]
    MODE = QUAD
    SEND_STRING dvMVP, '1.' (* MVP PRESET *)
    ON[dvTP,71]
    ON[dvTP,72]
    OFF[dvTP,73]
    ON[dvTP,74]
    ON[dvTP,75]
    SEND_STRING dvROUTER, '1*1!'
    WAIT 1 SEND_STRING dvROUTER, '2*2!'
    WAIT 2 SEND_STRING dvROUTER, '5*3!'
    WAIT 3 SEND_STRING dvROUTER, '4*4!'
    }
    }
    }

    BUTTON_EVENT [dvTP,73]
    {
    PUSH: (* WITNESS ODD CAMERA OUT *)
    {
    ON[dvTP,73]
    OFF[dvTP,74]
    SEND_STRING dvROUTER, '3*4!'
    }
    }

    BUTTON_EVENT [dvTP,74]
    {
    PUSH: (* ODD CAMERA OUT *)
    {
    ON[dvTP,74]
    OFF[dvTP,73]
    SEND_STRING dvROUTER, '4*4!'
    }
    }

    BUTTON_EVENT [dvTP,233]
    {
    PUSH:
    {
    PULSE[dvPOLYCOM,WAKEUP3] (* TURN PIP ON *)
    WAIT 300 PULSE[dvPOLYCOM,WAKEUP] (* TURN PIP OFF *)
    }
    }

    (***********************************************************)
    (* THE ACTUAL PROGRAM GOES BELOW *)
    (***********************************************************)
    DEFINE_PROGRAM
    (****************** POLYCOM REMOTE EMULATION ***********************)

    SET_PULSE_TIME(3)

    IF((130 <= PUSH_CHANNEL AND PUSH_CHANNEL <= 139))
    PULSE[dvTP,PUSH_CHANNEL]

    IF((146 <= PUSH_CHANNEL AND PUSH_CHANNEL <= 159))
    PULSE[dvTP,PUSH_CHANNEL]

    PUSH[dvTP,130] (* CALL/ HANGUP *)
    {
    TO[dvPOLYCOM,43]
    }
    PUSH[dvTP,131] (* AUTO *)
    TO[dvPOLYCOM,44]
    PUSH[dvTP,132] (* NEAR *)
    TO[dvPOLYCOM,45]
    PUSH[dvTP,133] (* FAR *)
    TO[dvPOLYCOM,46]
    PUSH[dvTP,134] (* SLIDES *)
    TO[dvPOLYCOM,47]
    PUSH[dvTP,135] (* CURSOR UP *)
    TO[dvPOLYCOM,48]
    PUSH[dvTP,137] (* CURSOR DN *)
    TO[dvPOLYCOM,49]
    PUSH[dvTP,139] (* CURSOR RIGHT *)
    TO[dvPOLYCOM,50]
    PUSH[dvTP,138] (* CURSOR LEFT *)
    TO[dvPOLYCOM,51]
    PUSH[dvTP,136] (* SELECT *)
    TO[dvPOLYCOM,52]
    PUSH[dvTP,155] (* STAR *)
    TO[dvPOLYCOM,56]
    PUSH[dvTP,157] (* # *)
    TO[dvPOLYCOM,57]
    PUSH[dvTP,159] (* INFO *)
    TO[dvPOLYCOM,59]
    PUSH[dvTP,158] (* MENU *)
    TO[dvPOLYCOM,58]



    (***********************************************************)
    (* END OF PROGRAM *)
    (* DO NOT PUT ANY CODE BELOW THIS COMMENT *)
    (***********************************************************)
  • travistravis Posts: 180
    Having converted Axcess to Netlinx before my best advice is to take your keyboard and hit yourself in the side of the head with it until you lose consciousness.
  • thanks guys. :thumbsup: i wish i learned axcess but is there even a point if it is no longer being used?
  • We do a lot of support for a university that has a substantial amount of Axcess controllers. Most of the work has just been keeping the hardware as is and convering projector control from IR to RS232. On one occasion, though, they had a very large cardcage full of relays and serial/IR boards. Ont his particular unit, we needed to convert everything to NI controllers. We rebuilt the code from scratch as the initial programmer must've used this for a learning project. almost all button presses not only performed an AV function, but it also change button parameters like font, color, etc. It was ridiculous. Rebuilding the code was much cleaner, but still difficult as they used cascading matrix switchers. In example, an 8x4 composite video switch that had three outputs feeding composite to S-video upconverters. These then fed an 8x4 S-video switch that had 5 s-video sources added to it. Three outputs went from S-vid to RGBHV upconverters...and you guessed it, went to an 8x4 RGBHV switch with 5 other RGBHV sources added to it. This then went to 3 projectors and the fourth output went to a confidence monitor. Nightmare job...especially since we had the one week of spring break to pull everything out, re-install, and recode. I'm still harassing the customer to upgrade the AV gear 2 years later.
    :)
  • ericmedleyericmedley Posts: 4,177
    playskool1 wrote: »
    thanks guys. :thumbsup: i wish i learned axcess but is there even a point if it is no longer being used?

    I have to admit...

    I started programming in Axcess back in the Paleolithic era. However, I'd be pretty hard pressed to recall any of it. It's been so long that even when I see it, it looks like a foriegn language to me. The old saying is still true. "Use it or lose it..."
  • ericmedley wrote: »
    I have to admit...

    I started programming in Axcess back in the Paleolithic era. However, I'd be pretty hard pressed to recall any of it. It's been so long that even when I see it, it looks like a foriegn language to me. The old saying is still true. "Use it or lose it..."

    Glad to hear someone else say that. I started in Axcess too way back in the day and I barely remember it either. I thought it was just my diminished mental capacity these days. I still hope I don't have to service any of our old Viewpoint Touchpanels either.

    --John
  • edgelitocedgelitoc Posts: 160
    Glad to hear someone else say that. I started in Axcess too way back in the day and I barely remember it either. I thought it was just my diminished mental capacity these days. I still hope I don't have to service any of our old Viewpoint Touchpanels either.

    --John

    Is there and equivalent keyword for HOLD on Axcess.. I was wondering how was the old language handle the button when it is hold for about 3s for instance
  • HedbergHedberg Posts: 671
    edgelitoc wrote: »
    Is there and equivalent keyword for HOLD on Axcess.. I was wondering how was the old language handle the button when it is hold for about 3s for instance

    put a named wait under your push and cancel the wait upon release.
  • edgelitocedgelitoc Posts: 160
    Hedberg wrote: »
    put a named wait under your push and cancel the wait upon release.

    Would it be something like this
    Push[tp,23]
    {
    wait 10 'volume'
    pulse [tv,11]
    }
    release[tp,23]
    {
    cancel wait 'volume'
    }
  • HedbergHedberg Posts: 671
    Yes, that looks right. You can do the same thing using the push and release handlers in a Netlinx button event (though the hold seems cleaner to me). Of course, you can do the same thing in define_program section of a Netlinx program, if you want to.
  • viningvining Posts: 4,368
    Now I know nothing of axcess programming but in this code if you hold the button less than 1 second nothing at all will happen, not even a single pulse, correct? If you hold the button over a second the most that can happen is a single pulse of IR, correct? If you're trying to ramp volume I would use the hold w/ repeat as Hedberg suggested.
         {
         Push[tp,23]
    	  {
    	  wait 10 'volume'
    	       pulse [tv,11]
    	  }
         release[tp,23]
    	  {
    	  cancel wait 'volume'
    	  } 
         }
    
  • Spire_JeffSpire_Jeff Posts: 1,917
    edgelitoc wrote: »
    Would it be something like this
    Push[tp,23]
    {
    wait 10 'volume'
    pulse [tv,11]
    }
    release[tp,23]
    {
    cancel wait 'volume'
    }

    I have not programmed in Axcess myself, but if you are looking for a volume ramp, this might work better:
    Push[tp,23]
    {
     pulse [tv,11]
     bRampVol = 1
    }
    release[tp,23]
    {
     bRampVol = 0
     cancel_wait 'volume'
    }
    
    ...
    
    if(bRampVol){
      wait 10 'volume' {
        pulse [tv,11]
      }
    }
    

    I am basing this on the assumption that the push is only executed once when the button is pushed. This should pulse the volume command immediately and then once every second until the button is released.

    Jeff
  • Converting Axcess to NetLinx Document

    I came across this document on my computer this morning and thought I'd upload it to this forum. It is a fairly old document and may or may not be useful. Still, it may prove useful to someone.
  • rgelling wrote: »
    I came across this document on my computer this morning and thought I'd upload it to this forum. It is a fairly old document and may or may not be useful. Still, it may prove useful to someone.

    kudos for sharing! this can be very useful to a lot of people.
  • playskool1 wrote: »
    i am dealing with code that came from an old Axcent3 Pro controller and now reloading it into an NI-4100 controller. i am still not very good at putting the brackets in the right spots. any tips on what i should do to convert these push_events(in the Define_Program section) to button_events(in the Define_Event) section?

    You probably know that you don't have to change DEFINE PROGRAM PUSH events to DEFINE EVENT Button events. Mainline runs the same way in NetLinx as it did in Axcess. I have clients that opt. to use their old Axcess programs in Netlinx and they work just fine.
Sign In or Register to comment.