How do I extract data from an OLE variant?

I am trying to retrieve a string from a Dot Net function.  What I get out is a Labview variant.
From my research, I suspect that what Labview is giving me in this variant is a pointer to the string that I need to dereference.  Problem is that I can't even get the pointer value out of the variant.
If I view the variant as an indicator, I see that it has a value but no matter what type I wire to the Variant to Data function, I get a type mismatch error.
The value is there, why can't Labview give it to me?

MoveBlock() won't help you here much. VT_DISPATCH indeed contains a pointer, but not a pointer to data but instead a pointer to an IDispatch COM object. This is basically a pointer to an object containing internally one (and typically more) so called COM virtual method dispatch tables. The only safe way to get at the information is by using the COM QueryInterface() method in that object to retrieve the IDispatch interface, then calling the IDispatch methods to inspect the data contents the object contains and then retrieving the actual data.
This is impossible to do on your own in a LabVIEW diagram but requires quite a bit of C(++) code. However if you know what the IDispatch is really holding internally (and your VBA.ICollection sounds like a plausible idea) then you can create a compatible Automation refnum by dropping one on your front panel and then browsing to the according ActiveX object type (here most like in the Visual Basic typelibrary) and then using Variant to Data, let LabVIEW comvert the contained IDispatch to the actual Automation refnum to the data object. Variant to Data will return an error if you selected the wrong ActiveX refnum type.
An VBA.ICollection is however not a string or numeric data already but more like an Array like container, so you would then have to use the VBA.ICollection methods to enumerate the elements in it as variants and convert them to the actual datatype using Variant to Data again.
Also note that pointers are 32 bit in LabVIEW 32 Bit and 64 bit in LabVIEW for 64 bit. This is independent if you run on 32 bit or 64 bit Windows, since a 32 Bit version of LabVIEW runs in a 32 bit environment even on 64 bit Windows.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

