If your DAQ device has digital output lines, you can use the DAQmx API to perform digital out tasks.
We cannot perform continuous generation on a device that is only capable of on-demand output. To perform on-demand digital output, we have a couple options:1. DAQ Assistant
Place down a DAQ Assistant in your block diagram (Right-Click Block Diagram >> Measurement I/O >> NI DAQmx
) and a configuration window should pop up. Click on Generate Signals >> Digital Output >> Either Line Output or Port Output
. The DAQ Assistant will output whatever data you wire into its 'data' terminal: 2. DAQmx API
You can also use the DAQmx API to output digital signals. We can specify the specific line on the port and write to it:
Or, we can set an entire port as the output. In this case, we can specify the input as either an array of booleans:
Or an integer:
The integer will be converted to binary to be written out to the port; in this case all the lines on port 0 will be high except for line 0.