NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView DLL

I have a labView (8.5) DLL that I have created and I want to call it using TestStand. One of the the parameters I need to pass in is a VISA Resource Name (serial port number and a session number) along with some other parameters (strings, numerics, etc.).  In trying to call the function from within TestStand, and have run into issues with passing the VISA Resource.  I can easily pass all other the parameters. It seems that the C/C++ DLL adapter does not recognize this type.  How do I get around this? 

 

Below is a screen shot of the VI front panel:

 

UI.JPG

 

The Prototype from the DLL looks like :

 

void __cdecl MIMICCommands(LVRefNum *VISAResourceName, uint32_t waitMs, LVBoolean *HWHSflag, TD2Hdl *InputStringDataArray, uint16_t

                                MIMICHOSTCOMMAND,  TD3 *Receive_Unpacked_Data, uint8_t Receive_buffer[], TD1 *errorOut,  int32_t len); 

 

The parameter in RED is the one the one giving me the issue?

0 Kudos
Message 1 of 7
(3,550 Views)
0 Kudos
Message 2 of 7
(3,549 Views)

I had read this post before submitting mine.  It seems that it is suggesting that I change the way the VI handles a serial port, just sending it a string.  This method would be extremely difficult at this point, As this is just one of many VI in the DLL that use a VISAResourceName.  Is this the only way?

0 Kudos
Message 3 of 7
(3,545 Views)

I think you can try it the other way around. Leave the VI complied dll as is. In the call library function node configure the VISAResourceName as a string and pass the resource name to it. If that doesn't work, configure VISAResourceName to a 32bit int and pass the visa ref into it, as described here: http://digital.ni.com/public.nsf/websearch/FB001AA027C8998386256AAD006C142D?OpenDocument. 

0 Kudos
Message 4 of 7
(3,543 Views)

Can you provide a quick example of how to do that within TestStand?

0 Kudos
Message 5 of 7
(3,541 Views)

I don't have test stand, but correct me if I'm wrong, I imagine that loading a dll from test stand would be similar to loading it in LabVIEW? If I show you how to do it in LabVIEW would you be able to do it in test stand? If you upload your dll, I can try to do it in LabVIEW.

0 Kudos
Message 6 of 7
(3,537 Views)

I don't think they are one and the same, I think that maybe my issue with implemeting it in TestStand. If I had a "C" code wrapper or Labview VI arond thisi DLL I would stand more of a chance.  TestStand loads different types of 'adapters' to communicate with different type of externals (i.e, LabView, CVI, C/C++ DLL, ActiveX, etc.) . It is very "strict" and doesn't allow you to change types.

 

I created, however a very simple VI with just a ResourceName as and input to see if I can get the name into it correctly from TestStand.  I will try the same with CVI, I might have better luck at looking at it in memory. 

0 Kudos
Message 7 of 7
(3,535 Views)