05-07-2014 12:51 AM
Hallo all,
Labview: 2013
Runtime :2013
my Problem: I want to control the Agilent 34401A with C# or C++ with the Labview Runtime. I tried to use ActiveX on c++. E.g crete Labview Instance -> GetViReference and so on. On my develop maschine it is no problem. But if i try to run my solution on the targit only with the runtime i cant create the Labview Instance.
Next try was to create a interop .net assembly. But if try to use the function of the .net assembly i get "Failed to call InitLVClient function". I also add the NationalInstrument.Labview.Interop Assembly to my Vs2010.
I think i read all guides to this topic but i cant get a solution. Can anyone help me?
Regard moe
05-14-2014 08:56 AM
Hello masterofeye
Please correct me if i got this wrong: You want to create an instance using the Runtime Engine.
"The runtime engine only contains functionality to run precompiled applications. It does not contain any compiler, application builder or even a possibility to save a VI."
I hope this solves the question why creating an instance does not work.
Regards.
05-14-2014 09:17 AM
@masterofeye wrote:
Labview: 2013
Runtime :2013
my Problem: I want to control the Agilent 34401A with C# or C++ with the Labview Runtime.
You have LabVIEW 2013. Do you have the "Application Builder"?
You can create a dll using the LabVIEW 2013 Application Builder on your development system and then call that dll using the LabVIEW 2013 Runtime engine from your C# or C++ on the other system.
You can control the 34401A stright from C. Why do you need to go through LabVIEW?
05-21-2014 06:45 AM
Hallo and thx for the answers,
we need the labview solution because it was the idea of the designer.
I try to create all DLL and call it from C#. But it seems nothing is happend but the exit code is 0.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace ConsoleApplication6 { class Program { [DllImport("C:\\Program Files (x86)\\Agilent 34401\\SharedLib.dll")] public static extern Int32 Agilent34401_Initialize(char[] String); static void Main(string[] args) { char[] hallo = {'C','O','M','4'}; Console.WriteLine(Agilent34401_Initialize(hallo)); } } }
Is there anything to take care?
regard Moe
05-21-2014 08:47 AM
What would you expect this function to do? It initializes the driver by trying to open the COM4 port and then it more or less ends. Not sure the Initialize functions does anything that would cause a visible change on the device. You should at least call another function after the Initialize that change some setting on the device so you can observe something happening.
12-15-2015 06:03 AM
Hi Moe,
have you managed to find a solution to this problem??
I have exactly the same issue and i simply can't get a solution.
Regards Rui
12-15-2015 07:52 AM
Dear All,
I found the solution to my problem and i'm just posting so that it may help someone with a similar issue:
My probelm was a dependency, basicly I had a IVI driver missing on the deployment PC, and unfortunatly the return error from the Labview Interop DLL was too generic ("Failed to call InitLVClient function") for me to catch the problem imediatly. The strange part was that i wasn't using any call to the equipment on the Method i was calling....
So next time you get this error make sure you are not missing any dependency on the deployment machine.
Best Regards,