From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting with DataFileSaveSel and setting ASCIIREALFORMAT in 10.2

Hello,
Just downloaded and started evaluating DIAdem 10.2 last night. Scripts that are working in 10.1 are now broken in 10.2. The "datasavesel" function returns the error "the configured header number must be >= then channel number" in 10.2. I tried converting the code to use the DataFileSaveSel command but this function appears to ignore the values set in the ASCIIREALFORMAT variable. The number formats are customer defined and cannot be changed. How do I export text files with explicitly defined number formats for data channels in 10.2?
Thanx,
Bill Davenport
Transportation Research Center, Inc.
 
0 Kudos
Message 1 of 7
(3,527 Views)
Hi Bill,

What are you sending for the FileExportFilter parameter? Your function call should look something like this:
Call DATAFILESAVESEL("example.dat","DD8x","'[1]/Time' - '[1]/Torque'")
Note that this is going to export a DAT file with the format specified in File>>DAT Files>>Settings.  If you want to export to a text file, then change the Type of Data field to ASCII.  This will produce a file with asc extension that uses the format specified in the ASCIIREALFORMAT variable.  This works in 10.1 and 10.2 on my end.

Please post an example if I've misinterpreted what you are trying to do.

Have a great day,

Ecleamus R
National Instruments
Applications Engineer
0 Kudos
Message 2 of 7
(3,495 Views)
Here is what I am currently doing in 10.1:
      DATASAVETYPE="Ascii"
      ASCIIREALFORMAT="d.ddd"
      DATASAVEKEY="Block"
      ASCIISEP=";"
    Call datasavesel("C:\Temp\ASCII", "10-14")
Which kicks out a ASCII.ASC file and an ASCII.dat file with only 3 digits past the decimal.
 
Using this method in 10.2 I get this error: "the configured header number must be >= then channel number"
 
When I try to use Call DataFileSaveSel("C:\Temp\ASCI,"CSV", "10-14")  the formatting is not used.
 
 
0 Kudos
Message 3 of 7
(3,493 Views)
Try "DD8x" instead of "CSV".

Ecleamus R.
0 Kudos
Message 4 of 7
(3,489 Views)
 
When I try to use Call DataFileSaveSel("C:\Temp\ASCI,"dd8X", "10-14")  10.2 I also get this error: "the configured header number must be >= then channel number"
0 Kudos
Message 5 of 7
(3,490 Views)
Figured it out. The dataset I was using had more than the default maximum number of channels (ActFileHdNo). When I set this to much bigger than my data set, it works fine.
 
"I am so smart, S-M-R-T"~Homer Simpson
0 Kudos
Message 6 of 7
(3,466 Views)
Thanks for posting the solution. 🙂

Ecleamus R.
0 Kudos
Message 7 of 7
(3,460 Views)