guide · pdf file6 connect the cblm_bussplitter block outports to the cblm_mainblock inports....

12
CAN BusLoad Measurement Guide Version 1.3 – September 2016

Upload: trannhan

Post on 06-Feb-2018

225 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Guide · PDF file6 Connect the CBLM_BusSplitter block outports to the CBLM_MainBlock inports. 7 In the RTICANMM ControllerSetup block or in a constant block, select the baud

CAN BusLoad Measurement

Guide

Version 1.3 – September 2016

Page 2: Guide · PDF file6 Connect the CBLM_BusSplitter block outports to the CBLM_MainBlock inports. 7 In the RTICANMM ControllerSetup block or in a constant block, select the baud

How to Contact dSPACE

Mail: dSPACE GmbH

Rathenaustraße 26

33102 Paderborn

Germany

Tel.: +49 5251 1638-0

Fax: +49 5251 16198-0

E-mail: [email protected]

Web: http://www.dspace.com

How to Contact dSPACE Support for Application Tools

In case of any problems related to application tools, contact [email protected]

How to Contact dSPACE Support

To contact dSPACE if you have problems and questions, fill out the support request form provided on the website

at http://www.dspace.com/go/supportrequest.

The request form helps the support team handle your difficulties quickly and efficiently.

In urgent cases contact dSPACE via phone: +49 5251 1638-941 (General Technical Support)

Software Updates and Patches

dSPACE strongly recommends that you download and install the most recent patches for your current dSPACE

installation. Visit http://www.dspace.de/goto?support for software updates and patches.

Important Notice

This document contains proprietary information that is protected by copyright. All rights are reserved. The

document may be printed for personal or internal use provided all the proprietary markings are retained on all

printed copies. In all other cases, the document must not be copied, photocopied, reproduced, translated, or

reduced to any electronic medium or machine-readable form, in whole or in part, without the prior written consent

of dSPACE GmbH.

© 2018 by:

dSPACE GmbH

Rathenaustraße 26

33102 Paderborn

Germany

This publication and the contents hereof are subject to change without notice.

CalDesk, ConfigurationDesk, ControlDesk, MicroAutoBox, MicroLabBox, SCALEXIO, SYNECT, SystemDesk, TargetLink

and VEOS are registered trademarks of dSPACE GmbH in the United States or other countries, or both. Other brand

names or product names are trademarks or registered trademarks of their respective companies or organizations.

Page 3: Guide · PDF file6 Connect the CBLM_BusSplitter block outports to the CBLM_MainBlock inports. 7 In the RTICANMM ControllerSetup block or in a constant block, select the baud

CAN BusLoad Measurement Guide September 2016 3

Contents

Contents

About This Document ................................................................ 4

Document Symbols and Conventions .......................................................................................... 4

Introduction ................................................................................. 5

Getting Started ............................................................................ 6

How to Configure an RTI CAN MultiMessage Main Block .................................................... 6 How to Open the CAN Busload Measurement Library .......................................................... 8

User Interface .............................................................................. 9

Busload Calculation .................................................................. 10

General Limitations ................................................................... 12

Page 4: Guide · PDF file6 Connect the CBLM_BusSplitter block outports to the CBLM_MainBlock inports. 7 In the RTICANMM ControllerSetup block or in a constant block, select the baud

4 CAN BusLoad Measurement Guide September 2016

About This Document

About This Document

Document Symbols and Conventions

The following symbols may be used in this document:

Admonition Description

DANGER

Indicates a hazardous situation that, if not

avoided, will result in death or serious injury.

WARNING

Indicates a hazardous situation that, if not

avoided, could result in death or serious injury.

CAUTION

Indicates a hazardous situation that, if not

avoided, could result in minor or moderate

injury.

NOTICE

Indicates a hazard that may cause property

damage if you do not avoid it by following the

instructions given.

Note

Indicates important information that should be

kept in mind, for example, to avoid

malfunctions.

Tip

Indicates tips containing useful information to

make your work easier.

The following abbreviations and formats are used in this document:

Names enclosed in percent signs refer to environment variables for

file and path names, for example, %DSPACE_PYTHON27% is the folder containing

the Python installation.

Angle brackets contain wildcard characters or placeholders for variable file

and path names, etc.

Symbols

Naming conventions

%name%

< >

Page 5: Guide · PDF file6 Connect the CBLM_BusSplitter block outports to the CBLM_MainBlock inports. 7 In the RTICANMM ControllerSetup block or in a constant block, select the baud

CAN BusLoad Measurement Guide September 2016 5

Introduction

Introduction

The CAN Busload Measurement blockset lets you measure the actual load and

frame rate of an RTI CAN MM bus.

Note

You need MATLAB R14 or later to use the MATLAB®/Simulink® features.

Objective

Page 6: Guide · PDF file6 Connect the CBLM_BusSplitter block outports to the CBLM_MainBlock inports. 7 In the RTICANMM ControllerSetup block or in a constant block, select the baud

6 CAN BusLoad Measurement Guide September 2016

Getting Started

Getting Started

How to Configure an RTI CAN MultiMessage Main Block

To use the CAN Busload Measurement block, you must first configure a dSPACE

RTI CANMM block.

To configure an RTI CAN MultiMessage Main block.

