How do you send a digital signal as an output to NI DAQ system?
52 views (last 30 days)
I'm starting to learn DAQ in simulink and I have a question on how to send Digital I/O signals to my daq device (NI USB-6009). So, here is my simple test set for Digital I/O connections.
Basically, I'm trying to send a sample of digital (or binary) data to the DAQ and make the valve which is connected to DAQ to be open or closed. The simulation itself runs fine without any error. However, the valve does not close or open, which means that the binary data sent out did not trigger the voltage output in the DAQ. I don't know what I'm doing wrong. I would really appreciate if you could tell me how to resolve this issue.
(I used the information in https://www.mathworks.com/help/daq/digitaloutputsinglesample.html for the Simulink)
LO on 15 Jul 2020
See the properties of your daq by typing its device name in command line. See how the channels are called and which types you have. you have to use the digital output code d = daq("ni"); addoutput(d,"Dev1","Port0/Line0","Digital") For example. But you can use also port 1 and other lines. It depends. Use the ni max software to test the channel. In that software you can also find a help to properly configure the output and know which gpio to use.