How to organize variables for file saving and scalability?

Hello,
I have created several CVI applications that store production data for numerous machines.  To organize the data for file saving I have implemented structures.  This has worked well with one limitation, the inability to scale the structure at a later date without invalidating existing files.  I would like to consider alternative approaches that would allow scalability.
Here's an example of my current method...
// Definition of structure per machine.
struct machine_1
   int  int_param_1, int_param_2, int_param_3;
   double  dbl_param_1, dbl_param2, dbl_param3;
struct machine_2
   int int_param_1, int_param_2, int_param_3;
   double dbl_param_1, dbl_param2, dbl_param3;
// Definition of inclusive structure. (Member name and structure tag name are the same.)
struct
   struct machine_1   machine_1;
   struct machine_2   machine_2;
} machine_parameters;
To assign a value to a structure variable:
// Assign value.
machine_parameters.machine_1. dbl_param_2 = 77.47;
Then when it comes time to save the populated structures:
// Save structure.
error = fwrite (&machine_parameters, sizeof(machine_parameters), 1, dest);
The problem comes later when multiple files already exist and one of the machine structures needs an additional variable added.  For example, if I need to add int_param_4 to the machine_1 structure.  Adding this variable will invalidate the previously saved files because they were saved with a different structure and will not be able to be opened with a new structure containing one additional variable due to the structure definition mismatch.
I have added spare variables per data type to the structures for each machine, but it's a losing game.  If I add 10 spare variables, I end up needing to store 11 more pieces of data.
Is there a better approach?
Thanks,
Aaron T.

One simple way is to output the data as ASCII comma separated values, with a newline character at the end of each row of data.
I.E., the only structure to your file data is a "row" of CSV's, with the file containing some number of rows.
Then, you load the data into Excel, and it will parse the CSV's for you and when it sees the newline, put the next set of CSV's on the next row of the worksheet.
If you ever need to expand the number of items in a row, you just add them as you generate data, pushing the newline to the right, the extra data  extending the row.
So you get an Excel worksheet filled with rows of (possibly varying length) data.   So long as you add data at the end of the row when you redefine what you're saving, anything reading the file should see the same stuff that was always there.
You can write a macro to reformat or parse the CSV's once they're in the spreadsheet.  With Excel 2007 supporting very large worksheets, you can put a lot of data into one.  I think they expose a C interface for writing fast data manipulation of cell data now too - sort of a fast macro from the Excel viewpoint.  I think the number of columns is 16384 and 1 million rows in a "Big Grid". The Excel 2007 engine is multi-threaded and you can tell it how many cores to use on a multicore machine.
So the only problem I see is the loss of local structure (your C structs get serialized and get concatenated to one another) but you could re-introduce the structure with a macro.
Or, if you were to write out serialized binary values and then view the file data using a hex editor like Neo, you can tell Neo what your C structs were and it will pick up binary file data and put it back into the C structs for viewing.
Or use MatLab to read the CSV's and reformat it.
Or use the CVI SQL interface and write it out as database records.  I think the SQL toolkit costs extra, maybe it comes with the FDS. 
Menchar

