LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquired data are all 0

I am acquiring data in a for loop then save to files.

If I am working at Highlight Extution, the data and waveform are all correct, which takes a long time.

But if I am working at non-highlight extution, all the data and the waveforms are 0.

what's the problem?

Thanks a lot!

0 Kudos
Message 1 of 13
(3,772 Views)

Looks like you have a race condition, but it is impossible to further troubleshoot without seeing the code. Could you attach your VI?

 

How are you acquiring data (serial port, DAQ card, USB, etc)

Message 2 of 13
(3,768 Views)
Well, clearly it would seem you probably have a timing problem. Where is the data coming from? My guess is that you're probably not waiting enough time for an instrument or something. If you post your code a more specific suggestion can be provided...
Message 3 of 13
(3,766 Views)

Thank you guys!

I am acquring data from USB.

 I tried put a 60s delay in the loop, which should be longer than the waiting time with highlight extution, but not helpful.

There are some vi from Newport and Andor.

The data acquring is located at the case2 of case1 in the for loop.

Hope this will work, and thanks again!

0 Kudos
Message 4 of 13
(3,757 Views)
I cannot open your program with LabVIEW 8.6. Could you verify that the attachment is correct?
Message Edited by altenbach on 08-28-2008 03:53 PM
Message 5 of 13
(3,749 Views)

To me it works. I am using 8.2

It has some comercial vi. Is that a problem?

Let me try another one.

Thank you!

Message Edited by Doherty on 08-28-2008 05:54 PM
I attached another one just cutting off all the for loop and other parts.
Message Edited by Doherty on 08-28-2008 06:00 PM
Download All
0 Kudos
Message 6 of 13
(3,747 Views)
Sorry, it opens in 8.5.1. There must be something wrong with my 8.6 installation.
Message 7 of 13
(3,743 Views)

Your program is, to put it bluntly, a mess. You're abusing sequence structures, and could probably answer this question. I can't tell what's going on because of all the missing subVIs. As far as I can tell all of them seem to have error clusters, but you're not using any of them, which means that if any errors occur you'll never know! So how you know that your program works? In your earlier response you said "The data acquring is located at the case2 of case1 in the for loop." I have no idea what this refers to since you've got multiple loops and multiple cases and multiple sequence structures.

 

If you are referring to the "Andor_test" VI and you are referring to the while loop that sets the temperature your problem is one of fundamental sequencing. You have no data dependency between the "Get Temperature" and "Set Temperature", so you never know which one will execute first. This is a race condition. It seems that you have a background in text-based coding. LabVIEW does not execute code top-to-bottom (except for property nodes) or left-to-right.

0 Kudos
Message 8 of 13
(3,700 Views)

The temperature part works fine, because it won't start acquring data until the temperature reach the set value.

You may right with structure, but I took from the examples of the company.

But I am still confused with why the data obtained are fine with highlight, but all 0 withought highlight.

0 Kudos
Message 9 of 13
(3,690 Views)

Doherty wrote:

The temperature part works fine, because it won't start acquring data until the temperature reach the set value.


 

From the above picture we see that there is no way to guarantee that a "Set" executes before a "Get" or vice-versa. Worse, it can be different from run to run.  

 


You may right with structure, but I took from the examples of the company.


Are you referring to your company, or some other company. Regardless, they are very poorly written examples.

 


But I am still confused with why the data obtained are fine with highlight, but all 0 withought highlight.


As I said before, I have no idea which part of the code you're referring to.

Message Edited by smercurio_fc on 08-29-2008 02:52 PM
0 Kudos
Message 10 of 13
(3,676 Views)