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

case structure

Hi,

I have two vi s which I want to connect through case structure.

I have 2 cases; true and false, in the case structure. I wanted to use a boolean button to control the case selection. If the boolean LED is turned on then true case should be selected and the first vi is connected to second vi. If the boolean LED is off then false case should be selected and first vi alone runs without connecting to the second vi. How to program it. Any suggestions please. I am new to programming and I am not sure whether my logic is correct. Please help. Thank you.

0 项奖励
1 条消息(共 14 条)
4,224 次查看

Hi ymadhuri,

 

it could be as simple as this example:

check.png

When you really have problems with such tasks you should go through some LabVIEW tutorials offered by NI (here or here)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 项奖励
2 条消息(共 14 条)
4,222 次查看

Thank you for your response. But I did exactly the sam way. When I execute the program it does nothing. So I kept excute highlight and run the program. The highlight execute comes only till first vi and continues only there even after selecting the case.  So I dont understand how to proceed .I attached the program code. Please check it and tell me where I am doing wrong. Run the Vi named "save image on event"

0 项奖励
3 条消息(共 14 条)
4,216 次查看

Hi ymadhuri,

 

next time you should name your "main VI" so I don't have to search for it in your ZIP file...

 

The VI "save image on event" contains the other two, so I suspect it's your main VI. It also contains a lot of IMAQ functions which aren't installed on my computer.

So I can't say what is happening before your "Save" case structure is called.

 


The highlight execute comes only till first vi and continues only there even after selecting the case.


 

I really don't know what you're trying to say here...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 项奖励
4 条消息(共 14 条)
4,212 次查看

The left portion of the block diagram before the case structure is used to acquire real time images using my laptop webcamera , process it and display. When I select the boolean LED "save" then the processed image is sent for pattern matching which is inside the case structure. When I execute the code with highlight execution I observe that only the code outside the case structure is executing, The case structure is not running. How to make my program function properly.

0 项奖励
5 条消息(共 14 条)
4,210 次查看

Hi ymadhuri,

 

when using highlight debugging you also should note when your LED is read! You should use some DATAFLOW when you need the LED read after the IMAQ stuff is processed! Right now that button is read just when the VI starts - switching the button later on has no effect! THINK DATAFLOW! As a simple solution to your problem you should use a sequence structure to read the button within...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 项奖励
6 条消息(共 14 条)
4,206 次查看

Sorry I do not know about sequence structures. This is my first programming experience. So I am not sure about my logic also. Kindly help me in achieving my output. the code which I have attched is developed by modifying existing programs available in discussion forums and example codes.Am I proceeding in the correct way?

0 项奖励
7 条消息(共 14 条)
4,201 次查看

Hi ymadhuri,

 

- LabvIEW provides a lot of examples. See the help menu...

- LabVIEW provides a big help. See the help menu...

- LabVIEW (or NI) provides online crash courses. See here or here...

 

You should know LabVIEW is based on DATAFLOW. This is all you need to learn at the start 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 项奖励
8 条消息(共 14 条)
4,198 次查看

I kept a flat sequence structure in the code. I found that there is an option of "stacked sequence structure". Which one would be suitabl for my application?

 

0 项奖励
9 条消息(共 14 条)
4,188 次查看

Hi,

 

in your case a single frame of a flat sequence is all you need...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 项奖励
10 条消息(共 14 条)
4,186 次查看