New to Factory IO and need urgent help

Hello good morning beautiful people. I just joined this community yesterday and to be honest I have seen some great works from people here. I am a novice using factory IO and TIA portal, but I desperately want to learn I have built the below framework in factory IO it isn’t perfect, but it illustrates the idea. I want to build an automated warehouse that can split parcels to their storage location using RFID tags and the RFID reader sensor. To be honest I don’t know how to control it on TIA portal because i this is my first time ever working with this device. I want to learn how to do it and one day be able to do it myself. This is a very important project to me and I need help. If anyone can look through it and point me in the right directions I would really appreciate.

Automated Warehouse NEW design.factoryio (224.4 KB)

1 Like

Hello there Martin, and welcome to the community.

Just in case that you weren’t aware, there’s a great Documentation on Factory IO that also lays out first steps on how to connect Factory IO and Siemens S7 CPUs.

Regarding your scene: looks good so far. The double-T splitting looks a little weird, I would normally use a similar setup as you have on the output-side of your warehouse (single line with split off), but that’s just a detail. What I am sure though is, that you will need some more sensors. As you currently only have a single sensor at the start of the line and then one sensor before the stacker crane. Everything in between will be run “blind”, which will hardly work.

In regards to help: please lay out where you are stuck and where you need help, as “I don’t know how to control it on TIA portal” is a pretty broad scope. We will gladly help if you need additional help in certain areas, and both @wayneschaefer (Youtube Playlist Part 1) and @paul.murray (Youtube Playlist) have multiple videos on their Youtube channels regarding the usage of Factory IO.

2 Likes

@janbumer1 firstly I want really appreciate your reply. I have seen your work the ladder and the code, but to be honest I don’t understand it. It’s my first time working with RFID. I will continue to check your recommendation. But About the scene it is not 100% complete. I am stuck in the use of sensors. In the scene I have a chain transfer device. My plan to read the RFID tags using the RFID reader and send the objects to a predefined storage system. Below is a representation of the movements in a hand sketch. From the emitter the conveyor loads boxes with RFID tags A,B,C & D the first chain transfer uses an RFID reader to read the tag and separates AB tags to the left and CD to the right. The conveyor carries A&B to another chain transfer that separates A to the left and B to the right. The conveyor takes the box to the storage warehouse. Same process for all B,C, and D for delivery a box is called, and it is delivered on the exit conveyor. The turn table directs to along the path of the remover.

1 Like

I suggest you follow this instruction step by step to get a good grip on how the reader works. I think you’re overthinking it here.

Regarding your layout: beware that EU Pallets have non-square dimensions and won’t work sideways after the chain conveyor. Also, keep in mind that you need to be within reading distance to read the RFID tags. Also, if you already have a scanner at every junction, why not make a junction each?
Hence I suggest the following alternative layout:


You could also move the output to the same side as the input at the stacker cranes and move them close together, or even make it a layered conveyor system with the input above the output as moving the horizontal axis is normally slower than the vertical one, and lifting an empy fork is faster than lifting a heavy one.

And, as a general rule of thumb, you’ll want a sensor on the end of each conveyor. If you’re feeling really fancy one at the beginning of each too.

And you should be able to get this sorting all done with a single RFID reader if you keep track of the pallets after the reader anf before they were sorted for example in multiple arrays that each get treated as FIFO stack and you move the data between the arrays.

3 Likes

@janbumer1 this is an amazing idea I really appreciate it. So I rearranged the scene just like you said, but I wasn’t sure if one RFID reader was going to work. So I included one each at the end of the turntable. Also, regrading setting up the RFID, i came had searched online about RFIDs and @wayneschaefer work was the first i saw, i looked at it for hours and i was lost( i am actually a novice in control). i noticed he wasn’t using TIA portal so i dont really understand this software he used,i read your instructions and i also go lost, I have looked through the YouTube videos you recommended, and I couldn’t find any instance where they programmed the RFID or any tutorials on it. I don’t know if I could ask you for this big favour, if you could please take me on an online class at your free time please. Thank you.
NEW design.factoryio (242.8 KB)

1 Like

