<< mdaqEncoderInit Data acquisition mdaqKeyRead >>

MicroDAQ toolbox >> MicroDAQ toolbox > Data acquisition > mdaqEncoderRead


Reads quadrature encoder

Calling Sequence

[position, direction] = mdaqEncoderRead(module)
[position, direction] = mdaqEncoderRead(linkID, module)


This function reads current value of quadrature encoder (ENC1, ENC2) position register on selected ENC module. Function returns current position and rotation direction. Value of direction indicates rotation direction (0 - no motion, 1 - CW, 2 - CCW).

The quadrature encoder pulse (ENC) module is used for direct interface with a linear or rotary incremental encoder to get position, direction, and speed information from a rotating machine for use in a high-performance motion and position-control systems.

Input arguments

Output arguments


// mdaqEncoderRead usage example
link_id =  mdaqOpen(); 
// initialize quadrature encoder with 0 
mdaqEncoderInit(link_id, 1, 0); 
// read quadrature encoder module 1
mdaqEncoderRead(link_id, 1)

See Also

Report an issue
<< mdaqEncoderInit Data acquisition mdaqKeyRead >>