LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

hightlight

Solved!
Go to solution

Looking at your program, it seems like in the first sequence you are putting a wait in a single sequence between two case structures.

Based on how it is written you code would:

1. Check the initial write (from before the program run button is clicked)

2. If write switch is true then write to serial.

3. If write is false then go to wait and wait for user defined time.

4. Check initial read (from before the program run button is clicked)

5. If read is true then read serial.

6. If read is false then close serial.

 

In summary, you are only reading your switches once for the first sequence. In order to remedy this, you can place a while loop around the case and wait structures so you can set up a polling of the controls. 

 

Travis-E

National Instruments
Product Marketer
Message 11 of 13
(435 Views)

Hi Travis,

 

I have tried to use the method you suggested; but it looks not solving my problem. If I use 3 cases case2 and case3 work fine, but if I use only two cases case2 works fine. I don't if I am understanding this thing wrong. I have attached the three cases code.

0 Kudos
Message 12 of 13
(412 Views)
Solution
Accepted by topic author gltfrs

From looking at your code, you don't have a while loop around your entire event structure so you are only reading your user input one time. Also, you didn't include other sub vis so I cannot run your code to step through it.

 

Travis-E

National Instruments
Product Marketer
0 Kudos
Message 13 of 13
(371 Views)