NI Home > Community > NI Discussion Forums
Reply
Active Participant
drohacek
Posts: 482

Re: VB6 with DAQmx compatibility with Microsoft Vista and Win7?

David -

 

Here is a DevZone article that you might find helpful in your efforts to move from VB6 and Traditional DAQ to VB.NET and DAQmx:

http://zone.ni.com/devzone/cda/tut/p/id/4344

 

 

David Rohacek

National Instruments

Member
Chapashop
Posts: 36
0 Kudos

Re: VB6 with DAQmx compatibility with Microsoft Vista and Win7?

David,

 

Thanks for your reply.  I went thru the documentation and it was very helpful.

 

I need to figure out if I can (actually 'want to') program NI-DAQmx with or without Measurement Studio.  I posted a question on a different forum.

 

I have a copy of Measurement Studio 7.1 (that I may want to upgrade) but I am wondering if I need it instead of using NI-DAQmx API.  Since I had to program without Measurement Studio (MS) when I was using VB6 with DAQmx I used the NI-DAQmx C API.  Although my experience was that MS made the development process easier I am wondering if not using MS would be one less thing to install.  My applications use fairly straightforward DAQ functions and the post processing of the acq is what the apps consist more of.

 

David

Active Participant
drohacek
Posts: 482

Re: VB6 with DAQmx compatibility with Microsoft Vista and Win7?

Your assessment is pretty spot-on. Measurement Studio is not required to create an application that uses the DAQmx .NET class library. However, MStudio does provide ease-of-use tools that should smooth your transition to Visual Basic .NET and DAQmx.

 

I'd like to mention that the DAQ Assistant integration that Measurement Studio provides for Visual Studio 2005 and Visual Studio 2008 is better than for Visual Studio 2003. In my opinion, it is far superior. In VS2005 and V2008, the DAQ Assistant generates components that are suitable for use directly in your application because:

  • The components do not include any user interface code
    • Instead, a separate tool allows you to generate user interface code suitable for a generated DAQ component; you can generate the code directly into your own Form
  • The components utilize partial classes, allowing you to add your own custom DAQ code to them, which will not get overwritten if you subsequently use the Assistant to re-configure the task
  • The components expose high-level events (e.g., DataReady) that make them easier to use from the rest of your code

 

In contrast, the VS2003 DAQ Assistant generates code that integrates the DAQ task configuration code, the DAQ reading/writing code, and the user interface code into a WindowsForms UserControl. This highly-coupled model is really suitable only for prototyping; integrating it into a larger applications requires a great deal of re-working.

 

So, if you assessed the MStudio-provided DAQ tools in version 7.1 and found them not useful enough to warrant their use, I'd encourage you to check out the tools for VS2005 and VS2008 (if you can use either of those environments). Other reasons you might need Measurement Studio are for the UI controls, the analysis library, the TDMS library, or the Network Variable library.

 

 

David Rohacek

Member
Chapashop
Posts: 36
0 Kudos

Re: VB6 with DAQmx compatibility with Microsoft Vista and Win7?

David,

 

 

Thanks for all the useful information.

 

Like I said previously, I have a copy of  MStudio 7.1 however I actually have never used it.  Someone else had purchased it when DAQmx devices were available and thought we could easily convert our existing code to .NET.  But we never got around to that, I ended up just using the DAQmx C API with VB6.

 

With Windows 7 in the horizon I guess we need to start moving ahead and away from VB6 and Windows XP and to Vista/Win7 and .NET.

 

Can you suggest if I can use MStudio 7.1 (standard) with VB.net 2005 or would you suggest moving to the latest version of MStudio?  I guess I can download the latest version as a trial for 30 days and use that.

 

David

Active Participant
drohacek
Posts: 482

Re: VB6 with DAQmx compatibility with Microsoft Vista and Win7?

David -

 

It is possible to use MStudio 7.1 libraries with VB.NET 2005. However, none of the MStudio Visual Studio environment integration features, including those that I  described in my previous post, will be available. MStudio 8.0.1 is the first version of MStudio that supported Visual Studio 2005. Another consideration is that the APIs designed for use with Visual Basic 2005 tend to be better than those designed for use with VB 2003, because they can take advantage of .NET Generics.

 

 

I'm not is a position to offer an unbiased opinion on whether you should upgrade or not. I think your best bet, as you suggested, is to use the evaluation version to determine if there is enough value in the product to warrant the expense. Instead of or before downloading and installing the eval, you might want to try the videos or online eval - http://www.ni.com/mstudio/try/.

 

I do need to point out that the MStudio Standard Edition does not include the DAQ Assistant integration features that I described in my previous post, so you would need to look at the Professional Edition for that functionality.

 

David Rohacek

National Instruments

Member
frankbruvold
Posts: 1
0 Kudos

Re: VB6 with DAQmx compatibility with Microsoft Vista and Win7, and CWDAQ.OCX?

I use cwdaq.ocx component with vb6.0 on XP with a PCI6503 card and CB50LP socket and it works writing some digital outs.

I try this on Win7 but get an error message: Invalid Index on the line     .Ports(0).Assignment = cwdioOutput

Is this because i do not have my CB50LP connected or is it not possible to use the (old 2000) cwdaq.ocx on Win7.

The demo apps. seems to run, but i have not tested with CB50LP connected.

My code looks like:

  With Bilvekt.DIO
    ' assign the port to output
    .Ports(0).Assignment = cwdioOutput

    Select Case LysKode
      Case 1
        .SingleWrite 4
      Case 2
        .SingleWrite 1

 

Do i have to rewrite my code according to the demo program or is it possible to use my code?

Member
JD_war_eagle
Posts: 126
0 Kudos

Re: VB6 with DAQmx compatibility with Microsoft Vista and Win7, and CWDAQ.OCX?

Hi frankbruvold,

 

Are you still using the VB 6 environment in Windows 7 or have you moved to a VB .NET environment?  If you have migrated to a .NET environment then you can get some details on how to upgrade your application in this article: http://digital.ni.com/public.nsf/allkb/1F882DF4142FBA7786256AFC006007BC?OpenDocument.  If the example programs you are running seem to be different than your previous code, you are likely using a .NET environment now.  You can try importing the code with the upgrade wizard, but parts will still likely by incompatible and need to be rewritten.

Justin D
Applications Engineer
National Instruments
http://www.ni.com/support/