I am working with the PCAN-MiniDisplay and would like to display several parameters on the screen, such as the average gradient, sector length, and next sector distance. Below is the script I am using
The Global Settings, Messages, Variables, and Labels sections of the script have been configured as follows:
Variables: Defined for Avg_Gradient, Sector_Length, and Next_Sector_Distance.
Messages: The message with CAN ID 0x600 is enabled, but I am transmitting the data with a different CAN ID (0x621).
Code: Select all
// =======================================================================================================================
// PCAN-MiniDisplay - Scrolling Plotter Example
//
// Author: PEAK-System Technik GmbH
// Description: Plots the first data byte of the CAN message with the ID 100 with the scrolling x feature enabled.
// Last Update: 2019-11-20
//
// =======================================================================================================================
// =======================================================================================================================
// Global Settings
// =======================================================================================================================
[global]
format=1
compress=1 // 1 => Scene will be compressed after first load. Further loading will be much faster.
protect=1 // 1 => The compressed instrument is encrypted and does not run on another device
plotter=1 // Number of plotters defined in this scene
messages=1 // Number of CAN messages defined in this scene
variables=3 // Number of variables defined in this scene
labels=9 // Number of labels defined in this scene
// =======================================================================================================================
// Messages
// =======================================================================================================================
[message1]
enable=1 // 0 => disables message proccessing, 1 => enables message processing
name="InstrumentsMsg"
canid=0x600 // ID
frametype=0 // 0 => 11 Bit, 1 => 29 Bit
channel=0 // 0 => CAN channel 1, 1 => CAN channel 2
timeout=0 // 0 => disables timeout function, 1 => enables timeout function
// =======================================================================================================================
// Variables
// =======================================================================================================================
[variable1]
name="Avg_Gradient"
messagename="InstrumentsMsg"
position=0,16 // Bit start and length
byteorder=0 // 0 => Intel, 1 => Motorola
muxtype=0 // 0 => None, 1 => Multiplexer, 2 => Multiplexed
muxval=0 // If muxtype = 2, this variable is updated if its multiplexer (muxtype = 1) has this value
scale=0.01
offset=0
vartype=0 // Representation of CAN data: 0 => unsigned, 1 => signed, 2 => float, 4=> string
datatype=2 // Representation of result: 0 => unsigned, 1 => signed, 2 => float, 4=> string, 5=> enum
[variable2]
name="Sector_Length"
messagename="InstrumentsMsg"
position=16,24 // Bit start and length
byteorder=0 // 0 => Intel, 1 => Motorola
muxtype=0 // 0 => None, 1 => Multiplexer, 2 => Multiplexed
muxval=0 // If muxtype = 2, this variable is updated if its multiplexer (muxtype = 1) has this value
scale=1
offset=0
vartype=0 // Representation of CAN data: 0 => unsigned, 1 => signed, 2 => float, 4=> string
datatype=2 // Representation of result: 0 => unsigned, 1 => signed, 2 => float, 4=> string, 5=> enum
[variable3]
name="Next_Sector_Distance"
messagename="InstrumentsMsg"
position=40,24 // Bit start and length
byteorder=0 // 0 => Intel, 1 => Motorola
muxtype=0 // 0 => None, 1 => Multiplexer, 2 => Multiplexed
muxval=0 // If muxtype = 2, this variable is updated if its multiplexer (muxtype = 1) has this value
scale=1
offset=0
vartype=0 // Representation of CAN data: 0 => unsigned, 1 => signed, 2 => float, 4=> string
datatype=2 // Representation of result: 0 => unsigned, 1 => signed, 2 => float, 4=> string, 5=> enum
// =======================================================================================================================
// Labels
// =======================================================================================================================
[label1]
name="label1" // Name of the label for reference
position=40,10 // X-position,Y-position in pixel; 0,0 is the top left corner
font_idx=2
length=25 // Number of characters
initval="Cummins - DriveTech"
fontcolor=70,130,255 // RGB value
bgcolor=0,0,0 // RGB value
[label2]
name="label2" // Name of the label for reference
position=40,30 // X-position,Y-position in pixel; 0,0 is the top left corner
font_idx=2
length=25 // Number of characters
initval="-------------------"
fontcolor=255,255,255 // RGB value
bgcolor=0,0,0 // RGB value
[label3]
name="label3" // Name of the label for reference
position=5,60 // X-position,Y-position in pixel; 0,0 is the top left corner
font_idx=1
length=25 // Number of characters
initval="Avg_Gradient :-"
fontcolor=70,130,255 // RGB value
bgcolor=0,0,0 // RGB value
[label4]
name="label4" // Name of the label for reference
position=5,80 // X-position,Y-position in pixel; 0,0 is the top left corner
font_idx=1
fmt_string="%2f %" // Format definition
var_name="Avg_Gradient" // Reference to the variable
length=2 // Number of characters
initval="-- %"
fontcolor=255,0,0 // RGB value
bgcolor=0,0,0 // RGB value
[label5]
name="label4" // Name of the label for reference
position=5,110 // X-position,Y-position in pixel; 0,0 is the top left corner
font_idx=1
length=25 // Number of characters
initval="Sector_Length :-"
fontcolor=70,130,255 // RGB value
bgcolor=0,0,0 // RGB value
[label6]
name="label6" // Name of the label for reference
position=5,130 // X-position,Y-position in pixel; 0,0 is the top left corner
font_idx=1
fmt_string="%f m" // Format definition
var_name="Sector_Length" // Reference to the variable
length=5 // Number of characters
initval="-- M"
fontcolor=255,0,0 // RGB value
bgcolor=0,0,0 // RGB value
[label7]
name="label7" // Name of the label for reference
position=5,160 // X-position,Y-position in pixel; 0,0 is the top left corner
font_idx=1
length=5 // Number of characters
initval="Next_Sector_Distance :-"
fontcolor=70,130,255 // RGB value
bgcolor=0,0,0 // RGB value
[label8]
name="label8" // Name of the label for reference
position=5,180 // X-position,Y-position in pixel; 0,0 is the top left corner
font_idx=1
fmt_string="%f m" // Format definition
var_name="Next_Sector_Distance" // Reference to the variable
length=5 // Number of characters
initval="-- M"
fontcolor=255,0,0 // RGB value
bgcolor=0,0,0 // RGB value
----------------------------
Issue:
The script specifies CAN ID 0x600, but I am able to receive and display data even when the CAN message is transmitted with CAN ID 0x621.
The data is displayed correctly even when using an arbitrary CAN ID, not matching 0x600.
Could you kindly help me understand why this is happening? Is there any configuration setting or other underlying reason that allows the script to process data from a different CAN ID?