Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't program the timed loop around a DAQ 6229 signal generator output

I put a timed loop around a finite signal output with the intent of getting periodic pulses.
 
It works fine for the default 1KHz clock and 1000 tick delay.  I can also program the delay to through the timed loop GUI.  It's now set at 2000.
 
The problem is that I can't wire up a variable to the dt count. 
 
I get an error "This node is not executable because an unexpected error occured during code generation.
 
What's going on?
 
I've attached the code.
 
Thanks,
Mark
 
 
Download All
0 Kudos
Message 1 of 4
(2,702 Views)

I replaced the Timed Loop with a While Loop and a timer and it works fine.

Too bad the timed loop doesn't work in this application. 

Since I struggled with the timed loop I'd like to know why I couldn't connect a wire to  "dt"  without it causing an error.

Right now it's a technical curiosity and I'm moving on.

Mark

0 Kudos
Message 2 of 4
(2,675 Views)

 

Hello Mark,

 

Thank you for posting to the discussion forum. I see that in your code you are trying to generate a periodic analog output signal by using the timed loop.

 

I have included a link to the help file on the Timed Loop. You can use this as a reference.

 

Timed Loop 

The timed loop is often used when you want loops to have multi-rate timing capabilities, precise timing, feedback on loop execution, timing characteristics that change dynamically, or several levels of execution priority.

 


The value that you have wired to the Period (dt) specifies the amount of time that elapses betwen two subsequent iterations of the timed loop. The unit of the period changes depending on the time source you select. Take a look at the following link for better understanding of what needs to be wired to the node.

 


Nodes of the Timed Loop

 

With regards to your application, if you want to write to your AO channel periodically, it would be more efficient to use a while loop. Perhaps consider moving your create channel, timing, and clear task outside the while loop. This will save processing time so you do not have to create and destroy the task every time it executes the loop.


Take a look at our shipping example. In LabVIEW, go to Help>>Find Examples. This opens NI Example Finder. In the Browse tab, Hardware Input and Output>>DAQmx>>Analog Generation>>Voltage, you will find various examples on how to write to your analog output channels.

Take a look at these resources and let us know if you are still running into issues.

 

Regards,
  Sandra T.

 

Applications Engineer | National Instruments

0 Kudos
Message 3 of 4
(2,669 Views)
Sandra,
 
Thanks for your help.
 
Oddly the issue with connecting to "dt" in the timed loop disappeared after I relinked the Timed Sweep VI.
 
It's almost as if the main VI was somehow corrupted and relinking the sub VI caused the main VI to recompile and it cleared the problem.
 
Anyway,  I'm using the timed loop now and it the results are much more predictable than the FOR loop.
 
Sorry for being such a pain.
 
Thanks again,
Mark
 
 
0 Kudos
Message 4 of 4
(2,657 Views)