Similar Messages

  • How can i extract data from oracle table  to flat file or excel spread shee

    Hello,
    DB Version is 10.1.0.3.0
    How can i extract data from oracle table to flat file or excel spread sheet by using sub programs?
    Regards,
    D

    Here what I did
    SET NEWPAGE 0
    SET SPACE 0
    SET LINESIZE 80
    SET PAGESIZE 0
    SET ECHO OFF
    SET FEEDBACK OFF
    SET VERIFY OFF
    SET HEADING OFF
    SET MARKUP HTML OFF SPOOL OFF
    Sql> SPOOL bing
    select * from -------;
    SPOOL OFF;
    I do not see file.
    I also tried
    Sql> SPOOL /tmp/bing
    select * from -------;
    SPOOL OFF;
    But still not seeing the fie,

  • How can I extract data from a sound file in carbon

    hello,
    I am a student and I start recently learning carbon. I have to do a application which can read and extract data from a sound file and use that data to do some kind of visual representation of the file. I would like to know if someone can give some directions, tutorial,some code sample etc.
    thank you for your help
    chenita7

    hello orangekay
    My idea is to create an application that can read a sound file( AIFF, MP3 or other) in order to extract some kind of data ( numbers or any values) and use that data to represent the sound file visually.
    I dont know which kind of data can be extract from a sound file, and in which way i can manipulate that data to became a visual representation of the sound file. this is what I want to do as my second assignment for a subject at school, introduction to programming. has to be done based in carbon.
    regards
    chenita7

  • How do I extract Data from a 1D Waveform into individual channels to be used for calculatio​ns on a live data page

    Hello All,
    I am a fairly new user to Labview and am currently creating a program that: monitors sensor inputs from various CompactDAQ modules (9213, 9217), does error checking, then uses the data in some final calculations, such as averaging etc.  I have put together a small piece of code that includes the main functions that I am trying to accomplish.  Right now I am fairly comfortable with getting the channels set up and assigned, then passing this data into a while loop that continually pulls data from these sensors.  
    I have the calculations vi complete and the channel inputs UI complete, now I am working on the reading and data manipulation side of things.  The 1D Waveform that is coming out of read function is being broken up into the components that I am interested in (String Name and Y data).  It then pass this information out of the loop through a queue which passes it along to the parallel loop below which will perform the error checking and the averaging calculations.  There are some things that complicate this. I have shown 2 sensors in my example, but in the actual program, there can be up to 400 inputs.  The issue is that not all these sensors will be used on every test that the software is used for.  To use the inputs in the test VI as an example:  If I am trying to average these 2 inputs to create a common value, but then on one test, sensor 2 is not there, it needs to recognize this and not use this in the averaging function.  
    So to get right down to it, I want to create something that can look through the clusters of data from the 1D Waveform, determine what these values are, then do the necessary functions to those numbers once they are identified, then pass them onto the Calculations VI where it then displays the usable information for the user.  I think I am having an issue with determing how to sort as everything I have thought of makes me think there has to be an easier way.
    Has anyone encountered this?  Does my explaination of what I am trying to do make sense?  Let me know and I can clarify.
    Solved!
    Go to Solution.
    Attachments:
    Channel Testing.vi ‏43 KB

    As far as functionality goes, I don't see anything wrong. when it comes to efficiency you need to keep some general pointers in mind. These issues which I'm bringing up will not affect your code currently since your array sizes are small but can start creating memory fragmentaion and slow down the software if your array sizes are much larger and the software runs for a long period of time.
    1. Try not to use Build Array. Each time you use a built array labview creates a copy in the memory. Try to initilized your arrays and replace the subsets.
    2. as much as you can try not index arrays or unbundle cluster multiple times. try to perform as many tasks as possbile in one shot. (this was evident in your second loop)
    Besides that it's looking good. 
    I made a few modifications to your code and attached it. I wanted to give you a different take on it as it relates to being able to control the inputs and outputs programitically, if you had a look up table. I didn't make the same modifications to your second loop but I can guide you through what needs to be done if you would like to move in this direction. Again your original code is well done for someone who is new to labview so don't feel like you need to follow the new VI design. Just try to remove the build array and multiple indexing as a good programming habbit.
    www.movimed.com - Custom Imaging Solutions
    Attachments:
    Channel Testing.vi ‏41 KB

  • How can I extract data from embedded collection??????

    I have 4 classes (class1, class2, class3, class4). Each of them contains properties, methods and a set (HashSet). The set declaration code is: private Set set1;
    The initialization occurs in the appropriate method (however I did declare and initialize as private Set set1= new HashSet(); without success). Each Set is declared and initialize in their own class. The insert and update method works perfectly well.
    When I load class1 object, I can see at runtime in the debug feature all properties data as well as all set elements (set1, set2, set3, and set4). I can extract the data from all properties belongs to the class1 as well as the set1 element. However I cannot extract the data from the set2, set 3 and set4. By writing the following �String s = class1.set1(). Property name;� and I will get the information. The problem that I have is that I cannot write the following �String s= class1.set1().set2().property name;� since set2 cannot be seen. What should I do to get the info from the other set collection???? The loading method provide an object that contains everything. This object is equal as class1 and the set are embedded one inside the other.
    Used hibernate and Struts.
    Could someone help???? Many thanks

    Are we talking about Java source code here or some weird expression language?
    Can you post a minimal, example Java program that demonstrates your problem?

  • Monitoring using a Dashboard - How do you extract data from different fields?

    I have a situation where a Dashboard needs to be made to monitor the state of different SAP systems.
    Within individual Systems I know its easy to monitor the systems using CCMS (rz20), but my question is, How do you get to pull out the data that is displaying on the CCMS screen so that it could be taken and displayed on a dashboard. A dashboard could be a JAVA program that displays data from various such fields and displays maybe on a TV screen.
    What I found so far was,
    in rz20
    Click on Performance Overview.
    click on CPU Utilization
    So, I place my mouse pointer on Value '2' for User CPU Utilization and hit F1 and then click on Technical Details
    Now even if I place my mouse pointer on Value '1'' for User CPU Utilization and hit F1 and then click on Technical Details I get the same screen as above.
    So, My question is, How do we determine what data sits in what field?
    The aim again is to read these data and populate an external Dashboard.
    The current Systems are not connected to SolMan as we do not have a SolMan setup yet. I am just trying to make a Dashboard using the existing CCMS tool.
    Any thoughts or suggestions would be greatly appreciated.
    Regards,
    Bevin

    Hello Bevin,
    There are other transactions : ST06N/OS07N to check performance data, see note:
    #371023 - OS07/ST06: Monitoring operating system data
    #1084019 - OS07N: New operating system monitor
    All CCMS agents can copy data from the SAPOSCOL shared memory segment to the CCMS monitoring segment and transfer it to a central
    monitoring system. This means that the data is visible in the CCMS monitoring architecture and is displayed both in the familiar transactions ST06
    and OS07 and in the Alert Monitor (transaction RZ20)
    Operating System Collector SAPOSCOL:
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/c4/3a6bff505211d189550000e829fbbd/frameset.htmk
    Kind regards,
    Tamas Istenes SAP Support Engineer
    AGS Primary Support, Global Support Center Hungary

  • How do you extract data from ArrayList of Maps and the classical Iterator?

    Hello guys.
    I ran into this great doozie when I was coding this project I am working on. I have created a randomized question pool for a test so that no two tests with the same ID are alike. I grab a resultset from the DB and push the values through a randomizer. After that, then I stick a Map of the entire object into an ArrayList. Each object is then one complete question. So I have X objects (questions) in the ArrayList then (this is determined by a value in the DB in the test table).
    I have the following code setup:
    Map m = (Map)i.next();
              Iterator keys = m.keySet().iterator();
              while (keys.hasNext())
                   key = keys.next();
                   value = (String)m.get(key);
    The key - data pair always comes out in the same order. What I am trying to do is populate a test (form values) for this. Is there a way that I can do this in JSP? The key map is 100% new to me.
    I want to put the test into a table layout. the typical HTML boiler plate stuff is a cinch, but how would I get the information into a textfield? I can print out the key value pairs, but I guess I get lost in the logic when trying to get these to print in a specific order. Any help you can provide would be highly appreciated.
    Kind Regards,
    Josh

    You can use the JSTL c:forEach tag for that.

  • How can I extract data from ST03 - what tables are used?

    Hi
    I currently have to create performance statistics daily for management. To do this I use transaction ST03 and manually copy the previous days Dialog average response time, DB, CPU and GU av. times into a spreadsheet, and also the average dialog response time for 4 key transactions from the transaction profile.
    It would be nice to automate this. I was thinking of writing a basic ABAP program to query the relevant tables to extract this data - does anyone know which tables are used? I'd tried running a trace but it was not clear which tables/rows etc would be required.
    Thanks
    Ross

    Ok, that FM is an old one - for NW2004s (700) need to use 'SWNC_COLLECTOR_GET_AGGREGATES'.
    Have a basic program below. What I'm trying to do is get the average response time for transactions. I can get 'respti' from the table but I think this is the total response time - what field represents average response time?
    Also, the numbers that it's pulling back don't seem to match the numbers in ST03 at all... except 'dcount'. This seems to correct ly show the number of steps... but the other values don't match anything. What am I doing wrong?
    Program below...
    Cheers
    Ross
    REPORT  Z_GETSTATS.
    PARAMETER: day TYPE dats DEFAULT sy-datum.
    DATA: t_usertcode  TYPE swnc_t_aggusertcode,
          wa_usertcode TYPE swncaggusertcode.
    START-OF-SELECTION.
    CALL FUNCTION 'SWNC_COLLECTOR_GET_AGGREGATES'
        EXPORTING
          component     = 'TOTAL'
          periodtype    = 'D'
          periodstrt    = day
        TABLES
          usertcode     = t_usertcode
        EXCEPTIONS
          no_data_found = 1
          OTHERS        = 2.
      LOOP AT t_usertcode INTO wa_usertcode.
             WRITE:/ wa_usertcode-entry_id.
             WRITE:/ wa_usertcode-respti, wa_usertcode-procti, wa_usertcode-cputi, wa_usertcode-dcount, wa_usertcode-ucount.
             WRITE:/ '*************************************'.
      ENDLOOP.

  • How do I extract data from an ActiveX control

    I am using a basic frequency counter. The counter comes with a user manual (attached) and a VB example (attached). I do not understand how to use the event callback node in Labview 7.0, it is rather confusing wiht this application.
    Attachments:
    3820uc.pdf ‏1765 KB
    UCounterExample.exe ‏28 KB
    UCounterExample.vbp ‏1 KB

    You example could not be loaded. You need to include the complete VB example code (zip the whole directory).

  • How to Extract Data from the PDF file to an internal table.

    HI friends,
    How can i Extract data from a PDF file to an internal table....
    Thanks in Advance
    Shankar

    Shankar,
    Have a look at these threads:-
    extracting the data from pdf  file to internal table in abap
    Adobe Form (data extraction error)
    Chintan

  • How to extract data from MBO which has input parameters

    Dear All,
    I have a requirement to show the material price and material stock.I have created MBOs which takes Plant and Material as its input.
    I have to make an android native application which will show the material stock and material price according to the input Material and Plant.
    So how can I extract data from these MBOs ?

    Have you already got the BAPIs details? If yes please check their structures and see how they are related to get the desired output. You should consult an abaper for this requirement.
    Meanwhile, you can check these posts:
    A workflow Application to Release A Purchase Order...
    Developing SAP Android Mobile app from scratch - Part 1
    Regards,
    Jitendra

  • Extract data from Dynamic Table in Pdf

    Hi,all
    How can I extract data from dynamically created table(the rows are added/removed by user in offline scenario) in pdf form?
    Regards,
    Michael

    Hi Micheal,
         I have a scenario which is similar as yours.I want to extract table data from the offline form.when i extract data i am getting values only for first row of the table.Can u please guide me how to fetch the data for a table(this table also has dynamically increasing rows in offline).I need the solution urgently.Please help me on this.
    WIll reward points for sure.
    Thanks and Regards,
    Srividya.

  • How can I join 3 tables while extracting data from SAP R/3?

    I have 3 tables with the following columns
    Emp table (emp)
      emp_id
      emp_name
      emp_add
    Dept table (dept)
      dept_id
      dept_name
      dept_loc
    Location table (loc)
      loc_id
      loc_name
    Now. If I want to select data from loc_id = 10 and emp_id between 2000 and 3000
    How to join these three tables while extracting data from R/3
      join condition
       loc.loc_id = dept.loc_id
    and dept.dept_id = emp.dept_id
    and loc.loc_id =10
    and emp.emp_id between 2000 and 3000.
    Could any one let me know the procedure to extract this data into BW system.

    Hi,
    shouldn't your join condition be:
    loc.loc_id = dept.DEPT_LOC
    and dept.dept_id = ??
    If you can join the three tables then create a generic datasource (RSO) based on a view (create your view with your join in SE11).
    Enable the loc_id and the emp_id as selectable in the datasource so you can then select the values from a BW IPack.
    hope this helps...
    Olivier.

  • How to Extract data from a Request management tool to Apex to avoid working on Excel reports

    Client uses a ticketing tool,I donot know what is the database for the tool,but I would like to know the best way to extract data from the tool to pex so that we can eliminate working on Excel reports.These excel reports are basically the open request log,resolved tickets,aging tickets etc,currently we work on many excel reports,can we achieve this in Apex ,if so how do we achieve this.Then we would like to use this report and prepare multiple charts,how the above two requirements can be mapped.

    A very important function for the system will be - one sends an email in certain format to a dummy email address, then some data will be extracted from the email based on the pre-defined format and inserted into the database my APEX application is using.
    Any idea on how I can make it happen please? I agree that this is not really an Apex question, but a more general PL/SQL question.
    There are many approaches, all boiling down to one of these two:
    1) Push: Some process in the mail server sends/forwards information to your database when new mail arrives.
    The language/tools used to do this, and the way it would connect to your database, depends on your environment (what is your operating system? mail server? existing middleware/tools? security protocols used? etc.).
    2) Pull: Some process in the database contacts the mail server and polls for new information.
    Ie. some PL/SQL code would communicate with the mail server. Again, it depends on your environment (what is your operating system? mail server? existing middleware/tools? security protocols used? etc.).
    For example, if you are using Exchange 2007 or newer, it has a web services API:
    http://msdn.microsoft.com/en-us/library/dd877045.aspx
    The challenge here will be to build the correct SOAP requests from PL/SQL, and to handle the security protocols used.
    - Morten
    http://ora-00001.blogspot.com

  • How to extract data from a structure?(Data Dictionary)

    Hi all,
           This is regarding extracting data from a structure.
    For Eg:if we want to extract data from a structure ADDR1_DATA,How will we do that in report programming?Structures on its own has no existence unless it s attached to a database table or view.when am using 'Where used List' on that structure also I am not getting any database tables or views.What can I do about this?
    Thanking you,
    anjaly

    HI Anjaly,
    as you said structure does not have any value .. unless something is added to it..
    So just use the structure to define the type of the sttructure you want..
    Or to include it in your itab like..
    data : Begin of itab occurs 0.
           include structure ADDR1_DATA.
    data  i type i.
           end of itab.
    you cannot directly extract data from the  structure ADDR1_DATA..
    regards
    satesh

Maybe you are looking for

  • Report to see  T CODE  use

    Hello  , is  there  some  report  when  we  can  see  how  many  times  users  have  used  some  of  the  transactions? Thanks and  best  regards L

  • Untimely reporting of data usage

    Why is Verizon's reporting of my data usage so sporadic?  I received two data reports today, one at ~730 am, and one around 9:30am.  Since then:  NOTHING!  Even though I streamed two 40+ minute programs (at their lowest resolution) from Hulu this aft

  • How should I deal with it in the BMM Layer

    Hi all, I need a suggestion in a problem. Here is the scenario, In the physical layer, There are some fact to fact joins. ProductFact ----< PolicyFact ----< PolicyCoverFact ----< ClaimFact ----< ClaimPaymentFact ----< CorrespondenceFact There are som

  • How to send a report for particular job chain every hour regarding the job

    Hi Gerben/Anton We are running one jobchain for all billing jobs . Is any chance is there to send a report automatically to certain pupils for every one hour regarding the job status(excel format ) . Coudl you please help on this it should be good if

  • Help with Error: $host does not have a method 'messageBox'

    Greetings Everyone: I get this error in my Log window: Error: $host does not have a method 'messageBox' I'm calling xfa.host.messageBox("MyMessage") from form's initialize event. What am I doing wroing? Acrobat Pro 9 - Java Script is enabled. Thanks