0% found this document useful (0 votes)
111 views21 pages

Beijer - FreeCAN Built-In

This document provides information about configuring and setting up the FreeCAN driver for X2 Extreme panels. The FreeCAN driver reads and writes CAN telegrams to and from the CAN bus. It supports various CAN protocols including CAN, J1939, NMEA 2000, and CANopen. The driver can import tag addresses from an Excel file. The panel has two CAN channels that can connect to separate CAN buses. Proper termination is required at each end of the CAN bus.

Uploaded by

Orhan Denizli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
111 views21 pages

Beijer - FreeCAN Built-In

This document provides information about configuring and setting up the FreeCAN driver for X2 Extreme panels. The FreeCAN driver reads and writes CAN telegrams to and from the CAN bus. It supports various CAN protocols including CAN, J1939, NMEA 2000, and CANopen. The driver can import tag addresses from an Excel file. The panel has two CAN channels that can connect to separate CAN buses. Proper termination is required at each end of the CAN bus.

Uploaded by

Orhan Denizli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

Introduction
This manual describes how to configure and set up the FreeCAN driver and the tag addresses in
the panel and how to connect the CAN network. This driver is for X2 Extreme panels only.

FreeCAN built-in The FreeCAN driver reads and collects CAN telegrams in a receive list and writes CAN telegrams
to the CAN bus on demand.
Introduction
Please ensure that you always have the latest operating system image in use on the panel.
Release Notes
Disclaimer Additional to normal address commands the FreeCAN driver can be used with an import module,
Limitations which imports tags from an Excel sheet and transfers them to the designer tag list. Using the
Firmware Update Excel sheet has the advantage of a single source which contains all variables and that every bit
[+] Connecting To The Can Network of a tag can be assigned to a bit of the CAN bus data. By importing this list, a “taglist.lst” file is
created, which is downloaded automatically to the panel on project download.
[+] Settings
[+] Addressing The panel hardware supports CAN Specification Version 2.0B. The physical layer supports the
[+] Import Module standard ISO11898-2:2016 and SAE J2284-1 to SAE J2284-5 (High Speed CAN).
Efficient Communication
[+] Troubleshooting The FreeCAN driver supports:
- CAN (11 and 29 bit header)
[+] Additional Information
- J1939
Bus State - NMEA 2000
Bus Load - CANopen slaves
Baudrate State
Firmware Version
Firmware Status
Receive List Count
Read Variable
Read Variable With Timeo…
Read J1939 Pgn
Read DM1 Message
Write Full Telegram
Write Telegram Cyclic
Detect J1939 Station
Examples
J1939 Example
NMEA2000 Example
Extending The Can Receive …
Start And Stop Of Cyclic Wr…
Rtr Telegrams Send And Re…

For information about the connected CAN devices we refer to the manual for that devices.

Release Notes
Version Release Description
Help files updated for X2 pro panels.
5.04.00 April 2019
Firmware V1.0.0.6 included.
Support for more PROT14 tags and improved import for this tags.
5.03.00 February 2019
Firmware V1.0.0.6 included.
Help files updated for X2 pro panel support.
5.02.00 October 2018
Firmware V1.0.0.5 included.
First version for release.
5.01.00 February 2018
Firmware V1.0.0.5 included.

Disclaimer
Please note that changes in the controller protocol or hardware, which may interfere with the
functionality of this driver, may have occurred since this documentation was created. Therefore,
always test and verify the functionality of the application. To accommodate developments in the
controller protocol and hardware, drivers are continuously updated. Accordingly, always ensure
that the latest driver is used in the application.

Limitations

1 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

• The maximal hold of the receive list is 3500 entries, so 3500 different CAN IDs can be hold.
• The maximum Excel length is 5000 tags.
• No LEDs available at the CAN interfaces.
• The 10 kBaud rate is not available. Lowest supported baudrate is 20 kBaud.
• The 800 kBaud rate is not available. Instead 750 kBaud are available.
• It is recommended to not use 1 MBaud on X2 Pro panels.
FreeCAN built-in • When this FreeCAN Built-in driver is in use then no other CAN Built-in driver
(like CANopen Built-in) can be used at the same time.
Introduction • This panels have no internal CAN support and CAN Built-in drivers cannot be used:
Release Notes X2 base, X2 pro 4 - B2, X2 pro 7 - B2, X2 marine 7 - B2
Disclaimer • The maximum number of supported PROT14 tags is 100 (using firmware V1.0.0.5 and older)
Limitations or 150 (using firmware V1.0.0.6 and newer).
Firmware Update
[+] Connecting To The Can Network
[+] Settings
[+] Addressing Firmware Update
[+] Import Module
Efficient Communication The FreeCAN driver uses a firmware which is, if necessary, updated automatically by the driver
[+] Troubleshooting during boot of the HMI project.
[+] Additional Information
If it is necessary to prevent the driver to update the module firmware this can be done by
Bus State copying a file named "nofirmwareload.txt" to the sub folder "project files" in the main project
Bus Load folder.
Baudrate State
Firmware Version Note:
Firmware Status It is always recommended to let the driver update the firmware.
Receive List Count Note:
Read Variable If you get communication errors after a firmware update, please reset your panel by power
Read Variable With Timeo… disconnect.
Read J1939 Pgn
Read DM1 Message
Write Full Telegram
Write Telegram Cyclic
Detect J1939 Station
Connecting To The Can Network
Examples The CAN connection is of the type Point-to-Net (bus). The demands of CAN bus connections must
J1939 Example be fulfilled. Terminate the CAN bus on each end with 120 Ohm.
NMEA2000 Example
Extending The Can Receive … On X2 Extreme panels two CAN channels (1, 2) are available. Each CAN channel can be connected
to a different CAN bus.
Start And Stop Of Cyclic Wr…
Rtr Telegrams Send And Re…
Termination
On a CAN bus a termination of 120 Ohm is needed at each end of the bus. That means if this
panel is at one of this ends a termination is needed.

CAN 1: no internal termination available.

CAN 2: On COM B on X2 Extreme HP and X2 Extreme SL HP panels an internal termination of 120


Ohm is soldered between pin 2 and pin 7. It can be used as termination by shorting the pin 1 and
pin 2 and ahorting pin 6 and pin 7.

If an external termination is added it should be as near at the connector as possible.

Galvanic isolation
X2 Extreme panels have this hardware configuration:

CAN 1: no galvanic isolation.


CAN 2: The CAN interface on COM B of X2 Extreme HP and X2 Extreme SL HP panels is galvanic
isolated.

If an external termination is added it should be as near at the connector as possible.

CAN cable
A typical CAN cable uses CAN_H, CAN_L and CAN_SHLD. For best results the data lines CAN_L and
CAN_H must be twisted. The shield CAN_SHLD must be connected to all CAN devices (CDs).

The CAN cable should be as short as possible. The ends of the cable must be terminated (T) with
120 Ohm. This can be a simple resistor at the end of the cable or it can be included in one of the
CDs (here CD1).
In addition the CAN cable plugs can be connected to earth directly.

2 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

FreeCAN built-in
Introduction
Release Notes
Disclaimer
Limitations
Firmware Update In some CANopen configurations other signals provided on the CAN connector (like CAN_GND) are
[+] Connecting To The Can Network used.
[+] Settings
[+] Addressing Note: Do not connect more than 32 nodes to one CAN cable without repeater.
[+] Import Module
Efficient Communication CAN cable length
[+] Troubleshooting
[+] Additional Information The maximum length of a CAN bus cable (without repeater) depends on the baudrate.
Bus State
Bus Load Baudrate [kBaud} Maximum length [m]
Baudrate State 1000 25
Firmware Version 750 50
Firmware Status 100, 125, 250, 500 100
Receive List Count 20 1000
Read Variable
Read Variable With Timeo…
Read J1939 Pgn Communication Ports
Read DM1 Message
Write Full Telegram The following communication ports are available. Splitter cables can be used to connect multiple
Write Telegram Cyclic serial interfaces simultaneously, please see chapter Cables.
Detect J1939 Station
Examples X2 pro 7 - B2 - 2eth
J1939 Example X2 pro 10 - B2
NMEA2000 Example X2 pro 12 - B2
Extending The Can Receive … X2 pro 15 - B2
Start And Stop Of Cyclic Wr… X2 marine 7 - B2 HB
Rtr Telegrams Send And Re…
X2 marine 7 - B2 SC
X2 marine 15 - B2
X2 control 4 - B2
X2 control 7 - B2

