x
x
Program code //Comments
//If there is no transponder in the field, jumped to error evaluation U "ANW"; // Presence (I10.5) SPBN ende;
//Run through the read loop only once U "Once_flag"; // Run through loop once (M2.0) SPB ende;
//If an error occurs, increment error counter U "Error";; // Error bit (I10.6) SPB erro; // => Abort if error
//New read command when <ready bit>is set and no <error>
U "Done";; // Ready bit (I10.7) SPBN ende;
//Does the address <read command> = <read acknowledgement>?
//Address 10 is set (see hardware configuration) L "PAE_Status"; // PII : CMD UW W#16#2;
L B#16#2; // Read command
==I ; //Acknowledgement U( ;
L "PAA_Adr_L"; // PIQ : Adr-L L "PAE_Adr_L"; // PII : Adr-L
==I ;
) ;
SPB adre; // Valid acknowledgment => adopt data SPA Lese; // => Output read command
//Save data at current transponder address in data DB adre: L "PAE_Adr_L"; // PII : Adr-L SLD 3; // Expand to 16-bit address T "lwa";; // Memory of the current address (MD3) L "PAE_Data"; // PII : Data (bytes 4-7) AUF "FC1Daten";; // Memory DB (DB100) T DBD ["lwa"]; // Enter read data in DB L "PAE_Adr_L"; // Increment address by 4 bytes
+ B#16#4;
T "FC1Daten".dbadresse; // Save new read address
//New read command when <ready bit>is set and no <error>
Read: L B#16#2; // Read command T "PAA_CMD"; // PII: CMD
//Load the last valid address L "FC1Daten".dbadresse;; // Memory DB (DB100.DBB114) T "PAA_Adr_L"; // PII: Adr-L
//Increment read address (address range 112 bytes = 70 Hex for MDS D124) L "FC1Daten".dbadresse;; // Memory DB (DB100.DBB114)
Program code //Comments L B#16#6C; // Check end address
(MDS D124 = 112 bytes = 6F hex)
>I ;
SPB enda; // => End when end address reached SPA ende; // => Continue reading in next cycle
//Read next transponder enda: U "VKE1"; // When all data has been read
= "Once_flag";
L 0; // End reading of the transponder T "PAA_CMD"; // => then deleted address etc. T "lwa"; // "
T "PAA_Adr_L"; // "
T "FC1Daten".dbadresse; // => wait for new transponder SPA ende;
// Troubleshooting erro: L "FC1Daten".fehler1; // Count errors L 1;
+I ;
T "FC1Daten".fehler1; // and end reading L "PAA_Adr_L"; // Data that led to error T "FC1Daten".err_dbadresse; // save L "PAA_CMD"; // "
T "FC1Daten".err_cmd; // "
L "PAE_Status"; // "
T "FC1Daten".err_Status; // "
L "PAE_Error_RFID"; // "
T "FC1Daten".err_ErrorRFID; // "
L 0; // Delete addresses/memory bits/memory T "FC1Daten".dbadresse; // "
T "lwa"; // "
T "PAA_Adr_L"; // "
T "PAA_CMD"; // "
U "VKE1"; // End reading
= "Once_flag";
ende: BE ;
DATA_BLOCK "FC1Daten"
TITLE =ScanUserData AUTHOR : IASCCI FAMILY : RFID NAME : IOLink VERSION : 1.0 STRUCT data : ARRAY [1 .. 112 ] OF BYTE; // Memory for "data"
fehler1 : WORD := W#16#0; // Memory for "error" count dbadresse : Byte := B#16#0; // Memory for "dbadresse"
err_dbadresse : BYTE ; // Memory address if error occurs err_cmd : BYTE ; // memory Command if error occurs err_Status : BYTE ; // Memory status if error occurs err_ErrorRFID : BYTE ; // memory Error_RFID if error occurs END_STRUCT ;
BEGIN fehler1 := W#16#0; // Memory for "error" count dbadresse := B#16#0; // Memory for "dbadresse"
err_dbadresse := B#16#0; // Memory address if error occurs err_cmd := B#16#0; // memory Command if error occurs err_Status := B#16#0; // Memory status if error occurs err_ErrorRFID := B#16#0; // memory Error_RFID if error occurs END_DATA_BLOCK
x x
x x
x
x x x
x x
x
x
x x
x x
x x
x x
x
x
x
x
x x x
x x x x x x
x
x
x
x x
x
x
x x x x x x x
x x x x
x x
x x x x x x x
x x x
x x
x x x x
x