putvalue - Write values to digital input and output lines

Syntax

putvalue(obj,data)
putvalue(obj.Line(index),data)

Arguments

obj

A digital I/O object.

obj.Line(index)

One or more lines contained by obj.

data

A decimal value or binary vector.

Description

putvalue(obj,data) writes data to the hardware lines contained by the digital I/O object obj.

putvalue(obj.Line(index),data) writes data to the hardware lines specified by obj.Line(index).

Remarks

More About Writing Values to Lines

Examples

Create the digital I/O object dio and add four output lines to it.

dio = digitalio('nidaq','Dev1');
lines = addline(dio,0:3,'out');

Write the value 8 as a decimal value and as a binary vector.

putvalue(dio,8)
putvalue(dio,[0 0 0 1])
  


 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS