LabView to ActiveX Variant

Hello,
I was looking for some help with this. I have had issues in the past with placing arrays into an ActiveX Variant and found that ActiveX variants are not the same as LabView variants. I am tring to place a 0 or a 2 into Property input which is variant type. At this moment, it does not work. My guess is that the activex variant isn't handling the input well. I may be wrong, but my intuition say this is my issue. Does anyone have a way to deal with this? Here is NI's response to the issue. 
Thank You for your responses.
-=-=-=-=
Hi Chuck,
I was able to talk to R&D and it looks like there is not necessarily a
simple or new way to handle ActiveX Variant data in LabVIEW. From a previous
issue I found, the engineer had worked with R&D and said:
"Use the 'Database Variant to Data' VI instead of the 'Variant to Data' VI
While the name may be misleading, the Database Variant datatype is the same
datatype as the ActiveX Variant. The native LabVIEW Variant is different from
the ActiveX and Database Variant datatypes."
The customer in that case had a few issues using this VI, though, so it may
also not help your implementation either; there also is not a "Data to
Database Variant" function that I am aware of. Furthermore, I understand
that this VI is the same direction of dataflow as RolfK's example. As far as
the "Data to ActiveX Variant" implementation, R&D said that it
would have to be implemented the same way that Rolf has made his VIs. The
R&D engineers referenced the following example, which is also linked by
"lvb" in the LAVA forum post:
NI Community: Dereferencing Pointers from C/C++ DLLs in LabVIEW
https://decibel.ni.com/content/docs/DOC-9091
Finally, I did find a post in the LabVIEW idea exchange, which I believe was
started by "lvb" on the LAVA forum you found. If you are not familiar
with the Idea Exchange, it is where LabVIEW users can propose and
"Kudos" (or vote) for ideas that they wish would be implemented in
LabVIEW. While this does not guarantee that a feature will be in a future
version of LabVIEW, it does more effectively put it on NI R&D's radar.
LabVIEW Idea Exchange: Support OLE Variant or ActiveX Variant Type Access
http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Support-OLE-Variant-or-ActiveX-Variant-Type-Access/idi...
Attachments:
GM FLIR A320 ImageGrab AE.jpg ‏16 KB

appears it is okay to wire directly like that. I found examples with I16 wired straight to property input. Must be the resister I am writing to isn't work like it should.

