v5 loop issue

Moderator: Benj

Post Reply
andrej123
Posts: 1
Joined: Thu Nov 03, 2016 8:35 am
Contact:

v5 loop issue

Post by andrej123 »

Hi,

I recently started using flowcode v5 since I want to start programming and a lot of people told me that flowcode is great for starting.

However I soon came to an issue. I wanted to make a loop that would end when a specific condition is met. In my case, that condition was a switch (momentary push) being pressed. So I connected a switch to B0 and added an imput that made value of the switch equal to the value of the bool variable also named "switch". So my loop should end when switch=1. However, no matter how I tried to do it, the simulation would always stop at the loop and would never proceed, even when the switch was pressed.

I do believe that the problem is actually me not understanding something rather than something being wrong with the flowcode itself, but that still keeps me empty handed and feeling rather dumb for not knowing something that appears to be basic knowledge. So please help this man see the light :D

Thank you for your time.

EtsDriver
Posts: 444
Joined: Tue Apr 15, 2014 4:19 pm
Location: Kajaani, Finland
Has thanked: 345 times
Been thanked: 227 times
Contact:

Re: v5 loop issue

Post by EtsDriver »

Hi and welcome to forums! I moved your post to V5 free edition area.

Are you reading the input inside the loop to check when it changes state? Or are you using interrupt to detect the change?
Ill just keep the good work up!

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: v5 loop issue

Post by medelec35 »

Hi andrej123,
We can help you further, if you can post your flowchart for us to take a look at.

Martin
Martin

andrej123
Posts: 1
Joined: Thu Nov 03, 2016 8:35 am
Contact:

Re: v5 loop issue

Post by andrej123 »

EtsDriver wrote:Hi and welcome to forums! I moved your post to V5 free edition area.

Are you reading the input inside the loop to check when it changes state? Or are you using interrupt to detect the change?
medelec35 wrote:Hi andrej123,
We can help you further, if you can post your flowchart for us to take a look at.

Martin
Thank you for your replies. I'm using loops for stopping the programm until the switch is pressed. They are basically fancy delays since the only difference is that with loops it's me who decides when the programm will move on.

I was trying to make a rather primitive simulation of level crossing barriers at a railway crossing. I used 3 switches: first for train entering the "zone" where the barriers started to move, second for train leaving the "zone" and third for level crossing barriers - lcb being in their "end position" (being at the very top or at the very bottom). I used 2 LED lights to show what is currently happening with the barriers ( for example if the combination of lights is 01 the barriers are closing).

The chart includes 3 loops that are all supposed to end when the value of the respective switch is 1, however the simulation would always stop at those loops and won't proceed any further.

Here is the link to the chart : http://imgur.com/a/sBX6Q

I'm sorry if there were any grammatical errors, English is not my first language.

Once again thank you for your time.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: v5 loop issue

Post by medelec35 »

There are settings within flowchart that can help solve the issue your facing.
Can't see them with screen shots.
Can you post the flowchart as previously requested.
Also what version V5 are you using?
Fee, Home, Pro etc?
Martin

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: v5 loop issue

Post by jgu1 »

Hi!

I am totally agree with Martin, it is much easyer to help if you add your programm. But anyway, I am not "hardcore", I can see in your 3 loop your missing the input. So inside the first loop, you have to add the inputconfig 'LCB' and inside the second loop you have to add the input ' train out'. And the last you add again the 'lcb' input.

In your programm, when it come to the loop, it wait for something, but can't see the input.

Hope this help.

Br

Jorgen

Post Reply