ActiveX - LabView from c#

Hello

I create a program in LabView in a program already developed in c# that uses ActiveX to control a laser machine.

The first thing I see in the program is the initialization of the ActiveX Server and equipment system:

Laser = new LaserAxApp();

LaserSystem = Laser.System;

I found a refNum in labview with LaserAxApp, but in their properties, I found systems within the ILaserAxApp property. But also, I found a different refNum called laserengineLib.ISystem which is another reference to class as AxApp.

which choose to continue implementing my program of c#?

Thanks in advance,

Stavrosyt wrote:

Hello

I create a program in LabView in a program already developed in c# that uses ActiveX to control a laser machine.

The first thing I see in the program is the initialization of the ActiveX Server and equipment system:

Laser = new LaserAxApp();

LaserSystem = Laser.System;

I found a refNum in labview with LaserAxApp, but in their properties, I found systems within the ILaserAxApp property. But also, I found a different refNum called laserengineLib.ISystem which is another reference to class as AxApp.

which choose to continue implementing my program of c#?

Thanks in advance,

Thanks anyway... I managed to find the answer.

It works with the properties and methods in the ActiveX menu in Labview. To answer my own question, the result is to use iLaseraxapp and ilasersystem refnums.

Here is better explained:

(1) start the laser with refnum laserengineLib.ILaserAxApp

(2) use the open automation to open and

(3) bind it with a node of the system IlaserAxApp (true visible) property.

And that's all. Then you can use lib system even for event reminder reg and ilaserdoc for loading a file of xlp laser.

Tags: NI Software

