08-28-2008 04:52 PM
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!
08-28-2008 05:22 PM
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)
08-28-2008 05:23 PM
08-28-2008 05:35 PM
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!
08-28-2008 05:49 PM - edited 08-28-2008 05:53 PM
08-28-2008 05:52 PM - edited 08-28-2008 06:00 PM
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!
08-28-2008 05:56 PM
08-29-2008 09:26 AM
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.
08-29-2008 11:53 AM
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.
08-29-2008 02:52 PM - edited 08-29-2008 02:52 PM
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.