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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Winradio Positioner and Labview

I'm working on building an outdoor antenna test range.  I'm looking for a little direction.  I have a Agilent 8753ES Network Analyzer for polling data and it works nicely with LabVIEW.  My issue is getting the USB connected positioner/controller unit to play with LabVIEW.  It appears no one has posted about it specifically, it is a WR-RCU-100 from WinRadio.  I'm a little rusty when it comes to programming, but the provided SDK (http://www.winradio.com/home/rcu100_sdk.htm) is detailed enough that I can write the appropriate routines in C/C++.  I'd like to be able to do these routines inline with polling data through LabVIEW.  Basically, controll the unit from LabVIEW directly.

 

Initially, I tried to load the Header and DLL directly into Labview as a Shared Library but I was unable to.  The API creates a single Function CreateInstance, which is not included in the Header file and stops Labview from proceeding.  I guess my question is whether loading the DLL this way (after making adjustments) is the proper/easiest way to interact with my controller unit?  And, what steps do I need to take to make things compatible/functioning for my setup?


My first impulse was to write external code and have LabVIEW execute it, but I'd like to have a little more controll over my Controller, pun inteneded Smiley LOL

0 Kudos
Message 1 of 10
(3,199 Views)

Hi BebopX,

 

I am currently looking into replicating this issue but I was wondering if you could try loading in a single function call from the API and testing that.

Patrick H | National Instruments | Software Engineer
0 Kudos
Message 2 of 10
(3,169 Views)

Hi Patrick,

 

Thanks for the reply.  I'm a little unsure as to what you mean by load a single function into LabVIEW  The API only has a single function and that is what is stopping me from loading the API into LabVIEW.  Every function call seems to be tied into using the initial CreateInstance and the interfaces it points to.  How do I load a single function call into LabVIEW from the API?

0 Kudos
Message 3 of 10
(3,155 Views)

Hi BebopX,

 

I am going to continue looking into this issue for you but I have found a link that walks you through creating wrappers using the Import Shared Library Wizard. Take a look and let me know if this is alone the lines of what you are trying to do. There are also some attached files at the bottom that you can use to try this out.

 

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

 

Patrick H | National Instruments | Software Engineer
0 Kudos
Message 4 of 10
(3,117 Views)

Hi Patrick,

 

I think this is where I'm getting stuck at http://zone.ni.com/reference/en-XX/help/371361D-01/lvdialog/dll_config_paths/.  It says, Windows.h and CreateInstance () need to be included in the preprocessor definitions and paths. I've attempted to path to the directory for Windows.h but it doesn't seem to work.  Or atleast it still gives me the same header not found.  

 

This is the reference to Create_Instance in the API's header file:  

 

typedef BOOL (__stdcall *CREATE_INSTANCE)(UINT32 ClassId,void **Intf);

 

Do I need a preprocessor definition?  If so, how would I write the preprocessor definition?

 

 

 

This is what I'm getting when I try to load the API's header and DLL.

 

NI-CreateInstance.PNG

0 Kudos
Message 5 of 10
(3,105 Views)

I am currently looking into this issue, but have you been able to complete the steps provided with the example files at the bottom? 

Patrick H | National Instruments | Software Engineer
0 Kudos
Message 6 of 10
(3,080 Views)

The Import Shared Library example files worked without any issues.

0 Kudos
Message 7 of 10
(3,046 Views)

The CreateInstance function is not defined in the header file. This is required in order to use the Import Shared Library Wizard. You mentioned that you tried to load the header and DLL directly into LabVIEW. How did you do this? Did you use a Call Library Function node?

Regards,

Anjelica W.
National Instruments
Product Marketing Manager
FlexLogger and TestStand
0 Kudos
Message 8 of 10
(3,027 Views)

All I ment was that I tried using the Import Shared Library without modifying anything.  The files were provided by WinRadio.

0 Kudos
Message 9 of 10
(3,023 Views)

I would suggest tryign to call the CreateInstance() function of the WRRCU100API.dll directly using the Call Library Function Node. You can do this by followign the steps in the example listed below.

 

Configuring the Call Library Function Node -  http://zone.ni.com/reference/en-XX/help/371361J-01/lvexcodeconcepts/configuring_the_clf_node/

 

Example - https://decibel.ni.com/content/docs/DOC-9069

Regards,

Anjelica W.
National Instruments
Product Marketing Manager
FlexLogger and TestStand
0 Kudos
Message 10 of 10
(3,006 Views)