LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

more programming problems...

I am running this vi (HVtest) and the first set of commands it follows, but when I press the stop button, it does not send out the second command of relay switches to open. It keeps looping until you stop the application, and the relays remain open. So you have to stop the program, press the relays you want to open/close for the second round, and start the program again. I would like to move on to the second command when I press "stop." What is wrong with the program?
 
Thanks,
Bethany
Download All
0 Kudos
Message 1 of 7
(3,295 Views)

Do I need to put the second part of the program in a sequenced structure or something? I thought if you had the error in/out running through each part of the program it would perform the tasks sequentially, but it doesn't seem to - thanks for your help,

Bethany

0 Kudos
Message 2 of 7
(3,291 Views)

Hi Bethany,

Your 'HVtest.vi' seems OK and indeed the wiring determines the data flow.

I think you have to add a timeout to your DAQ assistant. Maybe this VI wait for ?? At least your program will stop and you can look further for the problem. I don't know what you want to do so i cannot see if you are using the right VI's for the job.

0 Kudos
Message 3 of 7
(3,281 Views)
Of course nothing works. I think this was explained to you once before. You have a main VI that calls Digital.vi. Execution passes from the main to the subVI. The while loop in the subVI will not terminate until it's own stop button is pressed. Unless the front panel of the subVI is displayed, you can't click it's stop button. Until that happens and execution control returns to the main VI, the stop button on main is completely ineffective. If you want your subVI to only execute once, then remove the while loop in it.
0 Kudos
Message 4 of 7
(3,268 Views)

This was not explained to me before. This is a different program than I have posted before.

Thanks.

0 Kudos
Message 5 of 7
(3,260 Views)

See http://forums.ni.com/ni/board/message?board.id=170&message.id=148290#M148290

"Third, your subVIs have a while loop. Since your subVIs are not set to show the front panel when called, unless the subVIs are already open, your main VI will start the subVIs, pass execution to the subVI, and appear to hang. That's because you then have no way to stop the subVIs with the stop button and execution will never return to the main VI."

0 Kudos
Message 6 of 7
(3,247 Views)

I do see that now. But nobody responded then to tell me how to do it. (I didn't know at the time) If you look at the thread, nobody answered when I told in detail what I wanted to do. So that's why I'm asking again what the problem is. This time, I understand how to do that. Before I didn't.

Thanks

0 Kudos
Message 7 of 7
(3,234 Views)