+86-1478258894512522120
葩星12522120 淘宝旺旺passiontechinc

pt@ptinfous.com

+86-14782588945

  加载中,请稍候...
浏览历史

 


CANOpen从站实训系统

关键词: CANOpen从站实训系统 CANOpen


简介:·1 Introduction ·2 System requirements ·3 Content of the Evaluation Kit ·4 Preparation of the ER-ST-EVAL-EVAL evaluation board ·5 Startup of the Example Application ·6 Implemented Functionality ·7 Examples ·7.1 Manipulating LEDs and Bar Graph on Color TFT Display by SDO Download ·7.2 Manipulating LEDs and Bar Graph on Color TFT Display using PDO Write Protocols ·7.3 Testing Heartbeat Pro...
品 牌 etherrt etherrt
产 地 China
型 号 PXF3306
折 扣 其他电询
咨询专家:

黄工-工业总线-工业自动化-实时仿真

黄工-工业总线-工业自动化-实时仿真 ID:2937

   机电电子工程专业硕士,机械设计制造及其自动化/计算机双学士,高级工程师

    具有丰富的从业、管理经验,曾在机电工程公司,资深设计代理公司工作。历任组织、经理等岗位,同时具有深厚的理论基础和项目项目研发经历。...

[MORE]

赵工-总线系统-嵌入式系统-工业自动化

赵工-总线系统-嵌入式系统-工业自动化 ID:2940

    机械电子工程,嵌入式系统专家,高级工程师

    嵌入式项目开发,ARM,Freescale,Infilion等系列单片机系统开发,DSP嵌入式系统开发,FPGA系统开发,项目经验丰富。


...

[MORE]

产品说明:

·       1 Introduction

·       2 System requirements

·       3 Content of the Evaluation Kit

·       4 Preparation of the ER-ST-EVAL-EVAL evaluation board

·       5 Startup of the Example Application

·       6 Implemented Functionality

·       7 Examples

·       7.1 Manipulating LEDs and Bar Graph on Color TFT Display by SDO Download

·       7.2 Manipulating LEDs and Bar Graph on Color TFT Display using PDO Write Protocols

·       7.3 Testing Heartbeat Producer and Consumer Functionality

·       8 Order Numbers

·       9 References

Quick Start Guide

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_0.jpg

Protocol Software

Quick Start Guide for STMicroelectronics STM32F107 Evaluation Software on ER-ST-EVAL-EVAL Development Board

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_1.jpghttp://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_2.jpg

ixxat

Headquarter US Sales Office

Ixxat Automation GmbH Ixxat Inc. Leibnizstr. 15 120 Bedford Center Road D-88250 Weingarten USA-Bedford, NH 03110

Tel.: +49 (0)7 51 / 5 61 46-0 Phone: +1-603-471-0800 Fax: +49 (0)7 51 / 5 61 46-29 Fax: +1-603-471-0880 Internet: www.Ixxat.de Internet: www.Ixxat.com e-Mail: info@Ixxat.de e-Mail: sales@Ixxat.com

Support

In case of unsolvable problems with this product or other Ixxat products please contact Ixxat in written form by:

Fax: +49 (0)7 51 / 5 61 46-29 e-Mail: support@Ixxat.de

For customers from the USA/Canada

Fax: +1-603-471-0880 e-Mail: techsupport@Ixxat.com

Copyright

Duplication (copying, printing, microfilm or other forms) and the electronic distribution of this document is only allowed with explicit permission of Ixxat Automation GmbH. Ixxat Automation GmbH reserves the right to change technical data without prior announcement. The general business conditions and the regulations of the license agreement do apply. All rights are reserved.

Document number: 1.02.0124-ER-ST-EVAL-EVAL Version: 1.0

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_3.jpghttp://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_4.jpg

1 Introduction ....................................................................................7 2 System requirements.....................................................................7 3 Content of the Evaluation Kit ........................................................7 4 Preparation of the ER-ST-EVAL-EVAL evaluation board................8 5 Startup of the Example Application ..............................................9 6 Implemented Functionality ..........................................................11 7 Examples ......................................................................................12

7.1 Manipulating LEDs and Bar Graph on Color TFT Display by SDO Download ............................................................................ 12

7.2 Manipulating LEDs and Bar Graph on Color TFT Display using PDO Write Protocols......................................................... 13

7.3 Testing Heartbeat Producer and Consumer Functionality 15 8 Order Numbers.............................................................................18 9 References....................................................................................18

1 Introduction

The canopen example application demonstrates the Ixxat CANOpen Protocol Software for the STM32F107 micro controller on the ER-ST-EVAL EVAL development board by STMicroelectronics [1]. This evaluation kit has been build using the Keil MDK-ARM by Keil Inc [4], a version build with IAR Embedded Workbench for ARM [5] is available as well.