BoX2 pro
BoX2 pro SC

Female DB-9 COM1


Pin COM2 signal COM3 signal
COM signal
RS422 TX+, RS485 TX+/RX+,
1 - -
CAN1-H
2 RS232 RX - -
3 RS232 TX - -
RS485
4 - RS422 RX+
TX+/RX+
5 GND GND GND
6 - RS422 TX-, RS485 TX-/RX-, CAN1-L -
7 RS232 RTS - -
8 RS232 CTS - -
9 - RS422 RX- RS485 TX-/RX-

X2 pro 21 - B2
X2 marine 7 - B2 HB SC
X2 marine 15 - B2 HB
X2 marine 15 - B2 SC
X2 marine 15 - B2 HB SC
X2 control 10 - B2
X2 control 12 - B2
X2 control 15 - B2

3 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

Female DB-9 COM1


Pin COM2 signal COM3 signal
COM signal
RS422 TX+, RS485 TX+/RX+,
FreeCAN built-in 1 -
CAN1-H
-

2 RS232 RX - -
Introduction
3 RS232 TX - -
Release Notes
RS485 TX+/RX+,
Disclaimer 4 - RS422 RX+
CAN2-H
Limitations
Firmware Update 5 GND GND GND
[+] Connecting To The Can Network RS422 TX-, RS485 TX-/RX-,
6 - -
[+] Settings CAN1-L
[+] Addressing 7 RS232 RTS - -
[+] Import Module 8 RS232 CTS - -
Efficient Communication RS485 TX-/RX-,
9 - RS422 RX-
[+] Troubleshooting CAN2-L
[+] Additional Information
Bus State
X2 Extreme
Bus Load
Baudrate State
Female DB-9 COM1
Firmware Version Pin COM2 signal COM3 signal
COM A signal
Firmware Status
RS422 TX+, RS485 TX+/RX+,
Receive List Count 1 - -
CAN1-H
Read Variable
2 RS232 RX - -
Read Variable With Timeo…
Read J1939 Pgn 3 RS232 TX - -
Read DM1 Message RS485 TX+/RX+,
4 - RS422 RX+
Write Full Telegram CAN2-H
Write Telegram Cyclic 5 GND GND GND
Detect J1939 Station RS422 TX-, RS485 TX-/RX-,
6 - -
Examples CAN1-L
J1939 Example 7 RS232 RTS - -
NMEA2000 Example 8 RS232 CTS - -
Extending The Can Receive …
RS485 TX-/RX-,
Start And Stop Of Cyclic Wr… 9 - RS422 RX-
CAN2-L
Rtr Telegrams Send And Re…

X2 Extreme HP

Female DB-9 COM A Pin COM1 signal COM2 signal


1 - RS422 TX+, RS485 TX+/RX+, CAN1-H
2 RS232 RX -
3 RS232 TX -
4 - RS422 RX+
5 GND GND
6 - RS422 TX-, RS485 TX-/RX-, CAN1-L
7 RS232 RTS -
8 RS232 CTS -
9 - RS422 RX-

Female DB-9 COM B Pin COM3 signal


1 RS485 TX+/RX+, CAN2-H
2 TERM+
3 -
4 -
5 GND
6 RS485 TX-/RX-, CAN2-L
7 TERM-
8 -
9 VCC

X2 Extreme SL HP

Female M12 COM A Pin COM1 signal COM2 signal

4 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

1 - RS422 TX+, RS485 TX+/RX+, CAN1-H


2 RS232 RX -
3 RS232 TX -
4 - RS422 RX+
5 GND GND
FreeCAN built-in 6 - RS422 TX-, RS485 TX-/RX-, CAN1-L
7 RS232 RTS -
Introduction 8 - RS422 RX-
Release Notes
Disclaimer Female M12 COM B Pin COM3 signal
Limitations
1 RS485 TX+/RX+, CAN2-H
Firmware Update
[+] Connecting To The Can Network 2 TERM+
[+] Settings 3 -
[+] Addressing 4 -
[+] Import Module 5 GND
Efficient Communication 6 RS485 TX-/RX-, CAN2-L
[+] Troubleshooting
7 TERM-
[+] Additional Information
8 VCC
Bus State
Bus Load
Baudrate State
Firmware Version
Firmware Status Cables
Receive List Count
Read Variable
CAB109
Read Variable With Timeo…
Read J1939 Pgn Splitter cable when using a combination of R232 and RS422 communication.
Read DM1 Message
Write Full Telegram
Write Telegram Cyclic
Detect J1939 Station
Examples
J1939 Example
NMEA2000 Example
Extending The Can Receive …
Start And Stop Of Cyclic Wr…
Rtr Telegrams Send And Re…

CAB150

5 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

Splitter cable when using a combination of RS232 and RS485 communication.

FreeCAN built-in
Introduction
Release Notes
Disclaimer
Limitations
Firmware Update
[+] Connecting To The Can Network
[+] Settings
[+] Addressing
[+] Import Module
Efficient Communication
[+] Troubleshooting
[+] Additional Information
Bus State
Bus Load
Baudrate State
Firmware Version
Firmware Status
Receive List Count
Read Variable
Read Variable With Timeo…
Read J1939 Pgn
Read DM1 Message
Write Full Telegram
Write Telegram Cyclic
Detect J1939 Station
Examples
J1939 Example
NMEA2000 Example
Extending The Can Receive …
Start And Stop Of Cyclic Wr…
Rtr Telegrams Send And Re…

Settings

Parameter Description
Selects the baudrate to use for each CAN channel [kBaud]:
1000, 750, 500, 250, 125, 100, 20.
Default: 125 kBaud
Baudrate CAN x
Note:
It is recommended to not use 1 MBaud on X2 Pro panels.
If 1 MBaud is needed please use an X2 Extreme panel.
The CAN node number of the HMI panel. Range 1..127. Used for the
CAN station
protocols J1939, NMEA 2000 and CANopen.
address
Default: 1
Selects the CAN channels for free baudrate setting.
1=CAN1, 2=CAN2.
Free baudrate
Add the numbers to activate free baudrate setting for both channels e.g.
channels 1+2
3 selects CAN1 and CAN2.
Default: 0 (free baudrate is off, pre-set baudrates are used)

6 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

32 bit value to set any baudrate.


E.g. for 250 kBaud set this value to 250000.
Note:
Free baudrate
Only some baudrates will be accepted. It may happen that a similar
baudrate is set. It may be lower or higher than the baudrate wanted.
Default: 0

FreeCAN built-in Autobaud detection


Setting baudrate = 10 kBaud for all 2 channels will activate the autobaud function.
Introduction The driver tries to receive valid telegrams on the preset baudrates 1 MBaud, 750 kBaud, 500
Release Notes kBaud, 250 kBaud, 125 kBaud, 100 kBaud, 20 kBaud. Make sure that the panel does receive CAN
Disclaimer telegrams.
Limitations Once the baudrate is found, the firmware will lock it and use on every channel. The result can
Firmware Update be checked in a tag with command BL3 or BL4 (see Basic signals).
[+] Connecting To The Can Network Note:
[+] Settings It is recommended to use fixed baudrates instead of the autobaud detection.
[+] Addressing
[+] Import Module
Efficient Communication
[+] Troubleshooting Advanced
[+] Additional Information
Bus State
Bus Load
Baudrate State
Firmware Version
Firmware Status
Receive List Count
Read Variable
Read Variable With Timeo…
Read J1939 Pgn At advanced setting please set Timeout=2000 and Retries=3. This is an important setting for
Read DM1 Message restarts on the HMI.
Write Full Telegram
Write Telegram Cyclic Parameter Description
Detect J1939 Station Enables read/write of unicode characters to the controller. Note
Examples Enable unicode that each character in a unicoded string will use two bytes of the
J1939 Example memory in the controller.
NMEA2000 Example Byte order Sets the byte order of the unicode character.
Extending The Can Receive … The number of milliseconds of silence on the port before the next
Timeout
Start And Stop Of Cyclic Wr… retry is sent.
Rtr Telegrams Send And Re… Retries Number of retries before a communication error is detected.
How long to wait after a communication error before trying to
Offline station retry time
restore communication.
Hides the error message that is displayed on communication
Hide comm error
problem.
Special commands that can be passed to the driver. For available
Command line options commands for this driver see chapter commands.
NOTE: This chapter does not exist for all drivers.

