Changing range voltage for NI acquisition : how to solve : Warning: Cannot support range of -5.0 to +5.0 Volts. Range set to -10 to +10 Voltt ?
12 次查看(过去 30 天)
显示 更早的评论
i try to change voltage range for NI card acquisition. If i use Daq Express or labview it works but from matlab i can't.
The code :
clear
close
clc
% %% acquisition
dq = daqlist("ni")
deviceInfo = dq{1, "DeviceInfo"}
%%
dq = daq("ni")
dq.Rate = 2000;
ai2 = addinput(dq, "Dev5", "ai2", "Voltage");
ai2.Range = [-5 5];
ai2.TerminalConfig = "SingleEnded"
Et voici l'erreur :
Warning: Cannot support range of -5.0 to +5.0 Volts. Range set to -10 to +10 Volts.
0 个评论
采纳的回答
Mario Malic
2024-1-22
编辑:Mario Malic
2024-1-22
Hello!
It's just a warning, it will work, range is still in between -10V and 10V. Why wouldn't you utilize the full range of your acquisition channel? For example, if you have a sensor with specific sensitivity that will produce Voltage signal that is above 5V or below -5V, you wouldn't measure signal correctly as it would be overloaded.
Also, this is a property of an acquisition card, some cards (maybe none?) do not support adjusting the range.
It might be of help, still in a development stage. I made this to acquire data from NI devices easily. Hopefully it works on R2021b. https://uk.mathworks.com/matlabcentral/fileexchange/128118-daqx
3 个评论
Mario Malic
2024-1-22
编辑:Mario Malic
2024-1-22
It is not neccessary to change the range. This Range property is related to the acquisition device, not the sensor.
Your measurement device will output the 5V signal and it is not going to cause any issue with the measurement.
更多回答(1 个)
Hassaan
2024-1-22
- Driver Limitations: The MATLAB Data Acquisition Toolbox may not fully support all features of the NI hardware driver that are available in LabVIEW or NI-DAQmx.
- Hardware Constraints: The NI card itself may have limitations on the supported ranges based on the mode you're using (for example, SingleEnded vs. Differential).
- Software Configuration: The configuration of the NI card through MATLAB might have constraints that differ from the configuration through LabVIEW or NI-DAQmx.
Here are some steps to troubleshoot:
- Check Compatibility: Ensure that your version of MATLAB, the Data Acquisition Toolbox, and the NI driver are all compatible and up-to-date.
- Consult Documentation: Refer to the documentation for both your NI card and the MATLAB Data Acquisition Toolbox to confirm the supported voltage ranges.
- Test Range Support: Try testing different supported ranges programmatically to see if any others are accepted. Sometimes, NI cards support a limited set of ranges in certain configurations.
- Device Configuration: Check if the device needs to be configured differently in MATLAB compared to LabVIEW or NI-DAQmx.
- Software Reset: Sometimes resetting the device configuration through the NI Measurement & Automation Explorer (MAX) can resolve software conflicts.
- Contact Support: If you continue to experience difficulties, consider reaching out to MathWorks Support for assistance specific to the Data Acquisition Toolbox.
-----------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
It's important to note that the advice and code are based on limited information and meant for educational purposes. Users should verify and adapt the code to their specific needs, ensuring compatibility and adherence to ethical standards.
Professional Interests
- Technical Services and Consulting
- Embedded Systems | Firmware Developement | Simulations
- Electrical and Electronics Engineering
Feel free to contact me.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Acquisition Toolbox Supported Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!