DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting files with a Script

Hi,

 

I am new to Diadem Scripting and I need to import bulk of data to Diadem as TDM files.

 

I found a example code on http://zone.ni.com/reference/en-XX/help/370858K-01/dlgcanconverter/dlgcanconverter/dlgcanconv_exampl... It is really what I am looking for.

 

I make my small changes. New code is below. Now I get the error below;

 

****

 

Bus Log Converter note: Started converting the following logfile: E:\AV8\AWS\kvaser_data\MDF\Kvaser_ob_2015-06-12_09-06-54.log
277  Bus Log Converter note: List of signal databases for this/these bus number(s) is empty: 2 
278  8:39:07 AM Error:
     Error in <batch_log2tdm.VBS> (Line: 43, Column: 5):
     Bus Log Converter error: Cannot open the signal description database: E:\AV8\AWS\kvaser_data\MDF\Kvaser_ob_2015-06-12_09-06-54.logE:\AV8\AWS\kvaser_data\DBCCANdb_small_OB.dbc

 

****

 

Some how my dbc file is changes into "logfilename + dbc file name". Do you have any suggestion for this? I am working on Diadem 2014.

 

Regards,

 

Onur BUTUN

 

 

'-------------------------------------------------------------------------------
'-- VBS script file
'-- Created on 07/28/2015 16:38:20
'-- Author:
'-- Comment:
'-------------------------------------------------------------------------------
Option Explicit  'Forces the explicit declaration of all the variables in a script.
 
Dim aFoundFiles       'Array of logfiles
Dim iCount            'Counter for existing logfiles
Dim sLogFileFolder    'Logfile folder
Dim sDbcFileFolder    'Dbc file folder
Dim sResultFileFolder 'Result file folder (tdm)
Dim sLogFileExt       'Logfile extension
Dim sLogFileName      'Currently converted logfile

'Settings
Call BusLogToTDM.Clear()
BusLogToTDM.BusDbConfig.Name = "CAN converter configuration"
BusLogToTDM.BusDbConfig.Description = "Convert logfiles of one folder"
BusLogToTDM.ResultSettings.TimeFilter.Active = False
BusLogToTDM.ResultSettings.BusFilter.Active = False
BusLogToTDM.ResultSettings.SequenceChannel = True
BusLogToTDM.ResultSettings.EnumSubstitution = True

sLogFileFolder = "E:\AV8\AWS\kvaser_data\MDF"
sDbcFileFolder = "E:\AV8\AWS\kvaser_data\DBC"
sResultFileFolder = "E:\AV8\AWS\kvaser_data\TDM"
sLogFileExt = "*.log"
BusLogToTDM.LogSettings.FileType = eLogFileTypeVLOG
Call BusLogToTDM.BusDbConfig.Buses.Add("CANBus", 1)
Call BusLogToTDM.BusDbConfig.Buses("CANBus").DbFiles.Add("E:\AV8\AWS\kvaser_data\DBCCANdb_small_OB.dbc")
' End of settings

'Convert files
aFoundFiles = DirListGet(sLogFileFolder, sLogFileExt, "filename", "FullFilenames")
If IsArray(aFoundFiles) Then
  For iCount = Lbound(aFoundFiles) to Ubound(aFoundFiles)
    Call BusLogToTDM.LogSettings.LogFiles.RemoveAll
    Call BusLogToTDM.LogSettings.LogFiles.Add(aFoundFiles(iCount))
    sLogFileName = FileNameSplit(aFoundFiles(iCount),"N")
    BusLogToTDM.ResultSettings.ResultFile = sResultFileFolder & sLogFileName & ".tdm"
    Call BusLogToTDM.Convert()
  Next
End If

 

---------------------------------------------

0 Kudos
Message 1 of 10
(6,444 Views)

Hi rower,

 

sorry, the error message is not correct. The problem is the missing backslash at the sResultFileFolder. So the Resultfile has an illigal Folder.

 

 

You could correct ist like:

 

    BusLogToTDM.ResultSettings.ResultFile = sResultFileFolder & "\" & sLogFileName & ".tdm"

 

or You add the backslash to the foldername above.

 

Hans

0 Kudos
Message 2 of 10
(6,368 Views)

You got a warning, that bus No 2 has not been configured. You have only configured bus No 1 but the logfile has also data for bus No 2.

0 Kudos
Message 3 of 10
(6,367 Views)

Thank you, backslash works 🙂

0 Kudos
Message 4 of 10
(6,288 Views)

Hi,

 

I'm working with Diadem 2015.

I'm trying to convert a Vector BLF file with data on CAN1 and CAN2.

On the CAN1, I put 4 .dbc files for the conversion. On the CAN2, I put 4.dbc files for the conversion. So in total, I have 8 .dbc files in the converter.

I always have the following error on the last database putted in the CAN2 configuration:

"Bus Log Converter error: Cannot open the signal description database"

 

Even if I try to change the dbc order, I have always the same issue on the last so it is not due to the fact that my dbc is wrong.

As soon as I put the last dbc in comments, I have no more error. So, it seems that there is a limitation to 7 .dbc files in the converter. Does someone can confirm that ?

 

Thanks in advance for your feedback.

 

Regards,

 

Xavier

0 Kudos
Message 5 of 10
(4,371 Views)

It is correct. The converter is limited to 7 dbc files.

A valid work around are two configurations. Configuration 1 for CAN1 with four dbc files. And configuration 2 for CAN2 with four dbc files.

0 Kudos
Message 6 of 10
(4,363 Views)

Hi Sandra,

 

Would you please comment on the reason for the limitation?  Or perhaps will this limitation stay in place in the future, or might it be relaxed at some point?

 

Thanks,

Brad Turpin

DIAdem Product Support Engineer

National instruments

0 Kudos
Message 7 of 10
(4,347 Views)

We are working on to increase the number of dbc files.

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

@SandraT wrote:

We are working on to increase the number of dbc files.


Hello SandraT,

 

Is the number of .dbc files increased since then or is it still just 7?

 

Thank you,

Hanna

0 Kudos
Message 9 of 10
(3,501 Views)

Hello Hanna

you can add more than 7 dbc files since DIAdem 2017 SP1. The number is not limited anymore.

Best regards, Sandra

Message 10 of 10
(3,494 Views)