Buying a DAQ device does not have to be costly. The NI USB-6000 is a USB-based DAQ device with 8 SE/4 DIFF analog input with 10 kS/s sampling rate and 12 bits resolution. It also has 4 DIO and a 32 bits counter. With so many features, it only costs $149. In this recipe, we will use DAQmx to work with such a device.
We will write an application that controls a NI USB-6000 with a state machine.