LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous Sample TTL signal generation with DAQmx

OK I know this has been asked many times but it all sees like different versions. I currently have a continuous data collection going for about 10 analog input signals at 10kHz. All working great.  I would like to replace an existing function generator (physical unit) with a command from labview. Always producing a square wave (TTL) 0-5 volt with a constant frequency and duty cycle.   My DAQ is one of the USB styles not sure of the model BNC interface primarily cost quite a bit $3k.  I cannot find any sample code to do this.  I don't use DAQ Assistant in my original code.

 

I would like to think I would just add the digital output to my continuous while loop but am not sure how it is done.  I could upload my analog input code but it would be fairly meaningless as it is full of signal labeling etc.

 

So I guess the quick question is. How to generate a TTL signal in continuous sampling mode (10kHz) without using DAQ assistant.  I'm basically commanding a solenoid to open and close which my system is taking high speed data.

thanks

Jason

0 Kudos
Message 1 of 5
(465 Views)

If it's continuous you can just run a separate task and you won't need to "service" it. If your DAQ is a new-ish model (63xx or 64xx) your digital outputs will have a clock source they can use. If it's a 62xx or 61xx you would need to do some shenanigans with other clocks but those are pretty old.

 

Use Help - Find Examples and see if you can find a digital output example. That would get you up and running super quick.

0 Kudos
Message 2 of 5
(462 Views)

Or better yet, just use a counter task to generate a continuous pulse train.  No buffers or bus bandwidth needed.   There's a shipping example to show how.

 

 

- 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.
Message 3 of 5
(424 Views)

@Kevin_Price wrote:

Or better yet, just use a counter task to generate a continuous pulse train.  No buffers or bus bandwidth needed.   There's a shipping example to show how.

 

 

- Kevin P


BertMcMahan_0-1729101470737.gif

 

0 Kudos
Message 4 of 5
(416 Views)

Thanks Kevin P. 

I'll look into this option. I've never really used NI HW for outputs, just inputs. I've seen a number of forum posts related to generating output signals but not typically along with DAQmx code as well. Merging those two together is where I often struggle. To me the DAQmx blocks are just nonsense. I want to record a signal or in this case output a pulse pattern. I don't care about start tasks, end tasks, etc. The "Voltage - Continuous Output.vi" is obnoxiously long to send out a sine wave output to an AO channel. It's fine for the power user but those of us that write new labview code once every 3 years not as fine.

 

Thanks again Kevin. I'll look to the counter code provided.

Jason

 

0 Kudos
Message 5 of 5
(388 Views)