I am wondering if I am going the long way about this.
I have a UDT with the status and information of a part we run. This UDT holds 100 bytes of information. Assorted items like Dints with real number values of LVDT's that gage the part, Leak rate of the part, and characters of a decoded 2D datamatrix.
Basiclly I want to take the information from this part and store it in a DB along with the last 50 parts. Is the only way to copy a UDT where the destination is offset each time with an ANY pointer.
If so this is my first attempt and wanted to know if I am on the right path or should be any of this differently. Thanks for any and all criticism.
Sorry for copy and pasting as text couldn't see how to enter code.
NETWORK 1
//Open Datablock to be used
// OPN "DB_DataTracking" //Open Past Part Buffer DB
//Load Max number of "Offset", Increment "Offset", Compare to Max
L 50 //Max number to allow before reseting
L "OffsetNumberIndirectAddr" //Number for "Offset" (MB12)
+ 1 //Increment "Offset" by 1
T "OffsetNumberIndirectAddr" //Increment "Offset" by 1 (MB12)
>=I //if "Offset" >= Max number specified above
JC skip //jump to skip otherwise reset offset
//Reset "Offset" if Max is reached
L 1 //Load 1 and transfer to
T "OffsetNumberIndirectAddr" //Reset offset to 1 (MB12)
//Calculate Indirect Address for current data to be moved to
skip: L P#DBX 100.0 //Load Pointer of 100.0
*D //Mulitply by "Offset" (MB12)
T "NdirctAddrsPastPartBuffr" //Create Indirect address (MD25)
NETWORK 2
LAR1 P##AnyPoint
L W#16#1002 //Byte 1 - Any pointer header, Byte 2 - Data Type = BYTE
T W [AR1,P#0.0]
L 100 // Set repetition factor to 100
T W [AR1,P#2.0]
L 203 //DB203 to be used
T W [AR1,P#4.0]
L "NdirctAddrsPastPartBuffr" //Byte Offset determined above (MD25)
T D [AR1,P#6.0]
NETWORK 3
CALL "BLKMOV"
SRCBLK :="SerialStages".EXIT_INFO
RET_VAL:=#tempint
DSTBLK :=#AnyPoint
NOP 0
I have a UDT with the status and information of a part we run. This UDT holds 100 bytes of information. Assorted items like Dints with real number values of LVDT's that gage the part, Leak rate of the part, and characters of a decoded 2D datamatrix.
Basiclly I want to take the information from this part and store it in a DB along with the last 50 parts. Is the only way to copy a UDT where the destination is offset each time with an ANY pointer.
If so this is my first attempt and wanted to know if I am on the right path or should be any of this differently. Thanks for any and all criticism.
Sorry for copy and pasting as text couldn't see how to enter code.
NETWORK 1
//Open Datablock to be used
// OPN "DB_DataTracking" //Open Past Part Buffer DB
//Load Max number of "Offset", Increment "Offset", Compare to Max
L 50 //Max number to allow before reseting
L "OffsetNumberIndirectAddr" //Number for "Offset" (MB12)
+ 1 //Increment "Offset" by 1
T "OffsetNumberIndirectAddr" //Increment "Offset" by 1 (MB12)
>=I //if "Offset" >= Max number specified above
JC skip //jump to skip otherwise reset offset
//Reset "Offset" if Max is reached
L 1 //Load 1 and transfer to
T "OffsetNumberIndirectAddr" //Reset offset to 1 (MB12)
//Calculate Indirect Address for current data to be moved to
skip: L P#DBX 100.0 //Load Pointer of 100.0
*D //Mulitply by "Offset" (MB12)
T "NdirctAddrsPastPartBuffr" //Create Indirect address (MD25)
NETWORK 2
LAR1 P##AnyPoint
L W#16#1002 //Byte 1 - Any pointer header, Byte 2 - Data Type = BYTE
T W [AR1,P#0.0]
L 100 // Set repetition factor to 100
T W [AR1,P#2.0]
L 203 //DB203 to be used
T W [AR1,P#4.0]
L "NdirctAddrsPastPartBuffr" //Byte Offset determined above (MD25)
T D [AR1,P#6.0]
NETWORK 3
CALL "BLKMOV"
SRCBLK :="SerialStages".EXIT_INFO
RET_VAL:=#tempint
DSTBLK :=#AnyPoint
NOP 0
Last edited: