LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital outputs turn on at the end of some programs

Hello,

 

I am using LabVIEW 8.6.1 with the same version FPGA and RT modules. The board we are using is the PXI-7853R. I have a strange problem where after some programs finish executing, all of the digital outputs turn on(at least, DIOs 0-15 on the multi-functional port).

 

I have attached two programs; one that does not turn on all of the digital outputs at the end of execution and one that does. I tried making the ending scenario for each of them as similar as possible, but I just can't figure it out.

 

Thanks! 

0 Kudos
Message 1 of 6
(3,145 Views)
Hmm, I actually discovered that in that last loop if I use the VI Stop Button (on the tool bar, near the run button) to end the program then the DIOs will remain off. If I use the Stop Button Control (not the one on the tool bar, that one that is actually part of the program and inside the last loop) then all of DIOs turn on when the program is finished. Why is this?
0 Kudos
Message 2 of 6
(3,126 Views)

Brian,

 

The tool bar stop button is actually an immediate Abort button.  It is intended to be used by the programmer when a program under development gets caught in an infinite loop or something like that.  It should never be used as the routine method of stopping a program for the exact reasons you discovered: The program does not end gracefully.

 

Someone on the Forum a while back stated the using the abort button to stop a program is like using a tree to stop a car.  It works but there may be unpleasant consequences.

 

Programs which are deployed to users should have the Abort button removed form the tool bar to prevent such consequences. 

 

Lynn 

0 Kudos
Message 3 of 6
(3,123 Views)

Using the abort button is what gives me the desired results, and that is to leave all of the DIOs off. When I use the correct method of stopping (i.e., the Stop Button Control for the While Loop) then all of the DIOs turn on when the program ends. This is not what I want. I want the DIOs to stay in the state that they were when the program ended (all of them off in most cases). I only get this when using the abort button and I want to know how I can do this without using the abort button. So again:

 

Using abort button -> All DIOs are left in state then the program ended (what I want)

Using Stop Button Control in While Loop to end the program -> All DIOs are turned on regardless of their final state in the program (not what I want) 

0 Kudos
Message 4 of 6
(3,114 Views)

I do not have the FPGA or RT modules so I cannot help with those code-specific issues.

 

Lynn 

0 Kudos
Message 5 of 6
(3,103 Views)

Hi Brian, 

 

When you're running these VIs, are you running the Host VI, which in turn runs the FPGA VI?  Or are you directly running the FPGA VI?  If  you're running the Host VI, then try turning on highlight execution to see when the outputs change to true.

Jared S.
Applications Engineering
National Instruments
0 Kudos
Message 6 of 6
(3,072 Views)