So, to be able to help you I to know where exactly you get lost. Where do have trouble?
Also, have you set up a simple scene before using TIA portal and Factory I/O?

For example the “From A to B (Set and Reset)” scene? Or a simple scene with a conveyor leading to a turntable where you sort for example pallets with green and blue raw material to the left or right accordingly? Just to get a grip onto how Factory I/O works and how to set up a scene and connection with TIA Portal.

I have the impression that you’re biting off my than you can chew and start to go complex from the get go, and now you’re struggling with multiple things at once, getting lost in the the progress.

1 Like

@janbumer1 thanks for the reply so last month is had a project in which we used factory IO to set a high level and low level water tank. Although we had classes on how to use fxn block etc. I can connect the factory IO and I can arrange the scene. so yes i have set up one to count how many boxes passed a sensor. I am sure if you mention basic terms i should be able to comprehend and perform the task. I can Create Tags for the RFID readers, but the problem is for example if the RFID reads A how do I tell the turntable to perform a function?, and if it is not A The turn table be stable?. Setting up the RFID in general is my issue

1 Like

I see. This sounds like more of a systematic issue then. Were you able to get the RFID reader isolated on it’s on working then? Just the RFID reader with the data reading and whatnot? Without the attached complexity of then deciding on how to now handle the pallet on the turntable.

1 Like

Yes i tried to follow your steps and it didnt work maybe i am doing some wrong

1 Like

If you send me the Factory-File and the TIA archive I’ll take a look.

1 Like

Hello @janbumer1 sorry for the late reply. So I have set up one RFID reader at the loading point, and also included its tags in TIA portal to be honest I haven’t done much and this is where I am finding it difficult. I feel if you can walk me through on how to connect this first one I should be able to implement it on the other ones. Below are the files you requested, also I may have done so much error just putting this here I am so new to the field of study. Please if possible we can schedule a Google meet or zoom class this will go a very long way for me. Thanks

NEW design.factoryio (229.0 KB)
first trail.zip (266.8 KB)

1 Like

I see you didn’t follow my instructions, because if you had you would have noticed that you were missing the “Reader Status” in your scene. :wink:

Anyways, I went ahead and “fixed” your scene and program.

  1. In Factory I/O I repositioned the first RFID reader to the right side of the conveyor and added a pallet right in front of it. As per documentation the position of the RFID tag on the pallet is at the front right. Hence the repositioning of the first RFID reader. You’d have to reposition the others yourself.
  2. I added the “Status” as an output to the driver, so you can check your Factory I/O connection in your TIA project.
  3. I changed the data type for numerical I/O of Factory I/O from “Word” to “DWord” so you can use the full 32 bits that the RFID reader offers. Beware of data types here.
  4. I added the missing MHJ function to your TIA project, as it is described to be required to run PLCSIM with Factory I/O in this documentation, the download link to the project containing this function is found in this documentation. I assumed you wanted to run the whole thing with PLCSIM and not a real PLC as the driver in Factory I/O was set to PLCSIM. If you want to use a physical PLC with Factory I/O, set the PLC up according to this documentation, the most noteworthy part being the “Enable PUT/GET” in the connection mechanisms dialog.
  5. I enabled the required setting “Support simulation during block compilation” for PLCSIM to work with the TIA project in the project settings>protection
  6. I added a new tag list and reorganized the tags required for the RFID reader 1 and added 2 functions to the project, the first being “RDIF_PackUnpack” with packs the inputs and outputs of the RFID reader (from the tags) into a data structure, defined by the UDT “UDT_RFID”, containing “UDT_RFID_IN” and “UDT_RFID_OUT” which will make handling all the RFID in and outputs easier down the line. I then called this inside the function “RFID_Reader” which I called in OB1.

That’s about all I think.

I tested the whole thing using PLCSIM and it worked for me. See the files attached.
If you have questions, feel free to ask.
FirstTrial_Corrected_20220709_1235.zip (355.3 KB)
Scene1_Corrected.factoryio (236.2 KB)

1 Like