1 Open the Capture messages page.

2 In Number of messages to capture in one sample step, specify a minimum of

10 capture messages.

3 Select the Capture messages included in TX/RX list and also FreeRawMessages

checkbox.

4 Select the Create outport for captured messages checkbox.

5 Connect the RTICANMM Main Block outport to the CBLM_BusSplitter inport.

Objective

Method

Page 7: Guide · PDF file6 Connect the CBLM_BusSplitter block outports to the CBLM_MainBlock inports. 7 In the RTICANMM ControllerSetup block or in a constant block, select the baud

CAN BusLoad Measurement Guide September 2016 7

Getting Started

6 Connect the CBLM_BusSplitter block outports to the CBLM_MainBlock inports.

7 In the RTICANMM ControllerSetup block or in a constant block, select the baud

rate.

You configured an RTI CAN MultiMessage Main block.

Result

Page 8: Guide · PDF file6 Connect the CBLM_BusSplitter block outports to the CBLM_MainBlock inports. 7 In the RTICANMM ControllerSetup block or in a constant block, select the baud

8 CAN BusLoad Measurement Guide September 2016

Getting Started

How to Open the CAN Busload Measurement Library

To work with the CAN Busload Measurement block, you must open the CAN

Busload Measurement library.

To open the CAN Busload Measurement library.

1 In the MATLAB Command Window, enter ds_cblm_lib.

Tip

Alternatively, you can open the library via the Simulink Library Browser.

You opened the CAN Busload Measurement library.

Objective

Method

Result

Page 9: Guide · PDF file6 Connect the CBLM_BusSplitter block outports to the CBLM_MainBlock inports. 7 In the RTICANMM ControllerSetup block or in a constant block, select the baud

CAN BusLoad Measurement Guide September 2016 9

User Interface

User Interface

The lCBLM_MainBlock user interface lets you specify the number of capture

messages and the frame type of CAN messages.

Lets you specify the number of capture

messages. By default it set to 10.

Lets you specify the frame type of CAN messages. By default, the

frame type is set to STD (standard). If the message identifier is less than 2^11-1,

the message is interpreted as a standard message, otherwise the message is

interpreted as an extended message.

NOTICE

1. Do not change the number of capture messages for models with a

sample time smaller than or equal to 0.001 seconds. If you are using a

model with a sample time of more than 0.001 seconds, like 0.01 seconds,

you must calculate the required number of capture messages and extend

the CBLM_BusSplitter block manually. Refer to Busload Calculation on

page 10.

Objective

Number of capture messages

Frame Type

Page 10: Guide · PDF file6 Connect the CBLM_BusSplitter block outports to the CBLM_MainBlock inports. 7 In the RTICANMM ControllerSetup block or in a constant block, select the baud

10 CAN BusLoad Measurement Guide September 2016

Busload Calculation

2. Never use less than 10 capture messages, as this can lead to incorrect

calculation results.

3. The use of buses with different signal types (standard and extended) will

lead to invalid measurement results.

Busload Calculation

To calculate the current busload for one message, you need the complete bit

length of a message. The following input parameters are relevant for the busload

calculation:

Baud rate

Message Identifier format

Message length

Message RX-Status

Message ID

Message Raw-Bytes (1-8) (Data)

To calculate the entire message bit length, you need both bit types:

Standard bits (static)

Stuff bits (dynamic)

NOTICE

You can read out the length of standard bits, as it is defined by the CAN

frame format. The length is therefore static:

47 (standard) or 67 (extended) protocol bits + data bits (8 * Message length)

You need the complete message bit array to precisely calculate the number of

stuff bits. Bit-stuffing occurs if four bits with the same value are written

consecutively:

1 1 1 1 0 0 1 1 1 1 1 1 0 0 0 1 1 – (stuff bit 0 added)

0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 0 0 – (stuff bit 1 added)

NOTICE

For stuff bit calculation, the message data is wrapped to a binary array.

After that, the array is scanned for possible stuff-bit patterns, to count the

stuff-bits.

You must calculate the complete message bit-length by adding the standard bits

and the stuff bits. To calculate the busload, you must capture all messages present

Objective

Page 11: Guide · PDF file6 Connect the CBLM_BusSplitter block outports to the CBLM_MainBlock inports. 7 In the RTICANMM ControllerSetup block or in a constant block, select the baud

CAN BusLoad Measurement Guide September 2016 11

Busload Calculation

on the bus at the same time and add the message bit-lengths. To calculate the

busload percentage, you must divide the sum of the message bit lengths by the

baud rate and then multiply the result by 100.

Page 12: Guide · PDF file6 Connect the CBLM_BusSplitter block outports to the CBLM_MainBlock inports. 7 In the RTICANMM ControllerSetup block or in a constant block, select the baud

12 CAN BusLoad Measurement Guide September 2016

General Limitations

General Limitations

The following limitations apply when working with the CAN Busload Measurement

block:

Error frames and not acknowledged frames are not measured. If a frame is

incorrect, it is not acknowledged, and an error frame is sent.

If you are using a model with a sample time of more than 0.001 seconds, you must

calculate the required number of capture messages and extend the

CBLM_BusSplitter block manually. Refer to Busload Calculation on page 10.

Objective