Documente Academic
Documente Profesional
Documente Cultură
Combinatorial Logic Events Data Handling Numerical Logic Lists Program Control Input and Output
MOV Source F8:07 Destination F8:23 MOV Source F8:07 Destination N7:23 MOV Source 123 Destination N7:23
Example
A MOV source 130 dest N7:0 MOV source N7:1 dest N7:2 MVM source N7:3 mask N7:4 dest N7:5 MVM source N7:3 mask N7:4 dest N7:6
before
Math Functions
ADD(value,value,destination) - add two values SUB(value,value,destination) - subtract MUL(value,value,destination) - multiply DIV(value,value,destination) - divide NEG(value,destination) - reverse sign from positive/negative CLR(value) - clear the memory location
ADD source A N7:0 source B N7:1 dest. N7:2 ADD source A 1 source B N7:3 dest. N7:3 SUB source A N7:1 source B N7:2 dest. N7:4 MULT source A N7:0 source B N7:1 dest. N7:5 DIV source A N7:1 source B N7:0 dest. N7:6 NEG source A N7:4 dest. N7:7 CLR dest. N7:8 DIV source A F8:1 source B F8:0 dest. F8:2 DIV source A N7:1 source B N7:0 dest. F8:3
OR
A CPT Dest. F8:0 Expression SQR(LN(F8:1)+XPY(2.718,F8:2)*ACS(F8:3))
Conversions
TOD(value,destination) - convert from BCD to binary FRD(value,destination) - convert from binary to BCD DEG(value,destination) - convert from radians to degrees RAD(value,destination) - convert from degrees to radians
Example
FRD Source A D9:1 Dest. N7:0
Addr.
TOD Source A N7:1 Dest. D9:0 DEG Source A F8:0 Dest. F8:2 RAD Source A F8:1 Dest. F8:3
Before 0 548 3.141 45 0 0 0000 0000 0000 0000 0001 0111 1001 0011
Advanced Functions
A AVE File #F8:0 Dest F8:4 Control R6:1 length 4 position 0
AVE(start value,destination,control,length) - average of values STD(start value,destination,control,length) - standard deviation of values SRT(start value,control,length) - sort a list of values
Example
before 3 1 2 4 0 0
Array Functions
COP(start value,destination,length) - copies a block of values FAL(control,length,mode,destination,expression) - will perform basic math operations to multiple values. FSC(control,length,mode,expression) - will do a comparison to multiple values FLL(value,destination,length) - copies a single value to a block of memory
Example
A
FAL Control R6:0 length 5 position 0 Mode all Destination #N7:5 E xpression #N7:0 + 5 FAL Control R6:1 length 5 position 0 Mode 2 Destination #N7:5 E xpression N7:0 + 5 FAL Control R6:2 length 5 position 0 Mode incremental Destination N7:5 E xpression #N7:0 + 5
file to file
file to element
Logical Functions
B3:5 01
EQU(value,value) - equal NEQ(value,value) - not equal LES(value,value) - less than LEQ(value,value) - less than or equal GRT(value,value) - greater than GEQ(value,value) - greater than or equal CMP(expression) - compares two values for equality MEQ(value,mask,threshold) - compare for equality using a mask LIM(low limit,value,high limit) - check for a value between limits
Example
EQU A N7:03 B N7:02 NEQ A N7:03 B N7:02 LES A N7:03 B N7:02 LEQ A N7:03 B N7:02 GRT A N7:03 B N7:02 GEQ A N7:03 B N7:02
O:012 04
Limit Functions
LIM low limit N7:0 test value N7:1 high limit N7:2
N7:5/0
LIM low limit N7:2 test value N7:1 high limit N7:0
Addr. N7:0 N7:1 N7:2 N7:3 N7:4 N7:5 before (decimal) before (binary) 1 5 11 15 0 0000000000000001 0000000000000101 0000000000001011 0000000000001111 0000000000001000 0000000000000000
N7:5/1
LIM low limit N7:2 test value N7:3 high limit N7:0
N7:5/2
MEQ source N7:0 mask N7:1 compare N7:2 MEQ source N7:0 mask N7:1 compare N7:4
N7:5/3
N7:5/4
Boolean Functions
AND(value,value,destination) - Binary and function OR(value,value,destination) - Binary or function NOT(value,value,destination) - Binary not function XOR(value,value,destination) - Binary exclusive or function
Example
AND source A N7:0 source B N7:1 dest. N7:2 OR source A N7:0 source B N7:1 dest. N7:3 XOR source A N7:0 source B N7:1 dest. N7:4 NOT source A N7:0 dest. N7:5 addr. N7:0 N7:1 N7:2 N7:3 N7:4 N7:5 data (binary) 0011010111011011 1010010011101010 0010010011001010 1011010111111011 1001000100110001 1100101000100100
after
Example Create a ladder logic program that will start when input A is turned on and calculate the series below. The value of n will start at 0 and with each scan of the ladder logic n will increase by 2 until n=20. While the sequence is being incremented, any change in A will be ignored.
x = 2 log n 1