User Tools

Site Tools


jvs:cigal:manual:chapter6:r_aread

CIGAL Reference Manual, Chapter 6 (RealTime): r_aread

r_aread -- Read analog input channel(s)

usage: r_aread opflg eflag ltime Databuf ChMask [Timbuf Rowflag]

R_AREAD is a REALTIME operator. It reads data from the analog input device and stores them in the short array DATABUF. CHMASK is a bit mask specifying which analog channels to read; when more than one bit is set the data are stored in sequential locations with the lowest specified channel being stored first. If ROWFLAG is specified it indicates that DATABUF is to be treated as a matrix with the different channels being stored in separate rows of the matrix; the value of ROWFLAG specifies the row length (in 16-bit words).

If TIMBUF is used it specifies a long array that receives the value of the clock counter at the end of the read operation; for multi-channel reads only a single time value is stored. The TIMBUF data pointer is automatically incremented if the DATABUF pointer is specified for autoincrementation (e.g. buf++).

Examples:

   r_aread - - - buf 4              ; read 1 value from analog channel 3 (0100b)
   r_aread - - - buf++ 5 buf        ; store 32-bit timestamp and 2 16-bit values
                                    ; (channels 0 and 3) in successive locations
                                    ; in BUF; advances BUF 8 bytes when done
   r_aread - - - buf++ 5 tbuf 1000  ; store timestamps in long array TBUF, analog
                                    ; channel 0 in the first 1000 entries of BUF
                                    ; and channel 3 in the next 1000 entries;
                                    ; BUF advances 2 bytes when done

See Also:
CIGAL Home, CIGAL Manual, RealTime List, Manual Help

jvs/cigal/manual/chapter6/r_aread.txt · Last modified: 2023/02/23 18:43 (external edit)