Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Acquire Non-Clocked Digital Data

This example shows how to read data using two channels on an NI 6255

Find devices connected to your system and find the ID for NI 6255:

d = daq.getDevices;
d = 

Data acquisition devices:

index Vendor Device ID          Description         
----- ------ --------- -----------------------------
1     ni     Dev1      National Instruments USB-6255
2     ni     Dev2      National Instruments USB-6363

Create a session and add two lines from port 0 on Dev1:

s = daq.createSession('ni');
addDigitalChannel(s,'Dev1','Port0/Line0:1','InputOnly')
ans =

Data acquisition session using National Instruments hardware:
   Clocked operations using startForeground and startBackground are disabled.
   Only on-demand operations using inputSingleScan and outputSingleScan can be done.
   Number of channels: 2
      index Type Device   Channel   MeasurementType Range Name
      ----- ---- ------ ----------- --------------- ----- ----
      1     dio  Dev1   port0/line0 InputOnly       n/a
      2     dio  Dev1   port0/line1 InputOnly       n/a  

Acquire digital data:

inputSingleScan(s)
ans =

     1     0
Was this topic helpful?