BOOL!

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

jgu1
Posts: 1179
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1104 times
Been thanked: 295 times
Contact:

BOOL!

Postby jgu1 » Mon Jan 23, 2012 7:57 pm

Hi everybody! :D

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.

User avatar
fotios
Posts: 458
Joined: Mon Feb 08, 2010 10:17 am
Location: Greece
Has thanked: 109 times
Been thanked: 117 times
Contact:

Re: BOOL!

Postby fotios » Mon Jan 23, 2012 8:49 pm

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
These users thanked the author fotios for the post:
jgu1 (Mon Jan 23, 2012 9:16 pm)
Rating: 5%
 
Best Regards FOTIS ANAGNOSTOU

jgu1
Posts: 1179
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1104 times
Been thanked: 295 times
Contact:

Re: BOOL!

Postby jgu1 » Mon Jan 23, 2012 9:37 pm

Hi Fotio!

Thank you for your help. :D

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

User avatar
Benj
Matrix Staff
Posts: 14793
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4755 times
Been thanked: 4360 times
Contact:

Re: BOOL!

Postby Benj » Tue Jan 24, 2012 12:34 pm

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

Code: Select all

b1


or

Code: Select all

b1 = 1


To check if b1 is clear you could do

Code: Select all

!b1


or

Code: Select all

b1 = 0

jgu1
Posts: 1179
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1104 times
Been thanked: 295 times
Contact:

Re: BOOL!

Postby jgu1 » Tue Jan 24, 2012 1:20 pm

Hi Ben! :D

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 93 times

User avatar
Benj
Matrix Staff
Posts: 14793
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4755 times
Been thanked: 4360 times
Contact:

Re: BOOL!

Postby Benj » Tue Jan 24, 2012 3:55 pm

Hello,

Here you go,
BOOL_Test-1.fcf
(8.5 KiB) Downloaded 107 times


Are you testing on hardware or in simulation?
These users thanked the author Benj for the post:
jgu1 (Tue Jan 24, 2012 7:13 pm)
Rating: 5%
 

jgu1
Posts: 1179
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1104 times
Been thanked: 295 times
Contact:

Re: BOOL!

Postby jgu1 » Tue Jan 24, 2012 7:18 pm

Hi Ben! :D

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.