Jump to content
  • 0

Getting time of CAN protocol reception in scripts


BFisher

Question

I'm writing a script which displays CAN messages in a slightly different format from the standard CAN protocol decoder.  I'd like to indicate the time that a CAN message arrived, as can be done in the standard display (with View/Timestamp).  However, I can't find a way to get the time.  The example shows getting time from Scope.Time.taken, for example, but this does not work either from CAN.Time.taken or Protocol.CAN.Time.taken or Protocol.Time.taken  (all seems like possibilities based on the doc saying that it would work with any "instrument".  It would also be fine to get the real time rather than the received time.  Is any of this possible?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi @BFisher

For reception in Protocol the device only stores the protocol specific bits so there is no time information memorized. The View/ Stamp inserts informative software time stamps.
For timing analysis use the Logic Analyzer. For newer devices (DigitalDiscovery, AD3, ADP3X50...) a precise trigger time stamp (based on device RTC) is stored for each capture.

Link to comment
Share on other sites

  • 0

Ok, thanks.  I get that you don't have the specific time in the protocol.  But I'd like to place an informative time stamp in the script output, but "Timestamp" does not appear under "View" in the script tab.  In other words, I'm using a script to replace the normal CAN protocol output to show more details of things I am interested in, but timestamp is not available under the script tab.   Alternatively, if I could get the time somehow within the script, I could print it myself.

Or perhaps I am missing something?  Is the Script tab the only place you can run the script or can you actually somehow run the script in the protocol tab?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...