取消
显示结果 
搜索替代 
您的意思是: 

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 项奖励
1 条消息(共 13 条)
4,171 次查看

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 项奖励
2 条消息(共 13 条)
4,163 次查看
3 条消息(共 13 条)
4,160 次查看
Since the case structure can only use integers, <0 or >0 is essentially the
same as ..-1, 1..

Regards,

Wiebe.


4 条消息(共 13 条)
4,159 次查看

 

 

Message Edited by smercurio_fc on 08-27-2008 09:57 AM
下载全部
5 条消息(共 13 条)
4,148 次查看

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

6 条消息(共 13 条)
4,130 次查看

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 项奖励
7 条消息(共 13 条)
4,124 次查看

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 项奖励
8 条消息(共 13 条)
4,123 次查看
Thanks for the post.  I never used this function before (learned something new today)!
9 条消息(共 13 条)
4,104 次查看

Hi Tim,

Here's the VI in 8.0

Regards

Steve

0 项奖励
10 条消息(共 13 条)
4,099 次查看