FC510x - PCI Cards for CANopen

FC510x as bus monitor

From firmware version 1.00 and TwinCAT 2.8 (build 740), the FC5101 or FC5102 can also be used as CANopen monitor instead of master or slave.

For example, the second channel of the FC5102 can be used for this purpose, in which case the first channel continues to function as CANopen master or slave, or vice versa. In such a case, both channels must be connected to the same CAN network. (Data exchange within the card is not provided, since this cannot take place in a non-reactive manner).

The telegrams recorded by the FC510x are temporarily stored in a ring buffer by the task linked with the FC510x; the stored telegrams can then be accessed by ADS. Beckhoff offers a CANopen monitoring program (CANMON) with filter and trigger options as freeware (see Download section at http://www.beckhoff.com).

 

Inserting the FC510x as a CANopen Monitor

In the Append Device context menu: insert CANopen monitor

 
Inserting the FC510x as a CANopen Monitor

After this it is necessary to select the appropriate channel (PCI memory address).

 
 

Linking the FC510x with a task

The monitor data is accessed at the start of a task from real-time TwinCAT. For this purpose it is necessary to create an additional task in the System Manager, containing at least one UINT16 input variable that is to be linked to one of the variables in the FC510x. 

 
Linking the FC510x with a task

The only purpose of this linking is to make it possible for the real-time system to access the FC510x in the cycle time of the task. The cycle time of the additional task is to be set as follows, depending on the baud rate:

Baud rate
Cycle time of the additional task
1 Mbaud
<= 10 ms
800 kbaud
<= 12 ms
500 kbaud
<= 20 ms
250 kbaud
<= 40 ms
125 kbaud
<= 80 ms
100 kbaud
<= 100 ms
50 kbaud
<= 200 ms
20 kbaud
<= 500 ms
10 kbaud
<= 1000 ms

The Autostart checkbox is also to be set (see illustration above).

 
 

FCxxxx Monitor tab

 
FCxxxx Monitor tab

PCI Slot/Irq: Indicates in which logical PCI slot the card was found.

Search...: Searches for all connected FC510x channels. Select those desired. In the case of an FC5102 both channels A and B appear. These behave in logical terms like two FC5101 cards.

Hardware Configuration...: The hardware version number of the FC510x can be displayed here

Firmware: Shows the current firmware version of the FC510x.

Firmware Update...: Update the FC510x card firmware version here.

Baud rate: The CAN baud rate is set here.

Ring buffer: The size of the ring buffer is set here. The recording time for the ring buffer size that has been set when the bus is fully loaded is also given.

Autostart: If the Autostart checkbox is ticked, the monitor recording can be started when TwinCAT starts. Otherwise the monitor software must be used to start it via ADS.

 
 

Monitor Software

The monitor software fetches the trace data from the FC510x card and places it as a file in the desired mass storage. Only the DLL (TcRouterHelper.dll) is required in addition to the monitor program itself (CAN-Monitor.exe). This must be placed in the same directory as the monitor program.

After starting the monitor program, the device ID of the FC5101 channel that will be used for the monitoring must be selected.

 
CAN Monitor - calling the options

The following window opens:

 
CAN Monitor - options

Device-ID: The ID that the System Manager has assigned to the FC510x monitor channel must be entered here:

 
Entering the device ID

Storing: The size of the ring buffer memory for the screen display (Display) and for that file output (File) can be set here.

Display: A filter for the display output can be specified here.

Trigger: Trigger conditions that will stop the measurement can be specified here. It is possible, for instance, for a specific otherwise unused output to be set when an error occurs, and to trigger off this bit in the output module's RxPDO.

Post Trigger: This can be used to specify how many telegrams are still to be recorded after the trigger condition has occurred. The number of telegrams recorded prior to occurrence of the trigger condition is only restricted by the specified buffer size.

Trigger and display filters function in such a way that only those bits for which the mask is set to 1 are considered when selecting the identifier (ID) or the data bytes (Data). These bits are then checked for conformity with the values specified in Value. The default setting (mask ID = 0x7FF and mask data = 0x00) is relevant if the identifier (ID) specified in Value is to be recognized, regardless of the data. If an identifier (ID) greater than 0x7FF (e.g. 0x800, default) is entered under Value, the filter or trigger is disabled.

Example:
The measurement is to be stopped after 250 telegrams, after bit 0 in the second data byte of a telegram with identifier 0x210 equal to 1 has been found. The following entries are to be made to achieve this:

Entering 250 telegrams
 
 

Starting the Recording

TwinCAT must be started, and a variable in a cyclic task (such as the Autostart task) must be linked with the dummy variable of the FC510x in monitoring mode. The recording can now be started by clicking the green traffic light symbol.

Starting the recording

If the start-up procedure associated with another CANopen channel in the system is to be recorded, then the "Autostart" checkbox on the System Manager's FC Monitor tab is to be selected. The card can then buffer up to 25,000 CAN messages. It is then only necessary to start the recording via monitor software before the CAN card's buffer overflows.

 
 

Stopping the Recording

Click the red traffic light symbol to stop the recording. The following dialog box opens:

Stopping the recording

Two trace files are created automatically. One is an ASCII file with the ending *.mon, readable by any text editor. A file with the ending *.ASC is also created: this can be read for further processing by the CANalyzer® tool from Vector Informatik.

 
 

Trace example

The beginning of a CANopen boot up with two nodes (node ID 1 and node ID 50) is illustrated.

Number Time (100 µs) telegram
0 0.0638 ID: 000 Len: 2 Data: 82 00
1 0.0649 ID: 632 Len: 8 Data: 40 00 10 00 00 00 00 00
2 0.0653 ID: 601 Len: 8 Data: 40 00 10 00 00 00 00 00
3 2.0722 ID: 632 Len: 8 Data: 80 00 00 00 00 00 04 05
4 2.0725 ID: 601 Len: 8 Data: 80 00 00 00 00 00 04 05
5 2.2686 ID: 732 Len: 1 Data: 00
6 2.7440 ID: 701 Len: 1 Data: 00
7 4.0802 ID: 632 Len: 8 Data: 40 00 10 00 00 00 00 00
8 4.0806 ID: 601 Len: 8 Data: 40 00 10 00 00 00 00 00
9 4.0813 ID: 5b2 Len: 8 Data: 43 00 10 00 91 01 02 00
10 4.0823 ID: 632 Len: 8 Data: 40 18 10 01 00 00 00 00
11 4.0826 ID: 581 Len: 8 Data: 43 00 10 00 91 01 07 00
12 4.0835 ID: 601 Len: 8 Data: 40 18 10 01 00 00 00 00
13 4.0838 ID: 5b2 Len: 8 Data: 43 18 10 01 02 00 00 00
14 4.0848 ID: 632 Len: 8 Data: 23 00 14 01 32 02 00 00
15 4.0853 ID: 581 Len: 8 Data: 43 18 10 01 02 00 00 00
16 4.0863 ID: 601 Len: 8 Data: 23 00 18 01 81 01 00 00