data acquisition in C++


Thread Starter


I am new to data acquisition and am doing a project on the subject. I have a data acquisition board with 16 single ended analogue inputs and 4 outputs. I have an input channel attached to a linearizer and then to a RTD. i have an output channel attached to an analogue power controller with 0 to 10 volts attached to a heating element.
I want to write a c++ application to read the temperature from the RTD (monitor) and adjust the heating element(control) to raise or lower the temperature to a user specified temperature.
The problem is i do not know a lot about reading/writing analogue signals and was wondering if anyone has any sample code or advice on the area.

all help appreciated.

Curt Wuollet


Most cards come with some sort of library that provides routines to get inputs and set outputs. I would assume that the linearizer also provides a voltage output. Your DAC can likely be set to 0-10V as well. Simplest case is a loop that compares the RTD reading to a setpoint and turns on the heater if temp is below setpoint. From there you can get as sophisticated as you want. I would bet the card software includes examples that can get you this far. Most of these are a free download from the card manufacturer. If you are using Linux then the manufacturers software is absolutely useless but the examples still may be of use. OSS drivers are easy to find for most popular cards. Try poking around the Linux Lab Project. Once you can manipulate your card, check back for bounded PID loops with asymmetrical hysteresis. :^)


I think you have got with your data acquisition board some libraries concerning reading and writing analog signals. You will be also able to choose the range of the analog input and output.
After you have to calibrate your signals, particularly you temperature input, and
finally use a regulation function. Fuzzy regulation is simple to use and you will find many articles on the web.

[email protected]

James Ingraham

Who makes the data aquisition board? They should be able to provide you with sample code.

Sage Automation, Inc.