| Data Acquisition Toolbox | ![]() |
Example: Writing and Reading Digital Values
This example illustrates how to read and write digital values using a line-configurable subsystem. With line-configurable subsystems, you can transfer values on a line-by-line basis.
You can run this example by typing daqdoc7_1 at the MATLAB command line.
dio for a National Instruments board. The installed adaptors and hardware IDs are found with daqhwinfo.
data = 3; putvalue(dio.Line(5:8),data) val3 = getvalue(dio.Line(5:8)); bvdata = dec2binvec(data,4); putvalue(dio.Line(5:8),bvdata) val4 = getvalue(dio.Line(5:8));
Read values from the last four lines but switch the most significant bit (MSB) and the least significant bit (LSB).
dio, you should remove it from memory and from the MATLAB workspace.
| Reading Digital Values | Generating Timer Events | ![]() |