delays in Flowcode

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
radist73
Posts: 36
Joined: Mon Dec 22, 2014 10:04 pm
Location: TALLINN
Has thanked: 5 times
Been thanked: 2 times
Contact:

delays in Flowcode

Post 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,

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: delays in Flowcode

Post 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
Martin

radist73
Posts: 36
Joined: Mon Dec 22, 2014 10:04 pm
Location: TALLINN
Has thanked: 5 times
Been thanked: 2 times
Contact:

Re: delays in Flowcode

Post 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 :)
Attachments
ADC4_lcd_877_2.fcf
(50.88 KiB) Downloaded 351 times

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: delays in Flowcode

Post 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
Martin

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: delays in Flowcode

Post 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
Martin

Post Reply