Simulink Analog Input from NI cDAQ-9185?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Kyle Smith
el 29 de Nov. de 2022
Respondida: Manoj Mirge
el 20 de Mzo. de 2023
Hello everyone, I am trying to send and read analog signals to/from Simulink using the NI cDAQ-9185 chasis that has an analog input (AI-9239) module and an analog output (AO-9269) module.
I have been successful in sending a signal to the cDAQ using the "Analog output (single sample)" block from the Data Aquisition Toolbox, but the "Analog input (single sample)" block from the same library doesn't appear to recognize the the connected device at all.
I have used the NI Max app to ensure the cDAQ device is "reserved" and have tested both modules. I then used the Matlab command line to see if the devices were recognized and they are. I got this:
>> d = daq.getDevices
d =
Data acquisition devices:
index Vendor Device ID Description
----- ------ ------------- ------------------------------------------------
1 ni Analog-Input National Instruments(TM) NI 9239
2 ni Analog-Output National Instruments(TM) NI 9269
3 ni SimDev1 National Instruments(TM) NI Simulated DAQ Device
>>
I even went a step further and used the Matlab apps "Analog Input Recorder" and "Analog Ouput Generator" simulanteously to see if I could send and receive data, both worked.
In the pictures below are the block parameters. You can see in the Analog Ouput block it is connected to the cDAQ, but the Analog Input block doesn't have this option (it only sees some other item from another USB port that I have my keyboard plugged into).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1212638/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1212643/image.png)
Here is what the NI Max program displays:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1212648/image.png)
Thanks in advance for the help.
0 comentarios
Respuesta aceptada
Manoj Mirge
el 20 de Mzo. de 2023
Hi Kyle,
You can use Analog Input (Single Sample) block only with devices that support single sample acquisition. You can check whether your device support signal sample acquisition or not. If your device does not support signal sample acquisition, then you can’t use Analog Input (Single Sample) block for that device.
To acquire data from devices that do not support acquisition of a single sample (such as devices designed for sound and vibration), use the Analog Input block.
Hope this helps.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Acquisition Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!