Exit Loop after push button

For MIAC users to discuss projects, applications, and any other issues related to the MIAC unit.

Moderators: Benj, Mods

Post Reply
Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Exit Loop after push button

Post by Monie Jacobsen »

Hi everybody
How to leave the Loop below and continue?
Exit Loop.JPG
Exit Loop.JPG (29.03 KiB) Viewed 8073 times
It does not help by pressing the Miac dsPIC KetPad button (8)

See attached file:
MIAC_dsPIC_ClockQuit KeyPad.fcfx
(36.27 KiB) Downloaded 321 times
Best Regard
Monie

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Exit Loop after push button

Post by Benj »

Hello Monie,

I take it you are updating the GetKey variable inside the loop. Looking at your program you are sampling the keypad but saving the result into the variable Key.

Maybe try this instead in the loop parameter.

Key <> 8

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: Exit Loop after push button

Post by medelec35 »

Hi Monie,
You have assigned a variable called Key to the GeyKey component.
However the variable you are checking within the loop to exit is called GetKey
You need to change one of the variables so they match.

Edit.
Ben beat me too it.
Martin

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: Exit Loop after push button

Post by Monie Jacobsen »

Hi medelec35 and Benj
Thanks for your suggestions;-)
Can't get out of this loop.
Even if I use it GetKey <> 8
Best Regard
Monie

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Exit Loop after push button

Post by Benj »

Looking at your program you are sampling the keypad but saving the result into the variable Key.

Maybe try this instead in the loop parameter.

Key <> 8

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: Exit Loop after push button

Post by Monie Jacobsen »

Hi Benj
I can't get out of LOOP
Even if I try what you write...
Best Regard
Monie

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: Exit Loop after push button

Post by medelec35 »

The way your Flowchart is set up, with no key pressed or any key except 8, it should not loop anyway.
It should only loop If you hold down key 8.
Could there an issue with one of the call macros?
You could try disable all then enable one at a time?
Unfortunately, I have not got a dsPIC to test with.
Martin

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: Exit Loop after push button

Post by Monie Jacobsen »

Hi medelec35
Don't Write Key <> !8
But this works Key <> 8
So now I can get out of LOOP and work on the codes.

You both have to thank you very much for your help.
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: Exit Loop after push button

Post by Monie Jacobsen »

Hi everybody

How to convert TimStr and MiniSter and SecStr
Have tried but not succeed!
I want to convert String to Float, must use Float format!
Must use HOUR FP and MIN FP and Sec FP... FLOAT format

Do you have a suggestion?
HOUR_FP = StringToFloat$ (TimeStr)
MIN_FP = StringToFloat$ (MinStr)
Sec_FP = StringToFloat$ (SecStr)
ConverterTime.JPG
ConverterTime.JPG (31.72 KiB) Viewed 8038 times
See attached file below!
MIAC dsPICSetting SolarTracker.fcfx
(137.67 KiB) Downloaded 274 times
If you have a proposal then I will be very happy;-)
Best Regard
Monie

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Exit Loop after push button

Post by Benj »

Hi Monie,

Replied here.
viewtopic.php?f=28&t=20979#p94032

Post Reply