The functionality implemented in the example application covers canopen services such as SDO, PDO protocol processing, and heartbeat, as well as simple digital and analog input and output via the on-chip peripherals of the STM32F107 controller and the color TFT mounted on the ER-ST-EVAL-EVAL.

2 System requirements

The CANOpen example application requires following components:

·       ER-ST-EVAL-EVAL development board by STMicroelectronics [1]

·       Flash Loader Demonstrator by STMicroelectronics [2] or any other Flash loader tool supporting download of Intel HEX files into the STM32F107

·       CAN interface with a CAN/canopen bus monitor, for example CAN-to-USB compact and MiniMon V3 or cananalyser V2.7 by Ixxat Automation GmbH [3]. To follow some of the examples described in this guide, it is required to transmit CAN frames to the ER-ST-EVAL-EVAL.

3 Content of the Evaluation Kit

The Ixxat canopen slave example for the STM32F107 micro controller respectively the ER-ST-EVAL-EVAL board by STMicroelectronics is supplied as compressed ZIP archive. The archive file contains a downloadable CANOpen application in Intel HEX file format, as well as corresponding CANOpen device description files both in EDS and XDD format according to CiA 306 and CiA

311. Also included as PDF file are this document and a document describing the terms and conditions under which the evaluation kit is made available.

Figure 1: Content of the STM32F107 CANOpen evaluation kit

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_5.jpg

4 Preparation of the ER-ST-EVAL-EVAL evaluation board

After unpacking the archive file, the canopen slave executable has to be downloaded to the ER-ST-EVAL-EVAL evaluation board. STMicroelectronics provides a free of charge Flash loader demonstrator on their home page that supports connecting to the ER-ST-EVAL-EVAL via a RS232 interface (Figure 2). The Flash loader demonstrator is designed to work with all STMicroelectronics devices that support the system memory boot mode UART protocol. The tool requires Microsoft Windows 2000, XP, Vista or Windows 7.

Please follow the installation instructions in the corresponding documentation provided by STMicroelectronics [2]. To connect to the ER-ST-EVAL-EVAL, the evaluation board must be configured to boot from System Memory (SW1: 0, SW2: 1). Please consult the ER-ST-EVAL-EVAL user manual [1] for details.

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_6.jpg

Figure 2: Setup of the RS232 connection to the ER-ST-EVAL-EVAL

After a successful connection the user may proceed until a wizard page requests the selection of the HEX file that shall be downloaded into the Flash memory of the STM32F107.

Select the ER-ST-EVALEVAL.hex file included with the example distribution and continue with Next ( Figure 3). After successful download and verification of the application the boot selection switches can be reset such that the ER-ST-EVAL-EVAL boots from User Flash (SW2: 0) after the next reset or power cycle.

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_7.jpg

Figure 3: Selection of the HEX file with the canopen example application

5 Startup of the Example Application

To start the example application, proceed with the following steps:

1. Set up the hardware.

 Use a suitable adapter to connect the CAN bus to the CAN header CN3 (CAN1) on the ER-ST-EVAL-EVAL board

1.     Connect and start a suitable CAN analyzer tool. Set the bit rate to 125 Kbit/s.

2.     Power-on the evaluation board.

3.     The CANOpen example application will display a small welcome note on the color TFT followed by status information on CAN bit rate and used node-ID. Subsequently the example application will attempt to transmit the CANOpen NMT boot-up message. The application is build with a fixed node-ID 10d and bit rate of 125 Kbit/s.

5. If the ER-ST-EVAL-EVAL board is not connected to any other active CAN device, the application will continue transmitting its NMT boot-up message and displaying a Wait for ACK.... status message on the color TFT display until any other CAN device acknowledges the NMT boot-up message (Figure 4).

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_8.jpg

Figure 4: Startup screen of the canopen example application

6. Provided that a CAN analyzer such as the ixxat cananalyser [3] is connected to the ER-ST-EVAL-EVAL board, the boot-up message will be recorded in the trace window of the analyzer (Figure 5, depicted is the trace window of the canopen Module for Ixxat cananalyser 2.7).

The startup screen will now display additional information on Consumer heartbeat and digital respectively analog output status (Figure 6).

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_9.jpg

Figure 5: NMT boot-up message of the canopen example application, data as interpreted by the CANOpen Module for cananalyser V2.7 by ixxat Automation GmbH Figure 6: Full content of TFT color LCD display

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_10.jpg

6 Implemented Functionality

The ixxat canopen Protocol Software example application for the STM32F107 on the ER-ST-EVAL-EVAL evaluation board implements a simple I/O device according to CiA 401CANOpen device profile for generic I/O modules. The application starts a CANOpen slave device with node-ID 10d on CAN1 at a CAN bit rate of 125 Kbit/s. The following features are implemented:

·       1 × SDO server

·       2 × RPDO (static)

·       2 × TPDO (static)

·       Node guarding

·       Producer heartbeat time, Consumer heartbeat time (1 entry)

·       Error behavior (Communication error)

·       Digital inputs (mapped on joystick U15)

·       Digital outputs (mapped on 3.2” TFT color LCD)

·       Analog input (mapped on potentiometer RV1)

·       Analog output (mapped on 3.2” TFT color LCD)

The default RPDO mapping maps object 6200h sub-index 01h (8 simulated LEDs on 3.2” TFT color LCD, text line Digital Out) on RPDO1, and object 6411h sub-index 01h (Bar graph on 3.2” TFT color LCD, text line Analog Out) on RPDO2.

The default TPDO mapping maps object 6000h sub-index 01h (mapped on joystick U15) on RPDO1, and object 6401h sub-index 01h (mapped on potentiometer RV1) on RPDO2.

7 Examples

7.1 Manipulating LEDs and Bar Graph on Color TFT Display by SDO Download

Digital and analog output data are routed to the TFT color LCD via objects 6200h sub-index 01h, and 6411h sub-index 01h. To manipulate the digital outputs SDO protocols may be used as described below (Figure 7, Figure 8).

Transmit the following message (CAN frame No 1) from a suitable CAN tool:

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_11.jpg

Figure 7: SDO download to node-ID 10d object 6200h sub-index 01h, data 53h

CAN frame No 1 uses the expedited SDO download protocol with CAN-ID 60Ah to write one data byte 53h to the addressed application object. The response frame No 2 with CAN-ID 58Ah confirms the download request.

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_12.jpg

Figure 8: Color TFT status after SDO download of value 53h to object 6200h sub-index 01h

Copyright ixxat Automation GmbH 12 STMicroelectronics STM32F107 Evaluation Kit Version 1.0

Performing a similar operation on the analog output will result in the following screen. Transmit the following frame (TX frame):

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_13.jpg

TX 60Ah 8 2Bh 11h 64h 01h A8h 61h 00h 00h

RX 58Ah 8 60h 11h 64h 01h 00h 00h 00h 00h

The SDO expedited download confirmation corresponds to the RX frame in the table above, the resulting screen after the SDO download will be approximately as shown in Figure 9.

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_14.jpg

Figure 9: Color TFT display after SDO downloads of value 61 A8h (25000d) to object 6411h sub-index 01h. Please note the Little-Endian representation of the two Byte data value

For object 6411h sub-index 01h software limits are set to 1000h respectively F000h. Any attempt to write a value outside this range is aborted by the device.

7.2 Manipulating LEDs and Bar Graph on Color TFT Display using PDO Write Protocols

To use PDO protocols the canopen slave device has to be transferred into NMT state Operational (Figure 10). This is achieved transmitting a NMT start remote node command (CAN frame No 1).

Note that any other canopen devices present in the network will be addressed as well by frame No 1. Use direct addressing of node-ID 10d (data content 01 0Ah) instead if the NMT broadcast message may interfere with the operation of any other device in the network.

Upon entering NMT state Operational the CANOpen slave device will transmit once all its TPDOs with transmission type 255 (frames No 2 and No 3).

Following this you may transmit PDOs with CAN-ID 20Ah – the default CAN-ID for RPDO1 of node-ID 10d according to the CiA 301 Pre-defined connection set – from your CAN tool containing one data byte 5Ah (frame No 4), or with CAN-ID 30Ah – the default CAN-ID for RPDO2 – with two data bytes 00 A0h (note: Little-Endian representation). The resulting screen will be comparable to Figure 11. For reasons of simplicity object 6411h sub-index 01h has been implemented with a dynamic range from 0 – 216 -1.

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_15.jpghttp://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_16.jpg

The examples above can be reproduced with any CAN tool supporting manual configuration and transmission of CAN frames. For a further evaluation of the canopen slave shipped with the evaluation kit and the possibilities of the CANOpen protocol it is recommended to purchase commercial tools such as the ixxat cananalyser ( Figure 5, Figure 7, and Figure 10) or the Ixxat canopen

 Device Manager (Figure 12).

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_17.jpg

7.3 Testing Heartbeat Producer and Consumer Functionality

Another feature offered by the canopen example application is consumer heartbeat functionality with support for monitoring one CANOpen device. To evaluate this functionality one additional CANOpen device is required that acts as heartbeat producer.

The following example first resets the canopen network to obtain a well-defined state. Then, the consumer heartbeat time on our evaluation board with node-ID 10d is configured to expect a heartbeat message transmitted by the additional device every 1200 ms at latest. Node-ID 10d will also be configured to return to NMT state Pre-operational on detection of a communication error. After the producer heartbeat time on the second device has been configured, monitoring starts with the first heartbeat message received by the CANOpen device that is monitored and the monitoring status can be observed on the color TFT display.

