Exchanging 2 D array between VBA and labview

I have a project : half part is VBA writen, half part is  Labview coded. Both parts are writen to operate manually. The first one prepares data and charts them on charts sheets, the second one smooths data with ready made labview curves fitting VIs. So I want operator could use them seamless, that means calling labview from VBA 2007 code collecting X,Y data into a 2 D array, then send it to labview DLL smooth the curves and send back an array with smoothed data to excel through VBA.
My concern is how to declare 2D array parameters in VBA  and in Labview in order to work fine (array of variants or doubles, parameters declared by ref or by val)
I have seen similar topics in NI forum but they dealt with VB.net and not VBA .
I run office 2007 and labview 2009 full dev. system with application builder.
Regards

bassevellois wrote:
Thank you for the answers.
The examples provided with labview for ActiveX exchanges are not very clear. I want to use labview as ActiveX server and Excel through VBA as client.
There's only one example that I know of that ships with LabVIEW and it shows how to access LabVIEW from VB using LabVIEW's ActiveX server. It opens a VI and runs it. Doing it from VBA is very similar. You want to add the reference to the ActiveX Server in your VBA project. If you're controlling the LabVIEW development environment directly, then the library to include in your list of references will be "LabVIEW x.x Type Library". If you are controlling a LabVIEW-build app, then the library name will be whatever you specified when you built the app. 
I have no idea of creating and exposing classes, methods or properties needed in VBA from my Labview VI which was at the beginning a standalone application.
I don't quite understand what you are referring to. The ActiveX Server in LabVIEW and a LabVIEW-built app are pre-defined. You do not export anything from your LabVIEW VI. The available properties and methods are a function of the LabVIEW ActiveX Server, not of your VI. If you are building an app then you just need to enable the ActiveX server for the application, and that's done in the build specification. 
How to reproduce my example:
Make sure you've enabled the ActiveX Server in LabVIEW. 
Download the attached 2D_VBA_Test VI to your C:\Temp folder. You can save it anywhere, but you'd have to change the path in the Excel VBA macro.
Download the attached Excel workbook.
Open the workbook and click the button. If LabVIEW is not running it should launch LabVIEW, and open the VI and populate the front panel array with the values from the spreadsheet. 
Attachments:
2D_VBA_Test.vi ‏6 KB
VBA to Excel.xls ‏24 KB

