Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Software development using VB6.0 for NI 6229 MIO card

Hello,

I have been till date using the 6024E series cards for all my data acquistion needs. The user interface and application software was developed in VB6.0 and Windows_XP.

For want of enhanced I/O count I recently purchased a PCI 6229M card. This as I understand is to be used with NIDAQmx software. Now NIDAQmx has no support for VB6.0.

So what do I do now ? Will my routines developed in VB6.0 using NIDAQ6.9.x run normally on PCI 6229M card ? Can someone give me the required things to be done to run the 6229M card using an application done in VB6.0?

Thanks

Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 11
(5,703 Views)
Hi Raghunathan,

Unfortunately, code written in Traditional NI-DAQ will not run on the new M-series cards. The M-series cards only support DAQmx. Currently we only have VB6 support for Traditional DAQ. However, we are working hard to bring our customers DAQmx support in VB6. I cannot say when this will be available but it is in the works.

For now, you may need to consider using LabVIEW or ANSI C to control your new M-series card. LabVIEW comes with MANY shipping examples that take advantage of your card's features. Using LabVIEW and the DAQ Assistant it will be very easy to use your DAQ card and perform measurements.

Please let me know if you have any further questions.

Thanks,
Sal
0 Kudos
Message 2 of 11
(5,679 Views)
Hello Sal,

thanks for responding to my query.

Even though I have LabView 7.0 full development system with me, it is new and I am yet to get used to it. So developing code in it and meet a dead line looks not very possible now.

I happened to come across a particular post in this forum wherein someone had posted a list of API declarations that can be used with VB6 and NIDAQmx. Unfortuantely I am unable to locate that post again. So it does looks possible that I can use VB6 with these declarations. What is your opinjion on this ? My application is a simple one to acquire 6 AI channels at the rate of about 100 Hz and programatically control a test equipment with about 28 DIs and 8 DOs and 2 AOs. To develop this in LabView looks quite intimidating as of now.

I will be happy if that particular person who posted the declarations responds to this post also .

Thanks

Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 3 of 11
(5,658 Views)
Hi,

It is possible to use DAQmx in VB6. However, such uses is sometimes problematic and it is not supported by National Insturments. However, we do have a KB that discusses this:

Title:
Can I Program A Board with NI-DAQmx in Visual Basic 6.0?


Problem:
I bought a National Instruments Data Acquisition board that is only supported under NI-DAQmx. Can I program it using Visual Basic 6.0?


Solution :
Currently, National Instruments does not support programming NI-DAQmx with Visual Basic 6.0. Therefore, we do not provide example code or documentation on this procedure. However, it is possible. The user will have to create a .BAS file, which imports the NI-DAQmx driver into Visual Basic Code. Then, you would need to create code that makes NI-DAQmx calls to the driver through the .BAS file.

To create the .BAS file, which imports the driver into Visual Basic, you should follow the data types definitions and function reference in the attached NIDAQmx.h file. This is the header file provided for programming NI-DAQmx with ANSI C. Using the same definitions outlined here, you can create a similar .BAS file for Visual Basic 6.0.

The NI-DAQmx C Function Reference Help is another piece of documentation that defines each function call and how to use it in ANSI C. When you install NI-DAQmx, it is located under Start»All Programs»National Instruments»NI-DAQ. Inside, you will find a list of all NI-DAQmx functions, data types, and detailed information.

Attached is a DAQmxDigWrite.zip file. In this file is a .BAS file, and a Visual Basic 6.0 project with seven DAQmx functions for writing to one digital port of a data acquisition board.
Message 4 of 11
(5,646 Views)
Dear Salvodor,

Thank you so much for the posting, outlining the procedure with a sample. Great.

When struggling with some code nothing helps like a sample code. I used the VB sample that you had linked to and got it going with my hardware. DO is fine - will next attempt DI,AI and A0. Must not be an issue. And your utility for displaying the error code is very helpful.

Thanks again.


Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 5 of 11
(5,632 Views)
Well thanks to support from members here, I have been able to call functions from VB after converting the functions into declarations.

But there appears to be a small issue :

Every time I create and access a function like ReadDigitalLines , is it required to first stop and clear it before I can access another function like WriteDigitalLines ? If I do not do so, I get an error message - even though I try to use a different task handle.

Basically I need to use the following functions :

AIRead
AOWrite
DIread
DOWrite

I have got each one of them running seperately. No problems there. But when I try to call all of them one after the other ( without stopping and clearing the earlier one in between ), I get an error message.

Can someone throw some light on this?

Thanks.

Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 6 of 11
(5,622 Views)
Hi,

Since you are using AI, AO, DI and DO you will need to create a separate task for each of them. Analog input and analog output use different resources so you should not have a problem using both tasks together. The digital input an doutput is a little different because you only have one digital port. If you are using a digital port (all 8 lines) you cannot have digital input and output tasks running simultaneously (can't have an input and output controlling the same port). However, if you configure your digital input task to be made up of multpile lines, you can specify it to be (for example) dev1\port0\lines0:3. Then you can specify a digital output task to be dev1\port0\lines4:7. This method will allow you to run digital input and output tasks simultaneously.

-Sal
0 Kudos
Message 7 of 11
(5,612 Views)
Hi Raghunathan,

would you mind sharing your VB6 code with me! I have the same problem with a 6259M DAQ card and want to use it with VB6. So if you would share your *.bas-file with me I would be very happy.
h0123k@yahoo.de

Thanks
Holger
0 Kudos
Message 8 of 11
(5,466 Views)


@HolgerHHI wrote:
Hi Raghunathan,

would you mind sharing your VB6 code with me! I have the same problem with a 6259M DAQ card and want to use it with VB6. So if you would share your *.bas-file with me I would be very happy.
h0123k@yahoo.de

Thanks
Holger




Hi Holger,

I would be only too happy to share the file. But let me forewarn you :

Without formal support from NI, developing a whole application based on your API declaration calls using the .bas file is full of problems. And I can vouch for it - as I have burnt my fingers very badly recently. I was able to get the API calls do my bidding - but the amount of unspecified errors were too many and these terminated the VB6.0 application with a simple "Sorry" message. Very helpful indeed !

So I would strongly recommend that the new DAQmx functions are left alone and you start using LV7.0 or later to get the full benefit out of the polymorphic stuff. Atleast I am a happy guy today as my application done in LV_7.3 is in its final slot and doing fine.

Anyway if you still want the VB code, confirm so and I will mail it to you. Incidentaly in this same thread, Salvador has posted a zip file- It contains most of what you want and I developed my .bas with this as a basis. Developing the .bas file is easy but to make it work flawlessly is another ball game.


Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 9 of 11
(5,461 Views)
Hi Raghunathan,

I'm still interested in your code! Please e-mail it to me. h0123k@yahoo.de or holger.klein@hhi.de !
It would be nearly impossible to switch my 2 programmes to LabView7-applications. I guess this would take 2 to 3 month! Believe me, I started with LabView, but all this wireing was to much. I developed a driver-class in VB6 so that I can do measurements just by typing "VoltageValue$ = DAQBoard.readmeasurement" for example!! And I can do it 100 or 1000 times in my code in any form. Thats it. No LabView, no ActiveX-controls, no .NET-stuff!
Hopefully your code will help me out!
Thanks
Holger
0 Kudos
Message 10 of 11
(5,459 Views)