Note:
Please check your settings after every update.

Addressing
There are 3 types of addresses:

• Basic signals (insert manually).


• Non list addresses (insert manually).
• MS Excel list addresses (insert by import). It is recommended to use the import!

Basic Signals
These commands are used to show basic CAN bus information like the CAN bus state. The
corresponding command must be connected to a tag in the designer. Therefore the command
must be written to the column of the FreeCAN controller in the Tags folder.

Bus state

Bus load

Baudrate state

Firmware version

7 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

Read receive list count

Module status

FreeCAN built-in
Non-Taglist Addresses
Introduction
This commands include all necessary CAN specific information like CAN ID and channel. So they
Release Notes can be used without having a taglist loaded to the CAN module. The corresponding command
Disclaimer must be connected to a tag in the designer. Therefore the command must be written to the
Limitations column of the FreeCAN controller in the Tags folder.
Firmware Update
Read variable
[+] Connecting To The Can Network
[+] Settings Read variable with timeout
[+] Addressing
[+] Import Module Read J1939 PGN
Efficient Communication
Read DM1 Message
[+] Troubleshooting
[+] Additional Information Write full telegram
Bus State
Write telegram cyclic
Bus Load
Baudrate State Detect J1939 station
Firmware Version
Firmware Status
Receive List Count
Read Variable
Read Variable With Timeo…
Excel List Addresses
Read J1939 Pgn
Read DM1 Message It is possible to define all variables for reading and writing of CAN bus variables in an Excel
Write Full Telegram sheet. Using the Excel sheet gives you a perfect overview on your tags and helps you avoiding
Write Telegram Cyclic transfer errors. The FreeCAN import function allows to easily import these tags automatically to
Detect J1939 Station your project (please use your "/Project Files" folder). So this method is preferable to manually
addressing.
Examples
This chapter gives a short overview. More detailed information can be found in the chapter
J1939 Example Import module.
NMEA2000 Example
Extending The Can Receive … This picture shows the structure of the sheet. It is an example for the variable CAN1 which is
Start And Stop Of Cyclic Wr… represented by the first byte of the 8 CAN data bytes. In addition the CAN Identifier and the CAN
Rtr Telegrams Send And Re… channel are defined.

At the import all selected variables are translated automatically to an ILmn address and stored in
a taglist. The m specifies one of the types X, B, W and D, the n (range 0..65535) is a counter that
differs between the tags:

Tag name Description


ILXn 1 bit tag
ILBn 8 bits tag
ILWn 16 bits tag
ILDn 32 bits tag
ILXn.VALID Boolean (range true, false) returning the tag timeout state

Tag type setting


Adding a tag type (e.g. ".WORD") to the Name (column A) in the Excel sheet will set the imported
tag type.
The exchange between driver and CAN module is always done with 32 bits data, so the "ILD" is
used for all tag types, except for BOOL which uses ILX.
".Bool" will set the tag type BOOL (1 bit) in the designer
".Byte" will set the tag type INT16 (signed 16 bits) in the designer
".Word" will set the tag type INT16 (signed 16 bits) in the designer
".UWord" will set the tag type UINT16 (unsigned 16 bits) in the designer
".DWord" will set the tag type INT32 (signed 32 bits) in the designer
".UDWord" will set the tag type UINT32 (unsigned 32 bits) in the designer
".Real" or ".Float" will set the tag type Float (unsigned 32 bits) in the designer
".String" will set the tag type String<4> (4 characters) in the designer
"" An empty string will load the default type UINT32 (unsigned 32 bits) in the designer

Example:
The imported tag from the Excel sheet (see example above) looks like this.

8 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

It was assigned automatically to ILD0. The Data Type is INT16 because byte variables are not
supported.
FreeCAN built-in
Introduction  
Release Notes
Disclaimer
Limitations
Firmware Update
[+] Connecting To The Can Network
[+] Settings
Import Module
[+] Addressing
The FreeCAN driver supports the import of tags from an Excel sheet to the designer. The Excel
[+] Import Module sheet must have a defined format. Use the standard import mask in the designer and select the
Efficient Communication corresponding Excel sheet.
[+] Troubleshooting
[+] Additional Information
Bus State Excel Sheet Creation
Bus Load
It is recommended to start with an existing FreeCAN Excel sheet and adapt it to your needs.
Baudrate State If you want to build your own Excel sheet, you have to do this:
Firmware Version 1) Create a new Excel file (*.xls) in the folder "/Project files" of your project
Firmware Status 2) Fill row 1 with at least this data:
Receive List Count   A: Tag Name (eg: mytag)
Read Variable   C: CAN header ID (eg: 0x181)
  E: CAN Channel (eg: 1)
Read Variable With Timeo…
  O..BZ: active bits (eg: O=8,P=7,Q=6,R=5,S=4,T=3,U=2,V=1)
Read J1939 Pgn 3) Use a new row for every new tag and fill the columns as needed to get correct tag
Read DM1 Message functionality
Write Full Telegram 4) Save file (*.xls)
Write Telegram Cyclic 5) Save file as *.csv (MS-DOS format)
Detect J1939 Station Now the exported csv file can be imported by the drivers import module.
Examples
Restrictions:
J1939 Example
  - Do not use returns (enter) or carriage return (CR) or linefeed (LF) in the datafields.
NMEA2000 Example   - Do not use special characters (use characters from English character set only).
Extending The Can Receive …   - Tag names must be unique and not longer than 80 characters. Do not use spaces.
Start And Stop Of Cyclic Wr…
Rtr Telegrams Send And Re…

Excel Sheet Structure


This chapter describes the tag (=variable) data structure in the Excel sheet.
Each line is a variable.
Each column is a special kind of information of a variable.

Column Name Description


Name of the variable. Must be less than 80 characters, no
A Tag Name Space " " or special characters may be used. Adding a tag type
(eg".WORD") will determine the tag type.
B Comment Add additional comments here
CAN telegram Header ID (0...0x1FFFFFFF). The CAN telegram
header, right aligned. It is Extended (29 bits) or Standard (11
CAN
bits). Values > 0x7FF will cause an extended header telegram.
C Identifier/Variable
Setting the format with 8 hexadecimal characters will force
number
an extended telegram: 0x00000001 will send ID 1 as an
extended telegram.
Reserved for protocol data. Leave this column empty. This
D   guarantees that in future when this feature is used your
current Excel sheet is still compatible.
Specify CAN channel 1 or 2. Nothing, 0, 1 will use CAN
channel 1; 2 will use CAN channel 2.
E CAN Channel Adding values n*16 will limit the writing data bytes. 17 (11
hex) will send 1 data byte on channel 1. 66 (42 hex) will send

9 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

4 data bytes on channel 2. 1 will send 8 databyte on channel


