NI DAQ channel terminal in MATLAB is read-only

5 visualizaciones (últimos 30 días)
Hyalex Ortho
Hyalex Ortho el 27 de Feb. de 2023
Respondida: Hyalex Ortho el 1 de Mzo. de 2023
Hello, I am using an NI-9422 to read in a signal for motor speed. I am reading in through the data acquisition toolbox in MATLAB. I can read the frequency fine for 1 terminal but I am struggling to understand how to read multiple terminals or a specific terminal.
For instance, the current assigned terminal is PFI5 and if I try to assign a variable ch to my channel and then re-assign the ch.terminal as PFI7 it says it's read only. I've also unplugged, and plugged the chassis back in and the default terminal changes which I can only solve by moving my wires.
What am I missing? Thanks for any help.

Respuesta aceptada

Hyalex Ortho
Hyalex Ortho el 1 de Mzo. de 2023
I realized I need to change the 'ctr0'/'ctr1'/'ctr2' when adding the input. Device pinout on the NI MAX was helpful.

Más respuestas (1)

chrisw23
chrisw23 el 28 de Feb. de 2023
As long as the PFI is configured as Input it should be readOnly.
Each PFI line can be individually configured as a static digital input or a static digital output.
Check the current I/O state.
  4 comentarios
Hyalex Ortho
Hyalex Ortho el 1 de Mzo. de 2023
I see, I am trying to read in more than 1 input, so how do I pull data in from the other PFI terminals? It seems to default me to PFI5 and I don't know when adding my input how to specify which terminal I'm reading in from. I'm not trying to change the name or write to it, just trying to access a different terminal.
chrisw23
chrisw23 el 1 de Mzo. de 2023
I'm not using the DataAcqToolbox but the DAQmx API instead but I think it is similar.
When you define the task you have to add all channels you want to use and you can't get access to a channel that is not defined for that task.
i.e.
obj.ContinuousAnalogInTask.AIChannels.CreateVoltageChannel(...
% physicalChannelName
% nameToAssignChannel (alias)
% enum NationalInstruments.DAQmx.AITerminalConfiguration
% minimumValue
% maximumValue
% NationalInstruments.DAQmx.AIVoltageUnits

Iniciar sesión para comentar.

Categorías

Más información sobre Data Acquisition Toolbox Supported Hardware en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by