Page 1 of 1
Auto-save .trc files
Posted: Thu 8. Jun 2017, 23:09
by YKraemer
Hello,
is there any possibility to auto-save .trc files? At the moment, I only know the following solution: open a .trc, run a test and then save it manually to a certain location. I'd like to do the following: start a trace which is automatically saved (and best case split after reaching a file size X), run the test and have the .trc without saving it by hand again.
Any chance this is possible?
Thanks and best,
Yvonne
Re: Auto-save .trc files
Posted: Fri 9. Jun 2017, 09:57
by PEAK-Support
While the installation of a PCAN-Explorer Version, we alsways copy a sample macro per default.
In this macro you will find a function called
.
You only need to change the following lines for your code
Code: Select all
' Modify as required
const DefaultDestDir = "c:\Trace"
const DefaultConnection = "TestNet@pcan_pci"
const MessagesPerTracer = 100000
DefaultDestDir is the Directory where to store all Trace Files (could store as much as this Directory could handle!)
DefaultConnection is the name of the used Connection in your Project
MessagesPerTracer is the max. Numbers per single Trace file
Re: Auto-save .trc files
Posted: Fri 9. Jun 2017, 17:32
by YKraemer
Hello,
thank you very much for your quick reply. How can I change this when a version of PCAN Explorer is already installed?
Thanks!
Re: Auto-save .trc files
Posted: Fri 9. Jun 2017, 17:58
by PEAK-Support
It is a VBS Macro - a simple Text File - see online Help of PCAN-Explorer How to Edit and Apply Macros.

- SelectMacro.JPG (96.83 KiB) Viewed 12702 times
Re: Auto-save .trc files
Posted: Fri 9. Jun 2017, 18:06
by YKraemer
Thank you very much - I'll look into that!
Last question regarding the commands:
const DefaultConnection = "TestNet@pcan_pci"
--> What do you mean with the 'used connection in the Porject'?
const MessagesPerTracer = 100000
--> In case the max number is reached will PCAN automatcally create a second file from a measurement? If so what is a good message number you can recommend?
Thank you!
Re: Auto-save .trc files
Posted: Fri 9. Jun 2017, 18:17
by PEAK-Support
const DefaultConnection = "TestNet@pcan_pci"
--> What do you mean with the 'used connection in the Porject'?
This is the name of the Connection you use --> Connections Window - Connection
(for example TestNet@pcan_usb for a Net you ´have named TestNet and use the pcan_usb Device)
const MessagesPerTracer = 100000
--> In case the max number is reached will PCAN automatcally create a second file from a measurement? If so what is a good message number you can recommend?
Open the VBS Script - it is very well documented!
Code: Select all
Do While IsRunning
' Tracer records data until the filling level reaches 95%
Do While IsRunning And (CurrentTracer.FillingLevel < 95)
Wait 50
IsRunning = CurrentTracer.TraceState = peTraceStarted
Loop
If IsRunning Then
NextTracer.Start
CurrentTracer.Stop
End If
Leave the value as is is and every single Trave file have max. 100.000 CAN Frames. You also could use higher values - then the Trace files are larger. This system run invinity - until you press stop macro. You could save milions of CAN Frames as long as you have storage on the disk of the PC.
Re: Auto-save .trc files
Posted: Fri 9. Jun 2017, 18:30
by YKraemer
Thank you very much!

Have a great weekend!!
Re: Auto-save .trc files
Posted: Wed 13. Nov 2019, 12:08
by virus
Hey Guys, I am having an issue when trying to auto save the can log. It seems, once one of the traces is full, its closed as it should but the second trace never starts recording! any idea on how I could get past it? I am using PCAN Explorer 5.4.3.905
Re: Auto-save .trc files
Posted: Wed 13. Nov 2019, 12:15
by PEAK-Support
please send the serial number and the version Information of your used PE5 to
support@peak-system.com (do not pos here!) Also send the script you use for autosave trace files.
Re: Auto-save .trc files
Posted: Wed 13. Nov 2019, 12:56
by virus
I dropped you an email! thanks