03-22-2023 04:24 PM
Hello,
I am very new to NI modules and LabVIEW and currently struggling on a fairly simple problem.
Before I dive into the actual project, I wanted to use a current output module (NI 9265) and voltage input module (NI 9201) to generate and read signals in real time (continuously).
To generate voltage signals for the voltage input module, I've setup a very simple circuit with a 100 ohm resistor, so that if I generate 0.01A of current, the voltage module should read 1V.
As I have only been instructed to use 'DAQ Assistant' for using the modules, the best I was able to do was as below.
The problem is that even if I change the control value from 0.01 to something like 0.02, the indicator stays at the same value (1V).
Only when I stop it and run it again, it changes to 2V. I have confirmed this by running it continuously, and stopping it every time I change the control value, then the indicator changes.
However, this is not how it should work, where what I want is the value to change without manually stopping the continuous run (hopefully I wouldn't have to run the whole model continuously, only run it once and let the while loop do the work).
I was wondering if this had something to do with how the NI 9265 assistant was set. So I went into the properties and deselected "use waveform timing" to match the samples to read and rate as same as the NI 9201 assistant.
However, doing this caused an error as shown below.
I am too new to this to even understand what the problem is and resolve the issue.
I would really appreciate some help.
Thank you.
Solved! Go to Solution.
03-22-2023 07:03 PM
Are you absolutely must only use DAQ assistant? Most users will tell you to avoid using DAQ Assistant and go with the DAQmx API. There are some good shipping examples that you can start with. They are available at Help >> Find Examples... >> Hardware Input and Output >> DAQmx.
See Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications to learn more.
Based on the error reported, your problem is with the timing configuration. What is your timing type, sample rate and the number of samples per channel? Can you provide a screenshot of the DAQ assistant configuration?
See Understanding and Avoiding NI-DAQmx Overwrite and Overflow Errors to learn more.
03-23-2023 01:45 PM
Thank you for the help. I will definitely look at the examples as I am not bound to Assistants if they are not good for applications. I was only using them as my lab member taught me.
For the error, the first screen shot is the read module setup and the second is the output module setup:
Would you be able to give me some intuition on how to set the "Samples to Write" and "Rate" for my application?
Thank you very much.
03-23-2023 03:31 PM
Specifying Number of Samples When Continuously Acquiring with NI-DAQmx for LabVIEW explains the concept very well.
03-23-2023 06:47 PM
Your output configuration all wrong if you want to output and hold a single value! Just use single sample on demand and write your scalar data point to the DAQ Assistant.
The configuration you show (Continuous) requires that 100 (your setting for samples to write) sample points (or a waveform with 100 y values) be written to the device buffer before starting the task. Wiring a 100 element array or waveform to the DAQ Assistant data input would work if you had to use the dreaded DAQ Assistant.
03-29-2023 09:35 AM
Actually, my intension is to read on a continuous manner, which is probably why LabVIEW automatically creates the loop.
One of my question is that if the DAQ module can generate at 100 kS/s (NI 9265) and read at 500 kS/s (NI 9201), which are the specs given by NI, why is generating 100 samples causing errors?
04-04-2023 06:57 AM
@gathanokos wrote:
Actually, my intension is to read on a continuous manner, which is probably why LabVIEW automatically creates the loop.
One of my question is that if the DAQ module can generate at 100 kS/s (NI 9265) and read at 500 kS/s (NI 9201), which are the specs given by NI, why is generating 100 samples causing errors?
Searching NI.com or Googling NI 9265, NI 9201 will turn up links to those user's manuals and specifications. Feel free to post those links and ask questions if you cannot understand specific terminology.