1.
Nothing or 0: no cyclic telegram send
A value greater than 0: sends the telegram cyclic in (value
*10 ms) time distances.
F Send Cycle [ms]
Cyclic send will start on the first write of a variable with the
specified CAN Identifier. The data value will be the last
FreeCAN built-in written value.
Timeout 0...65530 ms, rounded by 10.
Introduction Nothing or 0: no timeout detection of this tag
Release Notes A value greater than 0: the tag will be checked for this
Disclaimer timeout value.
Limitations G Timeout [ms] ILXn.VALID is created on import only if timeout > 0 and will
Firmware Update return the result of the time compare: TRUE: this CAN
[+] Connecting To The Can Network telegram was received within timeout time;
FALSE: this CAN telegram was NOT received within timeout
[+] Settings
time.
[+] Addressing
Nothing or "J1939" or "J1939P".
[+] Import Module
"J1939" will cause a preset data value of all bits=1.
Efficient Communication "J1939P" will cause a preset data value of all bits=1 and a
[+] Troubleshooting H Protocol
search for a PGN (column C) without priority or station in the
[+] Additional Information receive list (this is used for finding J1939 values from
Bus State unknown stations)
Bus Load This value is copied to gain (multiplier) in the designer Tags
K Gain
Baudrate State folder.
Firmware Version This value is copied to offset (addition) in the designer Tags
L Offset
Firmware Status folder.
Receive List Count O - BZ Data mask Data Mask definition (see next chapter)
Read Variable This reserved columns are for extensions in future. Let them
Read Variable With Timeo… CA - CI Reserved
empty.
Read J1939 Pgn The sorting of the tags on import can be defined. Give first
Read DM1 Message tags a "1" and count all tags to be sorted, e.g. "2","3",...
Write Full Telegram Unmarked tags are added at the end. This function is
Write Telegram Cyclic CJ Tag priority important to build read tag groups, e.g. all read tags on one
Detect J1939 Station project page. This will fasten up the communication between
driver and CAN firmware. If it is not used, the tags are copied
Examples
in the same order as in the Excel sheet.
J1939 Example
Any entry different from an empty string checks the "Always
NMEA2000 Example
CK Always active active" in the designer Tags folder. This enables that tags are
Extending The Can Receive … read cyclic, even if they are not used on a screen.
Start And Stop Of Cyclic Wr…
If the string is within "PollGroup1" to "PollGroup5" then this
Rtr Telegrams Send And Re… CL Poll Group
name will be set in the Poll Group of the designer Tags folder.

• Note: the *.VALID tag is created for every tag with Timeout defined. The return value is
always true when a packet with the CAN ID of the tag was received within timeout. This
could have happened because another tag with same CAN ID has changed.
In detail this means that the *.VALID tag is showing the timeout of received CAN IDs. If
several tags use the same CAN ID it is not needed to use more than one *.VALID tag.
The second effect to notice is that this *.VALID tag does not show the change of tag values
it shows only that data was received independent on the content.
• Do not insert columns in the Excel Sheet else the import will not detect the predefined
columns.
If you want to add columns, do this starting from column CM. This columns are ignored at
the import.
• Remember not to use special characters or line feed.
• For a basic functionality this columns must be filled with values:
A (Tag Name), C (CAN Identifier), E (CAN Channel) and O-BZ (Data Mask).
All other columns are optional. If they are not specified then default values are used.
• The cyclic write starts after a value is written to it, then it runs cyclic. For an automatic
start in the project write a "script.init" function and write a value to the tag by e.g.
"Globals.Tags.MyTag.setAnalog(startvalue)"
• Adding a tag type (e.g. ".WORD") to the Tag Name (column A) will set the imported tag
type.
Valid types are:
".Bool" will set the tag type BOOL (1 bit)
".Byte" will set the tag type INT16 (signed 16 bits)
".Word" will set the tag type INT16 (signed 16 bits)
".UWord" will set the tag type UINT16 (unsigned 16 bits)
".DWord" will set the tag type INT32 (signed 32 bits)
".UDWord" will set the tag type UINT32 (unsigned 32 bits)
".Real" or ".Float" will set the tag type Float (unsigned 32 bits)
".String" will set the tag type String<4> (4 characters)
"" (empty string) will load the default type UINT32 (unsigned 32 bits)

Data Mask Definition

10 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

FreeCAN built-in
Introduction
Release Notes
Disclaimer Column Name Description
Limitations O - BZ Byte0 Bit7 - Byte7 Bit0
Firmware Update
[+] Connecting To The Can Network
[+] Settings Here you can define the mapping of tag value bits to the CAN data bits.
[+] Addressing The 64 data bits of a CAN telegram can be freely mixed to bit, byte, word and double word
variables.
[+] Import Module
The bits in the Excel sheet are defined from left (MSB,Byte0,Bit7) to right (LSB Byte 7, Bit0). This
Efficient Communication is gathered in a mask, which is given to the driver as tag value.
[+] Troubleshooting Define the position of a bit tag by a 1 in one of the Data Mask columns. Define the position of a
[+] Additional Information byte tag by the numbers 1..8 in eight of the Data Mask columns. Define the position of a word
Bus State tag by the numbers 1..16 in sixteen of the Data Mask columns. Define the position of a double
Bus Load word tag by the numbers 1..32 in thirty two of the Data Mask columns. The number 1 is always
the least significant bit (LSB) in the tag.
Baudrate State
The zero (0) or an empty string makes the position unused, the data is not copied.
Firmware Version
Firmware Status On a write the unused data bit information is taken from the last received CAN telegram.
Receive List Count
Read Variable Beside this direct definition of the bit positions it is possible to force bits to be written as 0 or 1.
Read Variable With Timeo… This is done by writing 100 to force a bit to "0" and by 101 to force a bit to "1". (The values 0 and
Read J1939 Pgn 1 are already reserved as unused bit and first bit of a variable.) With this preset bits a
predefined write telegram can be built.
Read DM1 Message
The forced bits will not be shown in the tags on a read. To see them in the tag read, use
Write Full Telegram "PROT17" in column H (Protocol).
Write Telegram Cyclic
Detect J1939 Station In the following examples the data bytes are always shown in hexadecimal notation.
Examples
J1939 Example Examples
NMEA2000 Example
J1939 example
Extending The Can Receive …
Start And Stop Of Cyclic Wr… NMEA2000 example
Rtr Telegrams Send And Re…
Hint: Extending the CAN receive filter

Hint: Start and stop of cyclic writing

Hint: RTR telegrams send and receive

Taglist Usage
The import of the Excel sheet into the designer creates the file taglist.lst. This taglist is a driver
specific reference file, connecting the driver tag names to the CAN bus data. At the download of
a project this list is automatically stored on the panel.

Make sure, that your Excel/CSV file is in the subdirectory "/Project Files" of your project and
that you have validated your project before the download. The new created file taglist.lst is
stored in the "/Project file" folder too!

Efficient Communication
The tags in the CAN controller should be consecutive. This means e.g. when 4 ILD tags are used
that they have the numbers ILD12, ILD13, ILD14 and ILD15. An example of tags that will cause
poor performance is ILD3, ILD12, ILD20 and ILD65.

Another possibility for optimization is the use of consecutive tags in the same screen of an
project. This is useful because tags are updated dependant on the screens.

Troubleshooting

11 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

Error Messages
The table shows some error messages from the controller which are created by the driver.

Error message Description and steps to solution


Communication from driver to firmware fails totally.
FreeCAN built-in You do have a communication problem from driver to the CAN firmware.
- After a taglist or firmware update: Restart panel (power off).
Introduction - Check driver and firmware version.
Release Notes Comm err station - Does your Excel file and project fit? The Excel file MUST be placed in the
X project folder "/Project Files"!
Disclaimer
- Does your taglist and driver project fit? Validate project, transfer it and
Limitations restart panel.
Firmware Update - Do you use one or more USB sticks in the panel? They may need too much
[+] Connecting To The Can Network power. Unplug them and restart.
[+] Settings Trying to access an illegal or non-existing address/tag.
[+] Addressing - You may have called an unknown tag. Does your taglist and driver project
[+] Import Module fit? Validate project, transfer it and restart panel.
Efficient Communication - Check the length of the read data, especially the length of strings must
Bad Reply station
[+] Troubleshooting fit to the tag definition.
X
- Check if driver and firmware fit together and are latest version.
[+] Additional Information
- Check CAN connection and termination. Check if CAN channel is switched
Bus State on.
Bus Load - Check the tag addresses used in the project.
Baudrate State Updating
Firmware Version Restart the panel. After that the update is starting again.
firmware failed
Firmware Status
Receive List Count X is the station address.
Read Variable
Note:
Read Variable With Timeo… Not all access errors are displayed. If a tag was not received, it returns a 0 by default, check
Read J1939 Pgn tag.VALID to find out if the value is valid or the CAN telegram was send at all.
Read DM1 Message
Write Full Telegram Note:
Write Telegram Cyclic Sending and receiving CAN messages is not only handled by the driver. There is a part running in
the operating system too. So please ensure that you always have the latest operating system
Detect J1939 Station
image in use on the panel.
Examples
J1939 Example
NMEA2000 Example
Extending The Can Receive …
Start And Stop Of Cyclic Wr… Errors On Import
Rtr Telegrams Send And Re…
• Make sure, that your imported CSV file is freshly saved from the Excel sheet.
• Check if Excel and CSV and taglist files are in project sub folder "/Project Files".

