09-21-2012 02:33 AM
Hi all!
I am trying to generate a series of outputs on the same channel. The aim is to create an output with varying amplitude and frequency (to simulate different magnitudes and types of disturbance on a signal).
I had a working version, but it was not really nicely coded (I just used the difference between the current time and the start time to control run-time) and I am trying to solve it now with the available DAQmx functions.
What I want to do:
Create a task using a waveform and feed this waveform to the output. The time is given for the duration of each output. When the task is done, I generate a new waveform to write to the output, and do this until all amplitude and frequency combinations have been created on the output.
You can view my solution on the attached picture (sadly it is not working)
I tried with and without the clear task at the end (in the green box)
The problem is the following: (without clear task)
At the first run, when the task ends the while loop exits and starts over. On the second run however no output is generated and the nested loops just fall through.
The problem (as I understand it) might be that no new task is created when I write new data to the output channel, but I could not figure out how to create a new task.
So this is my problem. Any input is appreciated!
09-21-2012 09:25 AM
All of those stacked sequence structures and local variables - one of the worst choices for a design. You should really change your architecture. A simple state machine is probably what you need.
An image is impossible to debug. Post the actual VI after you have cleaned things up.