Controlling Labview using CVI/Labwindows

I am learning to control Labview using CVI/Labwindows using activeX automation but am currently having some trouble. I am trying to modify the "CVI Controlling Labview" example to accept 5 controls as supposed to the original 4 that controls the "frequency response.vi". I am doing this by increasing the size of the "paramData" array sent via ActiveX. Do I have to change something in one of the labview controls, in order for a command to be accepted. I am already making sure the corresponding "paramNames" part of the array co-incides with the labview control name. I am using Labview 7.1 and CVI/Windows 7.1.
Attachments:
cvilv.zip ‏407 KB

Hi Simy,
When you call a VI in labview the input parameters have to be defined as you would when performing a function call in C. In order to do this you must place a control or indicator on the front panel of the VI with the corresponding datatype. You must then wire the control/indicator to the connector pane for the VI (Similar to defining a function prototype).
In LabVIEW goto help>>search the labview bookshelf, LabVIEW user manual chapter 7 and look for the part on wiring the connector pane.
Hope this helps...
Tristan
Applications Engineer
National Instruments UK & Ireland

Similar Messages

  • Using CVI/labwindows application in labview

    I have an application software written in CVI and wish to use it in labview. Is there any other way to do it besides converting the codes to DLL?

    You could make the CVI program an ActiveX server but creating a .dll might be easier.

  • Control LabVIEW DLL from LabWindows GUI only

    Hello,
    I have been developing an application in LabWindows/CVI and have recently built some auxiliary applications in LabVIEW.  My goal is to make the LabVIEW applications into a DLL and call them from the LabWindows app; however, one of my LabVIEW VIs has a front panel control and a local variable to stop a pair of asynchronous while loops.  What I would like to do is remove/hide the front panel of this LabVIEW VI and control the VI from the LabWindows GUI exclusively.  Is this possible?
    Thanks!
    Slowpoke
    Slowpoke
    CLAD (believe it or not!), using LabVIEW 8.5
    They don't call me "Slowpoke" for nothin'!

    Hi, David,
    Once I figured out how to make a front panel control into a parameter, I had what must be a common reaction among LabVIEW users: Can it really be that easy?  Thank you for your reply and your assistance.
    Slowpoke
    Slowpoke
    CLAD (believe it or not!), using LabVIEW 8.5
    They don't call me "Slowpoke" for nothin'!

  • Crash in application by using TestStand 4.0 and CVI labWindows 8.01

    Our application often crashes in two areas:
    1) Often crash in the case:
        During running, if there is poop, like error message, you want to debug by opening other programs,like notepad. 
        It shows error signature:
        AppName: operator Interface.exe     AppVer. 4.0.0.326, ModName  cvirte.dll
        ModVer: 8.1.0.271         Offset : 000b9c8a
    2) Often crash at the end of test, when generating TSV file.
         AppName: operator Interface.exe     AppVer. 4.0.0.326, ModName  msvcr80.dll
        ModVer: 8.0.40727.762         Offset : 00008a8c
    We use TestStand 4.0 and CVI LabWindows 8.01. The program is running in our customized operator interface.
    But I tried using the default TestStand operator interface, it crashed too.
    Also we found it is related PC too. One PC in our lab crashed often, but it actually newer PC with bigger RAM. (Pentium(R) 4 CPU 3.2GHz), 3.19GHz, 0.99 GB of RAM)
    The one crashed Less often is Pentium(R) 4 CPU 2.80GHz, 2.79 GHZ 504 MB of RAM.
    Hope you can help us to find out root cause.
    Thanks 

    Hi Doug,
    Thanks for your reply.
    Answers to your queries:
    1. We are not calling any DLLs from our sequences.
    2. We are only using LabVIEW modules and the VIs are called under LabVIEW development environment and not using Run Time engine.
    3.  In our case it is always seqedit.exe which crashes. LabVIEW never crashed. Hence I think its TestStand whose memory is getting corrupted.
    We  are trying to narrow down the issue as suggested by you.
    By the time, we have observed a strange thing while the sequence editor crashed.
    In our sequence we call a thread which calls a VI to run continuously and collect the data from other modules.
    What we observed is that, when the sequence editor crashed (the popup appeared), it was still executing the sequence (running a loop). I was able to break the execution and debug it. All the variables were also having proper values.
    But the VI which was running in a separate thread was in surprising state. That VI was showing as executing but actually it was not running any of its code. I tried to put probes inside that VI but they were not updated (meaning that part of code was not runnning). I tried to stop the VI using the abort button but no help. It was not having any effect. I also clicked on the Pause button. The button turned red but the VI didn't halt at any part of code (actually the VI was not at all executing). An other VI which was called by another thread was working properly. I could see it by putting probes in that VI.
    If your thought about the memory corruption is correct, is it possible that this VI is somehow corrupting the sequence editor memory?
    I am not sure, but I think wherever the sequence execution may be, but the above mentioned VI is always in this state at the time of crash.
    I tried to reproduce this scenario locally but it ran without problem for hours
    Probably I am still not able to properly reproduce it. I'll work on it further and let you know the outcome.
    Regarding your last question, We are using LabVIEW notifier. A VI is called which waits on LabVIEW notifier from another VI. That code is pretty simple it just obtains a notifier and waits on it indefinitely.
    Please let me know your views on the above mentioned issue.
    Thanks,
    - Kaustubh

  • Using LabView drivers with LabWindows

    Hi.
    I'm planning on using LabWindows to operate a progRes camera, which states they have labview drivers. I'm assuming that labview drivers will work with LabWindows, but just thought I'd ask if that's a valid assumption. (I've never used either program before)

    Typically, when a piece of harwdware says it had LabVIEW drivers, this means that it has utlity or accessibility functions for LabVIEW. As LabVIEW is its own language, and LabWindows is a C editor/compiler, LabVIEW functions or .vi's will not inherently work in LabWindows/CVI.
    While it is definitely possible to call LabVIEW code from LabWindows/CVI, you will most likely want to see if there is a C interface for the hardware from LabWindows/CVI.
    Hope this helps.
    Peter Flores
    Applications Engineer

  • How can i use labview.tl​b to control Labview from an external applicatio​n?

    Hi,
    I've been told by a labview engineer that i could use the file
    labview.tlb located in the labview install folder to control labview
    from an external application (in my case, a C# app). I'm using Labview
    6.1 under Windows 2000. This article confirms that:
    "ActiveX and LabVIEW"
    http://zone.ni.com/devzone/conceptd.nsf/webmain/54​01BE584FBAEECE862567C2006D36C7?opendocument
    But i've not been able to find out how to use this file to achieve
    what i want. I just want to be able to open/close labview, open/close
    a vi, start/stop a vi, hide/show a vi from a C# application. The above
    web page talks about activex but i really don't see the realtion
    between activex and that labview.tlb file.
    Is there so
    mebody around who knows how to use that file? Why does NI
    tell us that it's possible to do what i want to do but doesn't explain
    how (or hides this info very well)?
    Thanks

    Hi,
    > Hi I am fighting a similar problem and so far I found this: Calling
    > LabVIEW from C++ Using ActiveX
    >
    > http://sine.ni.com/apps/we/niepd_web_display.DISPL​AY_EPD4?>p_guid=B45EACE3E21356A4E034080020E74861&p​_node=DZ52051&p_submitted=N&p_rank=&p>_answer=&p_s​ource=External
    Thanks for the link, i actually already found this link before. I've
    found yesterday how to use Labview.tlb, just add it to the references
    of the project, it was probably too easy for me at that time:-) But
    now, i'm still stuck as there is no doc about using the interfaces and
    classes of this activex to control labview.
    The example given on your link is made is C++ and for some reasons,
    the wrapper generated for Labview.tlb when i added it to my c# project
    doesn't seem to expose the same
    interfaces and classes as the one used
    in the C++ example. I therefore can't use the C++ example in C#.
    I've tried to do something like:
    LabVIEW.ApplicationClass a = new LabVIEW.ApplicationClass();
    Just this line causes labview to launch but then immediately throws an
    exception: "Query interface for interface LabVIEW._IApplication
    failed".
    Does somebody knows how to use that control in C#/VB.NET ?

  • How to pass Visa Resoure Name parameter to labview dll in labwindows​​/cvi

    Hi, everyone
    I build a dll from labview, the prototype is : double  getchannelpower(double f, uintptr_t *VISAResourceName);
    I don't know how to pass VISAResourceName to this function.How can I get the VISAResourceName of this type(uintptr_t *)?
    Is it related to the paremeter ViPSession in function viOpen(ViSession sesn,ViRsrc rn,ViAccessMode am,ViUInt32 ti,ViPSession vi)?
    BRs,
    lotusky

    1. uintptr_t *VISAResourceName in the labview dll is connected to viOpen function as input parameter internally.
    2.I can call the labview dll in labview via CLF Node, when the VISAResourceName parameter is set  to Numeric(32-bit int or 32-bit usigned int) OR Adapt to data(Handle by Value). And I got the value of the VISAResourceName parameter, which is 0; When I directly connect 0 to the dll, it still works. But in labwindows, when  I pass 0 to the VISAResourceName parameter of the dll function, I got a FATAL RUN-TIME ERROR: The program has caused a 'General Protection' fault.
    mkossmann 已写:
    Could you check what exactly uintptr_t *VISAResourceName in your labview dll does.Might it be that it is connected to the labviews Dll internal ViOpen() ViSession output parameter ?.   And the name VISAResourceName is misleading.
    Another idea would be that Labview uses 32bit Unicode for the ResourceName. And you have to convert the C String to that Unicode first.

  • Why can't LabVIEW use the common dialogue control?

    Hi,
    I was trying to place Microsoft's common dialogue control (6) into an active
    x container in LabVIEW 6.02. The container remains empty. I am running
    Windows 2000. I tried it on another Labview 6.02/Windows 2000 machine with
    the same results. Can you tell me why I can not use this control? (I was
    able to use other Microsoft controls this way, but I needed the common
    dialogue control.)
    Thanks.

    The common dialog control is used to display several common dialogs in windows. You can place the control in the container and then use an invoke node to launch a specfic dialog, and use property nodes too set options and read results of the dialog.
    Attached is a simple examlpe of using the open dialog.
    Brian
    Attachments:
    commondialog.vi ‏21 KB

  • Tension control in labview using PCI 7354 Motion Control Board

    I want to make a program for web tension control of roll to roll system in labview using PCI 7354 Motion Control Board. Is there any interface program that can convert my controller output in a format to be directly used as the input of PCI 7354 (Motion Controller Board) for tension control?
    Thank you!

    thanks for your reply, i have already make the code of a straight line move and the motor moves successfully, but know i want to put the H-bridge to be able to make a reverse direction for the motor, for your information i only use a PCI-7340 controller and a UMI-7774, where the controller connected to the UMI-7774, the UMI connected to a PWM circuit and the PWM connected to the DC-motor, so what do you think i can do?

  • How does labVIEW use ActiveX controls?

    How does labVIEW use activeX controls?
    I recently wrote an activeX control in VB and noticed that it would not work if the control was set so that its properties could not be set in ambient mode. This may suggest that labVIEW uses some activeX controls only in ambient mode.
    Is this the case or are there more complexities?

    Dan,
    Which version of LabVIEW do you have?
    As per the KnowledgeBase bellow, in versions of LabVIEW prior to 5.1 you would get errors accessing the ambient properties.
    ActiveX Controls in LabVIEW 5.0.1 Containers Cannot Access Ambient Property
    Do your controls use the Ambient.UserMode to determine when the control is being used in a development environment? When embedding ActiveX controls into a container on the front panel, by default, the ActiveX control generates and responds to events, i.e. it is running, even when LabVIEW is in edit mode.
    Right-click an ActiveX container and select Advanced»Design Mode from the shortcut menu to display the container
    in design mode while you edit the VI. In design mode, events are not generated and event procedures do not run. The default mode is run mode, where you interact with the object as a user would.
    Information can be found in the LabVIEW help files
    Zvezdana S.

  • CALLING DLL: Labview or CVI?

    I'm going to start a new project using Testand and Labview or CVI. In this project I will make a lot of calls to C++ functions packed at a DLL file. The Dll was prepared and compiled using MVC++.The function prototypes are not simple & contain structures, pointers and typdefs's.
    Is it possible to call the functions from Testand,Labview,CVI?
    Is it easier to call the functions from CVI compared to Labview?
    Thanks,
    Ofer

    ofer_o wrote:
    I'm going to start a
    new project using Testand and Labview or CVI. In this project I will
    make a lot of calls to C++ functions packed at a DLL file. The Dll was
    prepared and compiled using MVC++.The function prototypes are not
    simple & contain structures, pointers and typdefs's.
    Is it possible to call the functions from Testand,Labview,CVI?
    Is it easier to call the functions from CVI compared to Labview?
    Thanks,
    Ofer
    Jon already mentioned that CVI will be a lot easier to deal with this than LabVIEW.
    BUT!!! Make sure the DLL exports standard C functions instead of C++.
    LabWindows CVI (and LabVIEW even more so) can only link to globally
    exported C functions. C++ classes are completely out of reach for both
    and C++ compiled global functions have both the problem of taking
    sometimes C++ parameter types as well as the name decoration added by
    the C++ compiler to all function names.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Can I automate the creation of a cluster in LabView using the data structure created in an autogenerated .CSV, C header, or XML file?

    Can I automate the creation of a cluster in LabView using the data structure created in an auto generated .CSV, C header, or XML file?  I'm trying to take the data structure defined in one or more of those files listed and have LabView automatically create a cluster with identical structure and data types.  (Ideally, I would like to do this with a C header file only.)  Basically, I'm trying to avoid having to create the cluster by hand, as the number of cluster elements could be very large. I've looked into EasyXML and contacted the rep for the add-on.  Unfortunately, this capability has not been created yet.  Has anyone done something like this before? Thanks in advance for the help.  
    Message Edited by PhilipJoeP on 04-29-2009 04:54 PM
    Solved!
    Go to Solution.

    smercurio_fc wrote:
    Is this something you're trying to do at runtime? Clusters are fixed data structures so you can't change them programmatically. Or, are you just trying to create some typedef cluster controls so that you can use them for coding? What would your clusters basically look like? Perhaps another way of holding the information like an array of variants?
    You can try LabVIEW scripting, though be aware that this is not supported by NI. 
     Wow!  Thanks for the quick response!  We would use this cluster as a fixed data structure.  No need to change the structure during runtime.  The cluster would be a cluster of clusters with multiple levels.  There would be not pattern as to how deep these levels would go, or how many elements would be in each.   Here is the application.  I would like to be able to autocode a Simulink model file into a DLL.  The model DLL would accept a Simulink bus object of a certain data structure (bus of buses), pick out which elements of the bus is needed for the model calculation, and then pass the bus object.  I then will take the DLL file and use the DLL VI block to pass a cluster into the DLL block (with identical structure as the bus in Simulink).  To save time, I would like to auto generate the C header file using Simulink to define the bus structure and then have LabView read that header file and create the cluster automatically.   Right now I can do everything but the auto creation of the cluster.  I can manually build the cluster to match the Simulink model bus structure and it runs fine.  But this is only for an example model with a small structure.  Need to make the cluster creation automated so it can handle large structures with minimal brute force. Thanks!  

  • How to get the position of the stem in control valve using slider control in the front panel

    I have created a calibration program for a control valve. Signal (4-20mA) is generated from labview using slider contorl which is given to the valve via DAQ(module 9265) and again the feedback signal from the valve is acquired using DAQ(module 9203).. . There is an input ISO/ISC(Increasing signal to open/ Increasing signal to close) in the front panel.
    ISO would set the output to increase from (4-20)mA further opening the valve
    ISC would set the output to increase from (4-20)mA further closing the valve
    I have doubt, how can i get the position of a stem

    Ravens Fan wrote:
    If the position of the stem is being sent to the PC through a 4-20 mA signal into your DAQ 9203 module, then you just need to do an analog input read in order to get the signal.
    When reading this post, that is what came to mind...  So let's see if both RavensFan & I are trying to understand the same thing...  Are you saying that the position of the stem is linear (or scaled) to the amount of current sent to it?  Meaning a 4mA signal would move it a certain distance, and 10mA would move another given / known distance?  Or are you saying that it is calibrated so that a 20mA signal for a certain duration (ms) would move it a given distance? So the scale would be time and not current unless a lookup table is used to adjust the time duration based on the current being drawn...
    It's just that I am not familiar with solenoid / drive devices that related to current..  To voltage, yes.  To time, yes..  To current, I'm simply saying that I am not familiar with that.  Can you tell us more about this stem (mfg / model designation)?

  • Trouble when Labview call CVI DLL in after compiled to EXE

    Hi,
    I m developing a program by LabVIEW, and have to call a DLL, which developed by using CVI. 
    The UI of the DLL consist of a table and a listbox. 
    The DLL run smoothly but when I compiled the project to EXE, when the program call the DLL, the DLL won't show properly.
    The DLL UI only show the table, and the listbox has "disappeared".
    Any common known-problem caused it ? Please advise. Thanks a lot. 

    Hi Engwei,
    I'm not familiar with any such issue. Would it be possible for you to post the corresponding CVI and LabVIEW codes and the built DLL and executable? I would like to investigate this issue further. Also, what version of CVI and LabVIEW are you using?
    Thanks!
    Joshua de la Llana
    NI Applications Engineer

  • Read an AutoCAD drawing In Labview using ActiveX

    I want to read an AutoCAD drawing (.dwg) in the LabVIEW using Activex
    plz send me the procedure for it & the Library files that will be required to get the objects.

    Had to change the labview background color. Here is an image of a dwg file inside the activex control.
    Attachments:
    autocad dwg document inside labview.PNG ‏113 KB

Maybe you are looking for