Flatten Variant to String vs. Flatten Data to String in case of variant data type

May be a dumb question, but I want just understand what is the principal difference and what are the restrictions for both methods? Also I noticed that in case of "Flatten Variant to String" it looses all its attibutes, and this is not in case of flatten generic data to sting. Where I can find a more detailed info on this?
LabView Ver. 6.0,6.1

defuflo,
See OpenG.org >> Site Docs >> LabVIEW Data 1 of 2.
On non variant data, "Flatten to String" and "Variant to Flattened String" have the same output.
On Variant data, "Variant to Flattened String" ouputs the flattened string and type string of the sub-type held in the variant. All variant attributes are lost in the process since they belong to the variant, not to the subtype.
"Flatten to String" operates on variants like on any other types, returning the type string of a variant and all its flattened data, including any attributes.
LabVIEW, C'est LabVIEW

Similar Messages

  • Data type of preprend array size in Flatten To String block

    Hi 
    The data type of the preprend array size in Flatten To String block is given as I32. Is it somehow possible to reduce the data type to I8, since the width and height of my array won't exceed 255 ?. I also need to do the same in Unflatten To String as well. 
    Best regards
    Oesen

    Oesen wrote:
    Hi 
    The data type of the preprend array size in Flatten To String block is given as I32. Is it somehow possible to reduce the data type to I8, since the width and height of my array won't exceed 255 ?. I also need to do the same in Unflatten To String as well. 
    The short answer is no.  This is because the index is an I32.  NI likes to keep integers as an I32 whenever possible for reasons like this.
    Since you are dealing with a 2D array (width and height), it will actually use 2 I32s before the actual data.
    As Ravens stated, you could put in your own array sizes before the array in the string.  But it is worth saving 6 bytes?  Not likely.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • What is the impact of using a variant data type on performance, speed memory demands etc?

    This is another one of my "lets get this settled once and for all" threads.
    I have avoided variant data types whenever possible to keep the performance of my apps up. From some observatsions i have made over the years, I am of the opinion that;
    1) In-place operations can not be carried out on variants.
    2) Passing a variant to a sub-VI (regardless of the terminal on the icon connector) are always copied.
    I would like confirmation or correction of the above so we know more about this animal we call LabVIEW.
    Thank you,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Solved!
    Go to Solution.

    A couple notes:
    1. You can use the To/From Variant nodes for the Inplace Element Structure to operate inplace on the contained variant data. This should work just fine even if you have a big 2D array contained.
    2. Variants are incredibly useful when you use them for Variant Attributes, rather than just storing data. The Variant Attribute implementation uses a binary tree to store the key value pairs, which provides quick insertion and lookup.
    3. I don't work on the internals of LV, but I see no reason whatsoever that passing a variant into a subVI would always necessitate a copy. I could be wrong, but that sounds very odd to me.
    However, I have generally started trending towards using flattened strings. Flattened strings are generally more efficient memory-wise, because they don't contain all the type descriptor information, just the raw data. (I think there's some exception when flattening LV Classes.) Variants always store the type descriptor, so even an empty variant can take up a bit of memory.
    Variants received a big performance boost from 7.x to 8.x. They used to have a bad reputation, but I wouldn't be afraid to use them where applicable. I personally don't see a lot of benefits over flattened strings, though, except in the case of tools like the OpenG Variant INI files, which can dynamically parse out and construct variant types.
    Jarrod S.
    National Instruments

  • What the data type of this variant? (in the following)

    What's the datatype of the following variant (use probe and indicator):
    value -> 1356.00
    I want to tranfer it to numerical data. When I tranfer it using "variant to data" function (the datatype used is string or numerical), An error occured:
     ERROR 91 occured at Variant to Data. The data type is not compatible with the data type wired to the type input."
    Thank you very much!

    You can investigate any Variant by using the 'Variant Probe' for download from LAVA.
    It will tell you what the actual contents of the Variant were.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Variant data type? does it exist in jsp?

    Is there a variant data type in jsp?
    public void setRedirect(String page, String error, HttpServletRequest req, HttpServletResponse res, String accountInfo) throws ServletException
    the method above does the exactly the same thing except 1 takes in a integer data type and the other page takes in strings

    Hi
    Java is a tightly coupled programming language. so you dont have a variant data type available.
    Thanks
    Swaraj

  • Variant Data and Data (Type)

    I'm on my way to build a XML parser for my program.
    How do you make Variant display it's Data and Data (Type) like the one on my screenshot?
    I dont want my data type be a string. I want it to be the same as my cluster.
    Is there a way to edit the data and data type for a variant control and return the same data for it's indicator?
    Thanks!
    Attachments:
    aaa.jpg ‏23 KB
    BBB.jpg ‏32 KB
    CCC.jpg ‏19 KB

    Can you demonstrate how exactly you're editing the Variant data type, as string...!!
    Below is an example, where I converted a cluster (Error data type) into variant and also displayed it on the Front Panel.
    Now if you wanna edit the original cluster data, by editing the string displayed in Variant indicator, this is not a good idea. Ideally you should convert the Variant data type to its original data type and thendo modification and convert it back to Variant.
    saintalan94 wrote:
    the VI at the link you provided have a password, I cant even look into the VI.
    Those VIs are provided as it is from its developer and even I don't have the password.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • Runtime conversion of a string value to a primitive data type in java

    can anyone of you give me an idea to convert a string value to a primitive data type during run time...i have the value and the type to which it has to be converted as String values...do you have any idea ,...pls share

    String recvalvalue = inputval;
                    String recvartype = inputtype;
                   if (recvartype.equals("int")){
                   value0 = Integer.parseInt(recvalvalue);
             else
             if (recvartype.equals("double")){
                    value1  = Double.parseDouble(recvalvalue);
             else
             if(recvartype.equals("float")){
              value2 = Float.parseFloat(recvalvalue);
             else
             if(recvartype.equals("Boolean")){
              value3 = Boolean.parseBoolean(recvalvalue);
             else
             if(recvartype.equals("char")){
               value4 = (char)recvalvalue.charAt(0);
            else
            if(recvartype.equals("String")){
              value5 = recvalvalue;
             else
             if(recvartype.equals("byte")){
               value6 = Byte.parseByte(recvalvalue);
                  //listA.add(6, value6);
                  //     listA.g = value6;
             else
              if(recvartype.equals("long")){
               value7 = Long.parseLong(recvalvalue);
             else
              if(recvartype.equals("short")){
              value8 = Short.parseShort(recvalvalue);
             } yes i can do this but the resultant value has to be assigned to a variable of a specific type which is here recvartype .....it has to be done dynamically automatically..if we know what type of data is that we can convert and assign to the type but we donot know when we run the program as the program will be supllied by someone and has to be executed

  • "Schema validation found non-data type errors" error when passing a string value to date field in infopath

    Hi,
    I have an infopath web brower enabled form. In the form i have a date field.
    I am passing the data from the database to that field using the C# code.
    But, as the field from database is coming as string, i am getting an error, and i am not able to assign the value.
    I get the date value from database as "3/25/2011 12:00:00 AM"
    I used the below code:
    [CODE]
    if (objInfopathFormcData.myRecievedDate != null)
      myRoot.SelectSingleNode("/my:myFields/my:field97", NamespaceManager).SetValue(objInfopathFormcData.myRecievedDate);
    [/CODE]
    I am getting the error as "Schema validation found non-data type errors".
    How to set the value for a date field in Infopath.
    Thank you

    HI,
    I fixed it:
    Below code is used to fix:
    [CODE]
    XPathNavigator xfield = null;
    DateTime dtmyRecievedDate;
    dtmyRecievedDate = Convert.ToDateTime(objInfopathFormcData.myRecievedDate);
    if (objFormcData.FcCompletionDate != null)
    xfield = myRoot.SelectSingleNode("/my:myFields/my:field97", NamespaceManager);
    DeleteNil(xfield);
    xfield.SetValue(dtmyRecievedDate.GetDateTimeFormats().GetValue(5).ToString());
    // method to delete xsi:nil
    private void DeleteNil(XPathNavigator nav1)
    if (nav1.MoveToAttribute("nil", "http://www.w3.org/2001/XMLSchema-instance"))
       nav1.DeleteSelf();
    [/CODE]
    Thank you

  • Performance issue while using data type 'STRING'.

    Hello All,
    I have created a table for storing values of different features coming under a particular country. Since the last field 'Value field' have to hold text upto 800characters for some features, i have used the data type 'String' with character length specified as 1000. I am able to store values upto 1000characters using this. Also, the table has to hold lots and lots of value, and it will increase in future also.
    Since i have mentioned the data type as 'String', I have one doubt whether this will affect the performance. Because length of most of the values in my value field is less than 75characters and in some case only it will exceed 700characters. So, my question is whether the 'String' data type will allocate the length which am specifying in the table for each entries, though the values entering is less than the specified length.
    For example, if the value of my value field is 'Very High Complexity' which is of length 20characters, will the space allocation be reduced to 20 or will it be still 1000characters?
    Hope someone can clarify my doubt.
    Thanks In Advance,
    Shino
    Moved to appropriate forum
    Edited by: Rob Burbank on Feb 23, 2009 4:27 PM

    Hi Shino,
    Well it is possible to store using STRING or LCHR in the transparent tables. There are some underlyning facts here:-
    1. You can only have one such field per table
    2. You cannot view them in the se11 / se16 table content browser
    3. You will need to maintain an additional field for storing the length of the STRING or LCHR field.
    Regarding the performance:
    even though ABAP allows storing STRING or LCHR type fields in the transparent tables but as soon as the lenght of the field crosses 255 chars it is not advisable to store it directly in the transperant tables.
    You should store that field in the knowledge repository and only a pointer to the knowledge repository in the transperant table field.
    Anyways, Since you have only one field with such a requirement then i would suggest you use STRING instead of LCHR as in LCHR you will have to mandatorily assign a length (like 1000) so even if you are storing only 20 chars or 300 chars the system will reserve a slot of 1000 chars; this is not with string as in case of string everything would be dynamic.
    The result being that the reading time increases in case of LCHR.
    I Hop this answered your question.
    Regards,
    Sagar.

  • Data type of the value in a string

    is it possible to determine what is the data type of the value of my string? for example if the user enters an integer, how do i know its an integer?

    if what the user entered is either 1 character,more than
    1 characters(a string), a whole number with no
    decimail places(an int) or a number with decimal
    places(a double).Those aren't mutually exclusive possibilities. If the user enters12345is that supposed to be a string with 5 characters or a whole number?
    how do i do that before i actually
    come to the Integer.parseInt or double.parsedouble
    statement?You don't. You use those statements to determine whether the string input can be interpreted as an integer or as a double.

  • Determine data type of string field

    I am trying to determine the data type of input strings in a data flow task.  For each column in the input (all of which are strings) I want to sample X number of records, try to cast them as money, date, boolean, etc and if 100% of X records pass then
    use the first data type that passes the test.  I looked into row sample but this doesn't appear to be the right data flow task.  Can anyone point me in the right direction?
    Thanks!

    You have two tasks:  find the datatype by looking at X rows; cast all rows to the popular datatype.
    What I use is the TryParse method that occurs on several datatypes in .Net (http://msdn.microsoft.com/en-us/library/f02979c7(v=vs.110).aspx).  It returns true if it parses
    and false if it doesn't.  I have used this in a profiling package that reads a CSV and stores counts of values that can be converted to different datatypes.
    The second piece is trickier.  If you can afford, I would add a second dataflow.  The first dataflow looks at a sample of the data and determines the datatype. You assign that to a variable.  Then the second one has a derived column that has
    a set of derived columns, each with a formula like this:
    @DataType == "Int"?(DT_I4)[Column]:NULL(DT_I4)
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

  • Problem in using a structure with a field of  data type 'RAW STRING'

    Friends
    I have written a ZBAPI that imports a structure which has 5 fields. I have defined this in the IMPORT tab of Tr.Code <SE37>.  One of the field of this structure is of data type 'RAW STRING'.
    When I try to activate this BAPI, I get an error message as follows:
    Function Module ZBAPI_ADD_CONFIG_DNA
    "ZDAMPER_CON_DNA" Must be a flat structure. You cannot use internal table
    strings, references, or structures as components.
    Where ZDAMPER_CON_DNA is the table name that I am using.
    FOR TESTING PURPOSE, WHEN I CHANGE THE DATA TYPE FROM 'RAW STRING' TO JUST A CHAR OF LENGHT 5, IT WORKS FINE.
    Here is the source code of the simple BAPI that i am trying to activate.
    FUNCTION ZBAPI_ADD_CONFIG_DNA.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(CONFIG_DNA_DATA) TYPE  ZCONFIG_DNA_STRUCTURE
    *"  EXPORTING
    *"     VALUE(MESSAGE) TYPE  ZRETURNMESSAGE
    tables: ZDAMPER_CON_DNA.
        ZDAMPER_CON_DNA-CONFIG_ID       =     CONFIG_DNA_DATA-CONFIG_ID.
        ZDAMPER_CON_DNA-STRING_NAME     =     CONFIG_DNA_DATA-STRING_NAME.
        ZDAMPER_CON_DNA-STRING_FORMAT   =     CONFIG_DNA_DATA-STRING_FORMAT.
        ZDAMPER_CON_DNA-STRING_VALUE    =     CONFIG_DNA_DATA-STRING_VALUE.
        ZDAMPER_CON_DNA-OBJECT_NAME     =     CONFIG_DNA_DATA-OBJECT_NAME.
        INSERT ZDAMPER_CON_DNA.
        MESSAGE-SUBRC = sy-subrc.
        if sy-subrc = 0.
            MESSAGE-RETURNMESSAGE = 'SuccessfullyInserted'.
        else.
            MESSAGE-RETURNMESSAGE = 'Insert Failed'.
        endif.
    =============
    ANY KIND OF FEED BACK WILL BE HIGHLY APPRECIATED.
    THANKS
    RAM

    Hi ram,
    there is no data element exists with the name RAW STRING ,
    but check one of these names..
    Data element                   Short text
    C2S_RAWSTRING                  C2-Server: Data Element of Type Rawstring
    N2_RAWSTRING                   Byte String of Variable Length
    QISRDRAW_STRING                Data in Format RAW Character String
    RCF_RAWSTRING                  Rawstring
    RPAP_TEMPLATE_RAWSTRING        Blob of Template File
    RSRAWSTRING                    Raw String
    RSRD_RAWSTRING                 Binary Content in the Broadcasting Framework
    SWH_RAWSTRING                  Workflow: Data Type RAWSTRING
    WDR_RAWSTRING                  Byte Sequence of Variable Length
    <REMOVED BY MODERATOR>
    venkat.
    Edited by: Alvaro Tejada Galindo on Mar 7, 2008 5:15 PM

  • Error in converting character string to smalldatetime data type

    I've installed SQL Server 2000 on my new laptop and Crystal Report XI, out of sudden, the Crystal Report to certain view can't run and I got the following error:
    Details: 22007 [Microsoft][ODBC SQL Server Driver][SQL SERVER]Syntax Error cnverting character string to smalldatetime data type.
    Any suggestions?
    Hannah

    Here is the view the err is complaining about:
    SELECT     TOP 100 PERCENT Cur.Closed_Month, Cur.Closed_Year, Cur.Incidents_Closed, Prev.Incidents_Closed AS PrevIncidents_Closed,
                          YrAgo.Incidents_Closed AS YearIncidents_Closed
    FROM         (SELECT     Closed_Month, Closed_Year, Incidents_Closed
                           FROM          dbo.Incidents_Closed) Cur INNER JOIN
                              (SELECT     Month(CONVERT(datetime, CAST(closed_month AS varchar) + '/01/' + CAST(closed_year AS varchar), 101) + 32) AS PrevMonth,
                                                       year(CONVERT(datetime, CAST(closed_month AS varchar) + '/01/' + CAST(closed_year AS varchar), 101) + 32) AS PrevYear,
                                                       Incidents_Closed
                                FROM          dbo.Incidents_Closed) Prev ON Cur.Closed_Month = Prev.PrevMonth AND Cur.Closed_Year = Prev.PrevYear INNER JOIN
                              (SELECT     Month(CONVERT(smalldatetime, CAST(closed_month AS varchar) + '/01/' + CAST(closed_year AS varchar), 101) + 366) AS PrevMonth,
                                                       year(CONVERT(smalldatetime, CAST(closed_month AS varchar) + '/01/' + CAST(closed_year AS varchar), 101) + 366) AS PrevYear,
                                                       Incidents_Closed
                                FROM          dbo.Incidents_Closed) YrAgo ON Cur.Closed_Month = YrAgo.PrevMonth AND Cur.Closed_Year = YrAgo.PrevYear
    What confused me is that it works fine with my previous laptop. I wonder if there is any patch in Crystal Report or SQL server that used to support certain functions but not support them anymore....
    Thanks
    Hannah

  • Dynamic structure of "string" data type. Please help.

    ABAPers,
    I am calling cl_alv_table_create=>create_dynamic_table method to dynamically create a structure. The input structure definition is as follows:
    data: xfc type lvc_s_fcat.
    data: ifc type lvc_t_fcat.
    * define Fld1
    clear xfc.
    xfc-fieldname = 'Fld1'.
    xfc-datatype = 'string'.
    append xfc to ifc.
    * define Fld2
    clear xfc.
    xfc-fieldname = 'Fld2'.
    xfc-datatype = 'string'.
    append xfc to ifc.
    Although the call to create_dynamic_table does not throw any exceptions, it appears Fld1 and Fld2 are not of "string" data type. I don't know of a way to see what type they are. However, they do have a length limit of 10 characters.
    After some experimenting, it turns out that the method simply ignores "datatype" value if it doesn't understand it and creates the field with some default data type.
    I would appreciate it if someone can show me how to create fields of "string" data type.
    Thank you in advance for your help.
    Pradeep

    That's right, use STRG as the datatype.  Please see the example program.
    report zrich_0003.
    type-pools: slis.
    data: new_table type ref to data,
          new_line  type ref to data.
    data:  xfc type lvc_s_fcat,
           ifc type lvc_t_fcat.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>,
                   <fs>.
    start-of-selection.
      clear xfc.
      xfc-fieldname = 'Field1' .
      xfc-datatype = 'STRG'.
      append xfc to ifc .
      clear xfc.
      xfc-fieldname = 'Field2' .
      xfc-datatype = 'STRG'.
      append xfc to ifc .
    * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
        exporting
          it_fieldcatalog = ifc
        importing
          ep_table        = new_table.
      assign new_table->* to <dyn_table>.
    * Create dynamic work area and assign to FS
      create data new_line like line of <dyn_table>.
      assign new_line->* to <dyn_wa>.
      assign component 1 of structure <dyn_wa> to <fs>.
      <fs> = 'This is string 1'.
      assign component 2 of structure <dyn_wa> to <fs>.
      <fs> = 'This is string 2'.
      append <dyn_wa> to <dyn_table>.
    * Write the values of internal table.
      loop at <dyn_table> into <dyn_wa>.
        do.
          assign component sy-index of structure <dyn_wa> to <fs>.
          if sy-subrc <> 0.
            exit.
          endif.
          write:/ <fs>.
        enddo.
      endloop.
    REgards,
    Rich Heilman

  • 'DATE' type in SQL converting to a 'STRING' in CR2008.

    Help!
    We have just installed the stand-alone version of CR2008 and running against a SQL db back end. The newest version of SQL consists of a data type, 'DATE' that's being recognized in CR as a 'STRING' when the stored procedures are accessed. However, I am converting it back to a 'DATE' data type inside the report and everything looks fine in the CR viewer.
    Our concern:
    Could this be an issue when the .rpt files are called via an ASP page?
    Thanks,
    Tony

    Hi Tony,
    I just checked by adding a Date field type into my 2K8 server and you are correct if you use the Native SQL Server driver. CR does see it only as a string. By default and to handle new types that DB makers can add, CR will convert any type is doesn't recognize into a string.
    However if you install SQL Server Client 10 driver and use it then you will see the Date field as a date type.
    So, if you are using MS SQL Server 2008 then simply install the Client and then you can use the SP.
    You can install it off the MS CD or use this link to their tools:
    http://www.microsoft.com/downloads/en/details.aspx?FamilyId=C6C3E9EF-BA29-4A43-8D69-A2BED18FE73C&displaylang=en
    Look for the Client install only, 32 or 64 bit.
    Thank you
    Don
    Edited by: Don Williams on Nov 20, 2010 12:39 PM

Maybe you are looking for

  • Netbook will not boot up

    Hi, so I got a virus on my netbook a few days ago. I was going to get rid of it, but I got lazy and waited and tried to boot it up today. I got a blue screen and I believe the error was bad_system_config_info. It's hard to tell because it disappears

  • How to move pin names

    Hello, i have just built a custom component in multisim. All is well and good until i place the component then set it so i can see pin names. The pin names overlap the chip itself so i was wondering if there was a way to moves the pin name, or justif

  • Register information on X series driver for encoder

    Hi All: I am working on the X series driver development by using MHDDK. After comparing M series and X series I found that theere is a Gi_Save_Trace bit in register Gi_Command_Register in M series. When it is set, the register goes into the latched m

  • After Effects CS6 on Mac OS

    Buenos dias, estoy usando la CS6 y abro photoshop y otros programas sin ningún problema pero cuando abro after effects me dice que no se puede utilizar en la OS X porque lel AE es una versión 11.0,que debo hacer, mi mac esta actualizada

  • Purpose of Contribute

    Hi everyone, I have to create a content management system for a small website I'm creating for a client. I was planning on using xml and php to create it but then I wondered about the possibility of my clients using contribute to update the site. I'v