LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call C-Code from my sbRio9636 target?

Solved!
Go to solution

Hi

I do have following configuration:

 

- 1 FPGA sbRio9636

- 1 sensor with RS485 interface is connected to the sbRio-Board

 

The sensor comes with a .dll (C-Code) which I implemented in a LabView vi while the device is communicating via an RS232 adapter. What I like to do is, to run this specific dll directly in the FPGA to read the sensor data.

 

Question:

-------------

Is this possible if or do I need to convert the dll file to a .out file for the VxWorks target? If this is possible how can I ensure that there is no Windows dependency on my dll file? And last but not least, how do I find out if the dll file fits into the FPGA target?

 

Is there another workaround to have everything run on the FPGA directly?

 

thanks in advance

 

 

0 Kudos
Message 1 of 7
(2,467 Views)

Hi norick,

 

to convert that DLL to an OUT file you need the source code of that DLL. Does the sensor manufacturer provide you the source for it's DLL?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(2,451 Views)

GerdW's recommendation is key. You'll definitely need the source. If you do have the source code here is some information on how to compile for NI RT VxWorks targets, 

 

The Definitive Guide: Programming NI VxWorks Real-Time Controllers in C/C++

https://decibel.ni.com/content/docs/DOC-13537

 

I'm not sure there is a simple way to report whether your .dll has MS dependencies. You would likely have to look at the dependencies and see for yourself. Dependency Walker is a great tool for looking at your .dll's dependencies. You could always run your .dll in that tool and check all the dependencies that way.

Tim A.
0 Kudos
Message 3 of 7
(2,442 Views)

If the manufacturer is documenting the serial interface commands it is most likely a lot easier to simply implement that directly in LabVIEW using NI-VISA interface.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 7
(2,433 Views)

thanks for the answers!

 

I have the code available but there is one big question coming up: Whats about the windows dependencies in the C-Code? I assume the compiler uses other Windows-libs to generate the dll.

 

Is this a problem at the end or what is the best way to convert such dll into a out-file? I fear that it will be a lot of work to find all windows dependencies at the end. It would be possible to program everything in LabView but it would be an extensive work.

 

 

0 Kudos
Message 5 of 7
(2,416 Views)
Solution
Accepted by topic author Norick_17

Hi Norick,

 

you need to decide which part is more extensive: hunting down all Windows dependencies and replace them by your own function calls - or the reprogram the whole thing using LabVIEW capabilities…

 

In the end you want to port some functionality from one OS to a totally different OS!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(2,409 Views)

Thanks for your answer Gerd..!

 

Therefore I have to figure out which is the easier way to convert the code to the sbRio platform...

 

 

best regards

Norick

0 Kudos
Message 7 of 7
(2,399 Views)