<< mdaqDIORead Data acquisition mdaqEncoderInit >>

MicroDAQ Support Package for Matlab/Simulink >> MicroDAQ Support Package for Matlab/Simulink > Data acquisition > mdaqDIOWrite

mdaqDIOWrite

Writes DIO channel

Calling Sequence

mdaqDIOWrite(dio, state)

Description

This function sets DIO channel output state. Function will return an error when DIO channel is configured as input or has alternative function (ENC1, ENC2, PWM1, PWM2, PWM3, UART).

DIO Bank containing selected DIO channel should be configured as an output with mdaq_dio_dir function. Selected DIO channel should be configured as a DIO function, if ENC1, ENC2, PWM1, PWM2, PWM3 or UART function is enabled on selected DIO channel, mdaqDIOFunc function should be used to disable it.

Parameters

Examples

% set DIO16 state
mdaqDIOWrite(16, 1)
pause(5);
mdaqDIOWrite(16, 0)

See Also


Report an issue
<< mdaqDIORead Data acquisition mdaqEncoderInit >>