Please check in the Excel sheet:

• Did you use any CR/LF (carriage return = new line) in the list?
This will destroy the CSV information. Delete all CR/LF.
• Check your CSV file after saving. The second line must be a legal tag!
• Did you use special characters like äöü? Delete them.
• Is your taglist.lst file marked as read-only?
Remove the read-only property.
• Did you use space " " in the name (column A)? A space will end the name input, do not use
it in a tag name.

For some kind of trouble it is useful to know the CAN telegrams on the CAN bus. The CAN
firmware allows to log the CAN telegrams. This feature can be used in cooperation with our
support team. Another possibility is the use of a third party CAN analyzer.

Additional Information

12 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

Bus State

CAN bus state - Sn


This signal reads the CAN bus activity one time per second.
Syntax: Sn where n is the CAN channel 1 or 2.
FreeCAN built-in Return: 0, if CAN Bus is off
            1, if CAN Bus is working.
Introduction
Release Notes Example: S1
Disclaimer
Limitations
Firmware Update
[+] Connecting To The Can Network Bus Load
[+] Settings
[+] Addressing
[+] Import Module
Bus load – BL1, BL2 and BLM
Efficient Communication BL1 and BL2: The bus load (in percent) can be read for CAN channel 1 and CAN channel 2. It is
[+] Troubleshooting the density of received and sent telegrams divided by the maximum possible telegram density.
[+] Additional Information This value is only a rough evaluation. Do not run a CAN channel over 60 % else some messages
Bus State with low priority will have a longer delay. A good value is maximum 30 %.
Bus Load Return: 0..100 (%)
Baudrate State
BLM: The CAN firmware internal load. The CAN firmware collects the CAN telegrams and puts
Firmware Version them into a receive list. The bigger this list the longer it takes to find a defined telegram. BLM
Firmware Status gives a percentage of the input delay. A percentage over 50 % will lead to message loss.
Receive List Count Return: 0..100 (%)
Read Variable
Read Variable With Timeo…
Read J1939 Pgn
Read DM1 Message
Write Full Telegram Baudrate State
Write Telegram Cyclic
Detect J1939 Station
Examples Baudrate state – BL3 and BL4
J1939 Example BL3: This signal returns the result of the autobaud detection
NMEA2000 Example Return: 2-100 (in 10 kBaud units). Example: 25 is 250 kBaud
Extending The Can Receive …
Start And Stop Of Cyclic Wr… BL4: This signal returns the result of the autobaud detection as index
Rtr Telegrams Send And Re… Return: 1..8 with 1=1 MBaud, 2=750 kBaud, 3=500 kBaud, 4=250 kBaud, 5=125 kBaud, 6=100
kBaud, 7=20 kBaud

Firmware Version

Firmware version - HV
Returns the firmware version as a 32 bit value.
Every byte corresponds to a part of the version number.

Example: The value 0x01042014 corresponds to firmware version 1.4.32.20.

Firmware Status

Firmware status - YS
Gives back a list of important CAN firmware state information in an ASCII string. This can be used
for debugging. Please do not use it in fast projects, as the read takes time resources.
The read can be shorted by adding 2 numbers: YSm,n.
m is start number, n is end number.

Example: YS0,5 will read FW to BL4.

The list of information is:

No Return name Full name Example Comment


0 FW Firmware Version FW1.4.32.20 Version 1.4.32.20
1 CAN2-1 CAN state 2-1 CAN2-1:10 CAN 2 is active, CAN 1 is inactive
2 BL1 Busload1 BL1:5 busload 5 %
3 BL2 Busload2 BL2:0 Busload 0 %

13 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

4 BL3 Busload3 BL3:0 reserved


5 BL4 Busload4 BL4:0 reserved
6 BLM Busload Firmware BLM:1 Internal load 1 %
7 LP Receive Listen pointer LP:21 21 telegrams in list
8 LR Receive List checked LR:21 21 telegrams counted
FreeCAN built-in 9 RL Reference list RL:45 45 tags for read prepared
10 SL Sendlist SL:2 2 telegrams in send list
Introduction 11 RC Reset counter RC:1 Firmware start counter
Release Notes
Disclaimer Remarks:
Limitations
• The Data Type in the controllers column of the tag in the designer for YS must be set to
Firmware Update
e.g. STRING<199>. It is important that the size of the string is long enough to store all
[+] Connecting To The Can Network characters and that it is smaller than 200.
[+] Settings • A “FC “ in front of the full string shows that this is the FreeCAN driver.
[+] Addressing • LP and LR should be the same number, otherwise your receive list is corrupted or you got
[+] Import Module CAN telegrams with Header ID "0".
Efficient Communication • RC should be 1, otherwise you have software restarts.
[+] Troubleshooting • CAN2-1 is built like this: CAN2*10+CAN1. CANx=0: bus inactive, CANx=1: bus runs.
[+] Additional Information
Bus State
Bus Load
Baudrate State
Firmware Version
Receive List Count
Firmware Status
Receive List Count Read receive list count - HRL
Read Variable
Read Variable With Timeo… Returns the filling level of the receive list. The list can hold up to 3500 different telegrams. Each
different CAN ID holds a receive place. Also a different CAN channel leads to a different receive
Read J1939 Pgn
place. For every CAN ID only the youngest data is kept. If more than 3500 IDs are received, then
Read DM1 Message the oldest values will be overwritten.
Write Full Telegram Writing a value to HRL clears the receive list. Same happens at a power up or reset.
Write Telegram Cyclic
Detect J1939 Station
Examples
J1939 Example
NMEA2000 Example
Read Variable
Extending The Can Receive …
Start And Stop Of Cyclic Wr… Read variable - RR
Rtr Telegrams Send And Re…
The data content of a CAN telegram can be read/written. You must pass the CAN ID, channel and
datamask.
Syntax: RR CID [Kc] Mm:n

The CID (CAN telegram ID) has a maximum of 29 bits for extended telegrams (default) and a
maximum of 11 bit for standard telegrams. In every case 32 bit values have to be written in
hexadecimal notation.
To force a standard 11 bit telegram, the value must be smaller than 800 (hex) and you must set
the highest bit of the 32 bit value.

Examples:
- 00001234 is CAN ID header 00001234 (hex) extended
- 80000234 is CAN ID header 00000234 (hex) standard

K describes: channel + format + (datacount*10 (hex)) (in hex notation).


The range of c is 0..8C (hex) (not all values are valid).
For CAN channel 1..4 use the values 1..4. If value 0 is used then the CAN channel 1 is used by
default.
Add 8 for Intel format (L, H), add 0 for Motorola format (H, L).
The datacount is used for write commands only. The range is 0..8. 0=8 data bytes (default), 1=1
data bytes and so on until 8=8 data bytes.

Examples:
K0 (or nothing) is channel 1, Motorola format and 8 bytes to read or write.
K3A is CAN channel 2, Intel format and 3 bytes to read or write.

