Start a New Trace Window within a VBS

Comprehensive CAN monitor for Windows® and its add-ins: Plotter, CANdb Import, Instruments Panel, and J1939
Post Reply
jnota
Posts: 20
Joined: Mon 18. May 2015, 17:32

Start a New Trace Window within a VBS

Post by jnota » Wed 20. May 2015, 13:04

Hello,

I've already searched in the Help Topics/Index but I can't find the right way to start a new Trace Window through VB code.

Start tracing, I already figured it out, but I need to open a new Trace window and to have it selected before running the Macro, otherwise it doesn't work.

Does someone know how to do it?

Thanks in advance!

jnota
Posts: 20
Joined: Mon 18. May 2015, 17:32

Re: Start a New Trace Window within a VBS

Post by jnota » Wed 20. May 2015, 13:21

I've already figured it out!

There is an example Sub in Macro sample - LosslessTrace -. that explains how to do it.
Thank you anyway!

jnota
Posts: 20
Joined: Mon 18. May 2015, 17:32

Re: Start a New Trace Window within a VBS

Post by jnota » Wed 20. May 2015, 15:27

Another problem came:
Is it possible to read the data of the traced messages and print it to the OutputWindow?
I tried but only could do that with the last traced message...
I searched about TraceMessage but I haven't found any practical examples...

jnota
Posts: 20
Joined: Mon 18. May 2015, 17:32

Re: Start a New Trace Window within a VBS

Post by jnota » Wed 20. May 2015, 17:36

I've already figured it out too!
I just need to use something like this:

Code: Select all

   For i = 1 to counter
		Set trc1msgs = trc1.Messages.Item(i)
		PrintToOutputWindow "CAN MSG: " & Hex(trc1msgs.Data(1))
	Next
Thanks anyway!

Post Reply