@janbumer1 i saw the amazing job you did and i followed the instructions from the README you gave me in the TIA and it worked perfectly. Thank you so much. But bro please don’t get tired of me now okay. So now you have explained to me how to read and write the RFID tags but the big question is how do i use this to drive other devices. The device in question now is the turnable. Eg if i started my simulation and a box reads 6009 ( or any type of code)how will I Instruct it to drive Turntable one.
Another question is can the RFID reader give in factory IO read digits?

2 Likes

I won’t get “tired of you”, don’t you worry.

So, now that you have that problem of using the reader out of the way, the rest comes down to actually programming your machine. For your scene to work properly you have to first give your pallets some data. When you spawn a new pallet the RFID tag is empty.

So you have to have some kind of identification point where you define what is on the pallet. This is normally either done through a vision system or by user input. For simplicity sake I would say that you use a user input system for now. So you would have to setup a RFID reader all the way at the beginning of your conveyors immediately after the emitter, where you initially feed the RFID tag with some data.

After that it comes down to detecting that a pallet is present in front of the reader (i.e. a photo sensor), then reading the data and then deciding if you have to turn the table or now when the pallet is on the turntable.

I could help you with this one, but this is where the expertise of @wayneschaefer and @paul.murray comes in, both of which are professional educators for automation. If you have trouble writing a program that decides if a turntable should turn or not, I suggest that you make some notes first on what your goal is, from that how your program should decide if a pallet should go left or straight, then writing down how you would actually achieve this and only then writing it out in code.
This is now the problem solving part on the software site, as in how to get the machine to do what you want it to do. That’s the main job of an automation technician or engineer. Or any programmer in general.

1 Like

@janbumer1 sorry for the late reply I had to look at the work you did on the RFID reader and try to digest it. So the inital goal is to sort boxes according to alphabetically letters, but i double the RFID reader can read letter like A,B,C and D. Since that isn’t possible, and you said “So you would have to set up a RFID reader all the way at the beginning of your conveyors immediately after the emitter, where you initially feed the RFID tag with some data”
i believe a serial is what can work. So in that case let’s assume I have assigned serial numbers of 1 - 10 (should be stored in stacker A). 11- 20 (should be stored in stacker B) and so on for stacker C and D
immediately the second RFID reader sees No 2 the turntable should turn to direct the box to stacker A if the first RFID reader see a number 14 the first turn table should not move the box then travels to the 3 RFID reader which is right by the second turntable.The reader then detects the No 14 and activates the turnable.

1 Like

Well, I don’t see why letters wouldn’t work. The RFID has a storage of 128 DWORD. So, that’s 256 Words or 512 Bytes. One letter encoded in UTF-8 takes between 1 and 4 bytes. So you could store between 512 and 128 Letters in the RFID tag. Normally you would use only 1 byte and encode im compliance with ASCII, so you would be able to store 512 letters, 4 per DWORD. That is, if you use an ‘Array of Char[0…n]’. If you would use a string, you would only have 2 letters in the first DWORD of the RFID as the first 2 bytes are normally reserved for the String length. You could of course discard that info. Either way, letters is possible, you just have to think a little bit around the corner. :wink:

But, of course, serial will work too. But as said, you’d have to decide what serial to store in your tag at the identification point. But after that what you said sounds solid. Don’t see why you’re using 10 different numbers per stacker though. Is there a particular reason for that?

1 Like

Wow amazing, So now that alphabet letters can work the idea is to name stackers A, Stackers B, stacker C and stacker D. so the first RFID writes to the box and let’s call it A. At the second RFID reader it identifies the tag and activates the turn table to turn and move in the direction of stacker A. the remaining RFID devices will be reading for other alphabets. So @janbumer1 how do I make the RFID read alphabets.

1 Like

I gave you all the tools. Now you have to do some legwork on your own. :wink:
I already gave you the info about data types and whatnot. Now you have to interpret how you read CHARacters from the storage of the RFID.

Edit: To be clear, if you have further questions or get stuck, you are of course free to ask further questions. But more the specific “Hey, I sent the RFID reader the command 2 and I got a status 3, can you help?” type of question rather than “How do I use a storage of length DWORD to store a 1 BYTE character?”.

3 Likes

@Martin So, how’s it looking?

1 Like

The I’m just moving in circles mate. I am so close to giving up on the RFID reader

1 Like