Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I used legacy Nidaq Devices from Visual Studio 2005

Hello,
 
I have two PXI-4351 cards in a PXI rack.
 
Can anyone give me any tips on how I can access the features of this card with Visual Studio 2005. I dont want to do anything fancy just read the channels at a few Hz.
 
I can access NidaqMX devices using the .NET API Provided by National Instruments
 
Many Thanks
 
Andy
0 Kudos
Message 1 of 11
(5,634 Views)
Hi Andy,

Just wondering first off whther you have NI Measurement Studio installed or just the DAQmx driver with Visual Studio?? Either way, the following document lists the locations of the DAQmx examples installed with Measurement Studio and the DAQmx driver. These include a variety of programs written with .NET which should therefore be of use to you. I would definately reccomend checking out these examples because even if there is one that does not do exactly what you require, they should provide a solid foundation which you can use to develop your own program. The chances are however, that as you are just doing some simple analog readings, there should be a suitable example at hand.

I would also reccomend using the help files which are installed with DAQmx. If you go to the Start Menu>>National Instruments>>NI-DAQ>>NI-DAQmx C Reference Help, this file will list all of the available functions installed with the DAQmx driver. These are all the driver calls that will enable you to commmunicate successfully with the card.

If you have any problems with this or are missing some of the files etc. please just let me know and I will send over the relevant documents to you.

Best wishes

Rob
Rob L

NI Applications Engineer

UK & Ireland


It only takes a click to rate this message 😉
0 Kudos
Message 2 of 11
(5,622 Views)
Rob
 
