Page 1 of 1

Exit Loop after push button

Posted: Tue Feb 19, 2019 5:46 pm
by Monie Jacobsen
Hi everybody
How to leave the Loop below and continue?
Exit Loop.JPG
Exit Loop.JPG (29.03 KiB) Viewed 8897 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 340 times

Re: Exit Loop after push button

Posted: Tue Feb 19, 2019 5:58 pm
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

Re: Exit Loop after push button

Posted: Tue Feb 19, 2019 6:00 pm
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.

Re: Exit Loop after push button

Posted: Tue Feb 19, 2019 6:14 pm
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

Re: Exit Loop after push button

Posted: Tue Feb 19, 2019 6:20 pm
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

Re: Exit Loop after push button

Posted: Tue Feb 19, 2019 6:33 pm
by Monie Jacobsen
Hi Benj
I can't get out of LOOP
Even if I try what you write...

Re: Exit Loop after push button

Posted: Tue Feb 19, 2019 7:11 pm
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.

Re: Exit Loop after push button

Posted: Tue Feb 19, 2019 7:33 pm
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.

Re: Exit Loop after push button

Posted: Wed Feb 20, 2019 4:16 pm
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 8862 times
See attached file below!
MIAC dsPICSetting SolarTracker.fcfx
(137.67 KiB) Downloaded 293 times
If you have a proposal then I will be very happy;-)

Re: Exit Loop after push button

Posted: Thu Feb 21, 2019 1:11 pm
by Benj
Hi Monie,

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