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
Display Cycle Time in Graph
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Display Cycle Time in Graph
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[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
Re: Display Cycle Time in Graph
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.
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
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
Greatings
Eggers
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Display Cycle Time in Graph
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 ?!
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[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
Re: Display Cycle Time in Graph
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?
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?
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Display Cycle Time in Graph
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.
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[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------