Protocol for downloading applications via CAN-bus into programmable terminals by MKT Systemtechnik

Similar documents
CAN-SNOOPER in MKT-Terminals CAN-SNOOPER

ELLSI. EtherCAN Low Level Socket Interface. Software Manual. to Product C.2050.xx and C.2051.xx

User Guide Laird Configuration and Test Utility Software. Version 1.0

Universal Communicator User Manual

PCAN-PassThru API. User Manual. Pass-Thru API and Connection of Pass-Thru Software to PEAK CAN Interfaces. Document version 1.1.

CANopen Slave. Protocol API V Hilscher Gesellschaft für Systemautomation mbh

InfoTag KE28xx Communications for 186 CPU Firmware Version 4

BV4109. Serial LCD Controller. Product specification November ByVac 2006 ByVac Page 1 of 12

RS 232 Interface. RS 232 is the Serial interface on the PC. Three major wires for the Serial interface: Transmit Pin 2 Receive Pin 3

Operating Manual. Inferface. CANopen. English

IrUSB Control guide. Overview. Hardware specifics. Revision 1.1 2/21/18

BV4615. Dual Interface Zero Keypad. Product specification. Dec 2009 V0.a. ByVac Page 1 of 11

LCD Module with I2C / Serial Interface and Keypad Control «LCD I2C/Serial» User s Guide. Copyright 2008 IMS

PCAN-LIN Interface for LIN, CAN, and RS-232. User Manual. Document version ( )

Serial Boot Loader For CC2538 SoC

Micro RWD H2 Protocol

Dual Interface LCD Display Controller

BV4531U. I2C or Serial 6 Way Relay

ambient XC RS232 Control Command Specification

PCAN-Explorer 6. Tel: Professional Windows Software to Communicate with CAN and CAN FD Busses. Software >> PC Software

User Manual version 1.04 TLM8 COMMUNICATION PROTOCOLS

Motors Automation Energy Transmission & Distribution Coatings. Software WSCAN. User's Manual

SPBUS PROTOCOL SPECIFICATION

BV4218. I2C-LCD & Keypad. Product specification. December 2008 V0.a. ByVac 2006 ByVac Page 1 of 9

ENGLISH ENGLISH ENGLISH ENGLISH

MODBUS TESTER SOFTWARE U S E R M A N U A L

Wireless Modem Exchange (WMX) Protocol Description

Graphical LCD Display Datasheet EB

CANopen Commandline Tool

