06-01-2006 09:45 AM
06-02-2006 03:18 PM
06-06-2006 08:33 AM
06-06-2006 08:47 AM - edited 06-06-2006 08:47 AM
Message Edited by AAM on 06-06-2006 08:56 AM
06-06-2006 08:57 AM
06-06-2006 09:16 AM
06-06-2006 11:17 AM
I am not receiving an error after each time the function is called but only after the loop completes (all 4 daq assistants run) and it tries to run the second iteration.
If the clear task is not called after every instance then the resource is not released causing the next Daq assistant not to execute. The sequence I attached is a simple example of my more complex 55 frame sequence that is controlling ac and dc motors with data acq and other functions. My example was the jist of the problem as was requested by the previous poster.
When I first created this code I was not using a clear task after each but found I had to in order for the resource to be released.
06-06-2006 11:59 AM
06-06-2006 01:10 PM
The code you have supplied is similar to the converted subvi but this code will give an empty task error on the DAQmx Create Channel vi.
Notice on the Daqmx create task vi that there is nothing wired to the "Task to copy" or the "Global virtual channels" connectors - I believe this is why the task is empty when sent to the Daqmx create channel vi.
The code we are currently using is a modification of a previous code used before a recent upgrade. It may be better in your/NI eyes to re-write this into a State machine but time constraints and resources do not allow that at this time - All other parts of the current program work except for the counter on the second iteration. Would rather not reinvent the wheel at this point.
If the task is being cleared was the issue then the other three should also not execute. The issue appears to be the "First Call"
I have attached a zip file of the complete program as it is now written to give you a better idea of the whole picture.
06-06-2006 01:51 PM
Well, my advice to get rid of the DAQ Assistant still applies. Create the task once and pass the task from frame to frame and don't clear it until the whole VI is over.
You might also want to look at adding some error in/error out wires. If you don't care about about sequencing some things, then you can leave it as is but certain frames might give you problems. For example, frames 1 and 2 have a digital write and an analog write. You have no way of knowing which will actually happen first or second. Where you place functions on a diagram makes no difference as to execution order.