From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Porting a Windows Device Driver to the NI Real-Time Platform

Hello,

 

I've got some questions about how to port a Win32 DLL to our NI Real-Time System (NI PXIe-8102).

 

The background: I want to use the Chroma PXI Optical Spectrometer 52962 in our System.

 

My actual knowledge is based on the NI White Papers:

- Writing Win32 Dynamic Link Libraries (DLLs) and Calling Them form LabVIEW

- Porting a Windows Device Driver to the Real-Time Platform

- Developing a LabVIEW Real-Time Driver for a PXI, cPCI or PCI Device

- Considerations in Implementing Real-Time Drivers

 

My thoughts are that I have to use NI-VISA, is that right? I have a .dll, a .fp, a .lib and a .h file. Additionally there are wrapper VIs for NI-VISA and some .inf files. I acually get the PXIe-8102 to recognize the Spectrometercard, by using the newest .inf file (--> so I didn't use the NI-VISA Wizard do create a .inf). The Modelname, Producername, Devicedata etc. are correctly listed in MAX now.

Additionally I runned the "DLL Checker" tool but it didn't worked well.. It asked me to allocate several .dlls and then it hung-up.

 

Now I'm at the point where the White-Paper "Porting a Windows Device Driver to the Real-Time Platform" says: This document assumes that you have a good understanding of the LabVIEW, ANSI C and register-level programming techniques." I think I have a good understanding of LabVIEW, its the last two points that make it difficult... I've never programmed any device driver or something similar.

 

Does anybody have some tips for me on how to proceed? Maybe a good link to specific instructions or some literature that could help me (If somebody reading this knows a good book in german would make things much easier for me..)?

 

Would be great to get some help 🙂

Bye Jan

0 Kudos
Message 1 of 6
(3,543 Views)

Hi Jan,

 

You already got pretty far by getting the device recognized.

 

There are following questions and suggetions I and my colleags thought of:

 

 

1. The .dll is the compiled code of the .fp .h and .lib file, meaning the real sourcecode is present? .fp meaning this can be used with NI Labwindows CVI?

->Then you can use CVI-RT to compile a new .dll for the RT target system. This is a Compile option if you have a RT-module for CVI. In CVI you can also see dependencies. if the .dll is inclueded as dependancy and you do not have its source code there is little to no chance you can port this at all.

You can use "Dependency walker"  (http://www.dependencywalker.com/) to see if the dll itself calls other dlls that are not suitable for RT. It usualle retuns a few dlls too which are responsible for the linking process.

 

 

2. If those VIs you are talking about were a Insrument driver using NI VISA VIs inside, you dont need a .dll to port to rt at all. VISA is available on RT as well, you could the use a LabVIEW project and drag those VIs to the RT target. if the .dll appears in the dependencys though it depends on where its uses and what it does of if the VIs are only wrapper VIs. But generally this will make it also very difficult.

 

Its correct that you will have to use the dll checker to verify if your dll is RT compliant. The fact it hung up is strange and maybe because there are parts to be called that are missing. See the Dependency Walker to check on this.

 

Besides that we will probalby need the Files you were talking about to see for our selves.

 

greetings!

 

 

 

 

0 Kudos
Message 2 of 6
(3,498 Views)

Hi Alex, thank you very much for your reply!

 

Didn't sound easy to me..

 

I've attached the driver files, maybe you can have a quick look at them. Possibly you know which things I should try next when you know better what I have here..

 

By the way.. I run the dependency walker and as far as I can assess it roughly I would say there are a lot of dependencys.

 

Would be great if you could afford the time to look at it. Thanks!

 

Bye, Jan

0 Kudos
Message 3 of 6
(3,489 Views)

Without the source to the chr52962.dll you cannot port to LabVIEW RT.  The chr52962.dll uses import libraries that are not available on LabVIEW Real-Time, and you would need to remove those dependencies on those import libraries in the source code before you could port it to LabVIEW Real-Time.  

 

-Danny

Message 4 of 6
(3,468 Views)

Its true, the .dll source is missing and therefore we can't compile it for RT.

sorry.

0 Kudos
Message 5 of 6
(3,449 Views)

Danny and Alex, thanks for your replies and your effort!

So I need the source, I will try to get it. Seems that porting the device isn't easy indeed..

Bye, Jan

0 Kudos
Message 6 of 6
(3,409 Views)