LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Everytime I try to run this code, LabVIEW crash

I am using Tektronix TDS3012B oscilloscope and LabVIEW7.1
My code just read the curve data (2 channels) from scope and draw the chart in LabVIEW. Sometimes the code runs well but usually it will crash and kill all LabVIEW programs. Even it run well sometimes, it will 100% crash when I try to close the program.
Please see my attached pictures and the attached VI file. (some sub-vi may miss coz I use scope library)
I read 500 data from scope. I guess the trouble is because of the memory? Does LabVIEW need to allocate and de-allocate memory? Thanks
0 Kudos
Message 1 of 5
(2,433 Views)
Attached VI file.
0 Kudos
Message 2 of 5
(2,429 Views)
Does it crash during running or really crash only when you try to close the VI after running? Do you get any error message?

I cannot test your code, because I don't have these drivers, but here are a few hints:

The problem is most likely with the drivers and the way you communicate with the scope. Maybe the second frame starts too fast? You have these delays between the write and read nodes (why two in a row???), but none between the frames.
Maybe you need a nother delay between the two frames?
There is also no error cluster connection between the two frames.

One of the problems with your VI is the fact that large sections of identical code is duplicated in thwo sequence frames for no reason. Your main code segment is called twice with a different string input. Why don't you put it in a FOR loop, autoindext with a string arrray containing the two inputs and autoindex the result on the right loop boundary. Seems much simpler and avoids duplication of code.

The attached quick modification shows what I mean. Let me know if you have questions.
0 Kudos
Message 3 of 5
(2,418 Views)
Hi,altenbach, I follow your suggestion and it works almost perfect now.
I use for loop and add delay between two frames. If I run the code 10 tims, 3 or 4 times it still crash with a pop window "LabVEIW7.1 development system has encountered a problem and needs to close. We are sorry for the incovernience .... Please tell Microsft this problem .."
When I run with 'hightlight execution', the program never crash.
One more question is: beside the chart, I also want to output the data, that is why I use two sequence instead of a FOR loop. Now if we use FOR loop, how to output the data of two curves? Please see my code. Thank you.
0 Kudos
Message 4 of 5
(2,401 Views)
Just use index array on the 2D array (See attached).
0 Kudos
Message 5 of 5
(2,392 Views)