Similar Messages

  • In Illustrator CS5, while file saving and opening, the PARM error shown. How to fix it.

    In Illustrator CS5, while file saving and opening, the PARM error shown. How to fix it.

    Have you tried here:
    iPhone, iPad, iPod touch: Unknown error containing '0xE' when connecting

  • How to organize RAC database files on ASM

    How to Organize RAC database files on ASM.
    Say,
    DISK Group = DATA
    DISK Group= FLASH
    Instance = prod1, prod2
    '+DATA/PROD/datafiles/'
    or
    Need to Organize sepratly for each instance specific db files.
    as
    '+DATA/PROD1/datafiles'
    '+DATA?PROD2/datafiles'
    Thanks in Advance,
    Regards
    Satish

    It would be just PROD - since that's the database name...and BTW, when you use DBCA to create a database using ASM, it organizes data files under PROD and it doesn't use instance names.
    HTH
    Thanks
    Chandra

  • How do I access my files saved in the cloud

    Once I filled/edited files on acrobat, I am unable to print or save, but it shows that it's automatically saved in the Cloud.  How do I access my files saved in the Cloud and how can I print the edited files?

    Welcome to the Apple Community.
    How did you store them in the cloud (back up or photo stream) and where do you want to view these photos.

  • How to define variable for value range in Bex Query?

    Hi
    How to define variable for Keyfig. value range on runtime like characteristic in Bex Query?
    Example: On runtime user select one of the following condition:
    1)User want to those records where amount is greater than $1000
    2)User want to those records where amount is greater than $1000 and less than $5000
    3)User want to those records where amount is greater than and equal to $1000

    Hi ,
    Need to Use exceptions & conditions for this scenario's  & need to create variable for exceptions based on condtions.
    Below document provides steps how to make selections at run time for a kfg.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60b33a28-dca2-2d10-f3b2-d2096b460b1e?QuickLink=index&overridelayout=true&48842368468641
    Regards,
    Seshu.P

  • How to find PG.xml file name and path associated with a FUNCTION

    Hi,
    I am having a function:IRC_VIS_HOME_PAGE with Web HTML value as below:
    OA.jsp?akRegionCode=IRC_VIS_HOME_PAGE&akRegionApplicationId=800&OAPB=IRC_BRAND
    How to find PG.xml file name and path assoicated with above funtion.
    Thanks,
    ashok

    Ashok,
    Function IRC_VIS_HOME_PAGE will have 2 parameter defined for it which are OASF and OAHP where
    OASF=<SelectedFunctionName> - this tells the Framework to select this function in the given "Home Page" menu context.
    OAHP=<HomePageMenuName> - this is used ONLY with the OASF parameter, and it is used to establish the current menu context. It should point to a "Home Page" menu.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to organize my photos in albuns and sub-albuns?

    Hi,
    I have Windows PC and wanted to know how to organize my photos in folders and sub-folders inside the Ipod.
    By sincronizing Ipod with a specific folder of your hard disk, all images are updated, but sub-folders are ignored. For instance, if you sinc the My Photos folder:
    c:\My Photos\2004\Family
    c:\My Photos\2004\Friends
    The Family and Friends photos will be cast together, because Ipod only sees one sub-level (the 2004 folder). Can anyone help with this? I tried the Photoshop Album, but I didn't manage to understand this program!
    Thanks!
    Carletti
    Ipod Video   Windows XP  

    As far as I know your only option is either Adobe Album or Photoshop Elements. (Not Album SE or a trial version)
    Once you've got your photo's imported, there are two tabs on the righthandside, tags and collections (? - I have a non-english version). Create a new collection and drag photo's on it or rightclick on a photo and select "Add to collection..."
    Now when you use iTunes to sync photo's from Adobe it will show the collections you've made and each collection you synchronise will show up with a separate name on your ipod.
    3G - Nano - 5G Windows XP
      Windows XP  

  • V10 Default Settings For File saving

    Hello, Could someone please tell me the default setting for file saving options in preferences for Elements V10 ?
    Thank you.

    If you reset the Preferences, all preferences will be set to their defaults:  Hold down your Ctrl+Alt+Shift keys when launching the Editor and answer "Yes" to the prompt asking if you want to delete the Preferences.  They will be re-built.
    Ken

  • How to populate data for 2LIS_40_REVAL, 2LIS_43_POSCAS and 2LIS_44_POSREC

    Hi
    How to populate data for 2LIS_40_REVAL, 2LIS_43_POSCAS and 2LIS_44_POSREC datasources at RSA3?
    I'm very new to retail BI.
    I think there is no setup tables for Retail infosources.
    Any IDoc or BAPI activation is required or other procedure?
    We are in BI-700 SAPKW70015 support pack R/3 side
    and SAP_BW 700 Support pack SAPKW70016 &
    BI_CONT 703 Support pack SAPKIBIIP9 BI side
    Can anyone guide me how to load data?
    Points assured
    Thanks in advance
    Ramana P

    Dear Ramana,
    There is no setup table for POSCAS and POSREC.This has to be popuated with a BADI Implementation. 
    As of PlugIns 2002_1_470 and 2002_2_470, POS data is update into BW the 2LIS_44_POSREC and 2LIS_43_POSCAS extractors using a BADI. To be able to update data into BW, the relevant implementation for the BADI must be activated in each case. You can activate the implementation in transaction SE19. The implementations are as follows:
    POS_EX_REC_PI2003_1 for extractor 2LIS_44_POSREC
    POS_EX_CAS_PI2003_1 for extractor 2LIS_44_POSCAS
    Once the activation of BADI , create the back ground jobs for the 44 application and the data is pushed into Delta queue and it can be loaded into BI .
    Hope this helps you.
    Thanks,
    Krishna Charan

  • How to solve Fusion ADF file upload and download?

    Now we are building web application with Fusion ADF (JDeveloper 11.1.2.0.0). We want to downloading and uploading from tables.Is there any special tool in Fusion ADF or should I going with traditional java coding. Thanks

    Actually ADF Provide Components for file upload and download
    Download :
    <af:fileDownloadActionListener/>
    See tagDoc: http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_fileDownloadActionListener.html
    Upload
    <af:inputFile/>
    See tagDoc: http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_inputFile.html
    Edited by: -CHS on Jul 6, 2011 9:52 AM

  • How to create documentation for report programs and how to use it

    how to create documentation for report programs and how to use it in the selection screen by placing an icon in the Applicatin Tool bar. If i click this icon the help documentation has to display.
      Note: Exaple <b>RSTXSCRP</b> programs selection screen

    Hi
    1 goto SE38 transaction, give the program name
    2 Click on documentation radiobutton & then press change
    3 Write your PURPOSE, PREREQUISITES etc details
    4 Save the same & Activae it.
    The icon will come automatically on selection screen
    Thanks
    Sandeep
    Reward if useful

  • How to create Variables for the Key Figures

    Hi All,
    How to create Variables for the Key Figures
    Thanks
    Bhaskar

    Hi,
    It is not possible to create the variables on Key figures directly. But we can create a formula variable with processing type 'User Entry' ,SO that the user entered value can be used in the calculations of the query.
    With rgds,
    Anil Kumar Sharma .P

  • My mac says that it has 40 gb of movies on it but when i finder search for file size, and for file type it gives me no videos

    My mac says that it has 40 gb of movies on it but when i finder search for file size, and for file type it gives me no videos or movies. I have called apple 3 times and each time they do the same thing and then do something that takes awhile to finish so we hang up and then it never works.
    Please Help

    each time they do the same thing
    And what thing might that be?

  • How to write code for page up and page down buttons on alv screen?

    Hi,
    Page up and page down buttons are not working in general alv report. Thease buttons are in disable mode. But is stnd. transactions (tcode : fbl5n)  these are enabled and working properly, but we can't debug this with /h
    How to write code for page up and page down buttons on alv screen?

    Poonam,
    On doing the screen debugging it took me over to    Include LSTXWFCC ,kindly check the below code.
    module cc_display.
      fcode = sy-ucomm(4).
      case sy-ucomm(4).
        when 'P--'.
          perform cc_firstpage.
        when 'P-'.
          perform cc_prevpage.
        when 'P+'.
          perform cc_nextpage.
        when 'P++'.
          perform cc_lastpage.
        when 'EX--'.
          perform cc_firstcopy.
        when 'EX-'.
          perform cc_prevcopy.
        when 'EX+'.
          perform cc_nextcopy.
        when 'EX++'.
          perform cc_lastcopy.
    I guess it can give you some lead.
    K.Kiran.

  • How to set variable to run java and j2ee

    how to set variable to run java and j2ee

    Please ask a specific and comprehensible question. Consider describing with less vagueness the actual current problem that you are encountering.

