Connect C++ with DAQ: A Beginner's Guide

  • Context: C/C++ 
  • Thread starter Thread starter babistopher
  • Start date Start date
  • Tags Tags
    Connection
Click For Summary

Discussion Overview

The discussion revolves around connecting C++ with data acquisition (DAQ) systems, specifically focusing on programming challenges faced by a beginner. Participants explore the feasibility of using C++ versus Visual Basic (VB) for data handling and the integration of existing software components.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant is tasked with writing a C++ program to collect data from two DAQ cards and save it, expressing uncertainty about how to connect C++ with the DAQ systems.
  • Another participant suggests that using Visual Basic might be easier, especially since one DAQ card already has a VB .dll solution, questioning the necessity of C++ for the task.
  • The original poster clarifies that the project is for research and not an assignment, and mentions contacting the second card's vendor, who does not provide a C++ support library.
  • There is a discussion about the possibility of using a .dll file found through Matlab to aid in programming.
  • One participant notes the complexity of learning programming through this project, especially for someone without a strong math background, and suggests looking for existing code online that could assist.
  • Another participant explains the MFC (Microsoft Foundation Classes) context of the existing program and questions whether the original code is well-commented for understanding.
  • Participants discuss the importance of understanding the architecture and protocol of the DAQ card interface to effectively write the necessary code.

Areas of Agreement / Disagreement

Participants express differing opinions on the appropriateness of using C++ versus Visual Basic for the project. There is no consensus on the best approach, and the discussion remains unresolved regarding the optimal programming strategy.

Contextual Notes

Participants highlight limitations in the original poster's programming knowledge and the lack of available support libraries for C++. There are also unresolved questions about the specifics of the DAQ card interfaces and the existing code's functionality.

Who May Find This Useful

This discussion may be useful for beginners in programming, particularly those interested in interfacing with DAQ systems, as well as individuals exploring the use of C++ and Visual Basic in data acquisition contexts.

babistopher
Messages
15
Reaction score
0
I am supposed to write a program using C++ that will take data collected by two separate DAQ cards and save them as either a text or spreadsheet file. Now, I'm still new at C++ and I do not even know where to begin. How am I even supposed to make a connection between Visual Basics and the DAQ? Note that only one of them has a .dll file (the program for that one is already done) and there is still the one without the .dll. Thanks!
 
Technology news on Phys.org
DAQ is usually associated with some sort of device and maybe a device driver. It sounds like you already have a VB dll solution for one - why not use VB simply on that one?

I do not see why C++ is a requirement, especially if you don't know it at all. All of this can be done less painfully in VB. Is this a class assignment?

Have you contacted the second card's vendor for a support library?
 
Hey, thanks for the quick reply. This isn't for an assignment. I'm doing research at CSTAR and I was asked to see if I could figure out how to make the program I described above. Although I actually don't know anything about programming, I am happy that I at least have a chance to learn a little bit of it.

So to answer your questions: I did call the manufacturers of the second card and they don't have a support library for C++. Now, I just noticed something. I am using Wincom (through Matlab) and a .dll file popped up in the file. Could I use this file to create the program?

Also, you said that it could be more easily done in VB. Could you go a little bit more into that?
 
Also, the program that is already done was made by another guy and I am trying to work backwards from what he has done. Unfortunately, I do not even know how he coded it. He made an MFC .exe file and I don't know how that came about. If you have an idea about how I could modify this program he's made then please let me know.
 
No offense - unless you have a really good math background, learning to program by taking on that project is probably a very difficult assignment. Even with good math skills it will take you a long time to write something like that.

MFC= microsoft foundation classes which is part of VC++ v6.0. So the .exe is from C++ source.

From your first post, I thought you knew VB.

You best bet is to find code off the internet that does what most of what you need to do.
Do you know what the architecture and protocol of the card interface is - serial/parallel/usb/ethernet/prorietary?

Let's assume serial for an example -
goto a site like codeguru.com, planetsourcecode.com (these work for most protocols)

1. search for C++ code that accepts a data stream from a serial device, for serial it is a COM port. For ethernet it will be using a specific TCP/IP port number. Maybe you can use the last guy's C++ code - I dunno. Did he comment his code? Can you figure out what each function does?

2. go to the vendor's site (or look through their manual) and figure out what is going on with the input datastream. See if you can hack the code you got into playing with the input stream. It will specify things like 8bit parity, or which TCP/IP port to listen to.

And IMO, MFC obfuscates things a lot for a beginner. Is there no advanced programmer around you can get one-to-one help from?
 
Believe me I have taken no offense whatsoever. I am a complete n00b at programming in general and I know it. I will look into what you said and it turns out that there may be a programmer here that can help me. Thanks a lot for you help.
 

Similar threads

Replies
81
Views
8K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 19 ·
Replies
19
Views
2K
Replies
69
Views
11K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 25 ·
Replies
25
Views
3K
Replies
89
Views
7K
  • · Replies 86 ·
3
Replies
86
Views
13K
Replies
5
Views
8K