Labview, ActiveX, and VarPtr

I currently have a 3rd party ActiveX product that I am using with Labview 11.0.  One of the Methods requires me to pass the VARPTR of a TYPE (Labview Cluster) and the LEN of the TYPE.  In Visual Basic, VARPTR and LEN produces a 32bit signed long integer word.  How do I get the Labview-equivalent of VARPTR and LEN values of a Labview Cluster to pass to the routine.

You can get a pointer to a memory address in LabVIEW.  The functions you'll need are DSNewPtr, MoveBlock, and DSDisposePtr.  These functions are built into LabVIEW and you can call them using a call library function node configured with the library name set to "LabVIEW."  They are documented in the LabVIEW help, and there are examples for how to use them on this forum.  You can get the size of a cluster by flattening it to a string, then getting the string length.  If your ActiveX component expects to do something useful with that cluster, you may need to reorganize the cluster or add extra padding elements because LabVIEW does not necessarily pack structure elements the same way other software does.  Also be aware that LabVIEW data has the opposite endianness of most Windows software so you may need to do some byte-swapping.

Similar Messages

  • Labview, ActiveX, and ThorLabs Piezo controller

    Grettings,
    We recently purchased some 6-axis piezo positioners, and 3-channel APT controllers from ThorLabs. The main goal of this was to created a Labview program that can automate the positoners and have them move in sync with other measurement hardware. All the software I can seem to find for the controllers is this ActiveX stuff. Is there a normal Labview driver for these Piezo controllers? Or does anyone have a good example code of Labview controlling the movements of the piezo positioners without this ActiveX GUI interface. I basically need to automate an optical alignment very accurately and quickly(with the piezo) based on measurements from other devices, such as lasers and power supply's power meters, mulit-meters, ect.
    Any help/tips/suggestions will be most appreciated.
    Thank you.

    Hi Everyone,
                      I am really very new to Labview and i am in great need for some help.I am assigned a task where i am supposed to create a labview program to control or moniter a BPC203 3 channel benchtop  Piezo controller. I created a program with the help of the instructions provided in the APT-Labview guide provided by Thorlabs.But th program doesnt run . Whenever i try to run it i get the same error which says that "Control HW Communications disabled".I have attached a snapshot of the error message.So i tried to create a small program in labview which would read the volage output.Even there i got the same error message.I suppose there is some mistake on my part which i am not able to correct due to the lack of proper knowledge.Could anyone please help me to solve this problem.A slight elaboration would be highly appreciated.Also i think the error lies in the use of invoke node with the get Voltage output method. I am not sure whether the parameters i have provided to the invoke node are correct.Any help of any sort would be highly appreciated.
    Attachments:
    Front Panel with error message.PNG ‏202 KB
    Block diagram.PNG ‏101 KB

  • LabView, ActiveX, and Arrays

    I'm experimenting around with using ActiveX controls in LabVIEW. I've
    written a method in C++ that accepts an array as one of the parameters;
    however, when I try to wire an array to that parameter in LabView, it
    comes up as a bad wire.
    Here is the .odl code:
    [id(5), helpstring("method SetConfiguredIDs")] HRESULT
    SetConfiguredIDs([in, size_is(ArraySize)] int* ID_Array, [in] int
    ArraySize);
    The prototype for the method is:
    SetConfiguredIDs(int *ID_Array, int ArraySize)
    I can wire an I32 control to the ID_Array parameter, but when I try to
    wire an array of I32s, the wire is bad.
    How do I specify that the input is an array?
    Scott

    The Variant really isn't going to slow down the transfer. LV arrays are not the same as VB arrays (which through COM are passed as SafeArrays). Thus to make the call, we need to create an instance of a SafeArray and copy the LV array into it (and back out if the parameter is marked in/out or out). If the array size is very large, this can get expensive. Unfortunately, if you want to access the array data in both languages, then there isn't any other solution - the data types are just different and thus require the copy.
    Brian Tyler
    http://detritus.blogs.com/lycangeek

  • How Do I set up a LabView ActiveX server?

    Are there any documenation or sample program which is about how to setup a LabView ActiveX server? my C++ program will dynamically call VI and then pass the integer to Labview program via ActiveX and then perform some control of digital oscillscope. Do anyone help me? thanks for help so much......It is in hurry......please help..............
    CowCow

    From the NI knowledge base...
    Problem: How do I enable LabVIEW as an ActiveX Server?
    Solution: Under Edit >> Preferences >> Server: Configuration, select ActiveX as a protocol and enable all server resources. Under Edit >> Preferences >> Server: Exported VIs, list the name of all VIs that can be accessed remotely. You can include the full path to the VI, or just list its name. Wildcard characters are valid. You can explicitly deny access to certain VIs by clicking the Deny Access button. Note that changes to the Server will not take effect until LabVIEW is relaunched.

  • LabVIEW 2011, and Excel 2010: saving problems

    Hello to all! I am a student of Mechanical Engineeringfthat very little has been using this software. I present the problem: for a matter which is called Biomechanics, I and my colleagues, we have developed the design of a rheometer, which is controlled by LabVIEW2011. Since we are still at the experimental stage, always has been simulated using labview: the whole experience. So, labview, at present, not only controls the stepper motor through the frequency sets, but also simulates the output (in the specific, the response to the torsion of the cartilage, simulated with a low pass filter of the second order). All this was done by my colleague more experienced than me, who today passed me the finished project that in his pc works perfectly while not in mine (we have the same version of labview, but different version of office). In practice, the program is fine (there is no arrow "Run" broken) and the simulation with the creation of the sine graph (response of the cartilage) is done perfectly. My colleague then set labview in order to save the data to an excel sheet at the end of the simulation, asking the user where to put it (the excel file must already exist, labview does not create it). The excel file should contain two columns and a scatter plot (one column represents the frequency, f, of the stepper motor, the second represent the shear modulus G, which increases as the frequency increases and the graph represent the trend of G in function of f). As soon as I decide to save the data, excel opens, for an instant appear the scatter plot and data in columns but immediately after the graph disappears and remain only the columns with data (so I have to make the graph "manually") and labview gives me the following error:
    Error -2147023170 occurred at Property Node (arg 2) in NI_ReportGenerationToolkit.lvlib:Excel_Insert_Char
    t.vi->NI_Excel.lvclass:Excel Insert Graph.vi->NI_ReportGenerationToolkit.lvlib:Excel Easy Graph.vi->SaveExcelFile.vi->Progetto 2.0.vi
    This error code is undefined. Undefined errors might occur for a number of reasons. For example, no one has provided a description for the code, or you might have wired a number that is not an error code to the error code input.
    Additionally, undefined error codes might occur because the error relates to a third-party object, such as the operating system or ActiveX. For these third-party errors, you might be able to obtain a description of the error by searching the Web for the error code (-2147023170) or for its hexadecimal representation (0x800706BE).
    What can I do?
    Thanks. Regards
    Solved!
    Go to Solution.

    The LabVIEW Report Generator in LabVIEW 2010 and more recent versions does, indeed, work very well with Excel in Office 2010.  I helped someone about two weeks ago with a problem saving a series of measurements to a (new) Excel Workbook.  Your problem differs in two ways -- you want to save in an existing Excel file (why? Aren't you worried about overwriting data, or are you trying to add a new WorkSheet, or append to the end of an existing WorkSheet?) and making a Chart.  I've not tried charts, so don't have advice right now.
    Judging by your error message, it is the Chart feature that is giving you trouble.  Can you see how your code runs if you eliminate the Chart functions?  [You can do that by putting a "Diagram Disable" Structure around the Chart code, clicking on the top of the structure and wiring the wires through in the Enable case].
    Give that a try and let us know what happens.

  • Problems with ActiveX and an IRtrans-modul

    Hello,
    I have a problem with an IRtrans-USB-modul. This is a modul for learning or sending infrared commands.
    The modul is connecting to the USB-port and supports ActiveX and .NET protocols.
    I have registered the ocx-library with the command regsvr32 and in LabVIEW I have the selection for the ActiveX-class.
    But when I use a method and will send or learn a command I get the
    failure: Exception occured in Winsock, wrong protocol or connection
    status for the prompted transaction or demand. Help path in
    MSWNSK98.chm and context 1040006 in Unbenannt1.
    With the supplied software from the manufactor the modul is working fine.
    Somebody is using this as well? Or somebody could help me with this problem?

    Hello Tweety,
    I've installed the software for the IRtrans module. Unfortunately, I can't start a server, because for this I have to connect this module.
    If You can select the methods of the IRtrans objects in LabVIEW, the activex connection should be OK. Make sure, that You use the right parameters and the right data types.
    Here is a link to the software, I've installed. Do You have the same Version?
    http://www.irtrans.de/de/download/windows.php
    Klaus

  • Calling LabView ActiveX Server from TCL?

    Does anyone have experience calling a LabView ActiveX server vi from
    TCL? I created a simple VI with one control (labeled "A") and one
    indicator (labeled "B") and a +1 adder between them. I can load and
    open the VI from TCL:
    package require tcom
    set lv [::tcom::ref createobject "LabView.Application"]
    set viPath "D:\\National Instruments\\LabView\\Activity\\a.vi"
    set vi [$lv GetVIReference $viPath]
    $vi FPWinOpen True
    But when I try to send in data:
    $vi -namedarg Call A 1
    I get the error message "unknown parameter A".
    I have also attempted to duplicate the "ActiveX Server" example
    from the LabView help file, calling "Frequency Response.vi". This
    approach encounters the same error message:
    % package require t
    com
    3.0
    % set lv [::tcom::ref createobject "LabView.Application"]
    ::tcom::handle0x013202F4
    % set viPath "D:\\National
    Instruments\\LabView\\examples\\apps\\freqresp.llb\\frequency
    Response.vi"
    D:\National Instruments\LabView\examples\apps\freqresp.llb\frequency
    Response.vi
    % set vi [$lv GetVIReference $viPath]
    ::tcom::handle0x01335AE8
    % $vi FPWinOpen True
    % $vi -namedarg Call Amplitude 10
    unknown parameter Amplitude
    If anyone can point me in the right direction, or give me an
    example of how to do this I would greatly appreciate it.
    TIA.
    Leslie

    In article ,
    Leslie Brooks wrote:
    >"Bruce Hartweg" wrote in message
    >news:...
    >> "Chin Huang" wrote in message
    >news:[email protected]...
    >> >
    >> > I don't use LabView, but from the Visual Basic example I saw, it seems
    >> > the Call method takes two arguments. The first is an array of parameter
    >> > names and the second is an array of parameter values. Try to send in
    >> > data with the Tcl command
    >> >
    >> > $vi Call [list A] [list 1]
    >>
    >> I'm unable to help the original question (don't know LAbView or VB stuff) but
    >> just want to point out that [list A] is equal to A and [list 1] is the
    >same as 1.
    >>
    >> Bruce
    >
    > I know what is supposed to be passed to the 'Call' method. Doing
    >this:
    >
    >set inst [::tcom::info interface $vi]
    >$inst methods
    >
    > produces (among other things):
    >
    >{1015 VOID Call {{{in out} {VARIANT *} paramNames} {{in out} {VARIANT
    >*} paramVals}}}
    >
    > So the 'Call' method is expecting two parameters, both pointers
    >to variants. TCOM appears to be passing the correct parameter type
    >because the TCOM documentation says that a TCL List maps to a
    >one-dimensional array of VT_VARIANT. However, the results are
    >INvariant (bad pun intended):
    >
    >% $vi -namedarg Call Amplitude 10
    >unknown parameter Amplitude
    >% $vi -namedarg Call [list Amplitude] [list 10]
    >unknown parameter Amplitude
    >% $vi -namedarg Call [list Amplitude] [list [::tcom::na]]
    >unknown parameter Amplitude
    >% set i 5
    >5
    >% $vi -namedarg Call [list Amplitude] {incr i}
    >unknown parameter Amplitude
    >% $vi -namedarg Call [list Amplitude] [list [incr i]]
    >unknown parameter Amplitude
    >% $vi -namedarg Call Amplitude [incr i]
    >unknown parameter Amplitude
    >
    > Who can help me with this? Who is the LabView Guru?
    Try invoking the Call method without the -namedarg option. The
    -namedarg option doesn't work the way you seem to think it works. The
    -namedarg option provides a way to specify arguments named from the
    method's parameter specification. For example, you discovered that the
    Call method take two parameters named "paramNames" and "paramVals".
    Tcom returns the error "unknown parameter Amplitude" because "Amplitude"
    doesn't match either parameter name.

  • Certified LabVIEW Architect and Professional Instructor willing to relocate

    I have been working for an NI Integrator for about 3.5 years and interested in seeing if I could be
    of value elsewhere. I like to travel, have no real roots and could move
    internationally if necessary.
    LabVIEW
    (6i to 8.5) including:
                FPGA, Real-Time, CompactRIO (Third-Party Development)
                Traditional DAQ, DAQmx
                VISA, Serial, GPIB
                I2C, SPI, CAN
                TCP/IP, UDP, AFDX
                Shared Variable Engine
                .NET, ActiveX
                Motion Control
                Compact FieldPoint
    Project
    management
    Software
    architecture
    Contact
    me at L a b V I E W A r c h i t e c t @ a o l . c o m (no spaces) if
    interested.

    We also have a client in the Brighton, NY Area that is looking for a full-time LabVIEW Software Engineer.
    Job Description
    Well established company in the Brighton, NY area interested in hiring a Programmer with skills in LabVIEW. This is an excellent opportunity to work for a growing company offering great benefits.
    Responsibilities:
    Project Programming using National Instruments LabVIEW
    Manage Projects and client relationships
    Work with other software developers at the firm.
    Requirements:
    Bachelors degree in Software or Engineering
    Strong Project Management Skills
    Strong Interpersonal Skills
    Strong LabViEW skills and experience
    LabVIEW Certified Developer
    Willingness to Travel
    Notes
    If interested please send your resume to [email protected] or call Ash @ 973-519-1840
    www.mamoollc.com

  • How to call LabVIEW ActiveX dlls into VB6

    I'm jumping in on a project written primarily in VB6. I'd much rather wirte code in LabVIEW so what I am looking for is some example code for calling LabVIEW activeX dlls into VB6. Does anyone have example code? I need to see how the LabVIEW libraries and classes are called and used in VB6.

    Hi Drewdafis,
    Refer to this link for example code on calling a LabVIEW DLL from Visual Basic.
    Hope this helps!
    Best Regards,
    Jonathan N.
    National Instruments

  • ActiveX and IE using https and TLSv1

    I'm starting with the ActiveX - Internet Explorer example found in C:\Program Files\National Instruments\LabVIEW 2009\examples\comm\ axevent.llb.  In the Navigate2::URL parameter, I can type in the IP address of a device I'm trying to talk to and it will serve up some web pages.  In the WebBrowser in the front panel, I can see the pages, fill in form data and send it, and get stuff back (in the form of more html pages).  My problem is that I need to automate this interface, and in the final app, the server is going to send me XML, and not html.  So, what I want to do is to perform GET/POST commands, capture the data, parse/analyze the XML, repeat.  Also, this is all done in secure mode.  In the example above, I can type in https://xx.xx.xx.xx and after the login, I'm in.  I see the opening (secure) page in the webBrowser on the front panel.  What I need is
    (1) to understand how to send in more specific commands.  Right now, after I type in the initial https link, my labview code really isn't doing anything.  It's all in the front panel's webBrowser.  I need to be able to send in specific GET commands, like GET https://xx.xx.xx.xx/setupRfData.asp HTTP/1.1.  And specific POST commands like POST https://xx.xx.xx.xx/setupRfData.cgi HTTP/1.1.  What I'm not sure about is how to pass in those parameters to the ActiveX Navigate(2) command.  I see the API at
    http://msdn.microsoft.com/en-us/library/aa752093(VS.85).aspx
    but it's not really clear how use it with LabVIEW.
    (2) In the POST commands, I have to send in data, which I assume goes in the POSTdata field, but the format is unclear.
    (3) And the Headers field also is where I'd like to specify certain things like "Connection::Keep-Alive"
    (4) Finally, this may not have been clear above, but I need to send this device http commands, and it can send me either html or XML based on an input parameter I provide when I send it commands.  If I say "html" then I would just control the device via the web pages it sends back to me.  When it sends back XML, however, instead of a webBrowser, I could probably just have the XML displayed in an edit box?  My concern, though, is that the WebBrowser is what is taking care of all the secure handshaking for me.  How do I keep the link established and still receive/analyze XML?

    BCho wrote:
    Hey mrbean,
    To address your first question; the web page continues to update even though the VI may not be running because
    when you did run the VI you loaded the script for that page. This script continues to loop even though the VI
    is not running. With an IE ActiveX container, it is a lot like you have a normal IE page open; it just happens
    to also be a part of your front panel. If you negative, say, www.ni.com, you will notice that even though
    the page is fully loaded and IE is not still attempting to load the page, it still 'updates'. You may also notice
    that links still work, even though the VI is not still running. So, one way to think about and IE ActiveX
    container is like a normal IE window that happens to also be in your VI.
    In regards to how to send specific GET and POST commands; unfortunately, I am not very familiar with the ins and
    outs of that particular ActiveX control. Judging by the msdn page that you pointed out, I would make the same
    assumptions about GET and POST transactions. If you don't wire anything to the POSTData input you do a GET
    transaction.
    What happens if you send the entire URL https://10.4.17.1/setupRfData.axp HTTP/1.1? If you were
    to do this same routine in a normal IE window, what URL would you use? What happens if you do include the HTTP/1.1? How about if you include it, do you get a different response? Here is a Thread that gives a little bit of relevant information.
    When I type in the entire URL above, I get a message saying "The Web page you are viewing is trying to close the window (yes/no)".  I've read several forums about this, but most make mention of java script updates and IE7.  I'm using IE6 and I'm not doing any scripting.  I did see another post that said that it's possible I need to specify the "Referer", so I'm going to try that shortly by adding it to the Headers input of the Navigate2.
    My underlying problem is that the in the current app, the user (me right now) only sees the html pages that the server is serving up (via https/TLSv1).  With that interface, you can enter info into various fields and send them to the server, or click a different tab which behind the scenes performs a GET, but no one has to type any of that.  In our app, we're trying to replace the IE with a labVIEW ActiveX IE and manually build/send these commands so that we can create automated sequences for a production test.  Therefore, I've used a sniffer (WireShark) and have determined what commands/fields are going across the ethernet to the server (and coming back). 
    As I mentioned, I tried sending the fully qualified GET message ( URL https://10.4.17.1/setupRfData.axp HTTP/1.1) and saw the ...trying to close message.  Assuming I can get past this, my next issue is accessing the response information coming back from the server.  Right now it's html, but in the final product it's going to be XML.  (1) What is the LabVIEW Invoke Method that allows me access to the response information and (2) Is there a way to setup an Event that would notify me when a response came in.  (3) Can the same WebBrowser that currently displays html be used to display XML

  • Interface between LabView Executables and compiled MATLAB code

    Query: Does anyone have experience of calling compiled MATLAB functions from a LabView Executable?

    Hello
    Well, I am using some applications as you ask. Some calculus was done in matlab, so, now, it is compiled as dll an front end and other calculatiosn are in Labview. matlab dll are registered as activex, and so are called from labview. Integration is so good, tha some old matlab application was changed to Labview and matlab dll.
    I must to state that I am not the integrator. My part is only Labview. So, should you have further questions, I can pass this thread to the integrator company. I do not promisse answers.
    But it runs fine.
    Cheers
    Alipio
    "Qod natura non dat, Salmantica non praestat"

  • Problems with activeX and native

    Hello SDN Community,
    i use NW04S SP11, NWDS 7.0.11 and Adobe LifecycleDesigner 7.1.
    I want to generate an Interactive Form with WebDynpro for Java only for Printing and Saving. Also I don't want to display the document in the browser so I set the displayType to activeX, because this isn't possible with native (ZCI). I have also installed the Active Component Framework. But when I deploy the application with activeX and start the application the Form is not displayed and the AcroRd32.exe runs with 98% in the TaskManager. When I deploy the Application with displayType native, the document is displayed but I can't save and open the document (Adobe Reader 8.0.0).
    I hope that anybody can help me. It's very urgent.
    Thanks
    Stefan

    Hello Tweety,
    I've installed the software for the IRtrans module. Unfortunately, I can't start a server, because for this I have to connect this module.
    If You can select the methods of the IRtrans objects in LabVIEW, the activex connection should be OK. Make sure, that You use the right parameters and the right data types.
    Here is a link to the software, I've installed. Do You have the same Version?
    http://www.irtrans.de/de/download/windows.php
    Klaus

  • Difference between LabVIEW RTE and TS LabVIEW RTE

    Ok, this may be an easy one but still I would to have it clear. What is the difference between using LabVIEW RTE and TS LabVIEW Runtime Server to run LabVIEW modules/steps in PC's with TestStand Deployment licences???
    Thank you,

    Hi,
    The TestStand LabVIEW Adapter can run VIs
    using any of the following LabVIEW environments, or servers: the LabVIEW
    development system, the LabVIEW Run-Time Engine, or a LabVIEW executable built
    with an ActiveX server enabled. The Teststand LabVIEW run-time server
    (TestStandLVRTS) is a version of the third option written way back at a time before the LabVIEW run-time engine is what it is now.
    The only reason you would possibly want to use the TestStandLVRTS is when you
    have VIs written with versions of LabVIEW older
    than 6.1.
    Have a great day,
    Ecleamus Ricks, Jr.
    National Instruments
    Applications Engineer

  • What Persistence Method does LabViews ActiveX containers use?

    What Persistence Method does LabViews ActiveX containers use?
    Stream, Storage, Bag, or other?
    I'm attempting to write an ActiveX control that will be used within LabView.
    Thanks!

    > What Persistence Method does LabViews ActiveX containers use?
    >
    > Stream, Storage, Bag, or other?
    >
    > I'm attempting to write an ActiveX control that will be used within
    > LabView.
    >
    I think its stream, but I'm not sure that it matters that much what you
    choose to use. They will get mapped to one another. The core control
    is written in ATL and the data is extracted and placed in a LV VI file
    as a LV Handle.
    Greg McKaskle

  • ActiveX and Graph-97

    I have set up an 3-D graph from Graph-97 in my LabVIEW program, and I am
    now able to
    input data to this object directly from my program. This is performed
    via the
    method Datasheet(Range, Range1, Range2) and the property Range(Value).
    My problem is the formatting when I want to transfer an array of data in
    one operation.
    This I haven't managed to crack down this yet.
    Anybody out there done this ???
    Please reply directly to me also.....
    Martin

    IndiJava@34 wrote:
    please suggest what are best options available to make 'activex' interacts with java server side code/servlet. .Send HTTP requests to the servlet, if need be with request parameters, then let the servlet handle it. You can use plain vanilla HTML links, HTML GET/POST forms or Javascript (so also AJAX) to send HTTP requests to the servlet.

Maybe you are looking for