Page 1 of 1

Calculation Function?

Posted: Fri Jun 12, 2015 9:20 pm
by JDR04
Hi folks, I'm hoping somebody could explain to me what the (CALCULATION BOX) function actually does in the small program I have attached

Thanks a lot for your help...............John

Re: Calculation Function?

Posted: Fri Jun 12, 2015 9:48 pm
by medelec35
Hi John,

Code: Select all

lightlevel = 0
only sets the variable lightlevel to 0
This is not necessary in the flowchart you have posted.
Reason being ADC component is setting the variable before it's read by decision branch.

If it was the other way round e.g a decision branch before ADC then you must have the lightlevel variable preassigned first,
since variables on hardware start off assigned with a random number.


Martin

Re: Calculation Function?

Posted: Fri Jun 12, 2015 10:02 pm
by JDR04
Thanks Martin, hope all is well with you.

Take care........John

Re: Calculation Function?

Posted: Sun Jun 14, 2015 10:06 am
by medelec35
Hi John,
Recovering nicely after being ill
Thanks for asking.

Hope you are well too?

Martin