DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Importing multiple ASCII files into one channel

We have an application where we are running life tests on some of our products.  Data is being acquired and written to an ascii (flat) file every 1-60 seconds, and a new file is started every day.  The first row of each file contains header information for the columns of data.
 
Is there a way to programatically select multiple ascii files for import, strip off the first row of each, and append them all together into one data channel based on the order that they were selected?  We currently do this manually and it is very time consuming.  Any help would be greatly appreciated.  Thanks.
0 Kudos
Message 1 of 12
(6,187 Views)
I meant to say one group, not channel.  Basically I want to be able to append to the end of each channel within one group based on the order of selection.  Sorry for the confusion.
0 Kudos
Message 2 of 12
(6,186 Views)
Recomenndation is to create a dataplugin for the file format in the first place. This will help you to import the files just by dragging and dropping them. Of course cou can configure the dataplugin to import the first row of the file as descriptive information, for instance channel names, etc. Try using the Plugin Wizard to create the dataplugin.
After loading several files of these measurements you will find a number of groups in the data portal, each corresponding to one measurement. The only remaining challenge is to concatenate all the channels within these groups to  create one group with long channels containing all measured values.
The latter can be done with a short script which is shipped with the DIAdem examples since 10.1. Look for the example "Merge Channels from different Measurements".
Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
0 Kudos
Message 3 of 12
(6,177 Views)

Hi SethRow187,

I agree with Ingo, first go through the ASCII DataPlugin Wizard in DIAdem 10.0 or later to generate a DataPlugin which will automatically load one of your ASCII files.  Then I would recommend using a VBScript that either concatenates data already loaded from multiple files into separate Groups in the Data Portal, or using a VBScript that additionally pops up a multi-select file dialog to automate both the selection and concatenation.

Below you will find an example of the latter,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

P.S.  You will need to edit lines 17 and 18 in the script "Importing Data From Multiple DataPlugin Files.VBS" and replace the existing file extension and DataPlugin name with ones that fit your data files.

0 Kudos
Message 4 of 12
(6,160 Views)

Wow, that really cuts down the time it takes to do this...thanks!

One more questions though:

1.  I noticed that whenever I run this script, it wipes out all of the data in the portal.  Suppose I have a TDM file already started that contains multiple groups corresponding to different test #'s of a particular component.  After a few days of testing I want to go back and update the TDM file with the latest data.  This would mean I want to bring in several files at once and either append them to a particular group of my choosing, or start a new group (if it is a new test).  Is there an easy way to do this?

0 Kudos
Message 5 of 12
(6,153 Views)

Hi SethRow187,

Well, you can change the script to do anything you want.  One way you could use the existing script to accomplish what you suggest is to save the intermediate group of processed or concatenated values to a new temporary file, then load in the additional data from the extra N files and have that data concatenated into one group, then save that group to another temporary file.  Then you could run the script a final time to concatenate the results from the two temporary files.

It's your choice whether you want to adapt the script to do these sorts of things for you automatically, or whether you want to live with the clunkiness required to use the script as it is to accomplish your additional use cases.  Certainly it is possible to concatenate from selected groups to a specific target group, without having to resort to unnecessary temporary files.

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 6 of 12
(6,125 Views)

Hello Brad,

I want to creat a report for some measurements that I do with an equipment, and I must use Diadem, and for that I transfer the data( a .csv file) in Diadem and I've use your script  "Importing Data from Multiple DataPlugin Files.zip"  and that help me, but I want to modify the script, and when I start to run the script and load the .csv file to appear with other field (like in attachment -  I insert with <freetext> the fields that I need).

Can you tell me how to modify the script, to start with the Fields that I need (see attachment)?

I'm new in working with Diadem, so I don't have  good knowledge about that.

Thank you a lot.

0 Kudos
Message 7 of 12
(5,685 Views)

Hi Marse,

The example I sent that you are running loads a *.TDV file into the VIEW panel.  If I understand you correctly, all you need to do is edit the *.TDV file to be what you want with the desired <freetext> fields in the legend, then save the *.TDV file and overwrite the one I sent you.  The next time you run the example it will load the edited *.TDV with the desired <freetext>.

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 8 of 12
(5,672 Views)

Thank you Brad,

 

I've found out later and I modify the .TDV file. Now is ok.

I have one more question (I repeat, I'm new in Diadem), there is a way to creat the template in a way that the value for the fields that I creat to be near the field( like I draw in atachment)?

 

Thank you again

 

0 Kudos
Message 9 of 12
(5,655 Views)

Hi Marse,

 

If I understand your request correctly, you want the property name and the property value to be side by side (the name on the left, the value on the right) in the VIEW legend.  This is not possible-- there is no setting in VIEW to repeat the property name for every channel in the legend and display the name and value side by side for each channel.

 

What you can do with a bit of effort, though, is construct something similar with a few VIEW textbox areas and the corresponding channel and property references in @@ expressions.

 

Try this example,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 10 of 12
(5,643 Views)