Similar Questions

  • Call the function in LabView from a DLL, and then access the global variable of DLL

    I've created a DLL in LabWindows with a function and structure.  I want to call the function from LabView and then access the overall structure.  I am able to call the function in the DLL with a "call library function node" and has access to the return value, but I can't understand how to access the overall structure.  The structure is declared in the header DLL with __declspec (dllimport) struct parameters file.

    Is it possible to access this structure without using the library of network variables?

    My guess is that you need two bytes of padding after "in_out" and another to two bytes of padding after "anin."  The reason being that ints are 4 bytes, and most of them C compilers will align on 4-byte boundaries.  The struct will naturally start to such a limit (in fact, in Windows, it will probably start to an 8 byte boundary).  If you then count bytes in your structure, you are 70 byte after "in_out."  70 is not divisible by 4, so you need 2 bytes more to reach the next 4 byte boundary.  You can also you could reorganize your struct so that "anin" follows "in_out" and this is probably the best option if it won't cause you other problems.

    Unlike most C compilers, LabVIEW compressed structures as closely as possible, without filling.  I don't know enough about the history of LabVIEW and internal parts to explain the reasons and to do this performance penalty, but, as choice of LabVIEW "endianness", it is probably a remnant of the first versions of LabVIEW that were running on the Mac.

    If for some reason you want to force your C struct to match package LabVIEW, you can use the #pragma pack (x) directive, but I wouldn't recommend that here because you can control the C and LabVIEW.

    EDIT: in the cases where it was not clear, add padding to your cluster of LabVIEW, insert appropriate size or items at the place desired in the cluster.

  • Client server of executable activex LabVIEW project with excel vba

    Hi all

    I submitted a ticket to support nor on this problem, but my deadline for this project is very close, so I would like to ask the community to see if someone has encountered this problem before (I hope it's ok that I'm doing this!). I did a fair amount of forum-scouring, and I didn't know this even discussed problem.

    I built a labView project which is essentially in the material data and
    preforms various visualizations and transformations on the data. A bit of the
    Screws in this project are available by VBA Excel as a Server ActiveX with LabView and
    Excel as the customer - and it works! I recently discovered I would need to do a
    executable version of my project, so I'm now trying to figure out how to do the same thing
    with my executable file as the server instead of LabView. Here's a simplified version are
    My VBA code:

    Void Button1_Click()
    Dim lvapp As MyServer.Application
    Dim vi MyServer.VirtualInstrument

    Set lvapp = CreateObject ("MyServer.Application")
        
    VI the value is lvapp. GetVIReference ("Main.vi", "", True)
        
    Sheet1.cells (1, 1) = vi. GetControlValue ("Path")
        
    lvapp. Quit smoking
    End Sub

    I replaced LabView here with the name of my server. The code
    failure of the CreateObject method with the following error:

    Run-time error '13':
    Type mismatch

    Things, I'm pretty sure I'm doing it correctly:
    -L'application is configured as an ActiveX server in the build options
    -J' ran the VI once and close/re-open it just after each build before trying the
    worksheet
    -In excel, VBA method is configured to reference the type library of the server.
    -J' have LabView itself closed when I run the .exe

    Thank you

    Alex

    My versions and such:
    Software of NEITHER: LabVIEW version 2012
    OS: Windows 7

    It's interesting - I'll have to look into the issue. In the meantime, I found a solution.

    It's quite mysterious, but it seems that all I had to do was make sure you only the type library of the server executable has been referenced in VBA (no LabView or OLE type library) and declare the variable app as object, rather than MyServerName.Application. Honestly, I have no idea why this works, but it does. Also, I learned that you need to use the executable file paths, which are a little different than the paths of project files.

    Thank you

    Alex

  • How can I get a picture back to labview from opencv dll code?

    Hi, I use the vi below to acquire an image of labview, then move to opencv dll code via, first getting pointer to image pixel and then passing the result parameters to create a "carpet" in my c code ++. Up to this point, everything works. Now I make opencv image treatment final resultiing I want to bring back to LabView. That I can't understand it. (btw, the image is a binary image). How can we get this image? Help, please

    P.S. actually what I get image3 is the same image I captured of LV

    Hello

    a simple example:

    OpenCV code:

    using namespace std;
    use of names cv;

    extern C
    extern "C" {}

    __declspec (dllexport) int CannyEdges (unsigned char * imageIN, int line, int cols, double lobbyist1, double Seuil2, kernel_size int, unsigned char * imageOUT);
    }

    __declspec (dllexport) int CannyEdges (unsigned char * imageIN,)
    int lines,
    int cols,
    statement1 double,
    Seuil2 double,
    int kernel_size,
    unsigned char * imageOUT)
    {
    check the size of the odd kernel
    If (kernel_size % 2 == 0) return-1;
    allocate memory
    Matt Image_input (rows, columns, CV_8U, & imageIN [0]); IT IS THE IMAGE, THE POINTER TO THE DATA ENTRY
    Matt Image_output (rows, columns, CV_8U, & imageOUT [0]); THIS IS THE OUTPUT IMAGE, POINTER TO DATA
    blur before ruse
    Blur (image_input, image_output, Size (3,3));
    Canny
    Canny (image_output, image_output, lobbyist1, Seuil2, kernel_size);
    return 0;
    }

    You can use directly on the "imageIN" by eliminating the image_output and replace them with the image_input.

    LabVIEW code:

    I enclose the Labview code (2013) and the file .dll for you to test.

    I hope this helps.

    Kind regards

    K

  • How to call sequence into LabVIEW, by providing the path of the sequence files.

    Hello

    Please give me a solution for call sequence from the API ActiveX LabVIEW file by entering the path of the LabVIEW user interface sequence.

    Thank you

    Wherry

    Here is a link I gave some pointers on how to run a file opened via Single Pass sequence.

    http://forums.NI.com/T5/NI-TestStand/direct-execution-of-the-sequence-when-UI-launches/m-p/2000819#M...

    How are you going to start this sequence is the user who selects the sequence on the disk?    Is already open in a SequenceViewMgr control?

    An operator interface would be more applicable to your situation?

    Thank you

    PH

  • PROFIBUS in Labview 2011

    Hello

    I recently updated my Labview from 2010 to 2011. And then I tried to install the latest driver for Profibus (DF_PROFI_II_LV_1.36.2.zip) that I downloaded from (http://joule.ni.com/nidu/cds/view/p/id/2687/lang/en). Release date: 10/10/2011

    Normally, this extension must be installed to the location following (C:\Program NIUninstaller Instruments\LabVIEW 2010\vi.lib\addons). However, I did find it in the folder "addons" Labview 2011. There never to this question? To resolve this problem, should I just copy Comsoft.lib in the folder "addons" from 2010 to 2011? Something else I have to do?

    Thank you

    Zhi

    I t looks like that it detected the LV 2010 version as the current and did not install anything in 2011. You should be able to copy files on the same path mentioned.

    DirkW

  • Download assessment for labview .vi editor 64-bit?

    I am trying to download .vi lead editor for LabView. I'm using windows 7, 64 - bit os. I installed LabView 8.6 run-time engine. So please can anyone suggest where I need to download the LabView evaluation Editor.

    You can downbload an evaluation version of LabVIEW from here.

    For future questions, please refer to the LabVIEW forum: this forum is dedicated to LabWindows/CVI

  • LabView VB6 Dll interface causes memory leak

    Hello

    We use a large written in vb6 in our laboratory measurement built house software. Recently, we have added a new detector that is read using a labview vi that is called using a dll directly from vb6. Here, we call the function for example of read_detector which starts the collection of data and in a next step writes the data to a string. When you have finished the called function returns a pointer to the string and its length. VB6, we read this pointer and process data.

    This is a memory leak. This could be the case because we presets not memory for labview to write in and so just writing lab data in memory without releasing again? In the current configuration, the function of the dll is just called again and again and each lab view creates a variable outputstring.

    If we allocate the memory. How can we achieve for vb6?

    Best,

    Julian

    Well first of all, a handful of string LabVIEW is a very specific type of data LabVIEW. Not only is only LabVIEW himself knows exactly how to allocate and deallocate, but you must also allocate and deallocate in exactly the same instance of LabVIEW. Given that your LabVIEW DLL is executed for this purpose inside the DLL to run LabVIEW, you must also recover the LabVIEW memory manager functions according to DSDisposeHandle() of the lvrt.dll and call it after you are finished with the strings returned by the DLL function. This is however made very complicated since there are circumstances where not lvrt.dll is actually used by your DLL but another LabVIEW runtime system. And if you happen to have two DLLs created with different versions of LabVIEW LabVIEW, each of them will load and use its enforcement LabVIEW system according to DLL load next. Believe me, you don't want to know how next dll works and how to make this opportunity to work in an application. This is the way for Microsoft to create a monster to manage the hell of the DLL and in this way, rather to create exponential version of hell.

    You create just two memory leaks for each call of DLL function at the moment. LabVIEW creates a new handle of string for each of the parameters string at each call, you dereference the pointer, and then copy the contents into a SysString. But you let the chain handles LabVIEW blow created around the stack and the next your function call, you initialize the new variables of the battery which is initialized to null and LabVIEW creates two new handles. Also you need to do is to define an "Integer DSDisposeHandle(LStrHandle As Long)" exported lvrt.dll function and call it once you have copied the data of the handle in your SysString for both of these handles.

    But basically calling a DLL LabVIEW from no LabVIEW code and using LabVIEW handles string or array as parameters is several times more trouble that it's worth. The easiest would be fair, allocate a large enough buffer beforehand and pass those to the Configuration of the service DLL LabVIEW function to not accept a handful of string LabVIEW but a pointer to a string C instead. Do you work around the problem on the memory allocated by someone else to worry about your own program of VB and duty he properly release. The disadvantage of this approach is, that you should make sure that the memory allocated buffer is large enough for the maximum possible length that your DLL function may never return.

    But another approach might be to leave out LabVIEW total here and call the DAQmx APIs directly from VB.

  • Impossible to fully install LabVIEW 2010 on WinXP SP3

    Hello

    I tried many times today to install all OR Developer Suite 2010 helps install disks. I catalogged all items that not have installed. LV 2010 works but I don't know if everything works. Here are the elements and the order in which I wasn't able to install:

    'Crucial questions when National instruments drivers using Microsoft Visual Studio.NET 2010 resolved by NOR-PAL 2.6.5' - I have successfully installed this but the message still comes up and gives me a message "Are you sure you want to move forward", when I'm trying to keep the installation

    "NOR-USI 1.8.0" has not been installed. Error 1935

    Error "Runtime-NOR-LabVIEW engine Interop 2010" 1935

    "NEITHER AFW UI assembled" Error 1935

    "OR Measurement Studio 8.6 company for VS2005 Runtime" Error 1935

    "NEITHER AFW Channel Configuration Tool" Error 1935

    "NEITHER AFW assembled custom user interface" Error 1935

    "NI LabWindows/CVI 2009 Service Pack 1 Runtime Engine" - no error number

    No idea if I need these applications run LV 2010?

    Thank you.

    It seems that there is something strange going on with your .NET framework, which is the origin of this conflict of driver.  Try uninstalling your current .NET framework as well as LabVIEW (from Add/Remove Programs) and re-setup of the Microsoft .NET Framework page followed by a new installation of LabVIEW.

    A few other things to note:

    Make sure you have all of your anti-virus software / firewall disabled while trying to install LabVIEW.  We have seen this before due Setup error.

    Also, make sure that you install your drivers after installing LabVIEW.

  • Simultaneous inputs from different sources

    I am creating a resistively heated wire heating unit.  What I had planned to do, is to connect the wire to a programmable DC power supply that I would link to a USB-232 (Jack single port RS232).  I also want to integrate some temperature readings of a thermocouple placed near the heating unit.  I would connect the thermocouple to one of the analog channels of a PCI-6259 (M series).  Already, we have the PCI-6259 (and the connection block), but so far have not bought the power supply DC or USB-232.  Until we buy these, anyone know if this configuration is still possible?  I wasn't sure if it would be possible to have two separate entries, enter LabVIEW from two different sources (USB and PCI) simultaneously.  Also, are there any other ways I could do it easier?  I looked into analogue programmable power supplies DC, which I was in control of the PCI-6259, but these seem to be still more expensive than RS 232 controlled ones.

    Thanks in advance

    Hi Stephen.

    You can have devices to multiply the input/output, how you design your code will detemin how well that work. The USB port can produce at the same time as the PCI card is entered. The channels you create what you will specify aquire and when.

    What is the programmable DC power you are looking at?

  • LabVIEW 2009 Student Edition Vista x 64 install no failure, no error message even though

    I am trying to install a copy of LabView student edition 2009 and initializes whenever installation, modules fail to install for each single module.  Also, there is no error message.

    I received a message that LabView can not work properly because of the firewall Windows, which I disabled it. This message sent me on ni.com/frinfo, code expm69.

    Let me know, I'm a little confused as to what is happening.  It would be due to a patch or what not?

    Thank you!

    Hi imagineerme,

    It is possible that the CD is damaged.  You can either try a different CD if you have access to one, or because you have access to a student version, you should be able to also access LabVIEW via ni.com/src.  All LabVIEW versions are available for download on this site. Please let me know if you are able to download LabVIEW from there.  NI.com/SRC will also specifically download the 64-bit version of LabVIEW, since you have a 64 bit OS.  I hope this helps!

    Kim

  • 2012 LabVIEW to hang at shutdown, now hangs at launch ("Initializing menus")

    Hello

    I'm 8 64-bit Windows and LabVIEW 2012 32 bits (12.0f3). I started using a few days ago and was never able to stop properly LabVIEW. I could close my projects, but when I tried to leave LabVIEW from the home screen, the GUI just stop responding, and I have to kill him by force. Then, I installed the last VIPM and noticed that I can not stop properly is (I think that VIPM is implemented in LabVIEW?). None of my programs not with LabVIEW has this problem.

    Then I tried to install OpenG within VIPM, which launched LabVIEW himself. However, who hung on "Initializing menus.

    I don't know if VIPM had nothing to do with it, but now I am unable to boot LabVIEW altogether. Even after restarting my machine (using the restart option, not of Windows 8 Hybrid Boot), LabVIEW cling to the "Initializing menus. Task Manager shows 0% CPU activity, and LabVIEW had taken only ~ 20 MB of memory.

    What could be the cause and how can I solve this problem?

    Thank you

    It was my antivirus which seemed to interfere! Turn off Avast! FREE Antivirus 7.0 makes LabVIEW behave properly.

    If someone has experienced something like this before?

  • Convert timestamp Unix LabVIEW

    Hello

    I need to convert a dll to come froma Unix timestamp to a moment of LabVIEW. Now someone some ready to use of function for this?

    Thank you

    What is the data type of a unix timestamp?

    The unix time is 01/01/1970.

    The era of LabVIEW is 01/01/1904

    All you add is the number of seconds between two times (i.e., the value of a timestamp LabVIEW from 01/01/1970)

  • LabVIEW: Unspecified error (Hex 0x80004005). = OR System Configuration: various failure (Hex 0x80004005).

    Hello:

    I get this error when you try to run the main.vi

    I am able to run the program from my computer at work fine. I then copied the files on another computer in our laboratory. Click on the arrow of the execution and the deployment progress window appears. Deployment status reads as follows:

    Initializing...

    Calculating dependencies...

    LabVIEW: Unspecified error (Hex 0x80004005).

    ========================

    System OR Configuration: Various operating default (Hex 0x80004005).

    I've been to the measurement and Automation Explorer and installed / reinstalled the system software to remotely on computers and that they are corresponding versions.

    Any help would be greatly appreciated.

    With the help of technical support NOR, I think we have found a solution. We uninstalled Labview from the computer. We have then reinstalled in the following order. 1 install the labview development environment in 2015. 2. install the real time module. 3. install the FPGA. 4 drivers CompactRIO. We installed these one at a time to make sure they were installed in the correct order, and it seems to have solved our problems. Thank you.

  • LabVIEW disconnects my SC card

    Hello

    I've been using a polarization controller which is only in fact a stepper motor. I order this step via a standard EiBotBoard motor. I was able to control with Labview via NI-VISA and it works. I also created a loop whose initialization process and some other commands to get a set of specific variables in terms of polarization. I run my loop once and everything is fine but when I try to do it for the second time, he is unable to finish the intermediate stage. At this time, it seems that labview loses communication with my EiBotBoard and it seems that the problem comes from Labview from any other program that I use with my Commission work great. What bothers me here is that when I close Labview, the Council immediately restarts and works very well.

    As additional information, my loop contains three wizards of Instrument of e/s on which I ask to run a single command 2500 times. If anyone wants to see it, I can upload a picture of my block diagram.

    I hope someone can help me find a way to solve my problem,

    Kind regards

    Marc-Daniel Gagnon

    Here is a view of my current VI. It is very simplistic and it is essentially a test to see if we needed to be able to generate a full sweep of the movement of an engine step by step. I'm open to suggestions to make it better if you ever get a little. My engine is connected by USB, but I had to install some. INFs given that the Council must be controlled by COM port, so basically my entry USB simulates commands COM port.

    The command send using the Instrument is simply a sequence of 'Writing' on the device with REFLUX controls that the guy who sold me the engine joined the Board of Directors. In other words, it is just the COM4, and then wrote a bunch of specific commands.

    As I said in my first post, it works real well the first time that I run and the second time that it still fails keep the connection until the movements.

    Enjoying quick responses.

    Marc-Daniel Gagnon

Maybe you are looking for