'***************************************************************************
'Galil Motion Control Sample DMC Code
'Filename: InputChooseSub.dmc
'***************************************************************************
'Description:
'Jump to different subroutines based on the state of digital inputs 1 and 2
'If both inputs are zero, the subroutines will execute one after the other
'***************************************************************************
#a
JS #b,@IN[1]=0;          'Jump to Sub #B if Digital Input 1 is 0
JS #c,@IN[2]=0;          'Jump to Sub #C if Digital Input 2 is 0
WT 250;                 'Wait 250msec
JP #a;                   'Jump back to label #A
#b
PR 10000;BG A;            'Move Relative 10000cts
AM A;                    'Wait for profiled motion to complete
EN;                     'Return from Subroutine
#c
PR -10000;BG A;           'Move Relative -10000cts
AM A;                    'Wait for profiled motion to complete
EN;                     'Return from Subroutine