Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

VB6 with DAQmx compatibility with Microsoft Vista and Win7?

Solved!
Go to solution

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

Message 11 of 20
(10,940 Views)

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

0 Kudos
Message 12 of 20
(10,927 Views)

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

Message 13 of 20
(10,909 Views)

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

0 Kudos
Message 14 of 20
(10,907 Views)

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

Message 15 of 20
(10,885 Views)

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?

0 Kudos
Message 16 of 20
(9,033 Views)

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/
0 Kudos
Message 17 of 20
(9,010 Views)

Hi,

 

As my old machine is spolit, so I get the new machine (win7x64) and I when try to install the NI 7.3 installer, I cant find the NI6508 DAQ hardware.

I tried to Installed the latest version 9.8, the hardware is found but I cant use the CWDAQ.OCX.

 

I read up the forum, it say that I will need to use DAQmx on x64 machine. But apparently I cant use my existing code based on the OCX.

How do I go about it without changing my VB6 code (as it is done by other people). 

 

Best Regards,

Jeremy

 

0 Kudos
Message 18 of 20
(8,369 Views)

I had to rewrite the code handling the IO card acording to the code in the demo app. But still use VB6 (on Win7/64)..

0 Kudos
Message 19 of 20
(8,365 Views)

For my old vb6 programs that I still must maintain I use NI-DAQ v7.4. This is actually a beta that, as far as I know, was never released as RTM. Anyway, it works fine with the traditional stuff and it works with Windows 7. You just have to be sure NOT to install the Ni-DAQmx stuff because it will conflict with the old stuff.

I use a multi-boot setup of Windows 7. One partition is used for traditional development and the other partition has the latest NI drivers for new development.

The only down-side of this configuration is that I have to reboot in order to move from one environment to the other.

0 Kudos
Message 20 of 20
(8,048 Views)