Page 1 of 1

Reading latest signal-values by macro

Posted: Thu 14. Mar 2013, 16:59
by mulan_nl
Hello,

Currently, I am reading the latest message value by using:

Code: Select all

signal_name.MessageToValue(msgs(msgs.Count-1))
which parses through the entire received messages buffer, which is quite slow.

1. Is there another way (macro?) to receive the latest message signal information only?
I am using Set msgs = trc.Messages.FindSymbol(sym) to link the new messages each time. (this could may be the cause of the delays)

2. Is it also possible during 'live' mode, i.e. when a connection is made using Connections.ReceiveMessages?

Re: Reading latest signal-values by macro

Posted: Fri 15. Mar 2013, 09:51
by PEAK-Support
When you work with Signals, you do not need to iterate to the Message queu. The Signal will always have the lates value. Means, if your Signal is defined as a Bitsection of a incomming CAN Frame, you only need to read the Signal.Value and you have the latest value. Attached a simple project that use a Symbol File that define 2 Signals based on a CAN Frame and use them to calculate a third, virtual, Signal.