05-18-2015 04:41 PM
How do implement this pseudo code in labview? Please keep in mind "a" and "c" in the code below ARE VARIABLES
for i =0 to i=maxvalue
if i <= a
output = output2
else if i > a AND i<=c
output = output2
else if i < c
output = output3
else i = d
output = output4
I understance i can use a case structures and modify the label, but i do not know how to make the label dependent on a variable value.
Thanks
05-18-2015 04:51 PM
@hpupo wrote:
How do implement this pseudo code in labview? Please keep in mind "a" and "c" in the code below ARE VARIABLES
Thanks
Sounds like you need to look at the basic LabVIEW tutorials available online. It might take some effort to think of things in terms of data flow and not variables.
05-18-2015 04:54 PM
Thanks for the quickly reply. I wish i had the time to do that. I am running on a very tight schedule adn unfortunately can't afford to learn how to think in labview mode, so i was hoping there was a an easy solution for this problem.
Thanks
05-18-2015 04:56 PM
Feel free to post what you have so far so that we can give you better advice.
05-18-2015 04:56 PM - edited 05-18-2015 05:21 PM
Try an array of boudaries and use threshold array. See this old example:
Now just iterate over an array of values using a FOR loop.
05-18-2015 05:03 PM
@hpupo wrote:
. . . I am running on a very tight schedule adn unfortunately can't afford to learn how to think in labview mode, so i was hoping there was a an easy solution for this problem. . .
The solution is pretty easy depending on a few key parameters. You'll get help here if you're willing to take the time to learn LabVIEW. If you're just looking for solution code, you won't get that here.
For your present problem: How quickly do you want to run through the indices in i? You're going to need a for loop for that. For checking a and c, you're likely going to want to poll the values of controls inside of the for loop. Sounds like you have the basics of what you'd like to put in your case structure.
Go ahead and take a stab at it and post what you think the solution might look like.
05-18-2015 05:14 PM - edited 05-18-2015 05:14 PM
Let the responses begin.
05-18-2015 05:27 PM
There is nothing intrinsically wrong with that solution at all.
05-18-2015 05:34 PM
@tyk007 wrote:
There is nothing intrinsically wrong with that solution at all.
What solution? This thread contains many posts!
05-18-2015 05:39 PM
I am definetely into learning and changing my way of thinking, the only thing, like i mention is that unfortunately i do not have the time right now.
This is what i ahve so far. Keep in mind i have not tested it, but in principle it should eb correct.