LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cDACMx Error

Solved!
Go to solution

Hi

 

I have this subVI that is suppose to output signals to my cDAC.

SubVI blcok diagram.PNG

 

Output_Waveform.vi block diagram

SubVi Inputs.PNG

 

As the above block diagram shows at the end of each loop, I get a pop up message to continue or stop.

 

The problem I have is that after the first loop, I get the pop up message and if I press 'continue', I get the following error message:

Error Msg.PNG

 

I do not understand why the task I have passed to the subVI is not being recognised for the second loop.

 

Where did I go wrong?

0 Kudos
Message 1 of 6
(2,896 Views)

Hi sherzaad,

 


@sherzaad wrote:

Where did I go wrong?


It's not a good idea (aka: it's a very bad idea) to delete DAQmx tasks in your loop, but still want to use the DAQmx task reference in the next iteration…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,888 Views)

@GerdW wrote:

Hi sherzaad,

 


@sherzaad wrote:

Where did I go wrong?


It's not a good idea (aka: it's a very bad idea) to delete DAQmx tasks in your loop, but still want to use the DAQmx task reference in the next iteration…


sherzaad_0-1583416855527.png so if I understood you correctly, then deleting this block should solve my issue, right?

 

 

0 Kudos
Message 3 of 6
(2,858 Views)
Solution
Accepted by topic author sherzaad

Hi sherzaad,

 


@sherzaad wrote:


so if I understood you correctly, then deleting this block should solve my issue, right?

Don't delete the DAQmxClear function, but move it after the loop.

You also should move the DAQmxTiming function before the loop. You also don't need to wire the N input of the FOR loop.

 

(Hint: Use MatrixSize instead of ArraySize when you need the number of rows/columns as separate wires…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,853 Views)
Solution
Accepted by topic author sherzaad

I would have placed a DAQmx Stop where you had previously placed DAQmx Clear.  (Although I'm actually not 100% sure it'll be necessary for a Finite Sampling task which might automatically revert to stopped state when you "wait until done".)   The task ref remains valid and suitable for reuse after a Stop but not after a Clear.

 

I also agree with all the points GerdW already made.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 5 of 6
(2,838 Views)

@Kevin_Price wrote:

I would have placed a DAQmx Stop where you had previously placed DAQmx Clear.  (Although I'm actually not 100% sure it'll be necessary for a Finite Sampling task which might automatically revert to stopped state when you "wait until done".)   The task ref remains valid and suitable for reuse after a Stop but not after a Clear.

 

I also agree with all the points GerdW already made.

 

 

-Kevin P


 

Yeah... I realised (better later than never!) that I should inlcude the DAQmx Stop block. 

 

All working fine now.

 

Thanks @GerdW and yourself! 

0 Kudos
Message 6 of 6
(2,807 Views)