Page 1 of 1

Start a New Trace Window within a VBS

Posted: Wed 20. May 2015, 13:04
by jnota
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!

Re: Start a New Trace Window within a VBS

Posted: Wed 20. May 2015, 13:21
by jnota
I've already figured it out!

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

Re: Start a New Trace Window within a VBS

Posted: Wed 20. May 2015, 15:27
by jnota
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...

Re: Start a New Trace Window within a VBS

Posted: Wed 20. May 2015, 17:36
by jnota
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!