LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Single Analog Output Pulse Using Low Level Blocks

Solved!
Go to solution

Hi all,

 

I'm fairly new to LabVIEW so I'm fairly sure there is a simple way to do this, I just haven't been able to figure out how. I need to create 2 different single pulse analog outputs. Both pulses start and end at 0V. One pulse rises to 3.3V while the other rises to 6V. I attached an image below that shows the pulses I`m trying to create. I`ve achieved this so far by using the Simulate Signal and DAQ Assistant functions (see AO_Trigger_DAQAssistant.vi code attached), but I was wondering if there is a way to do this using the lower level LabVIEW blocks. I pretty much have to convert the code I have using the DAQ Assistant to code using the lower level functions.

 

I`m making the pulses only last a second and only half of a sine wave by setting the frequenct in the Simulate Signal Function to 0.5Hz and only sampling for 1 second at the DAQ Assistant. I`ve started doing this using the low level functions (see code AO_Triggers_LowLevel.vi attached) but I just don`t know how to set the pulse properties at the DAQMx Write function.

 

Any help with this issue is greatly appreciated. Thank you,

Alberto M.

 

Below is an image illustrating the pulses that I need to create with my analog outputs. Attached is also the code I made using the DAQ Assistant.

AO Triggers.png

Download All
0 Kudos
Message 1 of 6
(4,211 Views)

First of all, usually when one says "Output Pulse", they mean a digital TTL pulse from a Digital Output port -- set to True for a High (nominally 5V) and False for a Low (nominally 0V).

 

Go into Google and search for "Learn 10 Functions in NI-DAQmx", read the article, and use that to replace the DAQ Assistant.  Also, get rid of the Dynamic Wires -- use Waveforms or Arrays, instead.

 

Bob Schor

Message 2 of 6
(4,198 Views)
Solution
Accepted by topic author martiaa3

From LabVIEW, if you navigate to Help -> Find Examples, you can search for a ‘Voltage – Finite Output.vi’ (this VI can be found manually under the Hardware Input and Output -> DAQmx -> Analog Output folders in the NI Example Finder). This example code would be a great place to start since you’re interested in working with the low-level DAQmx functions; I was able to mimick your desired output by altering the front panel settings of this particular VI.

Ross S.
Applications Engineering
National Instruments
Message 3 of 6
(4,129 Views)

Thank you for the reply, Ross.

 

I was able to mimic my desired output for one function using this example. How do I generate a 2nd output waveform? Do I need to set up another channel and use new low level blocks or would this be similar to an analog input where I can use a single "DAQmx Write" and "DAQmx Read" functions?

 

All suggestions are greatly appreciated!

0 Kudos
Message 4 of 6
(4,092 Views)

I was able to basically duplicate the code that I used to get a single sine wave output and have one instance (task) trigger based on the other one starting. I wasn't sure whether or not you needed the two outputs to be synchronized, but true synchronization requires the two tasks share a sample clock (master timebase) and start trigger. Take a look at the 'Analog Input - Synchronization.vi' in the DAQmx Synchronization examples. It shows how you might implement your desired architecture. Post any questions you have!

Ross S.
Applications Engineering
National Instruments
Message 5 of 6
(4,061 Views)

Thanks for the reply. I took a read through the article and I think I was able to recreate my desired outputs.

 

Cheers,

Alberto M.

0 Kudos
Message 6 of 6
(4,015 Views)