Similar Messages

  • ActiveX variant to LabVIEW variant

    Hi Ppl,
    I'm reading ActiveX data from an application(TestStand) in LabVIEW. The data I get is of the type ActiveX Variant. When I use variant to data node I'm able to convert the data to the corresponding data type. Howevere in my application the data type varies dynamically and I cannot use the variant to data node.
    I will have to flatten it to string. But the flatten to string node does not work with ActiveX variants. It only works with LabVIEW variant types. So is there any way that i could convert ActiveX variant types to LabVIEW variant. I tried the to variant node too. I too does not convert it as expected.
    Thanks,
    Sathish
    Here is how both the variant types differ
    Activex variant (boolean):
    '': OLE Variant 
    Variant Type -> VT_BOOLValue -> FALSE
    LabVIEW variant(boolean):
    'Boolean': boolean (TRUE or FALSE) 
    FALSE

    Hi lordsathish,
    Unfortunately, there is no way in LabVIEW to access type data for OLE/ActiveX variant data.  However, you can obtain information about the datatype of a TestStand PropertyObject using the ValueType method:
    myObject.Type.ValueType
    This will return the data type (see the ValueType help entry for more details).  you can then use the specific type methods (getValBoolean, etc) to extract data.  In the case that you have an array, you can use the ArrayDimensions and ElementType to extract the data from the array.  In the case of a container, the contained items will be considered propertyObjects, so you can use the getNumSubProperties and getPropertyObject methods to access the contained items.
    Refer to the PropertyObjectType reference help for details on these methods
    I hope this clarifies!
    Al B.
    Staff Software Engineer - TestStand
    CTA/CLD

  • Problems using Labview as ActiveX Server

    Hello,
           I have been having difficulty using Labview as an AcvtiveX server. I have reviewed all the postings on this subject and most are either pre Labview 8.2 and thus do not account for the changes made between 8.2 and 8.5 which broke the Activex server functions. I have looked at the recommendations for changing the to code to export (exported vi's in a DLL or Source distribution) and have tried these with no success. The closest example I have found was posted here http://forums.ni.com/ni/board/message?board.id=170&thread.id=283417 the example code they posted does ont work for me and still generates and error 3005.
          What i need is simple. I want to turn my applicaiton into a Vi server.. Expose a vi that acceses elements in the Vi server.. (controls, queues, Globals etc) that are in the Vi server context. I would then like to build a vi .. or dll that calls the 'exposed' vi in the vi server to pass data to or from the vi server. The V test.zip example file in the above indicated post is a pretty good example of this .. it just does not seem to work when i build it in 8.5. Are there any GOOD and 'current' examples of using labview as the ActiveX server (Compiled) and calling exposed vis from an external application Labivew, Visual Basic.. etc??  I am only interested in cases where Labview is the Sever. or both client and server.
           I have used a tool "ActiveXplorer" to examine the registered "exe" when the viserver is run. It always shows that there is no Type Library associated and the object is not creatable. There is a .tlb created by the project build however, where as the previous version 8.2.1 of Labview did not build that correctly. I have also tried this on 8.6 with similar error 3005 generated. sooooo what am i missing?
          Thanks
           Louis Ashford

    Mike,
           Thank you for your response to my question. The problem is that the example you site does not use the Labview vi as the Server. Excel is actually the vi server and the automation open is using and excel automation object. I am sure that Excel creates proper automation objects .. Labview however does not seem to. So while this example shows how labview can function as a client it is not an example of a compiled Labview Sever being accessed by a 'laview vi'. Possibly I am not looking at the vi that you are thinking of.
           The examples i am aware of:
                        "ActiveX Event Callback for Excel.vi... (Excel is server not Labview vi)
                        "ActiveX Event Callback for IE.vi (same Labview vi is client)
                        "Write Table to XL.vi" ( again excel is the server)
                        "3D Graph Properties - Torus.vi" (accesses an activex Control 'not' and Activex EXE)
                        "3D Lorenz Attractor Draw at Compeltion using 3D Curve.vi (Uses an activex  control not activex Exe server)
                        "3D Parametric Surface - Ribbon.vi (Uses an activex  control not activex Exe server)
                        "3D Surface Example - Fluctuating Sine Wave.vi (Uses an activex  control not activex Exe server)
                        "Excel Macro Example.vi (Uses excel as automation server..not Labview)
                        "FamilyTree.vi (uses MSComctlLib.ITreeView object not Labview as server)
                        "SlideShow.vi" (uses PowerPoint._Application not Laview as server)
          Most of the posts I have seen are for versions prior to  Labview version 8.2 (where the ActiveX server was broken) I have seen only a few posts that actually address the issue i am talking about. however thus far no real solution has been offered. I get the same results when compiling and testing this with 8.6..  as well. So have you tried this Mike? Possibly i am missing something very simple..
          The example i did find and gave the link to is a pretty simple one. This does not work on my machine at all. You can select the automation server that is registered with windows after running the server one time and this then breaks the client vi.. I have found by reselecting the GetViReference property node in the Client vi that it will the 'fix' the client vi as far as labview is concerened and it no longer shows and error. Now when you run the Client vi it will infact find the vi server and will launch it ok. However. The open automation object then hangs.. for quite some time then returns the error
    "Error -2146959355 occurred at Server execution failed
     in Client_reader.vi" Obviously the automation Exe (server) was seen because it was opened yet it did not return a valid reference so the subsequent property nodes in the client.vi will fail. Something is wrong with Labviews opening of or creating of automation objects..
              Thanks,,
                    Louis Ashford

  • 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

  • Calling Microsoft word speech in LabVIEW through ActiveX

    hi
    Yesterday i had posted 1 question , how to get the output of some other programme in LabVIEW. Well. i have found out the answer. This can be done by using ActiveX. For this the programme also must be ActiveX enabled.
    I wanted to use the microsoft Word Speech in labVIEW through ActiveX.Since microsoft word is also ActiveX enabled, this can be called.
    But the question is HOW????????
    Help me out of this
    Somil Gautam
    Think Weird

    If you want to give voice commands to LabVIEW, you might want to read this blog
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • Exporting figures to word from labview using activex??

    Does anybody know how to export figures into MS Word, XP edition from LabVIEW using activex. I am not using the report generation toolkit...dont have it....help wld be appreciated
    kuttu

    Here are some examples you can use. they all use activeX. One is even a toolkit I got from somewhere.Try these and if you have any more questions let me know.
    Joe.
    "NOTHING IS EVER EASY"
    Attachments:
    word.zip ‏1226 KB

  • NVIDIA control (Shadowplay mostly) with LabVIEW via ActiveX - Does anyone have documentation?

    Hi Everyone,
    I'm looking to capture my monitor video at around 30fps. ShadowPlay works well with my graphics card, and I've found that there is an ActiveX Library on the PC. The attached screenshot shows an example code for 5 seconds of capture. 
    Shadowplay only captures one monitor but I want it to capture both, or make two videos (one for each monitor) preferably. Although a possible work around would be recording one at a time but being able to programatically change between the two. The Shadowplay library is: ShadowPlayServerLib and the NVIDIA Library is: NVI2Lib (I presume this is NVIDIA but could be wrong)
    I can't find any documentation on the activeX commands so I'm struggling to know what inputs and outputs of the property nodes should be. Does anyone have any? A search of the internet brings up my own forum post on NVIDIAs website: 
    https://forums.geforce.com/default/topic/805560/geforce-experience/shadowplay-activex-documentation-...
    Any help on the NVIDIA/ShadowPlay side of things would be great, alternatively any ideas for capturing video at 30fps (I tried to use .NET to capture the screen shots to png files but it only managed 2.5fps without saving them)
    Many thanks
    Attachments:
    NVI class.png ‏27 KB
    shadowplayActiveX.png ‏32 KB
    ShadowPlayCapture.vi ‏12 KB

    Hi Woody247,
    Here is brief overview to help using LabVIEW with ActiveX:
    http://www.ni.com/white-paper/2983/en/
    Here is an interesting example that could be useful to your application's functionality 
    https://decibel.ni.com/content/docs/DOC-41144
    Regards,
    Mark 
    Applications Engineer Intern
    National Instruments UK and Ireland

  • Controlling CANoe TestCases in LabVIEW over ActiveX

    Hi,
    I want to run CANoe TestCases in LabVIEW using ActiveX.
    Handling envVars and sysVars in CANoe was not a big deal and there are a lot of examples here.
    But handling TestCases is quite difficult. The CANoe help file shows this way in the object hierarchy:
    Application
    Configuration
    TestSetup
    TestEnvironments
    TestEnvironment
    TestModules
    TSTestModule
    TestSequence
    TestCase
    But I didn't find any way to realize it. I ended up in the following:
    IApplication3
    IConfiguration4
    ITestSetup
    ITestEnvironments
    ITestEnvironment
    ITestSetupItems
    ITestSetupItem
     ITestSetupItem is an object without any methods. I don't know how to access the TestCases without the linking objects in between.
    Greetings,
    Ludwig.
    Solved!
    Go to Solution.

    I've solved the problem with the help of Vector Support. They send me the following C# Example:
    CANoe.Application mApp = new CANoe.Application();
    CANoe.Configuration mConf = (CANoe.Configuration)mApp.Configuration;
    CANoe.TestSetup mTestSetup = (CANoe.TestSetup)mConf.TestSetup; //Test SetUp Window
    CANoe.TestEnvironments mTestEnvs = (CANoe.TestEnvironments)mTestSetup.TestEnvironments;
    CANoe.TestEnvironment mTestEnv = (CANoe.TestEnvironment)mTestEnvs[1]; // Test Environment (*.tse File)
    Console.WriteLine("Name " + mTestEnv.Name);
    CANoe.TestSetupFolders mTestSetupFolders = (CANoe.TestSetupFolders)mTestEnv.Folders;
    CANoe.TSTestModule mTSTestmodule = (CANoe.TSTestModule)mTestEnv.TestModules[1];
    Console.WriteLine("Name " + mTSTestmodule.Name);
    CANoe.TestSequence mTestSequence = (CANoe.TestSequence)mTSTestmodule.Sequence;
    Console.WriteLine("TestSequence Count " + mTestSequence.Count);
    CANoe.TestCase mTestCase = (CANoe.TestCase)mTestSequence[1];
    Console.WriteLine("Testcase Name " + mTestCase.Name);
    mTestCase.Enabled = false; // deactivate testcase - XML and structured NET module only.
    //CANoe.TestReport mTestReport =(CANoe.TestReport) mTSTestmodule.Report; // Access To report
    CANoe.Measurement mMeasurement = (CANoe.Measurement)mApp.Measurement;
    if (!mMeasurement.Running)
    mMeasurement.Start();
    mTSTestmodule.Start();
     I've realized that you can cast ActiveX object references to another child class in the following way:
    This was the correct solution and I want to share it with you. 

  • 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.

  • How do you pass an ActiveX Variant from an external application to LabVIEW?

    Background: I created a LabVIEW ActiveX server. I can access it with my external application (Matlab). I have a control variable in my LabVIEW executable. I want to use Active X to set the value of my control variable from my external application.
    Documentation: The only reference in the documentation for this task is in the Using ActiveX with LabVIEW in the LabVIEW 2009 help. It simply says "Use the variant control and indicator to pass data to or from ActiveX controls." I also went through all the ActiveX examples in the example finder and did not find any vis that passed variables using ActiveX.
    Questions:
    What should my control variable look like in LabVIEW? Should it be a refnum, a variant, or a data type? Does it have to be wired to a vi connector?
    Do I need to do any magic on this variable, such as change its properties?
    How do I pass the value from my external application to the variable in my LabVIEW executable?
    Thank you.

    Hello Lyn,
     The control variable should be a refnum and it would have to be wired to Automation Open with the correct reference.
    Here are some great examples of using ActiveX Server in LabVIEW
    LabVIEW Executable Used as ActiveX Server in LabVIEW
    http://decibel.ni.com/content/docs/DOC-9647
     Calling ActiveX Code from LabVIEW
     http://decibel.ni.com/content/docs/DOC-9073
    Andy Chang
    National Instruments
    LabVIEW Control Design and Simulation

  • LabView 8.5 ActiveX Variant Data

    Hi all,
    First off, I admit I have no idea what I'm doing with this ActiveX stuff however I did find some vi's that do almost what I need.  My question is, how do I know what data I need to squirt into the purple texts under sheets to achieve the result I need.  Specifically, the After which I assume controls whether the new added sheets occur before or after the first sheet created by excel.  I got lucky with the Count but is there another document I need from say Microsoft that tells me what type of data each of these takes?  Sorry for being so ignorant but this is how we learn, no?
    Mark
    Attachments:
    ActiveX.jpg ‏52 KB

    That sounds like you don't have the Visual Basic Help files installed. A "normal" installation of Excel doesn't install this. You have to install them using "advanced customization" of the application. If you're installing Excel as part of office this checkbox is present right below where you select which product(s) to install. Then, in the "Advanced customization" window expand "Office Shared Features". Then make sure that the item "Visual Basic for Applications" and its child entry "VIsual Basic Help" are both selected to be "Run from My Computer".
    As noted, though, this information can also be found on the web from MSDN.

  • Text Message sent from LabVIEW using ActiveX and Internet Explorer

    I am fairly new to LabVIEW and I am trying to make a VI that will be able to text me and let me know when a test is about to be done or if something has caused it to shutdown.  My VI uses www.onlinetextmessage.com but I can't get it to click the Send Message button. 
    I can get it to insert text in the text fields.  I just can get it to click send.
    Can you help me?
    Solved!
    Go to Solution.
    Attachments:
    My Texting.vi ‏38 KB

    MoonMan wrote:
    Well it sure seemed like that should have worked but no luck. When I try to add the FormElement with submit in my VI after I wire in the reference wire it automaticaly changes to a regular Element.  Then it wont run because submit is not an option for Element, I have to change the submit back to click. 
    I dont understand, it really seems like the click should work, and it seems like the submit should have also worked.  Getting text into the different fields was easy enough.
    Did you try my modified version?  That uses IHTMLFormElement properly.  If you then change the element name from "Send Message" to "txtmsg" (the name of the form), it appears to work - or at least, it pops up an advertising window in Internet Explorer (I didn't fill in any of the fields as I don't want to give out my phone number or email address to some random website, especially one that pops up advertising).
    When you try to change to FormElement, what steps are you taking?  Are you changing the type of the "type" input to Variant to Data?  You'll need to right-click on that constant, Select ActiveX Class... and choose IHTMLFormElement.
    As a LabVIEW style note, you should close all the ActiveX references you open.  That means all the references (IHTMLFormElement, IHTMLElementCollection, etc) need a Close Reference when you're done with them.
    Again, I think sending an email is a better way to send a text message from within LabVIEW, and for that matter, you might be able to find a better website for doing it.  TMobile allows their subscribers to send SMS messages through their website and it appears that AT&T provides a similar service; Verizon provides a web page to send SMS to their users.
    EDIT: by the way, the submit button is not a named element (it has a "Value" property but not a "Name" property) so you can't get a reference to it by name.  If you probe the item output of the IHTMLElementCollection property node, you'll see it returns an empty variant, which is why "click" has no effect.

  • ActiveX Variant Pointer - Variant?

    Hello.
    I have an ActiveX control that requires a VARIANT to be passed in. The VARIANT needs to contain a SAFEARRAY of int32s. I have a DLL that assembles the variant SAFEARRAY from a standard LabVIEW array. However, because of limitations on Call Library Function Nodes my DLL function has arguments of long * and VARIANT *. So I end up with a VARIANT pointer rather than a plain VARIANT.
    Q. Why can't Call Library Function Nodes just return a VARIANT?
    Moving along, I wire the VARIANT pointer to a "To Variant" vi and then wire the output to my ActiveX control method.
    => The ActiveX control (IDL SetNamedArray) is meant to share memory with the container application. I assume this is possible by sharing the SAFEARRAY pointed to by p
    array within the VARIANT. The problem is that this doesn't work. The error returned is that "memory is locked" in the vi.
    Q. Does LabVIEW lock SAFEARRAYs?
    If anyone has had any experience manipulating SAFEARRAY VARIANTs in LabVIEW and passing them to ActiveX controls I'd be most interested to hear of any tricks and undocumented features.
    cheers,
    Novak.

    > But I need to do something different because wiring an LV array
    > straight into the method will copy the data into the IDL ActiveX
    > control but the memory is not shared between LV and IDL - I get the
    > memory locking error and the method fails (returns 0). Thats why I
    > tried making the VARIANT myself. I've contacted IDL and when I
    > resolve this issure I will post my findings because it might be of
    > general interest amongst users of ActiveX controls in LV.
    >
    If you want there to be shared memory between the two, then you should
    probably look to make additional methods, one that allocates if
    necessary and copies the LV data into the shared space, and another to
    return the value to the LV diagram from the shared memory.
    Greg McKaskl
    e

  • ActiveX Variant in Invoke Node?

    I'm trying to do some stuff with a Word document through ActiveX in LabVIEW. This is mostly going well, but I am unsure of what the variant options are on the invoke nodes. I have included a picture with the variants on the invoke node circled. Where are these variants documented? What kind of data/type needs to be in the variant to use these options?
    Thanks.

    Whoops... I meant to put this inthe LabVIEW board, not the TestStand board. Will someone please move it to the appropriate board for me?
    Thanks.

  • How to create a table in MS Access from Labview using ActiveX?

    I want to transfer datas from Labview to Access using activeX method. My only problem is to find out how to create a new table (array) in Access from the Labview program.
    Remarks: I use Labview 6i and MS Access 2000.
    For the moment I can write and read datas of Access from Labview.
    If someone could help me... that would be grate!

    This is off the Microsoft MSDN site "creating an external table". I think you can drop the last step.:
    Open the database you want to create the table in. If it is the current database, use the CurrentDb function to return an object variable that represents the current database. If it isn�t the current database, use the OpenDatabase method to open the database you want.
    Use the CurrentDb function to create a Database object that points to the current database.
    Use the CreateTableDef method of the Database object to create a table definition for the Microsoft Access table.
    Use the CreateField method of the TableDef object to create one or more fields in the Microsoft Access table.
    Use the Append method of the Fields collection to add the new field or fields t
    o the Microsoft Access table.
    Use the Append method of the TableDefs collection to create the Microsoft Access table.
    Use the TransferDatabase method to create the external table in the specified folder.
    Use the Delete method of the TableDefs collection to delete the Microsoft Access table definition.

Maybe you are looking for

  • What do I do if a download is incomplete due to loss of internet connection?

    I bought a song and it started to download, but then my interenet conncetion went out and it won't finish the download. What do i do? Do I have to buy it again?

  • Help! Safari 6.0.5 keeps won't stop reloading my new tabs

    Safari appears to be on some sort of webpage auto reload. I can't open additional tabs bc as soon as the Top Sites feature comes on it keeps reloading and freezing Safari. My Macbook says I now have Safari 6.0.5 and Mountain Lion 10.8.4.

  • Interrupting video playback to play an ad

    I looked at the MASTPlugin sample that allows adding pre-roll and post-roll ads using SerialElements. What I am not clear is a way to show ads during the middle of the video stream. In other words, I would want to interrupt the current video, show an

  • Will USB-6251 execute multiple tasks at the same time?

    Hi all, I have an application controling an experiment and logging data using a USB 6251. One measurement uses Two Edge Seperation , and takes a while to complete (20 to 30 seconds). Meanwhile I need to execute another task repeatedly to sense a digi

  • IS BT CLOUD ALTERING THE "MODIFIED DATE" ON MY FIL...

    Hi I have BT Cloud 2GB Free running as both the downloaded "auto sync" software and also using the Chrome Browser Interface. I am on Windows XP. I only use Cloud to backup word / excel documents and family photos - basic things I just dont want to ri