Maybe you are looking for

  • How easy is to transfer data from an old apple mac to a new apple mac

    I have an old Intel Apple Mac And I am looking to change it for a new one asap I live 110 miles from Exeter Apple I would rather deal with them direct Rather than local Apple resellers here in Cornwall,They offer a costly alternative, and not a very

  • SUM problem in SSRS 2005 report

    I don't know how best to explain this but will try. In my SSRS 2005 report, i have one group in my table.  In that group, I have a field that for each company record in my dataset, this field value is repeated for each record. This is a transactions

  • IPhone 3G intermittently not compatible with Apple Dock / Component Video

    I purchased a new Apple Dock and Component Video cable for my 3G. Both original Apple parts. On the first day it all worked perfectly. Now it seems I have a 50/50 chance of getting the "this device not compatible with iPhone - switch to airplane mode

  • License key for pre-installed 8

    Hello, I went over the clean install guides found here, but it's not entirely clear to me if it's possible to install 8.1 without going through the pre-installed 8 and upgrading it. First, I would need to get a vanilla 8.1 kit from a trusted source a

  • Error in build firefox on ABS

    Hello. I'm trying to compile firefox 36.0.1, but I can not finish the build. Always in the (I believe) the packaging, it happens here: Traceback (most recent call last): File "/home/junior/firefox/src/mozilla-release/toolkit/mozapps/installer/package