About the new function: read_all()

18 julio 2015

Recently we pushed new code to the firmware repository. Part of the reason was that we tried to improve the firmware documentation. But, also, a new function was added to the communications protocol: AIN_ALL, with function code #4.

This function is also implemented in the python library that will be released next week.

The new function returns a list with all the analog values at the openDAQ inputs, with very little latency between them (some hundreds of microseconds).

The openDAQ is not capable of doing simultaneous readings, but this feature may be enough for many applications that require fast swithching between channels.

Moreover, although the command is only accesible through command-response mode, thanks to the fact that the command only requires a single transaction through the serial port, the eight channels of the instrument can be read within a few milliseconds, which means that the transfer rate is high (better than 1kSPS) for the standards of openDAQ.

The sintaxis of the command is as following: 

odaq.read_all(self, nsamples, gain)


The only (optional) parameters are the number of samples (per point) and the gain of the analog channels. All the analog channels are forced to share the same gain, for reasons of simplicity.

All the analog channels are read in SE mode (referred to ground).


Hope that you, users, will find this function useful!