VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a possibility to start the VeriStand 2014 Gateway programatically using LabVIEW 2014?

Solved!
Go to solution

Hello,

 

This is a reload of the Is-there-a-possibility-to-start-the-VeriStand-2011-SP1-Gateway because what worked in 2011 SP1 does no more in 2014.

 

I ported the code from the previous topic, do do the same thing (calling "__cdecl Int32 StartVeriStandGateway(out Int32 handle)" in "C:\Program Files (x86)\National Instruments\VeriStand 2014\Data\NationalInstruments.VeriStand.Gateway.dll".

 

Doing this from a .NET programme (console or windows process) or directly from a DLL node in LabVIEW 2014 seems to have no effect, knowing the .NET code worked in 2011 even when called from a Windows service.

 

Is there a new way to do it?

 

By the way, the "NationalInstruments.VeriStand.WindowsRegistry.GetInstallationDirectory()" method has disapeared from the assemblies.

 

Best regards,

 

0 Kudos
Message 1 of 8
(6,222 Views)

Re,

 

Some clarification: I was not totaly right: it seems to work when everything is called from a .NET program. But when called from LabVIEW, direct call to the DLL => no effet?, call through the .NET assembly => Licensing error code.

 

Regards,

0 Kudos
Message 2 of 8
(6,208 Views)

It certainly should work when called from a LV program if called correctly. NI VeriStand.exe is a LabVIEW-built application that invokes the Gateway. Can you post the configuration page screenshot for your Call Library Function Node?

Jarrod S.
National Instruments
0 Kudos
Message 3 of 8
(6,206 Views)

Are you trying to load the VeriStand 2014 Gateway DLL in a LabVIEW 2014 VI? Or is it a different version of LV?

Jarrod S.
National Instruments
0 Kudos
Message 4 of 8
(6,205 Views)

Hi Jarrod,

 

You're rigth, after PC reboot the Gateway starts when calling the DLL node (OpenWorkspace & GetSystemStatus are called with no errors), but when I try to ConnectToSystem the program stays blocked into the sub-vi, although the code works well if the Gateway was previously started normally by running VeriStand from Windows.

 

I tryed to change the call policy in the DLL node (UIThread & any thread) but it seems doing nothing.

 

Please find here joined the test files and debug capture of the stall.

 

Best regards,

Download All
0 Kudos
Message 5 of 8
(6,139 Views)
Solution
Accepted by topic author thumble

I remember a while back I saw this. There was some issue where the dll cannot run in the UI thread, but LabVIEW has no way of specifying any thread but the UI thread. Therefore the workaround was to put the DLL calls in a subVI, set that subVI to run in the 'standard' thread, and set the DLL call to run in any thread. See attached.

 

 

Stephen B
Message 6 of 8
(6,111 Views)

Thanks Jarrod,

 

I'm busy this week, but I forward to a person concerned with this issue. I'll give feedback ASAP.

 

Best regards

0 Kudos
Message 7 of 8
(6,094 Views)
Solution
Accepted by topic author thumble

Re,

 

You’ve found the reason of the blocking. But it’s not located at the DLL call but at the ConnectToSystem.vi call. Hopefully this code is not locked and I could change its execution policy to standard, so it doesn’t block anymore. Maybe some other calls are suffering from the same artifact, but I didn’t check so far.

 

Best regards,

0 Kudos
Message 8 of 8
(6,051 Views)