04-07-2008 06:07 AM
04-07-2008 12:01 PM
The code is a bit messy, and its a little hard to fully follow it, you may want to buy a style guide "The LabVIEW Style Book" by Blume is my personal favorite. You also should consider switching your design pattern to a queued state machine, or producer/consumer (w/ Events is my personal favorite there).
As for the overflow you modify the buffer before you initialize, so in the current case structure you are initializing (before the initialization), would be a good place to put it in its current architecture. Configuring it requires more info, mostly from your equipment manual.
Also coercion dots are a bad thing (I saw several), everytime you see one of those memory gets copied and causes slow downs in your execution, and ever so slightly possibly overruns in RAM (due to not enough memory).
Your loops have no wait time, and could suck up way more CPU processing time needed, which could mean one loop is using all the processor, and the other gets none. Also you need a data dependancy wire going into the second loop to ensure execution.
04-07-2008 09:20 PM - edited 04-07-2008 09:23 PM

04-08-2008 04:29 AM
04-08-2008 05:09 AM
As for the overflow you modify the buffer before you initialize, so in the current case structure you are initializing (before the initialization), would be a good place to put it in its current architecture. Configuring it requires more info, mostly from your equipment manual.
I do not completely understand what changes should be done, may be you could show me an example?
Also coercion dots are a bad thing (I saw several), everytime you see one of those memory gets copied and causes slow downs in your execution, and ever so slightly possibly overruns in RAM (due to not enough memory).
I did not notice the before. What is the way to eliminate them?
Your loops have no wait time, and could suck up way more CPU processing time needed, which could mean one loop is using all the processor, and the other gets none.Also you need a data dependancy wire going into the second loop to ensure execution.
When i have tried to pass data from the bottom loop to the upper one the system reacted unexpectedly. It runs one of the loop and another one either did not work or worked with interruption. For this program the critical thing is consant signal generation and the sine should be as ideal as possible.
04-08-2008 06:36 AM
04-08-2008 06:38 AM
Oh coercion dots appear when you perform calculations or inout items with different data types/representations, so make them the same data type/representation and the dots go away.
For example if you multiply an i16 and a i32 you have a coercion dot, so you would want to make them both i16 or both i32...
04-08-2008 11:00 AM
sergueiK wrote:
I always thought that the forum is the place where the people are helping each other. Some forums are for fun, I agree. But we do not want NI forum be alike a fun forum. When we post our problem we are looking for solutions and useful comments.
04-08-2008 11:27 AM
04-08-2008 12:32 PM - edited 04-08-2008 12:33 PM
Here is what I see is happening.
You are using DAQ assistant in the 2nd loop to acquire 1000 samples at 1000 Hz It is set for continuous samples. So that will take a second. Then the data is passed of to the other functions. I don't know how long they would take to run, but they are pretty substantial. (By the way, your write measurment file as no data going into it.) If it takes longer than a second, then the DAQ functions which have been continuing, will have the buffer overwritten and you will get the error.
You could ignore the error, but that also means you've lost data which may or may not be important.
It is better to pass the data off into a queue. Let another parallel loop do the number crunching and saving to file. Search the labview help and the discussion forums for producer/consumer design architecture for examples. With only the DAQ assistant in the loop, you will get all of the data. The only risk would be if the queue would grow without bounds in the event that each chunk of data still takes longer than a second to process.
Putting a wait statement in the top loop as well will help. Without a wait statement, a loop will run as fast as it possibly can. Since you are mainly reading a local variable and some controls such as the stop button, you probably don't need to run instantaneously. Even a small wait of a few milliseconds can help yield processor time to other loops.
In your top loop, you are recalculating the waveform and writing it to the analog output on every iteration. It would be better to put that code in a case statement that only executes in the event the values change. I believe with continuous samples, and if you allow that channel to regenerate its data, the analog output will run continuously without needing to update it every iteration.
Also, please move your front panel down and size it to fit closer to the front panel controls. For some reason your VI appears with the title bar off the top of the screen.