M describes the position (m) and length (n) of the data mask (in hex notation).
m is the position of the mask in the 64 data bits. 0 is the most left bit, 3F is the most right bit.
n is the length in the mask 1-20 (hex), so it is 1 to 32 bits (double word).

Examples:
M0:8 is the most left data byte:                  FF,xx,xx,xx,xx,xx,xx,xx
M8:1 is the second data byte, highest bit:   xx,8x,xx,xx,xx,xx,xx,xx
M3F:1 is the most right byte, lowest bit:     xx,xx,xx,xx,xx,xx,xx,x1

Return: value or 0 (if CAN ID is not found in the list)

Write:
Data will be shifted most right in the mask.
As values in the designer can only be double words (32 bit), the maximum data length is 32 (=20

14 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

hex) bits.
So writing “1” to M0:20 will set data: 00,00,00,01,xx,xx,xx,xx.
All other data in the telegram (shown as xx) are left unchanged.

Example for a full read command:


RR00001234K19M0:8 reads the most left byte from the telegram with CAN ID 00001234 (hex) on
channel 1 in Intel format (the format can be ignored because it is only one byte).
FreeCAN built-in
Introduction
Release Notes Read Variable With Timeout
Disclaimer
Limitations
Firmware Update Read variable with timeout - RT
[+] Connecting To The Can Network
The age of a CAN telegram can be compared.
[+] Settings The CAN ID, channel and timeout value in sec must be passed to the command.
[+] Addressing Syntax: RT CID [Kc] Tn
[+] Import Module Return: 1 (within timeout) or 0 (timeout)
Efficient Communication
The CID (CAN telegram ID) has a maximum of 29 bits for extended telegrams (default) and a
[+] Troubleshooting
maximum of 11 bit for standard telegrams. In every case 32 bit values have to be written in
[+] Additional Information hexadecimal notation.
Bus State To force a standard 11 bit telegram, the value must be smaller than 800 (hex) and you must set
Bus Load the highest bit of the 32 bit value.
Baudrate State
Firmware Version c is the CAN channel. Use the values 1..4 for CAN channel 1..4. If c=0 then the CAN channel 1 is
used by default.
Firmware Status
Receive List Count n is the time in milliseconds (decimal), rounded by 10. The range is 0..65530.
Read Variable If n=0 then the receive of the telegram will be compared without timeout: if this ID is found in
Read Variable With Timeo… the receive list then it returns a 1, else 0.
Read J1939 Pgn
Example:
Read DM1 Message RT18FEE000K0T5000 searches the receive list for a telegram with ID 18FEE000 (hex) on channel 1
Write Full Telegram and compares the receive time. If this telegram was received within 5 seconds then this
Write Telegram Cyclic command will return a 1, else 0.
Detect J1939 Station
Examples
J1939 Example
NMEA2000 Example
Read J1939 Pgn
Extending The Can Receive …
Start And Stop Of Cyclic Wr…
Rtr Telegrams Send And Re… Read J1939 PGN - RJ
The data content of a J1939 telegram with PGN (Parameter Group Number) can be read/written.
The receive list is searched for this PGN, regardless of the station or priority. The first found CAN
ID is taken. So you must pass the PGN, channel and data mask.
Syntax: RJ PGN [Kc] Mm:n
Return: value or 0 (if CAN ID is not found in list)

The range of the PGN is 0-FFFF (maximum 16 bits, in hex notation).


The PGN in J1939 are the bits 8-23 in the telegram header.

K describes: channel + (datacount * 10 (hex)) (in hex notation)


For CAN channel 1..4 use the values 1..4. If value 0 is used then the CAN channel 1 is used by
default.
The Intel format (L, H) is always used for the data bytes.
Datacount is 0..8. 0=8 data bytes (default), 1=1 data bytes and so on until 8=8 data bytes.
So the range of c is 0..84 (hex).

M describes the position (m) and length (n) of the data mask (in hex notation)
m is the position of the mask in the 64 data bits. 0 is the most left bit, 3F is the most right bit.
n is the length in the mask 1-20 (hex), so it is 1 to 32 bits (double word).

Read DM1 Message

Read DM1 Message - DM1


The data of a J1939 DM1 (Diagnostic Message 1) telegram can be read. Each DM1 message
contains two bytes of lamp status and zero or more DTCs (Diagnostic Trouble Codes) with 4 bytes
each. A DTC includes 19 bits for the SPN (Suspect Parameter Number), 5 bits for FMI (Failure
Mode Identifier), 1 bit for SPN Conversion Method and 7 bits for Occurrence Count.

Syntax: DM1[n]Kc
The range of n is 0..22 (decimal). For details see the table below.
The K parameter is optional. It specifies the channel. c has the range 1..2. If the K parameter is
missing then channel 1 used.

15 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

Example:

DM1[0] The number of valid bytes of the DM1 message received on interface CAN 1.
DM1[14]K1 Least significant 16 bits of the SPN of DTC 7 received on interface CAN 1.
DM1[22]K2 The source address of the DM1 message received on interface CAN 2.

FreeCAN built-in
Note:
Introduction This implementation can read DM1 messages with up to 10 DTCs included. Longer DM1 messages
Release Notes are ignored.
Disclaimer
Note:
Limitations Messages with more than 8 data bytes: only broadcast messages with PDU (Protocol Data Unit)
Firmware Update specific field set to global destination address (0xFF) are accepted.
[+] Connecting To The Can Network
[+] Settings Note:
[+] Addressing It is needed to include all parts DM1[0] to DM1[22] into the iX project.
This can be done by putting them all to the same page or by selecting "Always Active" in the tag
[+] Import Module
editor. The command DM1[0] should always be used to detect the correct number of valid bytes.
Efficient Communication The scripting can be used to extract parts of interest from a DM1 message and to put it to
[+] Troubleshooting another tag (e.g. DTC1_SPN or DTC1_FMI).
[+] Additional Information
Bus State
Bus Load
Baudrate State DM1 - Diagnostic Message 1
Firmware Version
Firmware Status Command Function Format
Receive List Count Number of valid data bytes in the DM1 message.
Read Variable Every of the following entries returns two data bytes.
Read Variable With Timeo… Example:
DM1[0] UINT16
If the number of valid bytes is 10 then the data can be read from the
Read J1939 Pgn
elements DM1[1] to DM1[5].
Read DM1 Message All following bytes are invalid.
Write Full Telegram
Lamp status
Write Telegram Cyclic Bit 1,0: Protect Lamp Status
Detect J1939 Station Bit 3,2: Amber Warning Lamp Status
Examples Bit 5,4: Red Stop Lamp Status
J1939 Example DM1[1] Bit 7,6: Malfunction Indicator Lamp UINT16
NMEA2000 Example Bit 9,8: Flash Protect Lamp
Bit 11,10: Flash Amber Warning Lamp
Extending The Can Receive …
Bit 13,12: Flash Red Stop Lamp
Start And Stop Of Cyclic Wr… Bit 15,14: Flash Malfunction Indicator Lamp
Rtr Telegrams Send And Re…
1st DTC
DM1[2] UINT16
Bit 15..0: Least significant 16 bits of the SPN
1st DTC
Bit 4..0: FMI
DM1[3] Bit 7..5: Most significant 3 bits of the SPN UINT16
Bit 14..8: Occurrence Count
Bit 15: SPN Conversion Method
2nd DTC
DM1[4] UINT16
Bit 15..0: Least significant 16 bits of the SPN
2nd DTC
Bit 4..0: FMI
DM1[5] Bit 7..5: Most significant 3 bits of the SPN UINT16
Bit 14..8: Occurrence Count
Bit 15: SPN Conversion Method
3rd DTC
DM1[6] UINT16
Bit 15..0: Least significant 16 bits of the SPN
3rd DTC
Bit 4..0: FMI
DM1[7] Bit 7..5: Most significant 3 bits of the SPN UINT16
Bit 14..8: Occurrence Count
Bit 15: SPN Conversion Method
4th DTC
DM1[8] UINT16
Bit 15..0: Least significant 16 bits of the SPN
4th DTC
Bit 4..0: FMI
DM1[9] Bit 7..5: Most significant 3 bits of the SPN UINT16
Bit 14..8: Occurrence Count
Bit 15: SPN Conversion Method
5th DTC
DM1[10] UINT16
Bit 15..0: Least significant 16 bits of the SPN
5th DTC
Bit 4..0: FMI
DM1[11] Bit 7..5: Most significant 3 bits of the SPN UINT16
Bit 14..8: Occurrence Count
Bit 15: SPN Conversion Method

