Version: 1.0.0

The following program uses the inputs 1-4 to run a motion based on the binary combination of the inputs. For example if IN1 is triggered, motion 1 is run. If IN1 and IN2 are both triggered, motion 3 is run, and so on.

B100.1 			//Clear any existing Program and Logic Banks
L100.1
 
K87=5 			//LOGIC BANK SCAN TIME OF 5ms
K85=1 			//START LOGIC BANK 1 ON POWERUP

//Assign required acceleration values
A1=100 		
A2=100 
A3=100 
A4=100 
A5=100 
A6=100 
A7=100 
A8=100 
A9=100 
A10=100
A11=100 
A12=100 
A13=100 
A14=100 
A15=100 

//ASsign required Speed values
S1=100 
S2=100 
S3=100 
S4=100 
S5=100 
S6=100 
S7=100 
S8=100 
S9=100 
S10=100
S11=100 
S12=100 
S13=100 
S14=100 
S15=100 

//Assign required position values
P1=1000 
P2=2000 
P3=3000 
P4=4000 
P5=5000
P6=6000 
P7=7000
P8=8000
P9=9000 
P10=10000
P11=11000 
P12=12000 
P13=13000
P14=14000 
P15=15000 
 
/*assign N values to be 
used as constants to compare 
to the input combination*/ 
N10=0 
N11=1 
N12=2 
N13=3 
N14=4 
N15=5 
N16=6 
N17=7 
N18=8 
N19=9 
N20=10 
N21=11 
N22=12 
N23=13 
N24=14 
N25=15 

//set default values for variables 
V0=0 
V1=0 
V3=0 
V2=2 
V4=4 
V8=8 

 

L1.1 
V0=I1; 			//CALCULATE DECIMAL VALUE OF BINARY INPUTS
V1=I2*V2; 
V0=V0+V1; 
V1=I3*V4; 
V0=V0+V1; 
V1=I4*V8; 
 
V0=V0+V1; 		
V0!=V3, CL2,T0 	//IF VALUE HAS CHANGED, CALL LOGIC BANK 2
END.1 
 
L2.1 
V3=V0; 			//SAVE NEW VALUE
V0==N10,]:],CL3 //IF VALUE OF INPUTS IS 0, STOP MOTOR, ELSE CALL LOGIC BANK 3
END.1 
 

L3.1 
V0==N11,[1.1,T0 //IF THE DECIMAL VALUE OF BINARY INPUTS EQUALS 1, RUN BANK 1
V0==N12,[2.1,T0 
V0==N13,[3.1,T0 
V0==N14,[4.1,T0 
V0==N15,[5.1,T0 
V0==N16,[6.1,T0 
V0==N17,[7.1,T0 
V0==N18,[8.1,T0 
V0==N19,[9.1,T0 
V0==N20,[10.1,T0 
V0==N21,[11.1,T0 
V0==N22,[12.1,T0 
V0==N23,[13.1,T0 
V0==N24,[14.1,T0 
V0==N25,[15.1,T0  
END.1 
 
B1.1			//Program Bank 1	
A1,S1,P1		//Run to position 1, at speed 1, and acceleration 1
END.1

B2.1
A2,S2,P2
END.1

B3.1
A3,S3,P3
END.1

B4.1
A4,S4,P4
END.1

B5.1
A5,S5,P5
END.1

B6.1
A6,S6,P6
END.1

B7.1
A7,S7,P7
END.1

B8.1
A8,S8,P8
END.1

B9.1
A9,S9,P9
END.1

B10.1
A10,S10,P10
END.1

B11.1
A11,S11,P11
END.1

B12.1
A12,S12,P12
END.1

B13.1
A13,S13,P13
END.1

B14.1
A14,S14,P14
END.1

B15.1
A15,S15,P15
END.1

$.1 		//Save program
  • No labels