Thank you for yo(with your reply.
 
I can use the mxDaq API without any problems. My specific problem in this instance is that 4351 is a legacy tradional NIDAQ driver.
 
I have managed to install the 4351 drivers and have a VB example cant get this to work at the moment. When I get this to work I will use PInvoke I guess to replicate the functionality.
 
What a pain. NI should have released drivers for all the products they currenttly sell. It is very negligent of them to do this. I will be getting back to the rep on this.
 
Thanks for your help.
 
Andy
0 Kudos
Message 3 of 11
(5,623 Views)


Hi Andy

My sincere apologies, you are indeed correct, the card does use Legacy Drivers, and these traditional drivers are available on the NI Driver CD which I presume you have with the device? The traditional drivers are not installed by default on the CD, they have to be manually selected from the Product Installation Tree. Can you load up Measurement and Automation Explorer andclick on the 'Software' tree near the bottom of the Configuration tree list on the left hand side (see the attached screenshot - Screenshot 2). Can you tell me if Traditional NI-DAQ is shown anywhere in the list? If not, it needs to be installed off the driver CD. The second screenshot attached shows you where to select the drivers in the Installation tree. If you cannot locate the CD, you can download the Traditional DAQ drivers for Windows XP from the following address:

http://digital.ni.com/softlib.nsf/websearch/E42B7A3564AB2F1A862572A7006D1564?opendocument&node=132060_US

If you are not using Windows XP, use the link below and select you operating system:

http://digital.ni.com/softlib.nsf/webcategories/85256410006C055586256BBB002C128D?opendocument&node=132060_US

Hopefully once the drivers are installed, you should be able to access the Legacy functions. Again, there is a help file installed in the same location as before called
Traditional NI DAQ Function Reference Help. I am in the process of locating the directory of the tradiational DAQ examples and will post back with them soon.

Let me know how you get on. Apologies agaion for not realising it used the Traditional DAQ driver.

Best wishes
Rob L

NI Applications Engineer

UK & Ireland


It only takes a click to rate this message 😉
Download All
0 Kudos
Message 4 of 11
(5,619 Views)

Hi Andy,

When installing the Traditional DAQ drivers, the examples will be installed if the "Entire feature will be installed on the hard drive" option is selected in the custom installation selection box. If you selected the same features as shown in the screenshot I sent you, then this is what you needed to do.They are installed at the following location.


Program Files »National Instruments » NI-DAQ »Examples»VBasic/VisualC.

Let me know how you get on.


Best wishes
Rob L

NI Applications Engineer

UK & Ireland


It only takes a click to rate this message 😉
0 Kudos
Message 5 of 11
(5,616 Views)

Hi Rob

Making some progress.

On the PXI machine, that came pre-installed with the lasted MAX, NIDAQMX, Traditional NIDAQ 7.4 and NI 4350 2.5.2 the VB sample applications were missing, so I tried to use the supplied driver CD which is only 2.5 (Hmm nice one) I could not install the samples, so a couple of hours later after downloading the install app for 2.5.2 I managed to install the VB sample applicaitons and CVI applications for the PXI 4351 card.

Good news first.

When I create an executable from VB6 of any of the NI supplied sample VB applications I can run the applications from the command line,

Now the bad

but when attempting to run from VB6 debugger ie single stepping thru any of the same NI supplied VB apps I get a file not found error ni435x_32.dll. (I should point out I have been programming low level C,C++ etc on a DOS, Windows, DSP platform for 20 years at this point) the dll is definately in the path, to make sure I coppied it everywhere including the directory where VB itself lives. This is really odd becuase when I install 2.5.0 on my laptop (with no prior version of MAX, NI etc etc) I can single step through the code. Obviously it fails when it gets to the point where it cant find the hardware.

I get the impression NI are in a real crisis with drivers at the moment! Just curious but why havent NI produced an MX driver for the 4350 product line?

Anyway, the VB sampls I can get to work even if I cant debug it. The values I get back from the card are sensible, in fact quite good temperature measurements.

I dont have lab windows CVI, what I really need is a VC++ 6.0 sample application, I am not sure what libs to include since this information is hidden in the CVI .PRJ file. Can you provide me with one?, or have a chat with an application developer who has programmed the 4350 using Visual C++ 6.0 who might be able to give me a few pointers?

Thank you so much for your help and being interested.

Andy

 

 

 

 

 

 

 

 

 

0 Kudos
Message 6 of 11
(5,608 Views)

Hi Andy,

I'm glad you are making some progress on your acquisition, I'll try to address the comments and questions raised in your last message. Firstly, the problem you are experiencing with the VB6 examples has been experienced before. The following link will take you to an article which I think may help you rectify the problem. Though, I am not totally sure because you have clearly tried to place the .dll's in the paths being asked for. However, the problem
arises from the CVI support not being installed correctly, and the linked document will talk you through this.

http://digital.ni.com/public.nsf/allkb/B53F3D5ADCFF287B86256869006EF6A9?OpenDocument

With respect to the driver CD you had with the device, unfortunately, because this is one of our older products, it had not been packaged with the later driver CD hence why you received the older one in the package.  The reason there is no DAQmx driver for the NI 4350 is that this has become quite a niche product and has been recently marked for obsolescence. Currently, the inherent structure of the device does not allow communication with a DAQmx driver and therefore would require hardware updating and a new driver to be developed. I
apologise for the inconvenience caused by this for you but I hope you can appreciate the circumstances regarding this specific device

With regards to the VC++ example you need, I
apologise once again that there are no specific examples available, but I will be happy to dig out the project files here if you let me know the examples which would be of use to you.

I hope this information is of use to you.

Best wishes





Rob L

NI Applications Engineer

UK & Ireland


It only takes a click to rate this message 😉
Message 7 of 11
(5,585 Views)
Rob
 
I have created a C version now (console app in VS6.0) , based on hunting arround the system and using the 4350x_32.H and 4350x_32.Lib file and examining the VB function calls.
 
I can read temperatures from two devices simultaneously, my plan is to convert my C program into a basic Modbus TCP/IP server, and then our .NET app can read the channels (we connect to lots of Modbus devices including multiple CFP1808 units)
 
However our client is concerned over reliability and speed of update and are looking at free issuing CDAQ USB based temperature measurement modules. So my goal posts have been moved! Which is a shame as I worked until 2AM yesterday making my C program work! So if anyone wants a C style exaple of how to get the best possible performance out of the 4350X then please email me, it needs a bit more work to make it production quality.
 
Thank you for your support. I am pleased NI are going to obsolete this product. I do understand the problems you have supporting such a wide ranging product.
 
Thanks again.
 
 
0 Kudos
Message 8 of 11
(5,583 Views)

Andy,

Thanks for the comments. I'm sorry to hear that your circumstances have changed but glad our correspondence was of use at the time.

Best wishes and the best of luck in your future programming.
Rob L

NI Applications Engineer

UK & Ireland


It only takes a click to rate this message 😉
0 Kudos
Message 9 of 11
(5,579 Views)
Hi
I met the same problem too. in my pxi, use two pxi4351s to measure temperatures. 5 pxi 4472s to measure viberation.these 4472s can be drived by daqmx .programmed by vb 2005.who can give me some examples? i just wanna to read temperature. thanks.
 
0 Kudos
Message 10 of 11
(5,387 Views)