How to enter delay as a time in the Calculation box.?

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

astro1234
Posts: 42
Joined: Mon Apr 10, 2017 12:53 pm
Has thanked: 36 times
Been thanked: 13 times
Contact:

How to enter delay as a time in the Calculation box.?

Postby astro1234 » Mon Feb 04, 2019 1:14 pm

Hi.
Can i use the calculation icon to enter a delay for time.
Example i make a var called Delay, then in the calculation box enter Delay = 100 milliseconds
How can i enter time in milliseconds/ or fraction of seconds in the calculation box.
Win 10 pro
Flowcode V8.1
Thanks Roy.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8478
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2435 times
Been thanked: 3488 times
Contact:

Re: How to enter delay as a time in the Calculation box.?

Postby medelec35 » Mon Feb 04, 2019 2:35 pm

Hi Roy,
Delay icons accept variable names:
Variable Delay.png
Variable Delay.png (11.35 KiB) Viewed 790 times

I'm not sure if there are any limits on the maximum value you can use but I believe the delays can be greater than 255 if required.
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

astro1234
Posts: 42
Joined: Mon Apr 10, 2017 12:53 pm
Has thanked: 36 times
Been thanked: 13 times
Contact:

Re: How to enter delay as a time in the Calculation box.?

Postby astro1234 » Mon Feb 04, 2019 3:32 pm

Tried that out, would only work up to 255,
so changed the number format to int, and it works ok.
Thank you.
Regards Roy.
These users thanked the author astro1234 for the post (total 2):
Benj (Tue Feb 05, 2019 5:26 pm) • medelec35 (Tue Feb 05, 2019 6:45 pm)
Rating: 10.53%
 

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8478
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2435 times
Been thanked: 3488 times
Contact:

Re: How to enter delay as a time in the Calculation box.?

Postby medelec35 » Tue Feb 05, 2019 6:40 pm

Hi Roy,
You're welcome,
Glad it's working for you.
Yes, you will need to change the variable type to reflect the value you're after.
For example, if you require a 300ms delay and the variable used is a byte, then the actual delay will be 300 - 256 = 44ms
The is because if you add 1 to a byte value of 255 then instead of being 256 the byte roles over to 0.
Reason being a byte in flowcode has the range of 0 to 255 only.
Best to use UInt as that goes from 0 to 65535
These users thanked the author medelec35 for the post (total 2):
astro1234 (Wed Feb 06, 2019 8:20 am) • Benj (Wed Feb 06, 2019 5:42 pm)
Rating: 10.53%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.