Hello,
I'm new to codesys and i'm currently leading with a problem which i couldn't find an efficient resolution yet. Basically all i wanted is to track a piece throughout the production line, and passing the Identifier of each piece between FBs (using SFC), in the runtime.
So, whenever a new piece comes in i was assigning ID to it, and then pass that ID to the next function_block whenever the piece reaches it.
For example between two conveyors:
when a conveyor is sending a piece to the next conveyor, at the same time, i call an action that copies the piece_ID to the input of the next conveyor. Then that same conveyor has to store that ID.
Furthermore, I thought in creating a global variable as array, where each position was a slot for each conveyor, and when a conveyor has a piece(detected by a sensor), i put the piece_ID in that corresponding slot. Thus, i only had to check the array to check where the piece was.
Example between 2 conveyors:
when conveyor is sending piece i call a this action:
gvl.piece_ID:=pieceID_O;
simultaneously the next conveyor stores that ID with this action:
pieceID_I:=pieceID_O;
and whenever the conveyor has a piece i had a POU in ST to test and store the IDs into the global array:
The logic behind the idea looks fine, but for some reason isn't working.
Do you have any idea how i could flow that piece indentifier and store it effectively?
Hello,
I'm new to codesys and i'm currently leading with a problem which i couldn't find an efficient resolution yet. Basically all i wanted is to track a piece throughout the production line, and passing the Identifier of each piece between FBs (using SFC), in the runtime.
So, whenever a new piece comes in i was assigning ID to it, and then pass that ID to the next function_block whenever the piece reaches it.
For example between two conveyors:
when a conveyor is sending a piece to the next conveyor, at the same time, i call an action that copies the piece_ID to the input of the next conveyor. Then that same conveyor has to store that ID.
Furthermore, I thought in creating a global variable as array, where each position was a slot for each conveyor, and when a conveyor has a piece(detected by a sensor), i put the piece_ID in that corresponding slot. Thus, i only had to check the array to check where the piece was.
Example between 2 conveyors:


when conveyor is sending piece i call a this action:
gvl.piece_ID:=pieceID_O;simultaneously the next conveyor stores that ID with this action:
pieceID_I:=pieceID_O;and whenever the conveyor has a piece i had a POU in ST to test and store the IDs into the global array:
The logic behind the idea looks fine, but for some reason isn't working.
Do you have any idea how i could flow that piece indentifier and store it effectively?
Thank you!
Related
Talk.ru: 1
Talk.ru: 2