DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

diadem script autom. Ascii-Import

I have written a script for automatical Ascci-Import from txt-data-files. It works perfectly with one exception. If the script starts automatical with starting Diadem, the automatical Ascci-Import (without wizzard) always aborded. If I start the script in the regulary way (shift F... or about the script selection) it worky perfectly. Why not by automatical start?
0 Kudos
Message 1 of 10
(5,073 Views)
Hello dalle,
try using the function ASCIIConfigLoad and ASCIILoad.
Diadem Base can not start script automatically.

regards
tim
0 Kudos
Message 2 of 10
(5,045 Views)
Hallo,
exactly this two lines I use for automatical Acsii-Import, but it doesn't work, when the script is automatical start (you can start a script instantly, if you open DIAdem, and in this case the Ascii-import (with ASCIIConfigLoad and ASCIILoad) misfire). If you open the script about the report modul, asciiimport works correctly!  I will give you my source code:
 
Call ASCIIConfigLoad(T7 & "AscciImportKonfig")
Call ASCIILoad(T8,0)
 
thank you for help!
0 Kudos
Message 3 of 10
(5,030 Views)
a german tutorial is available for using the ascii Import in auto sequences
0 Kudos
Message 4 of 10
(5,014 Views)
Is it possible for you to post your whole script? I would like to run it on my PC and see if i get the same issue.
0 Kudos
Message 5 of 10
(4,991 Views)
If you are not using Diadem Base Edtion, it should work (tested on my computer).
Are you using /cScriptStart(...) after the Diadem.exe for starting your script automatically.
 
Another problem could be the path of your configuration file and data file. Did you write the whole path or only the file name? It could be that writing only the file name without the path, that Diadem 9.1 (having another default path as root path) cannot find your configuration file or data file. If is the case, write the whole path in ASCIIImport or set a new default path for Diadem Script (under settings ->modul specific parameters).
 
Regards
 
Ken
0 Kudos
Message 6 of 10
(4,981 Views)
He,
I use the whole path for the config data file and for the measurement file, but it works first after Diadem is complete started. My source code is:
 
'------------------------------------------------------------------------------------------------------
Dim fso, f, g, counterLN, counter
 Call DATADELALL(1) 'Löschen aller Vorhandenen Kanäle
 
'--------------Erstelle Zeitkanal-------------------
Call ChnAlloc("Zeit",20000 , 1, DataTypeFloat64)
counter = 1
Do While f.AtEndOfStream <> True
  f.readline
  chd (counter,"Zeit") = counter
  counter = counter + 1
Loop
 
  counterLN = counter
  counter = 1
'--------------Erstelle Zeitkanal Ende---------------

'----Asccii-Import der gewählten Messdatei inkl der Konfigdatei für den Import
Call ASCIIConfigLoad("C:\Programme\National Instruments\DIAdem 9.1\User\DIAdemscript BKV\AscciImportKonfig")
Call ASCIILoad("C:\measurements\test.txt",0)
 
'----Umbenennen der Kanäle
  chnname (2) = "pVR"
  chnname (3) = "pVL"
  chnname (4) = "pHR"
  chnname (5) = "pHL"
  chnname (6) = "pPrim"
  chnname (7) = "pSek"
  chnname (8) = "Kraft"
  chnname (9) = "Weg"
  chnname (10) = "Vakuum"
  chnname (11) = "Stellgrösse"
  chnname (12) = "pPrim_Mittelwert"  
 
 '----Laden des entprechenden Diagrammportals------------------
 Select Case L10
     Case 0
        PicLoad(T7 & "BKV_Analyse_Report_F")
     Case 1
        PicLoad(T7 & "BKV_Analyse_Report_W")
     Case 2
        PicLoad(T7 & "BKV_Analyse_Report_V")
     Case Else
        PicLoad(T7 & "BKV_Analyse_Report_F")       
 End Select
 PicUpdate
 '-------------------------------------------------------------
Regards
 
 
0 Kudos
Message 7 of 10
(4,973 Views)

This source code does not run.

You dim the variable f but do not reference to a file. Before using a command like f.readline you always have to do sth like:

 

Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.OpenTextFile("c:\test.txt", ForWriting, True)
   f.writeline("Hello World")

 

Does this help?

0 Kudos
Message 8 of 10
(4,957 Views)

hello,

this was only a part of the hole source code, but it dosn't matter - the decisive lines are:

Call ASCIIConfigLoad("C:\Programme\National Instruments\DIAdem 9.1\User\DIAdemscript BKV\AscciImportKonfig")
Call ASCIILoad("C:\measurements\test.txt",0)

the rest of the code is irrelevant.

regard and thanks for help

0 Kudos
Message 9 of 10
(4,945 Views)

These two lines work for me, and also with:

"C:\Programme\National Instruments\DIAdem 9.1\DIADEM.exe" "/CScriptstart('c:\test\test.vbs')"

Are you sure it should be ...ascciimportKonfig and not ...asciiimportKonfig ?

What is your error code?

0 Kudos
Message 10 of 10
(4,927 Views)