Hi everybody!
Is there here anybody who can help me how to use BOOL, true or false in FC. Only a simple examble. I can´t find anything about this even not in the helpfile.
Best Regard
jorgen.
BOOL!
Moderator: Benj
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
- fotios
- Posts: 458
- Joined: Mon Feb 08, 2010 10:17 am
- Location: Greece
- Has thanked: 109 times
- Been thanked: 117 times
- Contact:
Re: BOOL!
Hi Jorgen
A very simple Boolean function that is executed by FlowCode is the "Decision". You know that in a FC Decision is checked if a concrette variable fulfils a condition, for example "If switch = 1?" Here the variable under test is the "switch". That is also a Boolean expresion: "Switch is TRUE?" The ON (=1) condition corresponds to TRUE, while the OFF (=0) condition corresponds to FALSE. Accordingly, there are two branches after a FlowCode Decision, the one that is called "yes" corresponds to Boolean TRUE while the other that called "no" corresponds to Boolean FALSE.
Fotis
A very simple Boolean function that is executed by FlowCode is the "Decision". You know that in a FC Decision is checked if a concrette variable fulfils a condition, for example "If switch = 1?" Here the variable under test is the "switch". That is also a Boolean expresion: "Switch is TRUE?" The ON (=1) condition corresponds to TRUE, while the OFF (=0) condition corresponds to FALSE. Accordingly, there are two branches after a FlowCode Decision, the one that is called "yes" corresponds to Boolean TRUE while the other that called "no" corresponds to Boolean FALSE.
Fotis
Best Regards FOTIS ANAGNOSTOU
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: BOOL!
Hi Fotio!
Thank you for your help.
I understand the function of BOOL. It's more how to handle it in FC I think when you create the variable and handle it in an if function. I would be very happy if you could make a small example.
Thanks in advance.
regard
Jorgen
Thank you for your help.
I understand the function of BOOL. It's more how to handle it in FC I think when you create the variable and handle it in an if function. I would be very happy if you could make a small example.
Thanks in advance.
regard
Jorgen
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: BOOL!
Hello,
Using a bool in a decision should be straightforward.
If b1 is your boolean variable
To check if b1 is set you could enter the following into a decision icon
or
To check if b1 is clear you could do
or
Using a bool in a decision should be straightforward.
If b1 is your boolean variable
To check if b1 is set you could enter the following into a decision icon
Code: Select all
b1
Code: Select all
b1 = 1
Code: Select all
!b1
Code: Select all
b1 = 0
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: BOOL!
Hi Ben!
Thank´s for your help. I understand the meaning with BOOL, Maybe I am stupid, but I have some problems to handle it in FC. Please, would you be kind to change it in att. test FC.
Thank´s in advance.
Best regard
JGU
Thank´s for your help. I understand the meaning with BOOL, Maybe I am stupid, but I have some problems to handle it in FC. Please, would you be kind to change it in att. test FC.
Thank´s in advance.
Best regard
JGU
- Attachments
-
- BOOL_Test.fcf
- (8.5 KiB) Downloaded 221 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: BOOL!
Hello,
Here you go, Are you testing on hardware or in simulation?
Here you go, Are you testing on hardware or in simulation?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: BOOL!
Hi Ben!
Thank you, now I am in business. It´s a new kind of variable for me. At the moment I test it in simulation, but later in "real wold". I know I have config the Pic before downloading.
Once again, thank you.
Best regard
Jorgen.
Thank you, now I am in business. It´s a new kind of variable for me. At the moment I test it in simulation, but later in "real wold". I know I have config the Pic before downloading.
Once again, thank you.
Best regard
Jorgen.