LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

not responding

I have developed many vi's to collected analog data and control DO's.  The problem that I continue to have is that the vi will hang up when opened.  It is non responsive and has to be closed.  Sometimes it will work the first time.  Other times, I have to open it several times before it will work.  If I execute the program in "highlight execution" mode, it works fine.  Any ideas?  Like I said, this is a problem that I have continuously so I think I am doing something wrong.  I have attached one of my vi's.
 
 
0 Kudos
Message 1 of 14
(4,099 Views)
Hi Stu,

usually: when a program runs in highlighted mode, but gives errors otherwise it's most often a timing problem (either running too fast for the hardware or due to parallel execution). So you should check the loop settings...

More notes:
-You should try to create subvis for each job of the main vi to maintain readability of the code. Also using style guide will help here (straight wires from left to right).
- You can work with arrays, either for calculations (see attachment, first loop) or for UI presentation (make an array of those 6 "P" indicators)
-You collect a lot of data in arrays just to calculate the maximum: You can work with shift registers holding the actual maximum and do a min/max comparison in each iteration...
- Try to move calculations out of the loop: first you scale your data (see attachment, first loop to find a different solution), then you calc the mean. You can calc the mean of the unscaled data and scale the data only when you need to display the data...
- when doing comparisons and calculations you should try to use integer datatypes when possible (see attachment, first loop, lower part)
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 14
(4,079 Views)
Thanks for the input.  I know that the whole thing could have been done differently (better).  But, I had a grand total of 2 hours to build this thing from start to finish.  I will keep those things in mind for later applications.  As a side note, once I fire the program up, if I quickly hit the abort button and wait a few seconds, the program will run fine after hitting the run button.  Don't know if this info help but I thought I would add it anyway.
0 Kudos
Message 3 of 14
(4,074 Views)
It doesn't appear to have any race conditions or bad use of local variable that would cause a problem.  I odn't see any uninitialized shift register that would cause unpredictable behavior.  The 1 kHz clock that is driving the second timed loop with a dt of 1 concerns me.  I wonder if the DAQ operations inside the loop are able to keep up?  Gerd, I couldn't figure out what changes you had made to your VI.
 
Aha!  Last second I see something.  In the 2nd timed loop you are using autoindexing tunnels.  And with the very rapid iterations of that loop, I bet those arrays are growing very large very fast and you are having memory management issues.
0 Kudos
Message 4 of 14
(4,054 Views)
The only real issue I have with that thought is that the program does not enter the second loop until I hit the test fire button.  The first loop is there for the sole purpose of calibrating the pressure sensors and visually being able to see the pressure.  When I experience failure, it never makes it into the first loop.  It just hangs up right out of the gate.  I was more interested to see if I am configuring the AI and DO correctly prior to entering the first loop.  Any thoughts?
0 Kudos
Message 5 of 14
(4,049 Views)
I forgot to mention in the other message that you should put probes on the error wires or create indicators to see if anything is generating errors.
 
Rereading your first message, you said  "The problem that I continue to have is that the vi will hang up when opened".  Is this VI problem occurring before you even start running the VI?  Is the VI being run automatically when opened?  Originally I thought you had some sort of execution problem with your code, but seeing this, I'm wondering if you have some sort of issue witht he Labview environment.
 


@StuJ66 wrote:
The only real issue I have with that thought is that the program does not enter the second loop until I hit the test fire button.  The first loop is there for the sole purpose of calibrating the pressure sensors and visually being able to see the pressure.  When I experience failure, it never makes it into the first loop.  It just hangs up right out of the gate.  I was more interested to see if I am configuring the AI and DO correctly prior to entering the first loop.  Any thoughts?

This description makes it sound like an execution problem with your code.  Do you have any error messages or error code numbers?
 I'm wondering if the Control Task Reserve Hardware command is the source of the problem.  I haven't done a lot with DAQmx code, but I have never used this command myself.  Do you need this command?  What if you take it out.
 
So are the problems with the opening of the VI or the running of the VI?
What error messages or codes to you receive?
0 Kudos
Message 6 of 14
(4,046 Views)
The problem happens when trying to run the vi.  I added the control reserve hardware command in an attempt to solve the problem.  Obviously, it didn't work.  Basically, when I try to run the vi, the front panel is displayed but none of the indicators activate and I cannot use any of the controls.  There are no error codes except for the typical windows non-resposive program error.
0 Kudos
Message 7 of 14
(4,043 Views)
I realized I could try running it based on a simulated device.  I had the same issue.  When it said Labview was not responding, I said close and it closed out all of Labview.
 
I would try making copies of your code and eliminating parts of it.  Divide and conquer.  For instance, take out all of the DAQmx stuff and replace it with constants or simulated values and controls.  Try changing the clock to a slower speed.  Try replacing the blue timed loops with ordinary while loops and based on software timed waits.  If it starts working by eliminating something such as the DAQmx, it would give you a place to start looking.
 
May even try copying all of the code to a new VI block diagram and then saving that.
0 Kudos
Message 8 of 14
(4,040 Views)
I have developed many vi's to suit our needs.  Since most of our applications are similar in nature, the vi's tend to be very similar in design.  I started using the timed loops because I was getting a large amount of jitter in my data and control using the while loop.  I have had the same type of problems with the majority of the vi's, so I am thinking there is just something wrong with the way I am approaching my design.  The divide and conquer technique may be the best plan.  I just have to find the time to do it.  Thanks for your help.
0 Kudos
Message 9 of 14
(4,034 Views)
I think time loops should work.  Search the forums for anyone else with issues with timed loops.  I think I've seem some threads where people had problems with them that went away when they used While loops instead.  I think I often hear about weird problems people have using tab controls as well.  By the way, what version of LV are you running?  It looks to me like 8.2.1?  Maybe someone know of any particular bugs or problems with different things in that version of LV that could explain it.
 
Good luck!
0 Kudos
Message 10 of 14
(4,028 Views)