DLL in VC ++ with several types of data

Hello world

I'm new on the Forum of Labview and Labview fairly new as well.

I have some errors in my VI and I can't quite understand what I'm doing wrong. I have a DLL written in VC ++. There is a function in the DLL that I'm shouting in VI, but the function contains variables that are composed of multiple data types.

These are my variables in the code for VC ++:

typedef struct
{
Double depth;
Double dWidth;
Double dHeight;

float fVolume;
float fSurfArea;

int iGood;
int iBad;
} box_t

Then I have my function that calls these variables:

_declspec (dllexport) int _cdecl ACL_GetData_Array(void *dataArray)
{
arrayStructure-> rockia = (array_t *) dataArray.
PrintGeneral ("table pointer value to retrieve data. ("\n new address.");
PrintAddr ((int) arrayStructure-> rockia);
arrayStructure-> Philippe-> depth = 30.3;
arrayStructure-> Philippe-> dHeight = 40.4;
arrayStructure-> Philippe-> dWidth = 50.5;
arrayStructure-> Philippe-> fSurfArea = 60.6f;
arrayStructure-> Philippe-> fVolume = 70.7f;
arrayStructure-> Philippe-> iBad = 80;
arrayStructure-> Philippe-> iGood = 90;
 
Return (int) arrayStructure-> Philippe;
}

Now my question is if I just want to read these variables and display them in Labview, how can I do? So far, I can get double appears correctly, but I did have a success with floats and integers (ints). If this has been posted by another user, I'm sorry to ask the same question. I searched for a few days now and have not encountered any useful information.

Thank you

George

ghatz85 wrote:

If possible, can you save the VI changed in version 8.5.1? LabVIEW won't let me open the files attached to the forum.

I'm sorry. For some reason, I thought that the originals were in 2009 LV. Version 8.5 is attached.

Insofar as the structure of data in the DLL, the programmer had rearranged the types of data to go from the largest to the smallest.

I was talking of having a structure within a structure and call it a "table".

Tags: NI Software

Similar Questions

  • Create table with several Collections of data control

    Hello

    I have a requirement about to display data in a table. It shows simple, but certain columns in the table are within a collection, and the others are in another collection. I read this chapter Creation of ADF Databound Tables - 11 g Release 1 (11.1.1.7.0), and she explains to create the table with a collection.

    I have no knowledge on the model, I know just as control data, so what should I do? :

    -Ask for the template designer to redraw the control of data to include a collection with all the data?

    -Try to work with the actual data control? If so, how can I create the table several Collections of data control?

    Plese let me know if there is another solution. I work with JDeveloper 11.1.1.7.

    Thank you!

    AAPDL

    Hello

    You can have a managed bean that e... g exposes an ArrayList of objects. This can then binds to the value property of the table. If the object sets the information of table row combination that you get multiple iterators (collections), then the table will display the joined data.

    Frank

  • Flex services with several types of return

    Hello

    We create a webapplication with flex and php.

    Everything works fine, until we got to the part of the library of the application.

    Each service has so far had only 1 return type (for example: user, group,...)

    Now for the library, we want to return a collection of ArrayCollection of different types of objects. To be more precise the LibraryService must return a collection ArrayCollection containing objects of folder and file.

    But how to configure this in Flex (Flash Builder 4 (standard))?

    So far it converts all objects of type Object, I really wish it was the folder or the file

    The only solution we can think of right now is to create a new library object which will contain 2 ArrayCollections, file type and file type. This might work of course, but I wonder if there is a better solution for this OR that I can configure several types of return for a service.

    Ideas/advice is greatly appreciated.

    Look at Zend or AMFPHP.

  • SQL * Loader vs external tables to a single file with several types of records (intercalated)

    I have a file of sample data (we will have the a 'true' at a later date and put in day after that) which includes a header, footer, and 5 types of records, that have different columns and lengths, noticed by the first two characters. The different types of records are not all together. On the contrary, some (in particular, two of these types in this example) are intertwined. I am currently working on a SQL * Loader configuration file when it was suggested that I use external tables. I know very little of either, then I would ask what is the best to use.

    Scott@orcl12c > host type test.dat

    header line

    AB, 123, efg

    CD, hij, 456

    Scott@orcl12c > type host test.ctl

    options (Skip = 1)

    load data

    in the ab table truncate where table_name = 'ab'

    fields ended by ',' trailing nullcols

    (table_name filler position (1), col1, col2)

    in the cd table add where table_name = 'cd'

    fields ended by ',' trailing nullcols

    (table_name filler position (1), col3, col4)

    Scott@orcl12c > create table ab

    2 (col1 number,

    3 col2 varchar2 (8))

    4.

    Table created.

    Scott@orcl12c > insert into ab values (1, 'old data')

    2.

    1 line of creation.

    Scott@orcl12c > create table cd

    2 (col3 varchar2 (8))

    3 col4 number)

    4.

    Table created.

    Scott@orcl12c > insert into cd values ("old data", 1).

    2.

    1 line of creation.

    Scott@orcl12c > commit

    2.

    Validation complete.

    Scott@orcl12c > host sqlldr scott/tiger control = test.ctl data = test.dat log = test.log

    SQL * Loader: release 12.1.0.1.0 - Production on Thu Mar 27 13:11:47 2014

    Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

    Path used: classics

    Commit the point reached - the number of logical records 2

    Table AB:

    1 row loaded successfully.

    Table D:

    1 row loaded successfully.

    Check the log file:

    test.log

    For more information on the charge.

    Scott@orcl12c > select * AB

    2.

    COL1 COL2

    ---------- --------

    EFG 123

    1 selected line.

    Scott@orcl12c > select * from cd

    2.

    COL3 COL4

    -------- ----------

    old data 1

    hij 456

    2 selected lines.

  • Fail to create the web service with the type of data defined by the user using the jwsc Ant task!

    Hello everyone!

    I used JAXWS to create WSDL from a file of Jehovah's witnesses.

    It's my TJ:
    -----------------------------------------------------------------------------------
    package ws;

    Import javax.jws.WebService;
    Import javax.jws.WebMethod;
    ws import. MyDataType;

    *@WebService*
    * public class MyWebService {*}
    public MyWebService()
    *{*
    *}*
    *@WebMethod*
    public MyDataType MyWebMethod (MyDataType mdt)
    *{*
    * / / mdt.setS ("I got it!"); *
    return mdt;
    *}*
    *}*
    -----------------------------------------------------------------------------------


    and this is my type of data:
    -----------------------------------------------------------------------------------
    package ws;

    * public class MyDataType {*}


    String ^ s;
    public MyDataType()
    *{*

    *}*
    * public String getS() {*}
    return s;
    *}*

    * Sets public Sub (String s) {*}
    This.s = s;
    *}*
    *}*
    -----------------------------------------------------------------------------------



    and that's my Ant build.xml
    -----------------------------------------------------------------------------------
    * < by default of the project = "all" > *.
    * < property name = "weblogic.jar.classpath" value="D:/Projects/bea103/wlserver_10.3/server/lib"/ > * "
    * < taskdef name = "jwsc" classname = "weblogic.wsee.tools.anttasks.JwscTask" > *.
    * < classpath > *.
    * < path id = "weblogic.classpath" > * "
    * < pathelement path = "WEBLOGIC_HOME" / >. *
    * < fileset dir = "${weblogic.jar.classpath}" > *.
    * < include name = "weblogic.jar" / > *.
    * < / fileset > *.
    * < / path > *.
    * < / classpath > *.
    * < / taskdef > *.
    * < target name = "all" depends = "clean, build-service" / > *.
    * < name target 'clean' = > *.
    * < delete dir = "output" / > *.
    * < / target > *.
    * < name target = 'build-service' > *.
    * <!-add jwsc and related tasks here - > *.
    * < jwsc srcdir = "" destdir = "wsoutput" > * "
    * < jws file = "MyWebService.java" type = "JAXWS" / > * "
    * < / jwsc > *.
    * < / target > *.
    * <!-< target name = "deploy" > - > <! - add wldeploy task here - > <!-< / target >-> *.
    * < / project > *.
    -----------------------------------------------------------------------------------

    I have run the Ant task, but I get this error:
    -----------------------------------------------------------------------------------
    BuildFile: build.xml

    clean:

    build service:
    [jwsc] TJ: processing module /MyWebService
    [jwsc] The analysis of source files
    [jwsc] The analysis of source files
    [jwsc] 1 TJS files processing for the module /MyWebService
    * [jwsc] [JAM] WARNING: could not resolve class MyDataType *.
    [jwsc] TJ: C:\Documents and Settings\samimi\IdeaProjects\SampleWebService\src\ws\MyWebService.java valid.
    [jwsc] Treatment of the web services JAX - WS 1...
    * [jwsc] error: couldn't get TypeDeclaration for: MyDataType apt tour: 1 *...
    ...................
    BUILD FAILED
    C:\Documents and Settings\samimi\IdeaProjects\SampleWebService\src\ws\build.xml:
    19: weblogic.wsee.tools.WsBuildException: JAX - WS web services processing error
    -----------------------------------------------------------------------------------

    Please help me solve this problem.
    Thank you
    Mojir

    I tried to compile your source code and received the same exception.
    However after compiling the MyDataType.java before running the jwsc task, I was successfully able to build the service.

    Please try the ant script below and let me know the result:

    **
    *     *
    *
    *



    <>
    srcdir = "${source.dir}" "

    DESTDIR = "${Build.dir} '"
    keepGenerated = 'true '.
    classpath = "${Class.Path} '"
    Debug = 'true '.
    verbose = "false" >

         


              

    Thank you
    Sandeep

  • Problem with the type of data in a view

    Hi all

    I have modified a view. For this reason my view passed to varchar2 column data type number automatically. But it should be only a number.

    Updated the view that changes the data type of column varchar2

    VIEW to CREATE or REPLACE v1
    AS
    SELECT Decode (Sign (mta.base_transaction_value), 0, Decode (Sign (mta.transaction_value), Decode (Sign (mta.primary_quantity),-1, NULL, 0))
    MTA.base_transaction_value),
    -1, NULL,
    Decode (Sign (mta.primary_quantity),-1, NULL, NULL
    MTA.base_transaction_value),
    (0)
    1, MTA.base_transaction_value,
    Col1 is NULL)
    Mtl_transaction_accounts MTA

    Old view that keeps this column under the number:

    VIEW to CREATE or REPLACE v1
    AS
    SELECT Decode (Decode (Sign (mta.base_transaction_value), 0, Decode (Sign (mta.transaction_value), 0, Decode (Sign (mta.primary_quantity), 1,0,))))
    0,0,
    (NULL),
    1.0,
    (NULL),
    1, MTA.base_transaction_value,
    Col1 NULL))
    Mtl_transaction_accounts MTA

    -> Create a note that the type of data of base_transaction_value, transaction_value, primary_quantity columns is number

    No help for making the data type of column 'col1' number using my first query?

    Thank you
    Srini

    The data type of an expression of DECODE() is determined by that of his first return value. Oracle has decided that a NULL value is a VARCHAR2 data type (because there must be something ).

    The changes to your code are extremely intertwined and twisted out and frankly too hard to work through. However, I think at some point the changes that you have implemented it had that effect.

    SQL> create or replace view v1
      2  as
      3  select decode(to_number(to_char(sysdate, 'dd')), 1, 0, 99) as col1
      4  from dual
      5  /
    
    View created.
    
    SQL> desc v1
     Name                                                  Null?    Type
     ----------------------------------------------------- -------- ----------------
     COL1                                                           NUMBER
    
    SQL> create or replace view v1
      2  as
      3  select decode(to_number(to_char(sysdate, 'dd')), 1, null, 99) as col1
      4  from dual
      5  /
    
    View created.
    
    SQL> desc v1
     Name                                                  Null?    Type
     ----------------------------------------------------- -------- ----------------
     COL1                                                           VARCHAR2(2)
    
    SQL>
    

    Cheers, APC

    blog: http://radiofreetooting.blogspot.com

  • problem with the type of date dd/mm/yyyy

    Hi all!
    I want to do something simple.
    to get a type of dd/mm/yyyy string and convert it ti date jj/mm/aaaa type.
    I wrote simple code
    String pattern = "dd/MM/yyyy";
    SimpleDateFormat format = new SimpleDateFormat (pattern);
    try {}
    Date = format.parse("12/03/2006");
    System.out.println (date);
    } catch (ParseException exception) e {}
    e.printStackTrace ();
    }

    but the problem that I get Sun Mar 12 00:00:00 GMT + 02:00 2006
    and I want to get this format dd/mm/yyyy.
    because I need to insert it in my db. Thank you all

    First thing: almost always if a SQL statement uses variable data, use a PreparedStatement. With the help of a simple statement can, at first, most obvious glance, but it will cause endless problems.

    The constant strings in SQL are "single quotes" i.e. apostrophes. They must at least cannot escape string constants. One of the reasons for always using class PreparedStatement is that you concatenate in a string value may contain an apostrophe. In this case it will be, at best, give your SQL syntax error. Worse it can make your system vulnerable to hackers.

    Use code publishing code tags. Put the word 'code' braces before and after. This makes your code readable.

    The field attribute by DEFAULT when you create a table must be a real date, not a model. I have never know this is useful for a date, except if it set to pick up the current date.

  • I can't create a table with SDO_GEOMETRY type of data in the database of 12 c

    Hello

    When I run the following script I get an error please help,

    Error from line: 3 in command.

    create table SPATIAL.warehouses)

    whse_code VARCHAR2 (4) primary key,.

    warehouse of VARCHAR2 (50).

    location SDO_GEOMETRY

    )

    Error report-

    SQL error: ORA-00902: invalid data type

    00902 00000 - "invalid data type".

    * Cause:

    * Action:

    I use a 12 c database.

    Hi guys

    I found the solution by asking my DBA to reinstall localization features using the oracle Installer.

    Now everything works fine.

    Thanks again for the responses.

  • Creating a report with several models of data...

    Use of BI publisher for Word 10.1.3.4

    I'm trying to create a template in Word format with report parameters, that I created in BI Publisher.

    I created two data models, the two tables different references I need on the report itself. The question that I've seen is whenever I use the table, rowset Wizard is grayed and only the default data model (sql query) can be used.

    I looked around and was unable to find a solution to this.

    Hello

    You must set as main data Source of concatenated dataset. Otherwise, only one set of data is used.

    Concerning
    Rainer

  • Maximum number of user defined dimensions for Hyperion application with several types of plan

    Dear,

    I know that the maximum number of dimensions is 20 for an application and for better performance, we shouldn't have more than 12 years, but if we plan different types? I found the below in the psb user guide:

    "Applications are supported up to 20 dimensions. However, optimal performance, not more than 12 dimensions must be attributed to each Type of Plan. »

    I have therefore 20 dimensions by plan type, or application? and that optimal performance it should be 12 dimensions by plan type, not by the application?

    Any advice, please?

    Thank you

    Hello

    The limit is for a planning application for a type of plan... You can add dimension to choose to exist for a type of plan in particular.

    All members of custom dimension that there will be for only this type of regime...

    Kind regards

    Sourabh

  • problem with a type of data encryption / decryption

    Hello

    I'm developing an application in which c ++ app will send encrypted table bytes unsigned using JNI for Java application that will decrypt the same and make the continuation of the procedure.

    As the unsigned c++ byte array is using before sending it to java he converts an array of jshort we do not want to lose the original array element values. So on the side of java, we will get the encrypted short table, to decipher the same I need the same converted to array of bytes as Cipher.dofinal (byte []) method accepts the byte array and I'll have short table. If I have the same assigned in byte array, then I will lose the original values of the short table. How can I solve the problem? How can I receive the array of encrypted bytes unsigned of C++ and decrypt the same in java?

    Published by: user3516155 on March 23, 2011 12:41 AM

    Question: have you tried simply to pass the array of bytes without any conversion of short?

    A signed and unsigned bytes are on the data level 100% equal to the other. the difference in interpretation.

  • unite with different types of data

    Hi all

    I am working in Oracle 10 g R2.

    I have the following function and each record would have one of the below fields filled... where Im trying to get the value non-zero to be the 'actual_data '. When I try to run I get the following error

    VALUE_NBR is a NUMERIC field in the table
    VALUE_DT is a DATE field in the table
    VALUE_CD is a VARCHAR2 in the table
    VALUE_TXT is a VARCHAR2 in the table
    ORA-00932: inconsistent datatypes: expected NUMBER got DATE
    COALESCE(VALUE_NBR,VALUE_DT,VALUE_CD,VALUE_TXT) AS ACTUAL_DATA,
    Please suggest me a solution or an alternative... I tried NVL... who had the same error as well.


    Thanks in advance
    HU

    Convert the dates and numbers to strings:

    coalesce( to_char(value_nbr)
            , to_char(value_dt, 'yyyymmddhh24miss') -- or some other format mask
            , value_cd
            , value_txt
            ) as actual_data,
    
  • FileSelectPopup, several types with the same extension

    Hello

    When you use a popup of file selection with several types of files for a SAME extension, such as:

    FileSelectPopup ("", "*.tiff (8 bits) ', *.tiff *.tiff";(16 bit) "(8 bits)," save under ", VAL_SAVE_BUTTON, 0, 0, 1, 1, file");

    Y at - it no way of knowing what 'Save as type' has been selected by the user on the popup?

    (win7x86; 2010 CVI)

    see you soon,

    DIZ

    None that I know.

    In your case, you will need to review the content of the actual file to discriminate between the different types available: I guess that's what programs focus on the image. A tiff file should have a header that specifies what tye of image is stored in it.

  • How to periodically send various types of data via the Serial Port?

    Hello! Everyone

    I have to send data to LabVIEW to my device on the Serial Port.

    I know how to send data on serial port in LABVIEW, I already have this part.

    Now the problem is that I have several types of data I need to question my embedded device, if I want to send the query periodically command.

    So lets say that my four Op Codes are the following, which will send four different types of query command to my device on the serial port.

    (To be honest only OP_LED and OP_SENSOR is used now)

    0, OP_SYNC

    1, OP_LED

    2, OP_SENSOR

    3, OP_FUTURE

    Structure of basic package is as follows:

    Header (0x2C), Checksum, length of the data (n bytes), Op_Code (1 byte), length (length of Code + data Op)

    For OP_LED, I need to send the package as follows:

    0x2c 0x02 0x01 0 x 00 0x2F (0x2F being the XOR checksum) (calculation of Checksum part is done and SUB Vi form)

    Length of the package this is 0x02

    0x01 is Op Code for OP_LED

    In the same way

    For OP_SENSORi need to send the package as follows:

    0x2c 0x03 0x02 0x00 0 x 00 0x2D (0x2D being the XOR checksum) (calculation of Checksum part is done and SUB Vi form)

    0x03 is length of packet here

    0x02 is Op Code for OP_SENSOR

    So, how can I do this periodically in labview, in such sort that period can be adjusted whenever necessary.

    Is there something in LabVIEW to do.

    I had done the reception and decoding part and working properly.

    http://forums.NI.com/T5/LabVIEW/store-data-coming-from-serial-port-in-buffer-and-then-take/m-p/32722...

    So I must implement read and write the part of same while loop?

    Do not insert in the table if you put data in an array at index 0.  Just use array to build.

    No need to have Visa to write don't be a part of wire to the wire of reference and error VISA go in the upper part.  These wires should go THROUGH the entry VISA.

    Don't your checksum requires all the bytes up through data?  Righ now, you only put the checksum on data bytes and forget the opcode and length bytes.

    Your sending is not the opcode for Opsync or Opfuture.  You just send the empty tables.  At the same time for the other two, you put the opcode in the data table.  All your original opcode in the table build thread.  Get the data out of these structures in case item which is supposed to represent the opcode.

    xpress_embedo wrote:

    Now it works but I have now two problems.

    (1) OP_SYNC and OP_FUTURE do not data, but still receive its data on serial port, can I do something here as I have nothing when the table is empty in the structure of the case.

    I do not understand this statement.  Perhaps my answer above will fix any issue you have here.

    (2) how can selection operation Code to be send is done using control façade but real application, this task should be automated to a certain frequency, like OP_LED package must go out to the serial port to 100msec and packet OP_SENSOR must go out to 1000msec, I do this.

    Now you agree a little more architecture.  I would encapsulate the code that is in the while loop as a Subvi.  Then with the hand of your program while loop, use two time Express VI, a game for 100 msec, the other for 1000 msec.  When an express VI is true, run the Subvi with a command set waiting for the answer.  When the other VI Express is true, have it run the Subvi with the other set of commands.

    The device responds with anything when you send these commands?  You only send data.  I see no VISA Read to be able to recover all the data.

  • Firefox crashes in typing or by clicking check box or the radio button, even with all the plugins / extensions removed. Check with many types of malware scanners.

    Firefox crashes in typing or by clicking check box or the radio button, even with all the plugins / extensions disabled, then deleted. Sometimes it hangs for five minutes. I checked the PC with several types of scanners of evil-ware, but none to be found. All hidden and deleted cookies, all DELETED & extension plugins. Remove all instances of Firefox PC and registry, then restored to bookmarks. The only thing that I did not is to remove and reinstall not my favorites.
    Windows Vista (yes I know) and FF 13.0.1

    Try disabling hardware acceleration in Firefox.

Maybe you are looking for