SANYO DENKI Servo Amplifier SANMOTION R and Pro-face AGP-3****-CA1M/LT Connection Procedure. Instruction Manual. Version1.0 (

AN1203 Automatic start of CANopen slave devices

T7 Modbus Communication User Guide

ENGLISH ENGLISH ENGLISH ENGLISH

Quick Start Guide PN/CAN Gateway Layer 2. Version. 2 en. ab FW

ENGLISH ENGLISH ENGLISH ENGLISH

BMS CAN Manual. V2.0, September 3, 2018 Visit to download the latest revision of this manual Copyright 2018 Roboteq, Inc

3 CH Analog Output module / CANopen

Leica LP C (Laser Printer for Cassettes) System Requirement & Specifications

Application programming notes for the DigiMaster microfsk interface.

RS 232 PINOUTS. 1. We use RJ12 for all of our RS232 interfaces (Link-2-Modbus & Link-2-PC- Serial/RS232). The diagram below shows our pin out.

Shared Variables. Firmware v Version 1.0, 16 Apr 2013

Programming Tool for User Programmable Terminals

RF RF 433MHz Transceiver Module

B Interface description 12.01/

Mounting instruction Gateway M-Bus Master AMB8466-M-GMM Release 1.2

BV4505. IASI-Keypad Controller. Product specification. January 2009 V0.a. ByVac Page 1 of 13

EtherNet /IP User Guide

DEBUGGING SERIAL COMMUNICATIONS WITH OTHER DEVICES

GP1 LCD RS232 Terminal Kit 2003 by AWC

BV4542. I2C or Serial 16x2 with Keypad interface

hipecs-gw30 General Description Features Ordering Information RS232 / CAN - Gateway

APPLICATION NOTES. Advanced Graphical Interface - AGI Internal PLC (CODESYS V3) SHENDONG

telnet Client User Interface for Accessing MX7cK s push buttons and LEDs. Template for P1.3

Version N 2.0. LaurTec. RS232 Terminal. Debugging Embedded Systems. Author : Mauro Laurenti ID: PJ11004-EN. Copyright Mauro Laurenti 1/33

PCAN-Router FD Universal, programmable Converter for CAN FD and CAN. User Manual. Document version ( )

Sending MAC Address Function

ID8400 Stamper Communications for Firmware Versions 5 and 6

ID8400 Stamper Communications for Firmware Version 7

Optris CT/ CTlaser/ CTvideo communication interface

GENOVATION. Application Note: MiniTerm USB Low-Level Programming

Quick Start Guide PN/CAN-Gateway. Version. 1 en. from FW

CAN OPEN DP404 Digital Output

mipick Pick-by-Light System

I-Dent Marker Communications for 186 CPU Firmware Versions 1 and 2

T1 4-Channel Protocol Manual

APPLICATION NOTE 5306 Programming Baud Rates of the MAX3108 UART

Programming 3 rd Party BACnet Controllers in CBAS

Contents. Additional Instructions P-3X CANopen

µmmc Serial Data Module Data Sheet

BMV Text Protocol. Table of contents

Wireless M-Bus Studio

Russound Controllers. RNET Protocol & Specifications RS-232 Communication. Document version

TORRIX RS485. Technical Documentation. with MODBUS Protocol. Edition: Version: 2 Art. no.:

OPTRIS CT/CTL communication interface

Parts List. XBEE/Wifi Adapter board 4 standoffs ¼ inch screws Cable XBEE module or Wifi module

G3P-WiFi User Manual Release 1.2

Form 4 ICT Literacy Modules Methodist Boys School Kuala Lumpur 1.0 PROCESSING DATA

Specification. Current Consumption Range 8m * Rotational Angle +/- 50 degrees * Shear Angle +/- 40 degrees *

420 Series RS232 Encoder Engineering Manual. Contents NOTICE

Russound Dual Tuners (ST2, ST2-XM, ST2-XM2, and ST2S)

GLOG V2. Quick Guide

CAN-CBM-COM1 CAN - RS-232, RS-422, RS-485

BV4626 General Purpose I/O. Product specification. Mar 2010 V0.a. ByVac Page 1 of 13

TCP/IP ASCII interface Protocol guide

The RS-485 user manual for B800 series communication

1602 SMART LCD DISPLAY MODULE HCMODU0122

nanodaq-lt Pressure Scanner Acquisition System

CANopen. stepim. Reference Manual. Manual Revision: 1.3 Firmware Version:

CAS IKS Gateway (Modbus RTU/TCP and HTML) Manual

EHAG 125 khz Multitag Reader Module ME-H10101xx

2a. Codes and number systems (continued) How to get the binary representation of an integer: special case of application of the inverse Horner scheme

COMMUNICATIONS PROTOCOL WAYNE MILLER ASSOCIATES SERIAL/PARALLEL INTERFACE MODEL WMA-039

AKKON USB CONTROLLER BOARD

CANopen Firmware. for PCAN-MicroMod. User Manual

Number Representations

High Performance Real-Time Operating Systems

Device manual Encoder with DeviceNet interface RM7 RN /00 08/2014

PCAN-MicroMod CANopen CANopen Firmware for PCAN-MicroMod. User Manual V1.1.1

I2C and SPI Foundation

VP Process Inc. Model: VP-EC-RDU Modbus RTU LCD Display

Transcription:

Technical Information for 'programmable CAN-terminals without CANopen' Version 1.0 Protocol for downloading applications via CAN-bus into programmable terminals by MKT Systemtechnik to be used in CAN networks without CANopen! Dokument-Nr: 85116 Original: C:\cbproj\UptWin1\DOKU\art85116_CanTerminalDownloadProtocol.odt Autor: Wolfgang Büscher (Software-Entwicklung)

Table of Contents 1. REVISIONS OF THIS DOCUMENT...3 2. INTRODUCTION...4 3. TERMS AND ABBREVIATIONS...4 4. PRINCIPLE...5 4.1 OPENING THE CONNECTION BETWEEN HOST AND TARGET...6 4.2 SENDING THE APPLICATION...6 4.3 CLOSING THE CONNECTION BETWEEN HOST AND TARGET...7 5. PROTOCOL TO SEND STRINGS VIA CAN ( WITHOUT CANOPEN )...8 6. PROTOCOL TO SEND STRINGS VIA CAN USING CANOPEN...10 7. PROTOCOL TO SEND STRINGS VIA RS-232 USING 3964R...10 C:\cbproj\UptWin1\DOKU\art85116_CanTerminalDownloadProtocol.odt 2014-06-18 page 2 of 10

1. Revisions of this document Revision number Date Author Notes, remarks V1.0 2007-04-23 W. Büscher Created document nr 85116 with OpenOffice 2014-06-18 W. Büscher removed 'Preliminary' on the front cover page C:\cbproj\UptWin1\DOKU\art85116_CanTerminalDownloadProtocol.odt 2014-06-18 Page 3 / 10

2. Introduction This document describes the protocol used to download an application from MKT's programming tool into the programmable terminal via CAN-Bus. It only applies to terminals *WITHOUT* CANopen protocol (because CANopen uses a totally different protocol to transfer strings via SDO). Purpose This document was written by a programmer for other programmers, to simplify the task of implementing your own download host. Basic programming skills, and knowledge of CAN networking are assumed. The document is not targeted for the general user of the programmable terminals. Disclaimer The software mentioned in this document, and all accompanying documents, are distributed as is without any warranties, either expressed or implied, including but not limited to implied warranties of merchantability and fitness for a particular purpose, with respect to the software, the accompanying written materials, and any accompanying hardware. Names of products, which are registered trademarks, are not explicitly marked as such in this document. Therefore, a missing,, or character doesn't mean that a name is not a registered trademark or similar. CANdb is registered trademark of Vector Informatik GmbH NTCAN API is copyright (c) by ESD electronic system design GmbH PCAN Dongle and the PCAN API is copyright (c) by PEAK-Service GmbH Microsoft, Windows, Win95, WinNT, WinXP are registered trademarks of Microsoft Corporation 3. Terms and abbreviations Application Here: The program for the user-programmable terminal which was typically created with MKT's programming tool. This application is usually saved in a *.cvt file. Host Target Here: The tool which sends the data into the programmable terminal. This is usually MKT's programming tool, but it may be something else too (for example, the application which you want to write yourself) Usually a programmable terminal without CANopen by MKT Systemtechnik. C:\cbproj\UptWin1\DOKU\art85116_CanTerminalDownloadProtocol.odt 2014-06-18 Page 4 / 10

4. Principle The host sends the application into the terminal on a line-by-line basis. Every line consists of a simple string of printable 1 ASCII characters. How text strings are sent from host to target (and vice versa) is explained in a later chapter. But the principle ( using text strings ) remains the same, regardless of the protocol actually used. To set up the communication, some special commands must be sent to establish the connection, and to erase the FLASH memory in the target. The next chapter explains a typical conversation between the host and the target. We'll discuss the details of how to send strings via CAN in a later chapter. Note: The very same protocol (on the text string layer) is used via RS-232 too. The only difference is, we use the 3964R protocol to send the strings via RS-232, and the protocol explained in another chapter to send the same strings via CAN. In future, we may introduce other protocols to send the same strings (and commands) via IRDA, Bluetooth, ZigBee, Ethernet, TCP/IP, or whatever ;-) 1 printable character in this context means, only character codes 32 (decimal) and above will appear in the text line. The text line will not contain any ASCII control character like carriage return, new line, NULL, or similar. C:\cbproj\UptWin1\DOKU\art85116_CanTerminalDownloadProtocol.odt 2014-06-18 Page 5 / 10

4.1 Opening the connection between host and target To establish the connection, a few special commands must be sent from the host to the target. All these commands begin with an exclamation mark to tell them from normal data lines. The following lines were copied from the Error and Message window of the programming tool, with the option Show messages from higher CAN protocols set. Green lines are sent from the programming tool (host) to the terminal (target), and blue lines are the answers from the target back to the host. The command!comp_date! queries the compilation date of the target firmware, and also switches the terminal into transfer mode. Note that the first two strings are sent slowly (without handshake frames), because the target must not send anything as long as it is not in the connected state. The other commands (like!hardware_name! to poll the target's hardware name, etc) are optional and can be ommited to simplify things.!comp_date!!comp_date!=apr 12 2007!hardware_name!!hardware_name!=A7_TFT_L!software_name!!software_name!=CVTv1!software_art_nr!!software_art_nr!=11092!software_step!!software_step!=10!receive_program!!ready! The command!receive_program! is very important, because the target needs to erase the FLASH memory device before it can receive the application ( program ). Depending on the hardware, it may take a few seconds until the FLASH memory is erased. The answer (!ready! ) will be sent when the erase processed is finished.!receive_program!!ready! At this point, the target is ready to receive the application. All following lines can be sent more or less directly from the *.CVT file (which contains the application) : ; File: C:\cbproj\UptWin1\programs\arm7_special\Arm7JoystickTest.CVT ; Saved: 2007-04-23 10:13:26 ; Type: program file for user programmable terminal ; Producer: programming tool compiled Apr 20 2007 Encryption=0 (...) 4.2 Sending the application The application is sent line-by-line from the host to the target, using the same format as used to store the application in a *.CVT (or sometimes *.UPT-) file. The line separators (carriage return and new line) are stripped from the text file, because the CAN protocol will automatically add 0x0D (CR) and 0x0A (NL) to mark the end of a text line. C:\cbproj\UptWin1\DOKU\art85116_CanTerminalDownloadProtocol.odt 2014-06-18 Page 6 / 10

4.3 Closing the connection between host and target After downloading the application into the target, an additional command must be sent to let the target finish the transfer. This finishing will flush some remaining data from RAM to FLASH, etc. The target will acknowledge this command when finished :!finish_transfer!!transfer_finished! Additionally, you may want to restart the target after this, so the terminal reboots with the new application. In contrast to all other commands mentioned before, the!run! command will not be acknowledged by the terminal :!run! After this, you should see the new application in the terminal's display. C:\cbproj\UptWin1\DOKU\art85116_CanTerminalDownloadProtocol.odt 2014-06-18 Page 7 / 10

5. Protocol to send strings via CAN ( without CANopen ) The protocol used to send text strings from host to target is quite simplistic (at least, in this case). Only two CAN identifiers are used. You can see these CAN-Identifiers in MKT's programming tool when starting the transfer, in a message box like this one: The TX-CAN-ID is used for all CAN messages sent from the host to the target. In MKT's programming tool, such CAN messages can be displayed in GREEN colour (as in the examples below, where we'll look at the protocol at the lower level). The RX-CAN-ID is used for all CAN messages sent back from the target to the host. These messages are displayed in BLUE colour (at least, in MKT's programming tool). Black text (below) are comments and remarks added by the author of this document. The programming tool can display single CAN messages in the following format: <timestamp>: <CAN-ID> <data bytes>, where timestamp is an integer number in milliseconds, CAN-ID is a 3-digit hex number (with 0x as hex prefix), and the up to 8 CAN data bytes are displayed as two digit hex numbers. To see the net data (in the upper protocol layer), and individual CAN messages (in the lower protocol layer), configure MKT's programming tool as follows, before starting the transfer. You will find these settings in the tabsheet named Errors (which can actually display a lot more than just Errors ): C:\cbproj\UptWin1\DOKU\art85116_CanTerminalDownloadProtocol.odt 2014-06-18 Page 8 / 10

We start with sending the command!comp_date!, which -as explained in the previous chapterestablishes the connection between host and target. Because at this step, the connection is not established yet, the terminal doesn't send handshake frames in the first step. So the host uses a large gap between two unacknowledged CAN messages (to make sure the target doesn't miss a frame). After reception of the!comp_date! command, the terminal begins sending response frames, which will make the transfer run much faster (explaination further below). Created program-transfer-thread. <--- this is a message from MKT's tool 02515379: 0x7F0 21 63 6F 6D 70 5F 64 61 ; <- from HOST to TARGET 02517329: 0x7F0 74 65 21 0D 0A ; <- from HOST to TARGET 02517381: 0x7F1 21 63 6F 6D 70 5F 64 61 ; <- from TARGET to HOST (1st part of response) 02517381: 0x7F0 11 ; <- from HOST to TARGET (acknowledge sequence)!comp_date! ; <- net data of the previously transferred string At this step, the command!comp_date! has just been sent. The terminal will now send the response string. Because the connection is now established, all CAN messages will be achknowledged immediately with extra handshake telegrams. So the sender only has to wait for the acknowledge telegram, before sending the next data telegram. An acknowledge telegrams contains exactly one data byte with the sequence number (beginning with 0x11 for the first message of one text line). So by looking at the first data byte in a CAN message, we can tell if it's data or acknowledge. Let's continue... 02517383: 0x7F1 74 65 21 3D 41 70 72 20 02517410: 0x7F0 12 ; second acknowledge telegram (!) 02517410: 0x7F1 31 32 20 32 30 30 37 0D 02517411: 0x7F0 13 ; third acknowledge telegram 02517412: 0x7F1 0A ; end of sent line, 0x0A = NEW LINE character 02517413: 0x7F0 14 ; fourth acknowledge telegram!comp_date!=apr 12 2007 ; <- net data of the previously transferred string At this step, the terminal (target) has sent its first complete line back to the host. Please note the appended carriage return (0x0D) and new line (0x0A) characters, which mark the end of a line. cknowledge telegrams contains exactly one data byte with the sequence number (beginning with 0x11 for the first message of a text line). For the next line of text, the acknowlege sequence begins at 0x11 again, which means the recipient acknowledges the first CAN message of the text line). This way, missing CAN frames can easily be detected. 02517425: 0x7F0 21 68 61 72 64 77 61 72 02517549: 0x7F1 11 02517550: 0x7F0 65 5F 6E 61 6D 65 21 0D 02517688: 0x7F1 12 02517688: 0x7F0 0A 02517830: 0x7F1 13!hardware_name! ; <- net data of the previously transferred string At this step, the string!hardware_name! has been completely send from host to terminal. Note that this is much faster now, because the response messages allow us to use eliminate unnecessary delays. In the next step, the terminal will send the answer (with the hardware name) back to the host : 02517839: 0x7F1 21 68 61 72 64 77 61 72 02517847: 0x7F0 11 02517848: 0x7F1 65 5F 6E 61 6D 65 21 3D 02517848: 0x7F0 12 02517850: 0x7F1 41 37 5F 54 46 54 5F 4C 02517851: 0x7F0 13 02517852: 0x7F1 0D 0A 02517853: 0x7F0 14!hardware_name!=A7_TFT_L ; <- net data of the previously transferred string Etc, etc.. Note that TWO CAN MESSAGES may travel in the same direction, without a large gap, and without an acknowlege message in between. In older firmware revisions, we used an extra delay between the last response message (here: 02517830: 0x7F1 13) and the begin of the next string transmission (here: 02517839: 0x7F1 21 68...), but it later turned out to be unnecessary because modern CAN controllers do have at least a two-stage receive buffer. C:\cbproj\UptWin1\DOKU\art85116_CanTerminalDownloadProtocol.odt 2014-06-18 Page 9 / 10

6. Protocol to send strings via CAN using CANopen If the target (terminal, or whatever) has a CANopen protocol stack implemented, the lower protocol level is totally different: We use a special object in the CANopen object dictionary, and use an SDO channel to send the application line-by-line into that object. Details are beyond the scope of this document; please refer to the CANopen protocol specification. Look for data type Visible String, because the text lines are transferred as visible strings from the host into the target (and vice versa). 7. Protocol to send strings via RS-232 using 3964R Most terminals with an RS-232 interface support downloading the application via this port, too. But be aware: The RS-232 interface may be occupied by a GPS receiver, or other devices; so you must switch the terminal into the Download mode manually (through the terminal's system menu). This will cause the terminal firmware to stop any activities which may have occupied the serial port (like communicating with the GPS, etc). The download protocol uses 3964R frames to send the strings mentioned in chapter 4. The 3964R protocol specification can be found in the internet, eg. http://de.wikipedia.org/wiki/3964r C:\cbproj\UptWin1\DOKU\art85116_CanTerminalDownloadProtocol.odt 2014-06-18 Page 10 / 10