General Information >
RSLogix 5000
1756-DHRIO Retrieve RIO Status Object
The attached file shows and example of retrieving the RIO Status Object using a message and has an add-on instruction to coerce the unsigned data into the next larger data type so that negative values will not be displayed. USINT -> INT UINT -> DINT UDINT -> REAL Hopefully commented well enough to follow. |
UDTs for use with 1771 & 1794 I/O BTR/BTW Instructions for use with 1756-DHRIO module in RIO mode
See attached files. If the above does not make sense, you probably don't need it. Some items below use bit field mapping to make it more intuitive for use. The ones that don't can be converted to that method. |
Miscellaneous Add On Instructions for ControlLogix
|
Add-On Instruction
Have posted a more advanced version, EST.zip, that utilizes the same Control structure that you use with a FIFO Load / Unload pair. This will allow you to delete an element in the middle of an array, but keep the Control.POS value set to the correct location. This one I titled EST for Extract Stack. Latter I will add a LST for Load Stack so that an element can be loaded anywhere in the array structure. ================================================================= This Add-On was created in V19. It will allow you to select an element within an array, that element will be copied to a destination and then the elements below it will be moved up to fill in. The last element in the array will then be written to 0. The add-on is attached below as ArrayShift.zip.The main logic resembles: /*If routine has completed previously then exit routine*/ IF DN THEN TND(); END_IF; /* Retrieve the size of the incomming array */ SIZE(ArrayIn,0,ArraySize); /*Validate requested position to remove*/ IF (Position >= 0) AND (Position <= ArraySize-1) AND (ArraySize>1) THEN ER:=0; /*Set destination data to extract array element*/ Destination:=ArrayIn[Position]; /*Calculate the array positions to operate on*/ CopyStart:=Position+1; CopyLength:=ArraySize-(Position+1); ClearStart:=10; /*Validate there is something to copy*/ IF CopyLength >0 THEN CPS(ArrayIn[CopyStart], ArrayIn[Position], CopyLength); ArrayIn[ArraySize-1]:=0; ELSIF CopyLength = 0 THEN ArrayIn[ArraySize-1]:=0; END_IF; DN:=1; ELSE ER:=1; END_IF; |
1-5 of 5