Display Cycle Time in Graph

Comprehensive CAN monitor for Windows® and its add-ins: Plotter, CANdb Import, Instruments Panel, and J1939
Post Reply
Heiko
Posts: 1
Joined: Wed 11. May 2016, 15:15

Display Cycle Time in Graph

Post by Heiko » Wed 11. May 2016, 15:23

Hi together!

is there a way to display the cycle time of a certain CAN-ID I am receiving in a graph (for example in a line writer file or in a plotter file)? The goal is to measure and display cycle time stability.

I am new to the PEAK Explorer - every help is very appreciated!

Cheers
Heiko

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1152
Joined: Fri 10. Sep 2010, 19:34

Re: Display Cycle Time in Graph

Post by U.Wilhelm » Tue 17. May 2016, 09:36

You need to wrote a small VB Script in PE5 and measure the time between the incomming CAN Message. Then store this information in a virtual signal. This signal could then be used like any other signal in PE5 and so could aslo be shown inside the Plotter or Linewriter.
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

T. Eggers
Posts: 2
Joined: Tue 3. Jan 2017, 09:31

Re: Display Cycle Time in Graph

Post by T. Eggers » Tue 3. Jan 2017, 09:45

Hello,

that is exactly what I am trying to do. But I am having problems with going to milliseconds resolution.
My signal is supposed to be received every 10ms. And I want to plot the variation on that time.

I can get the time stamp of my signal, BUT only to the resolution of seconds.

Code: Select all

Dim dow
Set dow = Signals("X")
PrintToOutputWindow dow.ValueChangeTime ' prints 03.01.2017 08:37:01
PrintToOutputWindow datepart("s",dow.ValueChangeTime) ' prints secounds
The documentation mentions the ValueChangeTimeString property and that would give me access to milliseconds and even microseconds, BUT that property does not exist for a signal object.

Greatings
Eggers

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1152
Joined: Fri 10. Sep 2010, 19:34

Re: Display Cycle Time in Graph

Post by U.Wilhelm » Wed 4. Jan 2017, 12:53

In the VB script use a layer 2 client - receice the raw message. In the CAN Message Structure you have a timestamp that you could use.

But it is always only the time between the 2 incomming CAN Messages...you will NEVER know when the signal was realy changed - this is not possible..only if the sending node does only send out the CAN Message if the signal is changed..but what happened with other signals in the same CAN Frame ?!
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

T. Eggers
Posts: 2
Joined: Tue 3. Jan 2017, 09:31

Re: Display Cycle Time in Graph

Post by T. Eggers » Wed 4. Jan 2017, 14:27

Thank you

with that information and the WaitForID100() example i have my plot up and running.

Is there a way I can plot this information without having to load a .sym file to get a virtual variable?
Or a way to load more than one .sym file?

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1152
Joined: Fri 10. Sep 2010, 19:34

Re: Display Cycle Time in Graph

Post by U.Wilhelm » Thu 5. Jan 2017, 09:31

If you want, you could generate a Signal/Symbol at "runtime" - so no need for a SYM File
Her a small sample.

This Macro will use the 2 Signals Voltage and Current from the Symbol file , but generate the Signal Power dynamicly if not available. Like this you could also generate own Signals without a SYM File.

Code: Select all

Sub CalculatePower()
  Dim voltage, current, power

  Set voltage = Signals("Voltage")
  Set current = Signals("Current")

  Set power = Signals("Power")
  If power Is Nothing Then
    ' Signal not found, create and initialize new one
    Set power = Signals.Add("Power")
    power.DataType = peDataTypeFloat
  End If

  While True
    power.Value = voltage.Value * current.Value
    Wait(10)	' Prevent 100% CPU load
  Wend

End Sub
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

Post Reply