New to Factory IO and need urgent help

Tell me then, where are you stuck?

1 Like

Honestly i really dont know my why around this RFID and time is ticking on my end to deliver. @janbumer1 i am disappointed that the code you wrote i cant even break it down to know where the read or write is. if i was to write to the tags first i dont even know how to located the write code. im just lost bro

1 Like

My friend, there is no “read” or “write” code in my example. The RFID reader is completely status based. You tell it to read via the command and then tell it to execute via the “execute”-bit. And if you want it to write, you tell it to write, deliver the date in the “write data” tag and then tell it to execute again.

You told me you were able to follow my previous instructions on how to use the RFID. There’s not more to it than that.
For your setup you will need to write to the RFID exactly once, that is at the beginning. How you actually trigger the “execute”-bit is up to you.
And then you will need to read the RFID at each intersection. Again, when or how you trigger the “execute”-bit is up to you.

The command is entirely static for each reader. For the first one you can always set it to “3” as in “write data”. And for the intersections you can always set it to “2” as in “read data”. Then you only have to trigger the “execute” at the correct moment.

Of course, for the first reader where you write data you have to provide the data at “Write Data”. The index can be static too, as you’ll always only use the first DWORD in the storage array, so you can set the “memory index” to 0 for all readers.

And for all the other readers you have to read what is in “read data” and act accordingly. As soon as the turntable is empty again you can disregard the data.

1 Like

@janbumer1 so i stopped using the RFID reader and tags and i demonstrated the Sorting using Vision sensor and coloured materials. i sorted with the chain transfer and sent it to the automated warehouse storage. i was able to write using SCL to stack the boxes only just one thing left. the removal. i will Further Make reserch on how to Get the RFID working once his project is completed

1 Like

Perfect, that sounds like a great basis! That means you got the other problems more or less sorted (hah). If you got the sorting and decision making working, that means you can then focus on the RFID reader, should you decide to take it up again.

If you decide to get back to it feel free to hit me up, I’ll gladly help.

1 Like

@janbumer1 I don’t know if you have an idea about this?. So I have set up an HMI to input a number. This number tells the plc where to remove the pallets after storing. Summary is I need help with inputting a number from the HMI to change the target position in the Automated warehouse system. Below is a zap showing code I have written. If you can check this to see what I am explaining. I’d really appreciate
test for sorting by height and storing.factoryio (123.1 KB)
SortbyHeightINCOMpeltenw.zap16.zip (6.3 MB)

1 Like

SortbyHeightINCOMpelte_answer_20220725_0920.zip (1.0 MB)

See the file attached. I currently don’t have a CPU, but it should work.
What I noticed: you used a DInt as a data type for your variable that you used in your HMI. The field in the HMI was set to binary. I added a new input field and variable. In the HMI it’s described as “Demo”, and in the PLC I assigned the value of the variable in the FC “HMI_Demo” to a temp variable.

1 Like

So yah the input is now working, but it is not setting my target position. so now #temp now has the value 12 i included on the hmi but i am unable to set my target postion to equals 12 below are pictures


1 Like

@janbumer1 forgot to tag you to the above reply

1 Like

My dude, #temp is a local temp variable. You can still use the other variable you defined before, you just have to set the input field in your HMI to “decimal” instead of “binary”. :wink:

1 Like


@janbumer1 I am trying to write into the target position from the HMI after doing what you instructed it didnt write. i used the watch table to check the values are working. so i will trace back and ask can you direct me on how to write into this target postion using SCL

1 Like

I don’t quite get what your problem is. Have you assigned the value you got from the HMI to your Output?
Can you send me your program again and tell me where your code doesn’t work and what output variable you try to write?

1 Like

@janbumer1 i have copied the same thing you did and if I use a watch table it to view the value in Retrival input it shows the value inputted. But i want to use it with the factory IO scene (automated warehouse) I want the input from the HMI be written into the target position. Photos below
photo 1- is the target position

Photo 2- is the code I wrote to set the target position equals to retrieval input. But this isn’t working the target position doesn’t change.

my program below also
SortbyHeightINCOMpeltenw.zap16 2.zip (6.3 MB)

1 Like

Your “Word to Shift” that is on %QD36 is set to 1 in multiple networks. And it is then incremented in different networks and functions. Have you ensured that the program will not increment the DInt at the same time in different functions and networks? It could be that your output is overwritten because of this.
You must at all times ensure step consistency.

1 Like

omg @janbumer1 you are Goated for life. it worked perfectly. i had repeated the word to shift i was so dumb ;( thanks alot for your help.

1 Like

No worries. Step sequences can be tricky, especially if they are spread across multiple blocks. Step consistency is key here. Also, to make it easier for yourself, ensure that you have some kind of system including prefixes. For example step 000 to 099 are preparation steps, step 100 to 199 are positioning, step 200 to 299 is loading, step 300 to 399 is unloading and so on. That way you know from the get go in which function you have to search.

That also makes it clear where you have to initialize (in the function where step 000 to 099 are). I would advise that you write the steps contained within as prefix of the block, as in “300-399_Loading” or something in the liking.

Another thing: I noticed that you rely heavily on memory tags and you use outputs and inputs directly in your program. Best practice in my experience with Siemens is to rely more on DBs. For example, make a function where you assign your inputs to DB tags, and a function where you assign DB-tags to outputs. And use DB-tags instead of memory-tags. This makes it easier for you to change your code later on for example if a input is changed. You only have to make a change at one place instead of dozens or hundreds.

1 Like

@janbumer1 so if you noticed when writing the automated warehouse steps I always checked the condition of my stacker crane to set the new condition. But I noticed that for the removal some conditions will repeat itself just like it appeared in the storing process and this confuses the plc thinking it is a previous step. I thought a solution is to create another step name, so I can utilize it in the removal process, but the system still gets to think it’s a previous step. if using the example you mentioned for the step sequence the condition still remains the same.

1 Like

You have to ensure that the next step can only start, if the previous step is active. And the only condition for a step is, that the step is active.
As in:

if step = 5 then
    bla...

    if condition1 then
        step := 6;
    end_if;
end_if;

if step = 6 then
    bla...

That way no matter where you are, you cannot transfer to the next step without a previous step where conditions where met to transition to the next step. You transition conditions should be inside the step.

1 Like

Hi @janbumer1 so I was able to conquer the step sequence and all is working perfectly. Thanks so much, although I am faced with another issue and I don’t understand, so I have set up 4 stacker crane setup and two of them are working well with a good removal logic. But upon setting up another sorting station the first one is getting stuck. i made sure to use seperate tags and i have monitored what is going on but still it keeps getting stucked.

1 Like

Are you using memory tags or did you start using DB variables/tags? I would suggest that you use DBs with UDTs, where you define all variables you need for your stacker crane in the UDT and just use the UDT 4 times, one for each stacker crane. Then you could even feed your whole structure at the In/Out of your functions / function blocks and you will only need to make changes at one place and all 4 machines will work.

1 Like