LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

case structure language help

I am trying to write a single case structure that will have three cases but am unsure of how the case language works. I know that ..1 is everything less than 1 including 1 and 1.. is everything 1 and greater. What I am tgrying to do is get:

 

<0

0; and

>0

 

I don't want to do any greater than/equal to

 

How is that done?

 

 

 

0 Kudos
Message 1 of 13
(3,910 Views)

I use comparisons, then convert boolean to integers and add creating three cases, 0, 1, 2

 

I'm still learning, so there may be a better solution.

 

I tried

 

..0.0

0.0

0.0..

 

and crashed LabVIEW 8.5 both times I tried it.

0 Kudos
Message 2 of 13
(3,902 Views)
Message 3 of 13
(3,899 Views)
Since the case structure can only use integers, <0 or >0 is essentially the
same as ..-1, 1..

Regards,

Wiebe.


Message 4 of 13
(3,898 Views)

 

 

Message Edited by smercurio_fc on 08-27-2008 09:57 AM
Download All
Message 5 of 13
(3,887 Views)

Hi,

The way you have described is perfect when dealing with integers. All that needs to be done is make three cases "..-1" (less than 0), "0"(for equal to zero), "1.."(Greater than 0) and then wire the numeric into the case structures selector terminal.

I've attached a simple example VI.

Hope this helps

regards

Steve

Message 6 of 13
(3,869 Views)

Thanks so much everyone for your help. I was able to get it to work. I now have a second question that I have been wrestling with on my program for some time. I am hoping to be able to count the number of times each event happens, be it >0, <0 or 0. So far, I haven't been having a lot of luck on figuring this out.

 

The way my program works is that the case structures control the opening of solenoid valves. I am running a while loop to keep the program running, but would like to be able to at least count the number of times each of the cases are true in an effort to figure out the amount of time each of the solenoids is open during a run.

 

What I really need to do is be able to run each case for a maximum of 10 minutes each, and then stop the case from running. I know this is an in depth problem, but simply counting the number of times each of the cases run would be a huge start for me.

 

Thanks again for the help on the other problem.

 

Tim

0 Kudos
Message 7 of 13
(3,863 Views)

Also, I am running Labview 8.0 so anything above that I won't be able to open. Thanks for the vi Steve. Unfortunately, I can't open it.

 

Tim

0 Kudos
Message 8 of 13
(3,862 Views)
Thanks for the post.  I never used this function before (learned something new today)!
Message 9 of 13
(3,843 Views)

Hi Tim,

Here's the VI in 8.0

Regards

Steve

0 Kudos
Message 10 of 13
(3,838 Views)