LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Embarcadero

Hello!

 

  • We have used a PCI 7833R (which is FPGA based card) to create a DAQ system using LabVIEW and C++ (.NET environment, Visual Studio compiler). For this, we created a complete VI in LabVIEW and then used the NI C API to communicate between the user (via a simple C++, multi-threaded class) and the FPGA.

  • This original system works fine; but now we have to incorporate the DAQ functionality with a (more robust, older) frontend created using the Embarcadero C++ environment (and compiler).

  • The challenge is that the NI C API does not support the Embarcadero compiler. As a work around we created a DLL with the VS compiler that was in turn used with the Embarcadero compiler. Things get compiled aright, the DLL is loaded and there is even some DAQ functionality, but not all

    We have been racking our brains to solve this issue without much luck but a lot of frustration :).  The issue is clearly with the use of the DLL with Embarcadero.  
    Any help or suggestions will be very greatly appreciated.

 

Thank you!

 

0 Kudos
Message 1 of 5
(3,875 Views)
What DAQ functionality is missing? Errors?

Why are you messing with C++? There is no need. Perhaps you could say a bit more about the application and where it fits in?

I don't see any code -- of any kind.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 5
(3,857 Views)
Hello Mike,
 
Thank you for responding to my plea 🙂
 
The DAQ system is being used to collect data from proton bombardment experiemnts where we image cells at sub micron resolution. Our experimental setup/data analysis require a multiple dialogue interface format to run the experiment reasonably. Actually, in the past 15 years we have tried various versions for the front end (based on LabVIEW, Measurement Studio, Qt and Command Line) and found that for our work C++ is the most suitable.
 
The working DAQ system uses a C++ front end and a FPGA  for DAQ. We use the DACs for beam scanning and DIOs for synchronised data collection from our specialised external ADCs. The data exchange and signalling between the C++ front and the FPGA is implemented via IRQ and DMA. 
 
 We converted all the functionality into a DLL and all the above works (beautifully) under the Visual Studio compiler. The problem is when we use the DLL (after COFF2OMF) with the Embarcadero compiler. Only certain functions (like data collection from the external ADCs) work while some others (beam scanning with the FPGA DAC) don’t. 
 
I am wondering if this is due to incorrect options given to the compilers(?) or Is there a way where we can use the NI C API with the Embarcadero compiler?
 
Thank you so much for you time!
 
Cheers,
 
Chammika

 

 

0 Kudos
Message 3 of 5
(3,853 Views)

Well, I'm not sure about the current state of affairs with Embarcadero but in the past when it was still called Borland C++, the issue was simply in the OMF library format they use. Since the NI-RIO C API is really inside of DLLs, the only real problem you have is that the provided import libraries for those DLLs are in Visual C COFF format.

 

Now, I haven't accessed the NI-RIO C API so far so I'm not sure how feasable that is, but in the past Borland C did not only have the COFF2OMF tool to convert those Visual C import libraries to their own format but they also had a tool that could generate a native import library for a DLL by simply pointing it at the DLL and the according header file. If that fails you could still write your own import library in C which uses LoadLibrary() and GetProcAddress() to compile it with Embarcadero. With a little bit of smart macro magic and some scripting environment like Python or TCL (or even a LabVIEW VI) the generation of that C code could be even mostly automated. 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 5
(3,846 Views)

Hello Rolf,

 

Thanks very much for your response. I will look for the tool you mentioned. It is encouraging to know that the DLL approach we have had to adopt has promise.

 

Cheers,

 

Chammika

0 Kudos
Message 5 of 5
(3,760 Views)