— 28 —
Use when you need to change PGNs source device address and make them appear as if they were sent by
the Bridge itself.
Example 4.
# Processing of Actual Pressure messages (PGN 0x1FD0A) and generation of the
# Environmental Parameters messages (PGN 0x1FD06)
match(CAN2,0x1FD0A00,0x1FFFF00)
{
send()
# Forward the original message
A = get(DATA + 2, UINT8)
# Extract the data type
if (A == 0)
# Is it atmospheric pressure?
{
B = get(DATA + 3, INT32)
# Extract the pressure value
if (B < 0x7FFFFFFD)
# Check the validity of the value
{
set(1, UINT8,6) # Change PGN from 0x1FD0A to 0x1FD06
set(DATA + 1, UINT32, 0xFFFFFFFF)
# Set the unused fields
set(DATA + 5, UINT16, B / 1000)
# Convert and set pressure
send(CAN1)
# Send Environmental Parameters to CAN1
set(0, UINT8, addr())
# Replace the address with the address
#
of
the
Bridge
send(CAN2)
# Send Environmental Parameters to CAN2
}
}
}
Program in Example 4 receives "Actual Pressure" PGN 0x1FD0A from CAN2 interface and forwards it
to CAN1 interface. Suppose we have a legacy device on CAN1 subnet which does not understand "Actual
Pressure" PGN, so Bridge will generate an extra "Environmental Parameters" PGN 0x1FD06 for atmospheric
pressure and will send it to CAN1 using its own device address. Original PGN 0x1FD0A will be send "as is",
with no change in device address.
Summary of Contents for YDNB-07N
Page 46: ......