| Data Acquisition Toolbox™ | ![]() |
out = getvalue(obj) out = getvalue(obj.Line(index))
obj | A digital I/O object. |
obj.Line(index) | One or more lines contained by obj. |
out | A binary vector. |
out = getvalue(obj) returns the current value from all lines contained by obj as a binary vector to out.
out = getvalue(obj.Line(index)) returns the current value from the lines specified by obj.Line(index).
By default, out is returned as a binary vector (binvec). A binvec value is constructed with the least significant bit (LSB) in the first column and the most significant bit (MSB) in the last column. For example, the decimal number 23 is written as the binvec value [1 1 1 0 1].
You can convert a binvec value to a decimal value with the binvec2dec function.
If obj contains lines from a port-configurable device, the data acquisition engine will automatically read from all the lines even if they are not contained by the device object.
Note Refer to the Vendor Limitations section before you access National Instruments devices with the NI-DAQmx adaptor simultaneously from multiple applications. |
Create the digital I/O object dio and add eight input lines to it.
dio = digitalio('nidaq','Dev1');
lines = addline(dio,0:7,'in');To return the current values from all lines contained by dio as a binvec value:
out = getvalue(dio);
![]() | getsample | inspect | ![]() |
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |