How to load a pointer data memory in table

I'm trying to interface to a DLL used to manage a piece of hardware. The DLL is written in c. uses _stdcall and the Import Wizard has hooked up with success of most screws in a library; many of them work everything just as it is. I have also played with the knot of library function call and think that most of the time, I got the hang of it. I ran successfully for the odd Windows API call (e.g., MessageBox). However, I am a newcomer in Labview. My problem is related to a DLL function that requires a pointer to a block of memory, in which he then dealt with the material (in the form of table of UINTs) data. I want to display these data in Labview, through a table I guess. I think I found everything I need to do in terms of creating a table and hanging until the node of library function call with an input pointer.

I hope this would work IF the block of memory has been fully completed until the function has returned. HOWEVER, this is not how the DLL function. It creates a thread that exert to put data in the memory block after the function in the DLL. Extra features are available for face to discover if the data transfer is complete. I guess this is enough to refute the marshaling of data in Labview, unless there is some special commands for this purpose.

I thought maybe I should allocate the memory using the Windows API (LocalAlloc LPTR flagged so I get a pointer) and I wrote a little VI that allocates and releases the memory that seems to work. This way I can release memory when the transfer is complete. MY PROBLEM is, given the pointer to the block of memory, as returned by LocallAlloc, how can I get Labview to read the memory in an array of integers.

I am now a little stuck and would like to receive advice on one, how to convert the block of memory, or on a way to approach things btter.

TIA

SteveJM wrote:

So I have a working solution, which is basically the same idea as your suggestion, but uses the Windows API. I took the trouble to mention it, but when I looked more closely at 'MoveBlock', 'DSNewPtrt' etc, I realized that they are a static C library. This means that using them requires that you have a C development system and knowledge how to build DLLs on that. As it happens that causes me a problem, but it seemed like a hammer in this case because the routines you need are already in the kernel32.dll module. [Yes that makes specific Windows, but then you would need rebuild your dll for each operating system in any case].

This paragraph is completely inaccurate.  These functions are integrated into the runtime LabVIEW, without which your LabVIEW code will not work.  You have the guarantee that if you can run your LabVIEW code, or in the development environment or as a compiled application, these functions are available.  No need for a C development system (if that were the case, don't you think someone would have mentioned in one of the many messages on this forum on the use of MoveBlock?).

SteveJM wrote:

It is true that you need to find a way to pass the pointer to the destination of reference. In other words, using a "handful" I guess. One of the difficulties is that the documentation for Labview is rather imprecise on what happening coming in and out of the function call. Unfortunately, the meaning of "Handle" is very dependent on context, so documentation should be much more detailed. If you select 'Manage' rather than "Pointer table" minimum size box disappears implying that Labview will take a pointer to a pointer to a format of Labview. It would then allow the size information in the allocation of the table and set the offset pointer approprately when passing a pointer to the function that would fill the memory. If the size of the table was large enough, it might be useful to tweak with this to avoid the copy useless (and allocation), but I don't have time now, unless I find the best literature which explicitly explains this gathering takes place for each option in the dialog box.

All the help you need is available.  Set up a call library function node to pass by handle, close the configuration dialog box, right-click on the function call library node and choose Create .c file...  You will get a draft of C with all structs defined for you, and you will see that the handful of LabVIEW table includes size information.  There is no "triage."  He is just passing pointers autour (and a few and Word-permutation of bytes due to problems of "endianness").  When you pass an array of pointer to array value, you get what you expect - LabVIEW dereferences the handle once and passes the pointer of table.  It's exactly like a C function call.  Nothing unusual occurs when the call is returned (with the exception, even once, "endianness" switch if necessary).  That said, it's a bad idea to do what you want to do with a handle, because LabVIEW is allowed to move the table when he likes and has no way to know that some other functions still has this memory block to stay where he is.

Tags: NI Software

Similar Questions

  • How to load the clob data in a table.

    Hello

    I loaded a column clob with a text file which has about more than 1000 lines, now the clob column has all the records as if it were a line... at the end of each record in the clob column, I think the value of this function: Chr (13)... I think it means end of line or new line something like that.. .my question is how can I move these data in a normal table... .i need a code which share this intro to data rows so I can insert them into a table...

    Thanks in advance...

    OAIS

    Sorry, but my code is designed to give you a starting point for how to address your problem, not a complete solution.

  • FDMEE error data import: No. periods have been identified for the loading of the data in the table "AIF_EBS_GL_BALANCES_STG".

    Hi experts,

    I tried to load the data of EBS in HFM via FDMEE.

    Importing data in the rule of loading, I have encountered an error in loading.

    2014-11-21 06:09:18, 601 INFO [AIF]: beginning of the process FDMEE, process ID: 268

    2014-11-21 06:09:18, 601 [AIF] INFO: recording of the FDMEE level: 4

    2014-11-21 06:09:18, 601 [AIF] INFO: FDMEE log file: D:\fdmee\outbox\logs\TESTING_268.log

    2014-11-21 06:09:18, 601 [AIF] INFO: user: admin

    2014-11-21 06:09:18, 601 INFO [AIF]: place: Testing_loc (Partitionkey:3)

    2014-11-21 06:09:18, 601 [AIF] INFO: name: OCT period (period key: 31/10/14 12:00 AM)

    2014-11-21 06:09:18, 601 INFO [AIF]: name of the category: real (category key: 1).

    2014-11-21 06:09:18, 601 INFO [AIF]: name rule: Testing_dlr (rule ID:8)

    2014-11-21 06:09:19, 877 [AIF] INFO: Jython Version: 2.5.1 (Release_2_5_1:6813, September 26 2009, 13:47:54)

    [JRockit (R) Oracle (Oracle Corporation)]

    2014-11-21 06:09:19, 877 INFO [AIF]: Java platform: java1.6.0_37

    2014-11-21 06:09:19, 877 INFO [AIF]: connect the file encoding: UTF-8

    2014-11-21 06:09:21, 368 [AIF] INFO: - START IMPORT STEP -

    2014-11-21 06:09:24, 544 FATAL [AIF]: error in CommData.insertImportProcessDetailsTraceback (most recent call last): File '< string >", line 2672, in insertImportProcessDetail

    RuntimeError: No periods have been identified for the loading of the data in the table 'AIF_EBS_GL_BALANCES_STG'.

    2014-11-21 06:09:24, 748 FATAL [AIF]: load balances data launch GL error

    2014-11-21 06:09:24, 752 [AIF] INFO: end process FDMEE, process ID: 268

    I found a post related to this error, but did not respond.

    I know I'm missing something, gurus please help me to overcome this error.

    ~ Thank you

    I managed to overcome this problem,

    This was caused due to an error in the map of the time.

    In the mapping of source, the name of period should be defined exactly as displayed in the EBS.

    for example: {EBS--> OCT - 14} FDMEE {mapping source--> OCT - 14}

    The names of the time must be identical.

  • How can fill us with data in this table AR_RECEIVABLE_APPLICATIONS_ALL

    Hi all

    How can fill us the data in this table, I created a credit memo and marked it complete but I'm still not able to get the data in this table.

    What is the correct approach or any other alternative available.

    Thank you
    Ajay

    Hello.

    Ok. In the Menu, choose Actions and Applications.

    Octavio

  • How to load the text file into a table and retrieve data line by line?

    I'm looking to help understand how to open a text file, each line in a table of load.  The data will be called to change the content of the text layer.  Thanks for any help.

    I did not test this code, but something like

    var a = [];

    var f = new File (Folder.desktop + "/ TestFile.txt");

    If (f.open ('r')) {}

    While (! f.eof) {}

    a.push (f.Readln ());

    }

    f.Close ();

    }

    Alert ("I read" + a.length + "lines in the file.");

    for (var i = 0; i)< a.length;="" i++)="">

    DoSomethingWithThisLine (a [i]); //<-- you="" need="" to="" write="">

    }

  • How to load #MISSING (empty data) in Essbase through ODI?

    Hello
    As a topic, how can I clear an Essbase through ODI value? I tried to load '#MISSING' & ' But since they are the text rather than a numeric field, it failed with the error "invalid column type specified for the data column. Can anyone help? Thanks in advance.
    Rgds,
    Ricardo

    Hello

    How you load, if you load a SQL table that you would simply load a null value in the database

    example of data in basic sample loading

    Measures, period, scenario, market, products, data
    Sales, Jan, real, Florida, 100-10, 10
    CMV, Jan, real, Florida, 100-10 to + NULL +.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • How to load all the data without uncheck Journalized data only option?

    Hi all

    Currently, I have configured an option only logged data for many game data and interface.

    But I need to load all the data (once) without clear logged Data Only. After that it will work with the CDC.

    Please help me on this.

    ARO
    EBA

    Hi Eba

    Another way is to copy the source data to another table (two copies).
    If you have 10 source table and then create another 10 tables in doubles in the backend.
    Now truncate these original paintings. Then insert the data in table duplicated in the original table. Now CDC will detect these are inserted.
    But I guess you have more than 300 paintings, which is again difficult to manage.

  • How to find if the data in the table are distributed on multiple disks

    Hi all

    I have a question on parallel processing.

    Assume that the Oracle (11 g 2) database is installed on a 12 CPU hardware has 24 independent labels, then I guess it's that we can have a maximum of 12 DOP.

    But if the table on which I use the parallel market that spans only 4 discs then the above 4 parallelism will degrade the performance of the query.

    My question is how do I know if the data in the table are spread over the number of disk drives, so that we can properly apply valid parallel operations on the table.

    Appreciate your valuable contributions here.

    Thank you
    MK.

    Just think logically.
    What is a table in the database? A segment.
    What is a segment made up of? Scopes.
    What is recorded on a scale? The id_fichier of the data file.

    ------------
    Sybrand Bakker
    Senior Oracle DBA

  • How do I get the data in a table column of material using the tcp/ip interface

    Hello everyone, I want to get my material data using tcp /ip interface.and and then display them in a column of the table control? can any body tell how to do that .that me clear I never before communicate with hardware so please help me in detail.

    Thank you

    Hi Charlotte,.

    ask that 'someone' for more specific information.

    You must know the exact format of the channels you receive in order to analyze!

  • How to load the file name in the table target. ?

    Hi Expertise,

    I load the data of 100 files of same schema using packages,

    It is a variable stores the names of files. I used this link for reference: ODI gurus: SEVERAL FILES - TARGET SINGLE TABLE - SINGLE INTERFACE & several files simple single interface target .

    but now I need what files have been executed in the interface. Please give me some ideas?
    I need when the data from a particular file was loading then in DB, the particular file name must also be sent to the target.

    using ODI 11.1.1.9 & wls 10.3

    Help with kindness,

    Thank you

    Shakur

    In my example src_file_name is a column name

    and #projectName.variableName - is a variable

    If you want to store in the column you define '#projectName.variableName.txt '- don't forget the single quotes - (as a result, you get an error)

  • while loading does no data in the table target, odi performance degrades?

    Hello

    I am trying to load some data from the source (Oracle DB1) to the target (Oracle, DB2) table in the same server

    Source table have 45lacks of data. These data must be load in the target table.

    I create interface. I took LKM SQL SQL & IKM SQL for SQL incremental Add.

    yesterday I executed interface, I checked the status in the browser of the operator. "his display like the loading status.

    However, the interface is in State of loading.

    sometimes odi is unresponsive. Plese help me.

    Need to add all the fetch sizes?

    Please solve this problem.

    Thank you and best regards,

    A.Kavya.

    Hello

    As you say, I tried with different knowledge modules. I used the incremental update IKM for db and db 45 do not data loading.

    its really increase performance. with in 10 minutes it will be correctly loaded into the target table. previously, I used SQL & SQL LKM, IKM SQL for SQL control append.it takes a long time. It takes two days also data is not loaded in the target table. really bad performance.

    I used DB loading for better performnace LKM SQL to ORACLE & IKM INCREMENTAL UPDATE.

  • How to load flat files without header to table in ODI

    I try to get data from a flat file, but it doesn't have any header

    as 1, tom, 36, usa.

    I have a table with id column, name, age, country, and I want to get the data. Please let me know how to proceed.

    Thanks in advance

    If you add columns manually in the data model there is no need to reverse engineering. If you reverse engineer with header set to 0 ODI will simply give the columns arbitrary identifiers such as C1, C2, C3 etc. That you can leave or change.

  • Load since excellent data to Oracle Tables

    Hi all

    I want to create a table with the payment year as default sysdate (to_char(sysdate,'yyyy')) and months in the form 'MM' (as default payment_month < (syadate, 'MM') >

    I'm doing it in vain. Help me please, and the other is want to load data from EXCEL to ORACLE table.

    I used to load the load data using SQL * LOADER. can you please let me know is possible to load data without using SQL * Loader? Please give me the solution for this.

    Thank you
    ORA.
  • How to insert deliberately incorrect data in a table for the test?

    Good morning (or afternoon you BluShadow) :),.

    I tried my hand to solve the problem that is mentioned in this thread

    Invalid number exception

    where the OP has incorrect data in a numeric field.

    When I tried to create a test case (which requires the insertion of incorrect data in a numeric field), Oracle fought me teeth and nails and won. I could not put incorrect data in a numeric field.

    Question is: How do we convince Oracle to allow me to "ZZZ" in a numeric field?

    By the way, what I was trying to solve the problem in the above thread, was to throw the digital field with incorrect data in a string type (Char (20), for instance) and then inspect the string to determine if it is a valid number.

    This approach has the potential if Oracle will not validate the contents of the field before castant. If that's the case then it will not work. That of what I tried to test but could not get the test data with.

    Thank you for your help,

    John.

    Question is: How do we convince Oracle to allow me to "ZZZ" in a numeric field?

    You can not.

    I look more deeply in the other thread that you mentioned, but this is probably a question like this:

    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 
    
    SQL> create table table1 (
      2   num number(5),
      3   des1 varchar2(10)
      4  );
    
    Table created
    SQL> create table table2 (
      2   num varchar2(5),
      3   des2 varchar2(10)
      4  );
    
    Table created
    SQL> insert into table1 values(1, 'desc1');
    
    1 row inserted
    SQL> insert into table1 values(2, 'desc2');
    
    1 row inserted
    SQL> insert into table2 values('1', 'desc1');
    
    1 row inserted
    SQL> insert into table2 values('2', 'desc2');
    
    1 row inserted
    SQL> insert into table2 values('A', 'desc3');
    
    1 row inserted
    
    SQL> select *
      2  from table1 t1
      3       join table2 t2 on t2.num = t1.num
      4  ;
    
    select *
    from table1 t1
         join table2 t2 on t2.num = t1.num
    
    ORA-01722: Nombre non valide
    
    SQL> select *
      2  from table1 t1
      3       join table2 t2 on t2.num = to_char(t1.num)
      4  ;
    
       NUM DES1       NUM   DES2
    ------ ---------- ----- ----------
         1 desc1      1     desc1
         2 desc2      2     desc2
     
    

    We can see what is happening behind the scene by running a plan to explain:

    SQL> explain plan for
      2  select *
      3  from table1 t1
      4       join table2 t2 on t2.num = t1.num
      5  ;
    
    Explained
    
    SQL> select * from table(dbms_xplan.display);
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    Plan hash value: 4277839568
    -----------------------------------------------------------------------------
    | Id  | Operation          | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    -----------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |        |     3 |    93 |     7  (15)| 00:00:01 |
    |*  1 |  HASH JOIN         |        |     3 |    93 |     7  (15)| 00:00:01 |
    |   2 |   TABLE ACCESS FULL| TABLE1 |     2 |    40 |     3   (0)| 00:00:01 |
    |   3 |   TABLE ACCESS FULL| TABLE2 |     3 |    33 |     3   (0)| 00:00:01 |
    -----------------------------------------------------------------------------
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       1 - access("T1"."NUM"=TO_NUMBER("T2"."NUM"))
    Note
    -----
       - dynamic sampling used for this statement
    
    19 rows selected
     
    

    The predicate of access actually includes a TO_NUMBER, which of course not on NUM = "A".

    Published by: odie_63 on 24 July. 2010 12:39

  • How to load the demilited hose to Oracle table text file

    Hi all

    I have a file (filaname.txt) I want to load into oracle table.

    This file is pipe delimited.

    Some examples of filename.txt data...

    SOURCE_SYSTEM_NAME | ACCOUNT_NUMBER | BILL_TO_LOCATION | SHIP_TO_LOCATION
    SMS US | 0001 | 1. 1
    SMS US | 0001 | 1. 2
    SMS US | 0001 | 1. 4
    SMS US | 0002 | 1. 1

    could you please suggest what are the parametrs to create a data store for a pipe delimited txt file.

    Thank you

    When you create him data store for the file in the files tab to define the field as separator. or Hex 7 c

    See you soon

    John
    http://John-Goodwin.blogspot.com/

Maybe you are looking for

  • How can I download my address book to other e-mail accounts in the mine?

    I left yahoo as my default e-mail address as the contact address book no longer works. I can't get my list that I compose a message, you start typing the name. I have other messaging such as Comcast and g-mail accounts. How can I import them into my

  • Restore to an earlier Date

    I have a HP Pavilion slimline desktop computer. I got a virus. What I have to restore the entire computer or can I just restore to earlier as a day or two before the computer has been infected? Or should I just restore the entire computer.

  • Is it legal to use and the version of Windows XP OEM from an old computer (to be retired) to the lower-grade a Vista to XP computer?

    (I have a few Win XP computers running the great. And I like Win XP.) Here's the situation: I have also a Vista computer and a very very old computer Win XP.  This computer very very old win XP has been in the dust of basement collection and will be

  • Lost serial number XP Home Edition

    I have just formatted my computer with XP Home Edition original genuine CD but I can't find the serial number anywhere. The computer is fully formatted and so I can't use one of the programs that go get my serial number for me to a Windows running. H

  • Neo V update is available

    Hello I read the discussion of ICS, ICS is available in Sweden, Denmark, Iceland, Finland and Norway this country. So can you tell me when the update is available in India.