LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital Output NI 9474 error

Solved!
Go to solution

Hello, 

 

I am trying to play around with NI 9474 to learn how digital outputs work with labview. However, I cannot even get the basic part down. I have a 9v battery hooked up to the device, and have a resistor element hooked up to one of the output terminals of the device. So, I am just trying to get labview to output a digital output. 

 

However, I am getting some error when I try to run the labview program. I tried searching my error on the knowledge base but was unable to find it. So, if anyone would help me on figuring out how digital output hardware works with labview, it would be great!

 

I have attached my block diagram!do error.png

 

Thank you

0 Kudos
Message 1 of 12
(2,402 Views)

Like the error says you need to configure a buffer for the data because your device doesn't support non-buffered hardware-timed tasks. How is your DAQ Assistant node configured?

 

You didn't attach your block diagram, you just sent a screenshot, so we have no way of knowing how the assistant was configured. In order to attach your code either upload the VI itself, or send a VI Snippet like this:

Slect the code on the block diagram, then go to Edit > Create VI Snippet from Selection. The latter is the easiest way to share simple code on the forums.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 12
(2,389 Views)

Sorry, I will attach the vi file.

 

 

0 Kudos
Message 3 of 12
(2,385 Views)

What data are you writing? There's nothing written to the data input in the VI you sent.

 

Here's a short article about that error with a USB DAQ. It seems to be related to not writing to the buffer before starting the task. I'm not sure how this works with the DAQ assistant, but this may be caused if you don't have an array of booleans written to the "data" input.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 4 of 12
(2,375 Views)

So I have a resistor connected to the output of the device. I am simply trying to turn on the digital output of the device so the resistor will have some voltage across it. 

 

I am not trying to write any data. I am simply experimenting how DAQ works with labview and so I am just trying something out. So, I am not sure as to how digital outputs work with labview. I thought all you would need to do is to tell labview when to turn on the digital outputs and it would work?

0 Kudos
Message 5 of 12
(2,365 Views)
Solution
Accepted by topic author kenypatel
This is pretty basic. If you are going to do a write, you have to specify values to write. For digital, values are true/false or 1/0.
0 Kudos
Message 6 of 12
(2,356 Views)
Solution
Accepted by topic author kenypatel

Oh ok, so DAQmx works by reading and writing values from DAQ devices. Since you're trying to set digital output values on a device you need to "write" the values to that device's channels from LabVIEW. With digital inputs and outputs, LabVIEW understands the values in the form of booleans (on or off = True or False). You need to write a True boolean to your DAQ Assistant data input to turn on a specific channel.

 

To get familiar with how DAQmx works, I would actually suggest you use MAX (Measurement and Automation Explorer) which installs with LabVIEW. With that you can use the Test Panels to read and write from connected devices. This will help you get familiar with read and writing from devices.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 7 of 12
(2,351 Views)

Ah so all I need to do is wire a boolean value or a numeric constant to the data port. It makes sense, I am just new to labview and am trying to experiment with it!

 

Thank you for your help!

0 Kudos
Message 8 of 12
(2,349 Views)

Hey, I am still having trouble. I cannot wire a true boolean constant to the data terminal of daq assistant. It says invalid data type, because the data type for daq assistant is array waveform.

0 Kudos
Message 9 of 12
(2,323 Views)

Insert a Build Array node in to that wire. It probably requires an array of data, but you only need a single value, so you need to input an array of just a single element.

 

Scratch that, it looks like you have your DAQ Assistant set to Continuous mode, which means it's going to try to write a whole waveform with a set sample rate, etc. I don't think you want this if you're just trying to set On or Off. Instead, double-click your DAQ Assistant and set to 1 Sample (On Demand) and it will then take in a boolean array. The array is becuase you might want to write to multiple digital channels, but in your case it's just the one, so it'll be an arraywith one element.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 10 of 12
(2,318 Views)