Control IO RFID Example

IMHO leaving the execute flag on TRUE while changing the index would be bad practice, as this could lead to inconsistent data. Process should always be: prepare command -> execute command -> read results -> prepare next command and so on. This also gives you a nice trigger flag && commands executed incr by 1.

You can however prepare multiple commands in a FIFO in your PLC to send them one after the other and store the results in a FIFO buffer and process them later and at a slower speed if your process in the PLC takes too long. But this is a unlikely scenario as you will mostly need the data from the RFID to control some process or some process has influence on the data you want to store on the RFID and you want to write specific data into a specific RFID tag.

2 Likes

Good points overall … totally agree with you.

Sounds, that it is necessary to toggle ‘Execute command’ for every index data,
@wayneschaefer thank u for the quick reply

1 Like

Hi i learn newly factory i o , I want to use RFID for read a code from one of box , but really i do not how can i start , i don’t understand how can i program and configuration this sensor . could you help me with a simple example . thank you

2 Likes

Hi … you will find two examples at the top of this thread. I’ve provided a Read Station and Write Station Scenario using the built-in Controlio Language and also standard PLC Ladder (using the same timing). The coding is also provided in pdf format for those who do have use the Rockwell Platform. A timing diagram is also included. This is certainly not the only way to program an RFID, just one example. I hope reading through the material will help answer your question.

2 Likes

thank you so much , at first time I look at this program , but it was so hard for me , because could not understand exactly how can we use tags for rfid , and what work exactly every tags .

2 Likes

how can i contact you please … i have some questions

1 Like

Best describe your problem here, we’ll help you as good as we can.

1 Like

Posting on the forum gives you the benefit of years of experience across many platforms and industries. How I implement or create a system is just one of many correct (or nearly correct :wink: ) options. However, there is a message utility to send private messages as well if you would rather not post publicly.

1 Like

So , i start a new project when i load a crate with the base or the lids and they go to the stacker cranes for the storage

And I want to use the RFID for adding to every pallet an id because I will make a station to unload them , so I need the id to be able to lower any pallet from the stacker cranes.

Because I will use 3 stacker cranes with 2 racks in every crane, I will have (3x2x54) 324 different positions and so 324 different ids.

So my question is , because i will use the database of the TIA portal to save and load the ID , should i need to change the Memory Index.

If i understand it correctly , the memory index is like a pointer , to “point” the ID that you want to write.
But i will use like a Static INT in the DataBase of the TIA Portal to write or read the ID.

1 Like

Assuming I am remembering correctly, if you are just reading the unique ID number that is assigned automatically by Factoryio, there is no need to index, just select the correct RFID mode. If you are writing your own data to the tag, you will require the RFID mode selection (read or write) and also an index number pointing to that memory location (0, 1, 2, 3, etc). Reading the automatically generated unique ID is independent of the memory index pointer.

1 Like

So , the zero base index suport 4 bit numbers ( 0-8).

If i need to write an id with the numbers 9 , i will “point” the second memory location, or i need to write the first location and then add to the second location the remains.

1 Like

Your user specific ID will be written to and read from memory locations starting at “0” to “127” based on your Index Integer value. If you place a read/write head into your project, the I/O requirements may be more clear.

1 Like

I’m not sure if I understand you correctly.
The RFID tags do have a unique serial number that you could use.
Alternatively if you want to assign your own ID you could just use the DWORD at Index 0.
With that DWORD you would already have 2^32 or about 4.3 Billion unique Numbers at your disposal to form an ID.
A length of 8 digits should already be enough for most purposes, meaning you’d use 24bits for 16.8 Million numbers.

3 Likes

This is exactly what i was rrying to find , thanks

1 Like

Hello sir hope this meets you well, i only started working on factory IO in may and now i have a project working with RFIDs. I am still finding it hard to comprehend how to utilize the RFIDs i have built the scene in factory IO and all i need to do is control but i am lost. Is there any step by step tutorial you can recommend to bring me out of these mess?.

1 Like

Is there any particular item you are getting hung up on? I provided a Controlio and Ladder sample as well as a timing chart at the beginning of this topic.

@Martin Maybe this will help?

As the Documentation states, each RFID Tag has 128 DWORD (or 4 bytes each) of memory plus a unique serial number.
The serial number is read by using the command ID 1 with the RFID reader. The memory is read and written by using the command ID 2 and 3 respectively and by providing an additional memory index from 0 to 127.
The reader is triggered by a rising edge on the “Execute Command” input.
I suggest that you follow the few steps I laid out in my linked reply to get familiar with the tag reader in a static setting.
Be aware that because this is a simulation, the time needed to read and write data might be longer than in a real field application. See the timing diagram provided by @wayneschaefer at the beginning of this thread for more details.

2 Likes