LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean flipping

Greeting, I want to implement the following code in LabView.

#include <iostream>

using namespace std;

void main {

bool thingy=true;

bool condition  =true;

if (condition==true)

{ ...

thingy=false;

...}//here there is a condition if thingy ==true

else {...

thingy=false ;}//in both cases the thingy is false

}

I want to make a boolean to turn on(true for a few seconds)and then turn off(false for the rest of the time) when a condition is satisfied

I did it by first initializng  the boolean as truewhen the conditionis satisfied(I don't care if it is true or false)(some things happen which  are not important)then I change the value back to false same also goes to !condition(i have placed it in a loop)

 

Unlike C++,where the condition is entered once and the things inside the condition=true || false are done once,the Labview will always process the the condition and the boolean are always initializedd.

The led boolean indicated turns on for few seconds(i have placed a timer=1 seconds) and that then it turns off for a fraction of a second and then continues to turn oooooooooooooon-off-ooooooooooooooon-off...which is quite annoying.

 In C++ ,I can use static inorder to initialize it the first time.

 

How can I make such a code it is simple if it wherenot for the loop[initialization to true])

Thanks again for your time (I havn't posted the code since it is basic to understand the code)

0 Kudos
Message 1 of 7
(3,369 Views)
Can you post a screen shot (.png, .jpg, NOT .bmp) or attach your existing code, noting what version of LabVIEW you are using?
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 7
(3,360 Views)

Here.The true and false of each if the same result

 

But I don't understand why you hate paint(bmp)?

Message Edited by Boolean Varible on 01-11-2010 01:03 PM
0 Kudos
Message 3 of 7
(3,352 Views)
Asked and answered here.
0 Kudos
Message 4 of 7
(3,342 Views)
I think this does what you are looking for.
Tim
GHSP
0 Kudos
Message 5 of 7
(3,334 Views)

Boolean Varible wrote:

Here.The true and false of each if the same result

 

But I don't understand why you hate paint(bmp)?

Message Edited by Boolean Varible on 01-11-2010 01:03 PM

 

A .docx file is worse than a bitmap. Not only is it proprietary, you can embed bitmaps into it to get around the ban.

 

If you don't know how to use paint to save png or jpg files, then you should read the basic help for it.

Message 6 of 7
(3,321 Views)

As Dennis mentioned .docx is not the way to go, a lot of us don't have the more recent versions of MS Office required to open it, and I think even MS will not be supporting it as a result of their loosing the XML lawsuit last year. I'm sure they will try to engineer a way around it, but it is just a good idea, if you want the maximum number of people here to look at your problem, to try and use the recommended "tools". Capturing a screen shot, opening it in Paint and saving it as a PNG rather than a BMP is very easy, one more step that just saving it as a BMP, but one that, as mentioned before, saves a lot of bytes of storage and download bandwidth.

 

It is also considered good form to note which version of LabVIEW code you might post was saved in, not everyone will have a version that is compatible either on their computer, or open as the working version (I have 7.1 - 2009 on my laptop, but which ever one was last used will be the version that tries to open a downloaded vi)

 

 

 

Message Edited by LV_Pro on 01-11-2010 03:10 PM
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 7 of 7
(3,299 Views)