16 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

6th DTC
DM1[12] UINT16
Bit 15..0: Least significant 16 bits of the SPN
6th DTC
Bit 4..0: FMI
DM1[13] Bit 7..5: Most significant 3 bits of the SPN UINT16
Bit 14..8: Occurrence Count
Bit 15: SPN Conversion Method
FreeCAN built-in
7th DTC
DM1[14] UINT16
Introduction Bit 15..0: Least significant 16 bits of the SPN
Release Notes 7th DTC
Disclaimer Bit 4..0: FMI
DM1[15] Bit 7..5: Most significant 3 bits of the SPN UINT16
Limitations
Bit 14..8: Occurrence Count
Firmware Update Bit 15: SPN Conversion Method
[+] Connecting To The Can Network
8th DTC
[+] Settings DM1[16] UINT16
Bit 15..0: Least significant 16 bits of the SPN
[+] Addressing
8th DTC
[+] Import Module Bit 4..0: FMI
Efficient Communication DM1[17] Bit 7..5: Most significant 3 bits of the SPN UINT16
[+] Troubleshooting Bit 14..8: Occurrence Count
[+] Additional Information Bit 15: SPN Conversion Method
Bus State 9th DTC
DM1[18] UINT16
Bus Load Bit 15..0: Least significant 16 bits of the SPN
Baudrate State 9th DTC
Firmware Version Bit 4..0: FMI
Firmware Status DM1[19] Bit 7..5: Most significant 3 bits of the SPN UINT16
Receive List Count Bit 14..8: Occurrence Count
Bit 15: SPN Conversion Method
Read Variable
Read Variable With Timeo… 10th DTC
DM1[20] UINT16
Bit 15..0: Least significant 16 bits of the SPN
Read J1939 Pgn
Read DM1 Message 10th DTC
Bit 4..0: FMI
Write Full Telegram
DM1[21] Bit 7..5: Most significant 3 bits of the SPN UINT16
Write Telegram Cyclic Bit 14..8: Occurrence Count
Detect J1939 Station Bit 15: SPN Conversion Method
Examples Source Address
J1939 Example DM1[22] This is the address of the sender of the DM1 message. UINT16
NMEA2000 Example This information can be used to ignore messages from certain sources.
Extending The Can Receive …
Start And Stop Of Cyclic Wr…
Rtr Telegrams Send And Re…
Write Full Telegram

Write full telegram – HRA, HRB


As the highest tag width in the designer is 32 bits, a full telegram with 8 data bytes must be
written in 2 commands.
HRA hold the left 4 data bytes, HRB holds the right 4 data bytes and sends the telegram.

So you must pass the CAN ID and channel.


Syntax: HRx CID [Kc]
Returns: the sent value

x is A or B.

The CID (CAN telegram ID) has a maximum of 29 bits for extended telegrams (default) and a
maximum of 11 bit for standard telegrams. In every case 32 bit values have to be written in
hexadecimal notation.
To force a standard 11 bit telegram, the value must be smaller than 800 (hex) and you must set
the highest bit of the 32 bit value.

K describes: channel + (datacount * 10 (hex)) (in hex notation)


The range of c is 1..72 (hex) (not all values are valid).
For CAN channel 1..2 use the values 1..2.
Datacount is 0..7. 0=8 data bytes, 7=7 data bytes, 6=6 data bytes and so on.

Example:
HRA18FEE000K1=11223344 and
HRB18FEE000K1=55667788
sends telegram on CAN1, ID 18FEE000 (hex): 1122334455667788 (hex)

Hint:
Force standard header (11 bit) by setting highest CAN ID bit.
CAN ID: Highest bit=0 -> extended header is send, e.g. 12345678 (hex)
CAN ID: Highest bit=1 -> standard header is send, e.g. 80000723 (hex)

Hint:
Send less than 8 data bytes: adding datacount to channel high nipple
HRB18FEE000K1 send 8 databytes

17 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

HRB18FEE000K41 send 4 databytes on channel 1


HRB18FEE000K72 send 7 databytes on channel 2

Write Telegram Cyclic


FreeCAN built-in
Introduction
Write telegram cyclic – RZ
Release Notes Sends a telegram cyclic. You must pass the CAN telegram ID (CID) and channel.
Disclaimer The value written to the RZ variable in hexadecimal notation specifies the cycle time in 10 ms
Limitations units. The value which is written cyclic to the CAN bus is specified by the last written telegram
Firmware Update with the specified CID. Therefore a telegram with this CID must be in the receive list or has to be
[+] Connecting To The Can Network sent first.
Syntax: RZ CID [Kc]
[+] Settings
Returns: the cyclic value in 10 ms units in hexadecimal notation
[+] Addressing
[+] Import Module The CID has a maximum of 29 bits for extended telegrams (default) and a maximum of 11 bit for
Efficient Communication standard telegrams. In every case 32 bit values have to be written in hexadecimal notation.
[+] Troubleshooting To force a standard 11 bit telegram, the value must be smaller than 800 (hex) and you must set
the highest bit of the 32 bit value.
[+] Additional Information
Bus State K specifies the channel. c=1 uses channel 1 and c=2 uses channel 2.
Bus Load
Baudrate State Example:
Firmware Version RZ18FEE000K1=100 (=256 decimal) sends telegram with CID 18FEE000 (hex) every 2,56 seconds
on channel 1.
Firmware Status
Receive List Count Hint:
Read Variable The cyclic write starts after a value with the specified CID is written, then it runs cyclic. For an
Read Variable With Timeo… automatic start in the project write a “script.init” function and write a value to the tag. For
Read J1939 Pgn example for the tag MyInput use “Globals.Tags.MyInput.setAnalog(0)”.
Read DM1 Message
Hint:
Write Full Telegram
The cycle time is only accepted when a telegram with the specified CID is already written. In the
Write Telegram Cyclic other case the value is ignored and 0 is returned.
Detect J1939 Station
Examples Hint:
J1939 Example The cyclic writing stops when the cycle time 0 is written to the RZ command.
NMEA2000 Example
Extending The Can Receive …
Start And Stop Of Cyclic Wr…
Rtr Telegrams Send And Re…
Detect J1939 Station

Detect J1939 station - HLI


Detect a J1939 device (ECU (=Electronic Control Unit))
Syntax: HLI m , n
m is the station address 0-ff (hex)
n is the timeout in sec 0-ff (hex)
Return: 1 (station detected within timeout time) or 0 (timeout)

Examples: HLI2,0 checks if J1939 ECU with address 2 exists.


HLI4,5 checks if J1939 ECU 4 did send a telegram within the last 5 seconds.

In J1939 telegrams the transmitting station is kept in the low 8 bits of the CAN ID header.
So HLI searches all received telegrams for this station number and returns if it was received
within the last n seconds. If n=0, then the total receive from this station is quoted that means it
returns 1 if a telegram with this station address was ever received.

Examples
"Tag1", Data definition: Byte 0, Bit 7, other bits unused.
CAN telegram data = 80,00,00,00,00,00,00,00 -> tag value = 1
CAN telegram data = 00,00,00,00,00,00,00,00 -> tag value = 0

"Tag2", Data definition: Byte 0, Bit 1; Byte 0, Bit 0, other bits unused.
CAN telegram data = 0F,00,00,00,00,00,00,00 -> tag value = 3
CAN telegram data = 0E,00,00,00,00,00,00,00 -> tag value = 2
CAN telegram data = F1,00,00,00,00,00,00,00 -> tag value = 1
CAN telegram data = FC,00,00,00,00,00,00,00 -> tag value = 0

