Home > Forum > IEC 61131 Programming (LogicLab) > Example of cart handling in SFC language
- This topic has 5 replies, 2 participants and was last updated 10 years, 5 months ago da Sergio Bertana.
-
AuthorPost
-
September 13, 2013 at 8: 56 am #35412StefanoParticipant
I am trying to get to know LogicLab and the SFC language but I am not yet clear about some aspects of the user interface (such as positioning the blocks, linking actions, etc.). I am looking for examples to clarify but I do not find projects a bit articulated for LogicLab with SFC components. A useful example would be something like moving a carriage with two positions (FcA and FcB) and a start key. With a sequence like:
- Start.
- Acknowledge start button.
- If (NOT FcA) and (NOT FcB): Run forward until FcA is activated -> Jump Waiting Start Button.
If FcB: Run forward until FcA is activated -> Jump Waiting Start button
If FcA: Reverse until FcB activation -> Jump Waiting Start ButtonPS: I know that the second case described should be inserted in case 1 for optimization. I split it to have for example one more transaction.
September 14, 2013 at 6: 24 am #37773Sergio BertanaAdministrator ForumI am not an expert SFC programmer, when I have sequential programs to create I prefer to use the ST language, the CASE OF statement allows you to manage them in a very orderly way. But I try to answer your request by making a simple SFC program that fulfills the purpose (Print program, Source Download).
- In step Init, I perform the zeroing of the two direction command outputs.
- In the next transaction I await the activation of the start button.
- Before opening a transition I must forcibly insert a step, the Dummy step and just a filler.
- I open a divergent transition, performing two control transactions on the state of the limit switches. If no limit switch is active, the leftmost branch prevails, therefore the forward axis is active (as per your request).
- I execute the two Forward and Back steps in which the relative command output is activated.
- When the limit switch is activated, it jumps to the Init step which resets the command outputs.September 16, 2013 at 8: 42 am #37775StefanoParticipantOkay, I'd say it's pretty clear.
Thanks so much!!September 17, 2013 at 1: 11 pm #37778Sergio BertanaAdministrator ForumWith a moment of free time I proceeded to expand the cart and / or axis handling project by adding the automatic movement, as seen from the screenshot of the SFC program.
In manual mode, the start command is expected to move forward or backward, the movement continues until the relative limit switch is reached.
In automatic mode, the forward movement is performed on the start command, the pause time is reached, the back movement is performed. When the limit switch is reached, a pause is executed, then the cycle resumes with the forward movement. To stop the automatic cycle, it is necessary to switch to manual mode.
I have also prepared a simulation input% IX0.2, with the active input the limit switches are simulated after a time from the start of the movement, in this way it is possible to test the operation in a much easier way, not having to manage the limit switch.
The various actions and transitions are managed with programs both in ladder LD language and structured text ST, this to demonstrate how a single SFC program can contain parts written in the other 4 languages of the IEC61131 standard, I am attaching press program e source files.
December 2, 2013 at 9: 34 am #37913StefanoParticipantWith regard to this example, I have a couple of questions.
One concerns LogicLab:
Going to the debug menu -> Sinulation mode the error “simulator definition (TGSX) not found” appears. Are any files missing in LogicLab?The other is about the sample project.
If you want to add two alarms, one that intervenes if the wagon takes more than X time to reach the limit switch, and the other that intervenes when a contact closes (which can be the emergency button, or a thermal protection contact) , what would be the most correct way to manage them?December 2, 2013 at 9: 54 am #37914Sergio BertanaAdministrator ForumThe simulator inside LogicLab is not implemented in the current version, it will be available from the next version being released. We currently provide an external simulator, you need to select the simulator target to use it (Topic).
I have converted your program for use with the simulator and I have added the management of the axis feed alarm (Download source program). There he is screenshot of your simulation program.
-
AuthorPost
- You must be logged in to reply to this topic.