Similar Messages

  • Communicate large number of parameters and variables between Verstand and Labview Model

    We have a dyno setup with a PXI-E chassis running Veristand 2014 and Inertia 2014. In order to enhance capabilities and timing of Veristand, I would like to use Labview models to perform tasks not possible by Veristand and Inertia. An example of this is to determine the maximum of a large number of thermocouples. Veristand has a compare funtion, but it compares only two values at a time. This makes for some lengthy and inflexible programming. Labview, on the other hand, has a function which aloows one to get the maximum of elements in an array in a single step. To use Labview I need to "send" the 50 or so thermocouples to the Labview model. In addition to the variables which need to be communicated between Veristand and Labview, I also need to present Labview with the threshold and confguration parameters. From the forums and user manuaIs understand that one has to use the connector pane in Labview and mapping in Veristand System Explorer to expose the inports and outports. The problem is that the Labview connector pane is limited to 27 I/O. How do I overcome that limitation?
    BTW. I am fairly new to Labview and Versitand.
    Thank you.
    Richard
    Solved!
    Go to Solution.

    @Jarrod:
    Thank you for the help. I created a simple test model and now understand how I can use clusters for a large number of variables. Regarding the mapping process: Can one map a folder of user channels to a cluster (one-step mapping)? Alternatively, I understand one can import a mapping (text) file in System Explorer. Is this import partial or does it replace all the mapping? The reason I am asking is that, if it is partial, then I can have separate mapping files for different configurations and my final mapping can be a combination of imported mapping files.
    @SteveK:
    Thank you for the hint on using a Custom Device. I understand that the Custom Device will be much more powerful and can be more generic. The problem at this stage is that my limitations in programming in Labview is far gretater than Labview models' limitations in Veristand. I'll definitely consider the Custom Device route once I am more provicient with LabView. Hopefully I'll be able to re-use some of the VI's I created for the LabView models.
    Thanks
    Richard

  • Interface between paravision and labview

    Hi,
    Does any one here who can help or give some idea how to make an interface between paravision and labview software???I need to acquire captured MRI image from paravision and store it to Labview.
    I would appreciate for any kind of assistance.
    Kind Regards,
    Jasim

    Hi Jasim,
    Could I get a little more information about how you are importing the MRI image into LabVIEW?
    1) How are you getting the MRI image into LabVIEW?
    2) What image format will the image be in?
    3) What will you be doing to the image once it is in LabVIEW?
    Best Regards,
    Bill
    Bill E. | Applications Engineer | National Instruments

  • The diffirenties between lookout and labview?

    how can i understand the diffirenties between lookout and labview?
    i ve learnt about lookout but known nothing about labview.
    my teacher ask me about this master. and what application we use lookout instead of labview?
    thanks for all your help!

    Lookout is focused on HMI/SCADA application. It uses OPC to communicate with PLCs or devices.
    LabVIEW is much more powerful. LabVIEW is a programming platform, like VC. It can do everything. LabVIEW DSC module adds the functionalities of Lookout to LabVIEW.
    You'd better try the LabVIEW software, to better understand it. See this page. http://www.ni.com/labview/whatis/
    Ryan Shi
    National Instruments

  • How do i data exchange between TestDirector and labVIEW

    Hai to all,
    By using one COMServer(VC++), that COMServer exchange the data between TestDirector and LAbVIEW7.0, How to call LabVIEW function in activex, is it posible or not?
    if posible please post your answer.

    Hi reddys,
    You can call the LabVIEW ActiveX Automation Server.
    This can be done from any programming language.
    Following the links below, you will find some examples.
    Calling LabVIEW from C++ Using ActiveX
    http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3E21356A4E034080020E74861&p_node=DZ52051&p_submitted=N&p_rank=&p_answer=&p_source=External
    Calling LabVIEW as an ActiveX Server from Visual Basic
    http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3E3D756A4E034080020E74861&p_node=DZ52051&p_submitted=N&p_rank=&p_answer=&p_source=External
    Communicating with LabVIEW from Delphi using ActiveX
    http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3E8D156A4E034080020E74861&p_node=DZ52051&
    p_submitted=N&p_rank=&p_answer=&p_source=External
    Calling a LabVIEW VI with the LabVIEW ActiveX Automation Server
    http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3D85956A4E034080020E74861&p_node=DZ52156&p_submitted=N&p_rank=&p_answer=&p_source=External
    Remote Control (Launch) of LabVIEW Using ActiveX/DCOM
    http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B123AE0CBA64111EE034080020E74861&p_node=DZ52051&p_submitted=N&p_rank=&p_answer=&p_source=External
    I hope this helps!
    Regards,
    Richard H.
    National Instruments

  • Difference between diadem and LabVIEW Report Generation Toolkit

    I want to expand LabVIEW's reporting capabilities.  Can someone tell me what the difference is between DIAdem and the LabVIEW Report Generation Toolkit for Microsoft Office.

    Hello Mr Bean,
    There are several major differences between the two solutions. I'll try and outline them as good as I can ...
    The biggest different is that LabVIEW and its toolkits are programming tools and DIAdem is a ready to run application.
    The LabVIEW Report Generation Toolkit basically provides an extensive library of VIs that allow you to connect LabVIEW to the MS Office library and create and edit reports in Word and Excel.
    DIAdem is a stand alone application that was designed to post-process data from various sources. The tools included in DIAdem are:
    1. NAVIGATOR: Allows you to import data from files (ASCII, binary, Excel, etc.) as well as DataBases (SQL/ODBC, Citadel, ASAM, etc.). The unique DataPlugin technology available within DIAdem allows you to import vitually and data file by creating a DataPlugin that describes the data format and gets linked to DIAdem. More information at: http://www.ni.com/diadem/dataplugins.htm
    2. VIEW: Graphical and Numerical data inspection tool. Use cursors to zoom and scroll through your data, edit your data graphically and numerically and compare different tests.
    3. ANALYSIS: DIAdem has a wide range of analysis functions, ranging from simple functions like integration and differentiation to FFTs, Order analysis and 3D data analysis.
    4. REPORT: The DIAdem REPORT tool allows you to create reusable report layouts that can contain multiple axis systems (2D, 3D and polar plots) as well as tables (2D and 3D) and variables. The REPORT tool generates templates that can be usedwith multiple data sets due to the inclusion of automatic (or manula if required) scaling as well as extensive use of variables for annotations. Finished reports can be exported to printers, graphics files, the Windows Clipboard, HTML pages and PDF files (PDF writing is build into DIAdem, no extra software required). Using Scripts, it is also possible to create Word, Excel or Powerpoint reports from DIAdem automatically.
    5. SCRIPT: The DIAdem scripting tools allows users to record macros or write scripts that automate complete sequences, for the import of data, via extensive analysis, to creating a publication ready report. Scripts can make reports "intelligent" by modifying the appearance of a report based on the data or calculation results that are going to be displayed in the report.
    I recommend you check out the following link for more information: http://www.ni.com/diadem/
    DIAdem is an extremly powerful tool for report generation. I am leaving to go on a business trip to Asia, but I would be more than happy to give you an Web presentation on DIAdem after I have returned. We could use your data and create a DIAdem report Script together online. My Email address is [email protected] and I will be back the week of Thanksgiving.
          Otmar
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."

  • Interface between C++ and labview

    I have decided a project that consists of C++ and Labview. C++ is used
    as the input to labview. However, i don't know how to use C++ to
    control the labview. Can C++ control the labview directly? and how ?
    or I have to buy another program or hardware to be interface?
    Sent via Deja.com http://www.deja.com/
    Share what you know. Learn what you don't.

    ActiveX and TCP/IP are both good choices for high-level communication
    between Windows applications. LabVIEW's VI Server, introduced in version
    5.0, gives you tremendous power to control LabVIEW programmatically and
    exposes it to the programmer via either ActiveX or TCP/IP.
    For a very nice example that shows how to call a LabVIEW VI with arguments
    passed from the C++ environment, then bring the resulting data from
    LabVIEW back to C++, check out the following example from NI's site:
    http://digital.natinst.com/explprog.nsf/websearch/6960cee3bf3d8c30862565da0078ef30?OpenDocument
    If the URL doesn't work for you, just go to NI's Example Programs Database
    (http://www.natinst.com/support/epd/) and search for "labview and c++".
    Regards,
    John Lum
    National Instruments
    Matthew
    Ho wrote:
    > I have decided a project that consists of C++ and Labview. C++ is used
    > as the input to labview. However, i don't know how to use C++ to
    > control the labview. Can C++ control the labview directly? and how ?
    > or I have to buy another program or hardware to be interface?
    >
    > Sent via Deja.com http://www.deja.com/
    > Share what you know. Learn what you don't.

  • Interface between Labmax and Labview

    Hi all,
    I am trying to control a laser energy meter, Labmax-top, with labview using labview drivers provided by the meter’s manufacturer (coherent). Once running the labview driver an error message appears saying that the sensor index cannot be found. According to the manual, the sensor index is a number between 1 and 127 and is automatically set by the system.
    Does anyone know how to set this manually? or any experience with these kind of problem?
    Thanks

    I am not familiar with this system at all, but in the worst case your LabVIEW program could just iterate over all possible sensor numbers until it no longer generates an error....
    LabVIEW Champion . Do more with less code and in less time .

  • Datasocket: link between java and labview

    Hi,
    I would like to link java and labview for a real time animation and i would like to use datasockets.
    Can somebody proficient in using datasockets help me out.
    My email id is [email protected]
    Thank u.
    jagadish.

    The person who wrote the book (literally) on LabVIEW and Java is Jeffrey Travis. His book "Internet Applications in LabVIEW" has examples. His web site is here. You can also get the book on Amazon.

  • Font Size Difference between Exe and Labview IDE

    I'm stumped on the following issue and surprizinglycan't find any references that are similar on this forum.
    I've developed an application which, when built to an Exe, has different font sizes than when executed on the same computer in the Labview Integrated Development Environment.  In each instance the screen resolution is the same.  I've used the "Application Font".  I'm having trouble figuring why the font would render differently in each case.  Of possible signifigance is that I'm running the Exe by simply browsing to the folder where the build procedure drops it instead of building an installation.
    I've attached one of the most glaring examples that shows the rendering in each case.
    I'm hoping that someone can point me in the right direction to resolve this issue.
    Attachments:
    Font Differences1.zip ‏1704 KB

    Hi Doctor,
    two notes:
    for the font size differences: I would try to change the font settings
    to a more 'specific' font like Arial 14pt. The application font is set
    somewhere in an ini-file and the setting may change with the
    environment (IDE vs. exe-rt).
    for your attachment: please convert pictures to jpg or png. This will
    reduce size by orders of magnitude :-) And please crop them, unless you
    have a very (VERY) beautiful desktop background picture!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • What is the link between PLC and Labview

    provide me details regarding Subtitution of scada with labview

    Lots of details if you follow this link:
    http://ni.com/labview/labviewdsc/what_is.htm?node=10418
    =====================================================
    Fading out. " ... J. Arthur Rank on gong."

  • Sharing an array between flex and php

    please provide some easy methods because i am new to
    php.

    please provide some easy methods because i am new to
    php.

  • Relations between Matlab structures and LabVIEW clusters

    I have a DLL created with Mathworks COM Builder, used as an ActiveX component in LabVIEW. Thus, I am able to have my Matlab functions inside LabVIEW. However, I have a problem regarding the pass of parameters between Matlab and LabVIEW.
    When the Matlab functions parameters are simple -DBL, DBL arrays, strings-, there is no problem. LabVIEW does the right translation. But I have not been able to pass a Matlab structure to LabVIEW, which counterpart I think it would have to be a cluster. To solve this situation I need to split the structure components and pass them separately.
    Does anyone know how to do it without the workaround?
    Thanks in advance and have a good day,
    spj

    Hello Tishu,
    1)       Can we use nested for loop in Mathscript node?
    1) Yes you can. Remember that loops should be avoided as much as possible in m-scrips. Most of the times you can use vectorization to represent same task.
    2)       Which one of these is feasible: 1) Matlab script node
                                                              2) Mathscript node
    2) What exactly is the "Feasable" question? Real time (see below) or nested loops (see above)
          3)  Is there any other way to interface between matlab and LV for real time signal processing?
    3) Real time is different depending the application. Some applications need ns or ps real time (RF appls) others need seconds delay. Real time means "determinism". That a task will execute in a know time with little jitter. Windows is not a real time OS therefore nothing in it will operate in real time. Can you tell us something about the signal your are processing (Audio, Image fps, Radar)?
          4)  Suppose X is 1D array (DBL) in Labview. And Mathscript code is as below:
    For i=1:inf,  4) Is this vector a valid one? inf = Inf which is different from 1/eps.
    Y= X-1;
    end
    Here X is input and Y is output.
    Such code does not produce output (Y variable) in real time processing.
    Does it wait till the FOR LOOP ends?  Is there any solution to such problem? 5) What is this suppose to produce?
    Let me know,
    yardov
    Gerardo O.
    RF Systems Engineering
    National Instruments

  • How Multisim, ELVIS 2+ Board, and Labview All Connect

    My school recently obtained some ELVIS 2+ boards and I have been tasked with figuring out exactly what they can do and how we can incorporate them into the curriculum as part of my work study.  Now I have all the basics down for building a circuit on the ELVIS, getting measurements and controlling inputs on the computer etc.  I would like to delve deeper into what the full potential of this device is by integrating it with multisim and Labview.  My question is, is it possible to construct a circuit (or partial circuit) in multisim and then send the output of said circuit to the ELVIS board where it could feed into an actual circuit.  For example, could I build a voltage supply virtually in multisim, and output the voltage to a specific pin on the ELVIS board where I could wire it into my built circuit?  Along the same lines, could I build a circuit on the board and send the output of the circuit to a program in Labview?  Is this board capable for such things or is its connections to labview and multisim just used as a comparison tool for real life readings and simulated readings?  What is the full potential of this board?

    Hello,
    Glad to hear about you work with NI ELVIS. The integration between ELVIS and Multisim is limited to running circuit simulations and then comparing results with the real circuit, in other words, you can compare simulated vs real measurements; this is a great approach to circuits education. 
    Now, if you want to have more control of the inputs/outputs available on NI ELVIS, then LabVIEW is the perfect fit. In LabVIEW you can use the NI ELVISmx Express VIs to configure settings for all the instruments. Furthermore, NI ELVIS is supported by the NI-DAQmx driver, therefore you can use the NI-DAQmx functions to acquire signals from the analog inputs, generate signals in the analog outputs, access the digital I/O and program general counter/timing functionality.
    Visit the NI ELVIS & NI myDAQ Instruments and Applications community to learn more about the integration between ELVIS and LabVIEW; in this page you will find some ready-to-use applications.
    Hope this helps!
    Fernando D.
    National Instruments

  • Exchange rate difference between MIRO and GR/IR

    Hi,
    Exchange rate difference between MIRO and GR/IR we need to written off as a expense for imported w/off expense and in case of assets we need to post exchange rate difference to exchange fluctuation account. Currently exchange rate difference is accounting under capital work in progress(Asset)instead of exchange fluctuation.
    Thanks in Advance
    Regards
    Venkata Suresh

    Hi,
    At MIRO stage, after entering PO number system will automatically populate the GRN value for selection. Here if you found that invoice value, which you have received from the vendor, is more than the system proposed amount, then you can adjust that diff amount in the GL account tab, which is next to PO reference tab in MIRO.
    There enter the exch loss GL account and enter the diff amount.
    Thanks,
    Srinu.

Maybe you are looking for

  • Facebook log in error occured

    I cannot log in to any of my accounts in facebook here in my ipad. Please help.

  • HP DV6 2030 SD recovery failure

    Hello I have a nearly three year old HP DV6 2030 SD and for several reasons I wanted to reinstall all software. Directly after buying (december 2009)  I made the three rescue DVD's and a system recovery DVD, and just to check, I then reinstalled the

  • Automatic  journal create  in HFM

    Hi, How to create journal using script function and set journal custom value? Thanks Edited by: D. Morozov on 14/5/2010 17:09

  • How to save mapping errors in a Table

    HI, In a mapping i have a target Table Customer, when some records are rejected i want to save those records in an error table. How can i do that in Warehouse Builder 10g Release 1 (10.1) Thanks.

  • IPhone not synching with iTunes - Windows 8.1

    A quick search finds that Microsoft Support is referring people to this Apple forum. The iPhone does show in "This PC" (formerly "My Computer).  Device Manager reports that the device is working properly. I will keep looking, but any help is apprecia