取消
显示结果 
搜索替代 
您的意思是: 

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 大笑表情

0 项奖励
1 条消息(共 10 条)
4,248 次查看

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 项奖励
2 条消息(共 10 条)
4,218 次查看

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 项奖励
3 条消息(共 10 条)
4,204 次查看

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://forums.ni.com/t5/Developer-Center-Resources/Tutorial-Creating-Wrapper-VIs-for-C-C-DLL-functi...

 

Patrick H | National Instruments | Software Engineer
0 项奖励
4 条消息(共 10 条)
4,166 次查看

Hi Patrick,

 

I think this is where I'm getting stuck at https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/resource/importtools/sharedlib/import-shar....  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 项奖励
5 条消息(共 10 条)
4,154 次查看

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 项奖励
6 条消息(共 10 条)
4,129 次查看

The Import Shared Library example files worked without any issues.

0 项奖励
7 条消息(共 10 条)
4,095 次查看

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 项奖励
8 条消息(共 10 条)
4,076 次查看

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

0 项奖励
9 条消息(共 10 条)
4,072 次查看

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 -  https://www.ni.com/docs/en-US/bundle/labview/page/configuring-the-call-library-function-node.html

 

Example - https://forums.ni.com/t5/Developer-Center-Resources/Tutorial-Configuring-the-Call-Library-Function-N...

Regards,

Anjelica W.
National Instruments
Product Marketing Manager
FlexLogger and TestStand
0 项奖励
10 条消息(共 10 条)
4,055 次查看