01-11-2010 12:38 PM
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)
01-11-2010 12:46 PM
01-11-2010 12:56 PM - edited 01-11-2010 01:03 PM
Here.The true and false of each if the same result
But I don't understand why you hate paint(bmp)?
01-11-2010 01:01 PM
01-11-2010 01:10 PM
01-11-2010 01:26 PM
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.
01-11-2010 02:07 PM - edited 01-11-2010 02:10 PM
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)