Page 1 of 1

delays in Flowcode

Posted: Mon Dec 22, 2014 10:37 pm
by radist73
Hi all,
Sorry for my poor English, I am new Flowcode user.
I need to make a power supply control unit with 4 adc for voltage measurement, lcd display to show voltages and any logic for switcing load to power sources.
ADCs, and lcd works good, but I have problem with any additional functions. They looks as very simple, but I dont know how make it.
Main code have ADCs, voltage calculations, lcd. It works good without any delay.
But I need one more separated loop for control lcd backlight, simply momentary press pushbutton activate output for 10sec.
If I add this code to main program, I have a delay 10sec for all program! It is wrong.
And one more... ADC1 and ADC2 is for batteries. Logic need to test battery with testload, before connecting to normal load. I need to activate one test output wich connect to batery a test load (6 ohms power resistor for 24v battery, 4amps test current) for 4 seconds. And at the same time need to be started second delay 3,5sec and after 3,5sec battery voltage need to be measured by adc (voltage on load) and after 0,5sec logic go to next step...
Problem just how to start two or more separated processes at same time and one of them not need to be delayed by any other.
Thanks all for answers,

Re: delays in Flowcode

Posted: Mon Dec 22, 2014 11:09 pm
by medelec35
Hi radist73,
Welcome to Matrix forums.

What version of Flowcode have you got?
Then I can move this thread to the correct section.

I have created a few flowcharts that usie a timer interrupt for timing a back light.
E.g here
multiple delays3.fcf would probably be the better one to take a look at.
You can use the timer interrupt to set-up multiple delays which will not affect the main program.

If I was you I would take a look at the learning center where there are tutorial videos and a Flowcode Beginners Course etc.
Look at some sample flowcharts, then try and create your own.

When you post your own flowchart, we can have a look at it for you and give helping advice.

Martin

Re: delays in Flowcode

Posted: Tue Dec 23, 2014 12:49 pm
by radist73
Thank you answer!
I have Flowcode v5

My project attached, backled control made as separate macro poweron_sw. AC_DC_check macro is a logic for testing and choosing supply input. It give too additional delay 500ms to main program. If it is possible, main program will work without this delay.

System logic:
main source is 230vac (230/24 ps between), second 24vdc and backup two batteries. OK, at moment adc programmed to 12v and adc_ok signal if voltage between 11 and 15 volts.
if230v is ok, system will connect load to 230vac (output DO) and do nor search any other input, only show other inputs voltages on lcd.
If 230v not present, system check 24vdc, if ok, activate outpit D1
If 24v not present, it search for battery 1 and 2.
If it works from battery and 230v comes back, it connect load to 230v and after 500ms (in real life may be 2sec) disconnect battery. It is very important to connect load to new input before, and after 0,5-2 sec disconnect second input.
I need one control loop more to switch system on. Long press to power button (not yet in program) will activate one output and second long press will deactivate. It is one delay more :)

Re: delays in Flowcode

Posted: Tue Dec 23, 2014 2:04 pm
by medelec35
Hi radist73,
Looking at your flowchart, since using 16F874A and EEPROM you must be using Flowocde V5 professional.
All Flowcode V5 professional users must have their account upgraded to be a "Flowcode V5 User so they can be helped further.
This post will explain more.

I will move this thread to V5 section tomorrow, so you will have a chance to register for V5 section.

Martin

Re: delays in Flowcode

Posted: Wed Dec 24, 2014 5:33 pm
by medelec35
Should be doable,
Will post something for you to look at when your account is upgraded to V5 status.

I have move thread to the correct section.

Martin