DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

script VBS : garder une ligne sur N

Bonjour, Diadem permet certes d'ouvrir de tres gros fichiers avec beaucoup de lignes mais j'aimerai pouvoir traiter mes données avec excel qui ne peut pas recevoir plus de 60000 lignes.... Du coup, je souhaiterai pouvoir créer un script dans diadem qui permet de créer un fichier texte qui contiendrait les colonnes initiales reduites par un facteur donné.
La structure du script serait donc :
* recuperation des données initiales
* creation du fichier destination contenant les differentes variables (ou creation des variables reduites directement)
* ecriture des variables destination à partir d'une ligne sur N des varaibles sources
 
Ca semble pas tres dur mais il me manque les commandes principales et surtout comment on designe les variables lorsque celles ci sont dans le data portal (a droite)
apres, une simple boucle devrait pouvoir me permettre de les remplir ....
Merci d'avance de votre aide...
Meme des petites notions pourraient m'aider à avancer, n'hesitez pas...
 
Bertrand
0 Kudos
Message 1 of 4
(3,781 Views)
Hi Bertrand,
 
I can mostly make out your question in French, but I'm afraid my French will be woefully inadequate to communicate my response, so I hope you read my English.  First let me restate your request as I understood it.  You have a data set with way more than 60,000 values, and you want to create a new data set with DIAdem that reduces the size of that data set down to 60,000 or less rows so that you (or others) can read the (reduced) data set in Excel.  I believe you wanted to reduce the data set by condensing several adjacent values into 1 value, either by simply reading every Nth value and ignoring the rest, or by averaging or taking the maximum or minimum value of each of the N intervals.  Then you would like to output the resulting channels to a file that can be read into Excel.
 
What I've described above is something DIAdem can indeed do for you.  If you happen to have DIAdem 10.1, then you can make use of the new "Data Reduction" loading feature to execute this data condensing while the data set is being loaded into DIAdem.  Then all you have to do is output to either a CSV file or an XLS file with the standard "File>>Save as" menu in the DIAdem NAVIGATOR.
 
If you have an earlier version than DIAdem 10.1, then you will need to load all of the data into DIAdem and use the "Reducing Classification" ANALYSIS routine found in the "Statistics" palette of functions to do the data condensing prior to output to file.
 
Ask if you have additional questions,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,772 Views)

hello

I thank you for your answer and i appology for writing in frecnh, but I though I was in the french part of the forum ...

Indeed, I only have the 10.0 diadem version (even if I received the 8.2 Labview version...) but I will try the function that you indicated...

I thank you for your answer

 

Bertrand

0 Kudos
Message 3 of 4
(3,770 Views)

Hi Bertrand,

Here is a brief VBScript which illustrates how to execute the data reduction when you have all the data loaded into DIAdem-- it should work in DIAdem 10.0.

Call DataDelAll
Call DataFileLoad(AutoActPath & "Example.TDM")
Call GroupCreate("Reduced Channels")
Call GroupDefaultSet(GroupCount)
ReducVal = 50
CalcXChn = 1
CalcYChn = "2-4"
ClassNo = ChnLength(CalcXChn)\ReducVal
Call ChnClassXRedXY(CalcXChn, CalcXChn, CalcYChn, "Automatic", "Mean")
FOR i = 1 TO GroupChnCount(GroupCount)
  ChnName(CNoXGet(GroupCount, i)) = ChnName(CNoXGet(1, i))
NEXT
Call View.LoadLayout(AutoActPath & "Loaded Data Reduction.TDV")
Call WndShow("VIEW")

Regards,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 4 of 4
(3,757 Views)