Hi all,
I am new around here & would like to get some help with running SFC simultaneously.
The project that I have in hand is a multi-track train station that has multiple start / end points.
As of now, I am able to run them 1 at a time.
However, I would like to run multiple train tracks simultaneously.
From what I found out, I have to use the parallel branch.
But other than that, i have no other idea already.
Can any one kindly point me to some places where I can get some help?
Thank you
-Jon Kang
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
sorry i did not see your post earlier.
this parrallel branch only is useful when all processes should start and end at same time.
This problem can be easily controlled with ladder or ST
An SFC as you did is for sequence operation , this means it is used to da tasks one after the other.
Oke your thinking is correct as you can see it as a sequence, however it means in reality only few steps can be used simultaneous and that is wrong solution here.
Keep your SFC as it should go in your report as a way of tackling the problem.
with your layout max 2 trains can run together.
1 on BD line and another on the A line
Now lets try it in SFC
press start is not needed but oke i think it is a good one.
now ask for a startstation
then ask for a end station
this gives your parrallel
so first transition is AE or EA
AC CA
AD DA
BD DB
this gives 4 parrallel branches (easy and simple)
check if anything on the route is occupied, if yes give error to operator
example AC:
action:
check occupation (double click in action block and a programming will open, make it ladder.
switch1 NOT occupied, switch 2 NOT occupied route=possible
transition
route possible and one not possible
possible route
action set switch1 straight
set switch 2 straight
set switch1 occupy
set switch2 occupy
i would like to know what inputs you have and what outputs
just give it a thought and you will see it works.
do not use parallel but simple lines. as only one transition is true.
greetings paul,
if not enable go button and set the switches.
occupy all switches and locations on this route
when this is done go to the start (for another route or just wait)
use another button to release the route. (to deoccupy the switches)
You could have controlswitches on all the ends to release automatically, however that is for later.
This way your loop is fast (only takes a second to set everything and you can expand it easily)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
and yes i could give you a complete answer, however you will not learn from it, and yes i will answer any question.
btw switch 3 should be connected to switch1 as they should be both straight or diverging. but keep in mind when staright not to occupy 3 on the A line. ahwell first check if anything occupied will set for this problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You mentioned that I should just use simple LD or ST, rather than SFC with parallel branch.
1 of the concern that made me use SFC was that the program will get too long & difficult to troubleshoot, hence my supervisor advised me to try SFC.
Jonthan Kang
(Dellsuperman)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So what are you making now?
send an zipped export of your program, and i can advice you if you will be able to make it working.
within the actions you can also use ST or LD or any other language.
do not use the double line as it means all branches are waiting until they are all done.
make a new SFC with
start button transition
input a character (A..E)
transition is character <>""
blink possible end characters
input another character
if possible blink the go
empty action
transitions are all combinations as you did.
the actions are dependant of the route so set switches
if switches are set you can go back to start.
In ST you can use functionblocks to get rid of long programs.
how is progress?
depending on level use occupied color when a train is passing.
make a logarray with times and wayplan (in real this is automatic done, so at 12:34 a way is set auto, then at at 12:40 another train will arrive and needs another setting.
this is a separate program and can be nice as demorun. you only need a few ways .
but you could say a passengertrain from B to D
a cargo from A to E
a passenger from C to A
a loc from B to D and back to A and up to E
you can use a polygon instead of these rectangles. (these you can turn)
make each railpart a separate visualisation and use placeholdernames.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have been advised by my supervisor to use the parallel branches but so far everything doesn't seem to be working out for me.
This is the program that I came up before I switch them to all parallel branch.
For this attached program, I can select the start point (1st row) & the end point (2nd row).
For example after pressing start (A) & end (C), I will need to press on the Point Machine 1 & 3's right button, before the train (brown) will move.
For now, I have used colored coding for the track status but there isn't any track checking at the moment.
Green: Good to go
White: Track is planned to be used
Red: Track in use
And after the train reaches it's destination, I will have to reset the whole program in order to run again, if not the 1st train will keep moving in same direction.
tell the supervisor please :
a parallel branch is used to have actions running parallel, and all actions needs to be ended, before the next step is executed.
However you only have one branch running at a time, the rest should not be active at same moment.
so you need parallel transition to make a decision what branch should be active.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Oke so i made one line a bit added
check also the action as i used limitalarm (from util.lib)
This way only one block is on.
as there are still no comments, i can not check your program.
However i see it running when all BOOLs are correct.
Keep it in this direction, as you can see on simulation it does work.
I changed my program significantly by removing SFC totally.
The problem I am facing now is inserting Function blocks.
This is roughly what I have done so far.
Start program
-- Reset all routes
Select route from interface
-- I have managed to allow 2 sets of route to be chosen after not using SFC.
Check route(s)
-- If all route clear, proceed to Function Block of individual train tracks
-- If not clear, wait for all tracks to clear before proceeding.
I plan to use function blocks to help reduce the length of the program to make it easier to trouble shoot.
However, I am not sure how does the function block works & how to place them.
I have attached my program for your reference.
Making a user function block is easy
go to POU
right click and add a POU.
select it to be a function block, select a language
type in a name
now the editor opens a new window
Here you can make your program.
if you make a new variable it will ask if it is a input /output etc.
After finished programming
go to the program where you would like to call the block.
insert a FB
you will need to give it a name
in the declaration above you need to give this name a type.
r_trig is a function (almost same as a function block.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Shooter,
Thank you for the advise.
I have created all the function blocks for my individual tracks & I have imported all the codes from my previous program.
However, I do not know how to call the function blocks from the main program.
The error that I get when I compile the program:
"Error 4301:PLC_PRG (22):POU'AE_ROUTE_Prog' needs exactly 0 input"
It is like the coil or FB that I place at the end of the rung is not supposed to be there.
Hi all,
I am new around here & would like to get some help with running SFC simultaneously.
The project that I have in hand is a multi-track train station that has multiple start / end points.
As of now, I am able to run them 1 at a time.
However, I would like to run multiple train tracks simultaneously.
From what I found out, I have to use the parallel branch.
But other than that, i have no other idea already.
Can any one kindly point me to some places where I can get some help?
Thank you
-Jon Kang
This is my main page of the SFC, with all the possible different routes
This is my UI
sorry i did not see your post earlier.
this parrallel branch only is useful when all processes should start and end at same time.
This problem can be easily controlled with ladder or ST
An SFC as you did is for sequence operation , this means it is used to da tasks one after the other.
Oke your thinking is correct as you can see it as a sequence, however it means in reality only few steps can be used simultaneous and that is wrong solution here.
Keep your SFC as it should go in your report as a way of tackling the problem.
with your layout max 2 trains can run together.
1 on BD line and another on the A line
Now lets try it in SFC
press start is not needed but oke i think it is a good one.
now ask for a startstation
then ask for a end station
this gives your parrallel
so first transition is AE or EA
AC CA
AD DA
BD DB
this gives 4 parrallel branches (easy and simple)
check if anything on the route is occupied, if yes give error to operator
example AC:
action:
check occupation (double click in action block and a programming will open, make it ladder.
switch1 NOT occupied, switch 2 NOT occupied route=possible
transition
route possible and one not possible
possible route
action set switch1 straight
set switch 2 straight
set switch1 occupy
set switch2 occupy
i would like to know what inputs you have and what outputs
just give it a thought and you will see it works.
do not use parallel but simple lines. as only one transition is true.
greetings paul,
if not enable go button and set the switches.
occupy all switches and locations on this route
when this is done go to the start (for another route or just wait)
use another button to release the route. (to deoccupy the switches)
You could have controlswitches on all the ends to release automatically, however that is for later.
This way your loop is fast (only takes a second to set everything and you can expand it easily)
and yes i could give you a complete answer, however you will not learn from it, and yes i will answer any question.
btw switch 3 should be connected to switch1 as they should be both straight or diverging. but keep in mind when staright not to occupy 3 on the A line. ahwell first check if anything occupied will set for this problem.
Hi Shooter, thank you for your reply.
I'll try those things that you mention & get back if i have any issues.
[DellSuperman]
Hi Paul,
You mentioned that I should just use simple LD or ST, rather than SFC with parallel branch.
1 of the concern that made me use SFC was that the program will get too long & difficult to troubleshoot, hence my supervisor advised me to try SFC.
(Dellsuperman)
So what are you making now?
send an zipped export of your program, and i can advice you if you will be able to make it working.
within the actions you can also use ST or LD or any other language.
do not use the double line as it means all branches are waiting until they are all done.
make a new SFC with
start button transition
input a character (A..E)
transition is character <>""
blink possible end characters
input another character
if possible blink the go
empty action
transitions are all combinations as you did.
the actions are dependant of the route so set switches
if switches are set you can go back to start.
In ST you can use functionblocks to get rid of long programs.
how is progress?
depending on level use occupied color when a train is passing.
make a logarray with times and wayplan (in real this is automatic done, so at 12:34 a way is set auto, then at at 12:40 another train will arrive and needs another setting.
this is a separate program and can be nice as demorun. you only need a few ways .
but you could say a passengertrain from B to D
a cargo from A to E
a passenger from C to A
a loc from B to D and back to A and up to E
you can use a polygon instead of these rectangles. (these you can turn)
make each railpart a separate visualisation and use placeholdernames.
Hi Paul,
I have been advised by my supervisor to use the parallel branches but so far everything doesn't seem to be working out for me.
This is the program that I came up before I switch them to all parallel branch.
For this attached program, I can select the start point (1st row) & the end point (2nd row).
For example after pressing start (A) & end (C), I will need to press on the Point Machine 1 & 3's right button, before the train (brown) will move.
For now, I have used colored coding for the track status but there isn't any track checking at the moment.
Green: Good to go
White: Track is planned to be used
Red: Track in use
And after the train reaches it's destination, I will have to reset the whole program in order to run again, if not the 1st train will keep moving in same direction.
SFC Parallel Setup Orig.pro [153.56 KiB]
tell the supervisor please :
a parallel branch is used to have actions running parallel, and all actions needs to be ended, before the next step is executed.
However you only have one branch running at a time, the rest should not be active at same moment.
so you need parallel transition to make a decision what branch should be active.
Oke so i made one line a bit added
check also the action as i used limitalarm (from util.lib)
This way only one block is on.
as there are still no comments, i can not check your program.
However i see it running when all BOOLs are correct.
Keep it in this direction, as you can see on simulation it does work.
SFC CS150211.pro [82.92 KiB]
I changed my program significantly by removing SFC totally.
The problem I am facing now is inserting Function blocks.
This is roughly what I have done so far.
-- Reset all routes
-- I have managed to allow 2 sets of route to be chosen after not using SFC.
-- If all route clear, proceed to Function Block of individual train tracks
-- If not clear, wait for all tracks to clear before proceeding.
I plan to use function blocks to help reduce the length of the program to make it easier to trouble shoot.
However, I am not sure how does the function block works & how to place them.
I have attached my program for your reference.
JonKang TrainTrack.pro [183.13 KiB]
Making a user function block is easy
go to POU
right click and add a POU.
select it to be a function block, select a language
type in a name
now the editor opens a new window
Here you can make your program.
if you make a new variable it will ask if it is a input /output etc.
After finished programming
go to the program where you would like to call the block.
insert a FB
you will need to give it a name
in the declaration above you need to give this name a type.
r_trig is a function (almost same as a function block.
Shooter,
Thank you for the advise.
I have created all the function blocks for my individual tracks & I have imported all the codes from my previous program.
However, I do not know how to call the function blocks from the main program.
The error that I get when I compile the program:
"Error 4301:PLC_PRG (22):POU'AE_ROUTE_Prog' needs exactly 0 input"
It is like the coil or FB that I place at the end of the rung is not supposed to be there.
Jon Kang
JonKang TrainTrack.pro [196.35 KiB]
i made you an example of a function block call in a ladder.
JonKang TrainTrack.pro [101.82 KiB]