Jump to content

Object Oriented Programming for DAQ and Instruments


Recommended Posts

Hi,

 

Recently I have been trying to develop a set of classes for data aquisition (as the encapsulation makes other tasks easier) however I keep running into several issues (described below). I was wondering what you guys did for your OO DAQ systems. I've found a few presentations lying around on the net but their implementations do not seem to work when using DAQmx based measurements.

 

I am trying to measure the inputs from two seperate instruments: (1) Torque Sensor (2) Encoder. Sometimes these instruments might  be using a DAQmx analog input and other times a .DLL.

 

My original thought was that I would have a parent class called Measurement with several functions (Initalize, Configure, Read Data, Close) that would be over-riden by its children Analog Input (DAQmx) and Digital Input (Seperate .DLL). There then would be (for example) an Analog Input object created called position and a digital Input object called torque. This seemed to look nice on paper, however it didnt work as my DAQs tasks need to be combined (you cant have several tasks on a single device.)

 

As this didnt work, I approached it with a different setup. This time I had a parent class called Instrument that has two children Torque Sensor and Encoder. Again, things get tricky, as sometimes I might want to use an analog DAQmx task for both the Torque Sensor and Encoder. 

 

What is your typical OOP class structure like for DAQ?

 

Thanks!

Edited by df_rob
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.