Write value = 3 to "Tag2"


Before: CAN telegram data = FC,00,00,00,00,00,00,01

18 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

After:   CAN telegram data = FF,00,00,00,00,00,00,01

J1939 Example
FreeCAN built-in Example for J1939, PGN F004 (hex), SPN 190 engine speed:

Introduction
Release Notes
Disclaimer
Limitations
Firmware Update
[+] Connecting To The Can Network
[+] Settings
[+] Addressing
[+] Import Module
CAN telegram data = FF,FF,FF,23,45,FF,FF,FF -> Value = 4523 (hex)
Efficient Communication This value should be multiplied by 0.125 in column K (gain) to get the correct speed in rpm.
[+] Troubleshooting The resulting value is 2212.375 rpm.
[+] Additional Information
Bus State
Bus Load
Baudrate State
Firmware Version
NMEA2000 Example
Firmware Status Example for NMEA2000, PGN F20E (hex), switch control for Bit 0, 1 of Byte 1:
Receive List Count
Read Variable Script for a write command on a Button1_Click() in the designer:
Read Variable With Timeo…
void Button1_Click(System.Object sender, System.EventArgs e)
Read J1939 Pgn
{
Read DM1 Message    Globals.Tags.data_byte1_bit01.SetAnalog(0x01);
Write Full Telegram }
Write Telegram Cyclic
Detect J1939 Station
Examples
J1939 Example
On a write caused by Button1_Click() the bits at position 1 and 2 are written, all leading bits will
NMEA2000 Example be = 0, all other bits will be taken from the last telegram (or = 0 at start). Button1_Click will
Extending The Can Receive … write 00,01,XX,XX,XX,XX,XX,XX on CAN ID 0x19F20E00.
Start And Stop Of Cyclic Wr…
Rtr Telegrams Send And Re…

Extending The Can Receive Filter


By default the CAN telegrams are seperated by the CAN ID header. This means that a new
telegram with the same CAN ID header will overwrite the last received data bytes.
In some cases it is necessary to separate CAN telegrams not only by the CAN ID header but in
addition by some data bytes (this feature is supported since firmware V25). That means that
some bits of the data bytes are used to differ between these telegrams. In the Excel sheet this
bits must be marked with 200 (bit=0) or 201 (bit=1) so the driver knows at runtime which bits
have to be used as an extension of the CAN ID. (The values 0 and 1 are already reserved as
unused bit and first bit of a variable.) In addition PROT14 must be written to the Protocol column
H to switch to this mode.
Note: Bits marked in the Excel sheet with 200 or 201 are read as 0 at runtime if they are part of
a data byte.
Note: Bits marked in the Excel sheet with 200 or 201 should only be used to differ between
telegrams with the same CAN ID. If they were used as data bytes at the same time this will lead
to undefined behavior.
Note: The number of supported PROT14 tags is limited to 100 (for firmware V1.0.0.5 and older)
or 150 (for firmware V1.0.0.6 and newer).

Example where Byte 0 is used to differ between the telegrams:


CAN telegram 1: ID 7f1 (hex), Byte 0 = 1, Byte 1-2 = Variable1 data
CAN telegram 2: ID 7f1 (hex), Byte 0 = 2, Byte 1-2 = Variable2 data

Definition of the CAN telegram 1 in the Excel sheet:

Definition of the CAN telegram 2 in the Excel sheet:

19 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

The definition of the CAN telegrams in the Excel sheet will lead to different tags in the designer.
The received data is passed to the correct tags.
FreeCAN built-in
Introduction
Release Notes Start And Stop Of Cyclic Writing
Disclaimer
Limitations The cyclic writing starts if a telegram with the specified CAN ID is written to a cyclic tag once. If
Firmware Update this value changes then the value which is written cyclic changes too.
A cyclic writing from the start of a project can be realized by including a write command into
[+] Connecting To The Can Network
the script of the start screen. This command can be called automatically or manually (see next
[+] Settings example).
[+] Addressing To stop cyclic writing a value followed by its inverted value must be written (for UINT16 tags).
[+] Import Module For the Data Types UINT32 and BYTE a similar formula must be used, see following example.
Efficient Communication
[+] Troubleshooting Example with 3 buttons on the start screen:
[+] Additional Information On the project start a value of 100 is written to the tag Can1 (Data Type UINT16) and the CAN
telegram is send frequently (as defined in the Excel sheet).
Bus State
Button1 stops the telegram sending.
Bus Load Button2 starts the telegram sending again.
Baudrate State
Firmware Version public partial class Screen1
Firmware Status {
Receive List Count   static bool bFirstTime=true;
  int val;
Read Variable
Read Variable With Timeo…   void Screen1_Opened(System.Object sender, System.EventArgs e)
Read J1939 Pgn   {
Read DM1 Message     if (bFirstTime == true)
Write Full Telegram    {
Write Telegram Cyclic       //Send a telegram
Detect J1939 Station       Globals.Tags.Can1.ResetTag();
      Globals.Tags.Can1.SetAnalog(100); //set start Value
Examples
      bFirstTime = false;
J1939 Example    }
NMEA2000 Example   }
Extending The Can Receive …
Start And Stop Of Cyclic Wr…   //Can1 OFF
Rtr Telegrams Send And Re…   void Button1_Click(System.Object sender, System.EventArgs e)
 {
    val=Globals.Tags.Can1.Value;
    Globals.Tags.Can1.SetAnalog(val);
    Globals.Tags.Can1.SetAnalog(val^0xFFFF); // 16 bit tag
    //Globals.Tags.Can32_1.SetAnalog((val2&0xFFFF0000) | (0xFFFF&(val2^0xFFFF))); // 32 bit
tag
    //Globals.Tags.Can8_1.SetAnalog(0xFF00 | (val3^0xFF)); // 8 bit tag
 }

  //Can1 ON
  void Button2_Click(System.Object sender, System.EventArgs e)
 {
    Globals.Tags.Can1.SetAnalog(val);
    Globals.Tags.Can1.SetAnalog(val);
 }
}

Rtr Telegrams Send And Receive


RTR telegrams are data calls from one CAN device to another.
An example is when a device reads a value from a slave module.

To define a RTR call use "PROT18" in the protocol column "H".


A RTR telegram will be produced on every driver read (driver polling time=500 ms default).
The data count (DLC) can be set in column "E" (CAN channel), e.g. 33 (21 hex) is DLC = 2 bytes on
channel 1.
The use of the timeout column "G" will create a ".valid" tag that shows if an answer is returned
by the CAN device.
If the "Send Cycle" time is set in column "F", then the RTR telegram is produced cyclic, e.g. 300
will produce a RTR call every 300 ms.

If RTR calls from another device should be answered, use "PROT19" in the protocol column "H".
At first a return value must be set in the designer project. After a write to the tag in the project
the RTR call is answered.
The ".valid" tag information is not valid in that case. The returned data byte count is depending
on the demand.

20 / 21 7.10.2022 21:44
FreeCAN bu�lt-�n f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...

Example:

RTR_300 will produce a RTR call telegramm with CAN ID=777 (hex) every 300 ms
FreeCAN built-in RTR_notime produces a RTR call telegramm with CAN ID=888 (hex) every 500 ms if the project
screen is shown.
Introduction RTR_respond answers the RTR requests on CAN ID=999 (hex).
Release Notes
Disclaimer
Limitations
Firmware Update
[+] Connecting To The Can Network
[+] Settings
[+] Addressing
[+] Import Module
Efficient Communication
[+] Troubleshooting
[+] Additional Information
Bus State
Bus Load
Baudrate State
Firmware Version
Firmware Status
Receive List Count
Read Variable
Read Variable With Timeo…
Read J1939 Pgn
Read DM1 Message
Write Full Telegram
Write Telegram Cyclic
Detect J1939 Station
Examples
J1939 Example
NMEA2000 Example
Extending The Can Receive …
Start And Stop Of Cyclic Wr…
Rtr Telegrams Send And Re…

21 / 21 7.10.2022 21:44

You might also like