Assuming that the additional canopen device uses node-ID 1d, perform the following configuration steps (messages denoted with TX) from your CAN tool:

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_18.jpg

TX

000h

2

81h

00h

Reset remote node all

nodes to obtain a defined

network state (See note in

section 7.2 on NMT

broadcast messages)

RX

701h

1

00h

Boot-up of node-ID 1d

RX

70Ah

1

00h

Boot-up of node-ID 10d

TX

60Ah

8

2Fh

29h

10h

00h

00h

00h

00h

00h

Configure object 1029h

such that on detection of a

communication error node-

ID 10d changes to NMT

state Pre-operational if

currently in NMT state

Operational

RX

58Ah

8

60h

29h

10h

00h

00h

00h

00h

00h

Confirmation of download

TX

60Ah

8

23h

16h

10h

01h

B0h

04h

01h

00h

Configure Consumer

heartbeat time 1 (object

1016h sub-index 01h) on

node-ID 10d such that

node-ID 1d is monitored

with 1200 ms (04 B0h)

RX

58Ah

8

60h

16h

10h

01h

00h

00h

00h

00h

Confirmation of SDO

download. Time and

monitored node-ID are

indicated on the color TFT

(Figure 13a)

TX

601h

8

2Bh

17h

10h

00h

E8h

03h

00h

00h

SDO download of value 03

E8h (1000 ms) to object

1017h on node-ID 1d

RX

581h

8

60h

17h

10h

00h

00h

00h

00h

00h

SDO download response,

node-ID 1d transmits now

its producer heartbeat

message. Node-ID 10d will

detect the heartbeat

message and update the

display (Figure 13b)

TX

000h

2

01h

00h

Start remote node all

nodes (including node-ID

1d), the LED will change to

green (Figure 13c). A bus

monitor will trace heartbeat

messages indicating that

both devices are in NMT

state Operational

TX

000h

2

81h

01h

Reset remote node node-

ID 1d. The power-on

settings for object 1017h

sub-index 00h are reloaded

(typically heartbeat

producer disabled). The

heartbeat monitor on node-

ID 10d detects a heartbeat

error, the LED on the

display changes to red.

Node-ID 10d automatically

enters NMT state Pre

operational (Figure 13d)

(a)

(b)

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_19.jpg

(c) (d)

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_20.jpg

Figure 13: (a) Consumer heartbeat time (1016h sub-index 01h) on node-ID 10d, monitoring not yet active, (b) first Producer heartbeat message by node-ID 1d received, monitoring active, node-ID 1d in NMT state Preoperational, LED yellow (c) The heartbeat monitor indicates that the monitored device is in NMT state Operational, LED green (d) The heartbeat monitor indicates the detection of a communication error, LED red

8 Order Numbers

1.02.0122.62130

canopen Slave Protocol Software for STMicroelectronics STM32F107 for Keil MDK-ARM

1.02.0124.62130

canopen Master/Slave Protocol Software for STMicroelectronics STM32F107 for Keil MDK-ARM

1.02.0122.62430

canopen Slave Protocol Software for STMicroelectronics STM32F107 for IAR Embedded Workbench for ARM

1.02.0124.62430

canopen Master/Slave Protocol Software for STMicroelectronics STM32F107 for IAR Embedded Workbench for ARM

1.01.0087.10200

USB-to-CAN compact (SUB-D9 plug); with galvanic isolation

1.02.0157.00000

canopen Device Manager

1.02.0133.00000

cananalyser

1.02.0145.00000

canopen Module for cananalyser

9 References

[1] STMicroelectronics, http://www.st.com/ , ER-ST-EVAL-EVAL , UM0600 , User manual, ER-ST-EVAL-EVAL evaluation board, Rev 3, STMicroelectronics, October 2009

[2] STM32™ STM8™ Flash loader demonstrator UM0462 , User manual, STM32  STM8  Flash loader demonstrator, Rev7, STMicroelectronics, November 2009

[3] ixxat Automation GmbH, http://www.ixxat.com/ , canopen Protocol Software , USB-to-CAN compact , Ixxat CANOpen Device Manager , ixxat cananalyser

[4] Keil Microcontroller Development Kit (MDK-ARM)

[5] IAR Embedded Workbench® for ARM

 

 

canopencananalyserixxat
参数资料:
CANOpen从站实训系统CANOpen从站实训系统
该文章系原厂商文章翻译,不通之处请参考原文
价格列表: CANOpen从站实训系统CANOpen从站实训系统
葩星订货号 订货号 产品名称 报价 品牌  
相关产品: CANOpen从站实训系统CANOpen从站实训系统
  咨询历史: