SHA CAN Realtime Core Documentation



Similar documents
CANnes PC CAN Interface Manual

Technische Alternative elektronische Steuerungsgerätegesellschaft mbh. A-3872 Amaliendorf, Langestr. 124 Tel +43 (0)

Certificate SAP INTEGRATION CERTIFICATION

StarterKit Embedded Control SC13 + DK51. From the electronic to the automation

Multipurpsoe Business Partner Certificates Guideline for the Business Partner

Upgrade-Preisliste. Upgrade Price List

IAC-BOX Network Integration. IAC-BOX Network Integration IACBOX.COM. Version English

How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint)

Quick Start Guide UTM 110/120

SAP Sourcing/CLM Webcast Query & User/Contact Maintenance Web Service

(51) Int Cl.: G10L 15/26 ( )

Programmieren von Schnittstellen für LiveCycle ES2-Modulen (November 2009)

Microsoft Nano Server «Tuva» Rinon Belegu

CobraNet TM User s Manual

O D B C / R O C K E T ( B S / O S D ) V 5. 0 F O R S E S A M / S Q L D A T E : F E B R U A R Y *2 R E L E A S E N O T I C E

Embedded Software Development and Test in 2011 using a mini- HIL approach

USB CASH DRAWER INTERFACE. Introduction

AC500. Software Description. Scalable PLC for Individual Automation. Installation of the AC500 Control Builder PS501

2010 Ing. Punzenberger COPA-DATA GmbH. All rights reserved.

Software / FileMaker / Plug-Ins Mailit 6 for FileMaker 10-13

PNOZmulti Configurator V8.1.1

iscan USB User manual UNIFIED FIELD COMMUNICATION

How To Connect A Webadmin To A Powerpoint (Utm) From A Usb To A Usb (Net) Or Ipa (Netlan) Device (Netbook) From Your Computer Or Ipam (Netnet

Data Sheet. Ihr Spezialist für Mess- und Prüfgeräte

U-HID Pac-LED64 PacDrive U-HID LEDs

Building an Architecture Model Entwerfen Sie mit AxiomSys ein Kontextdiagramm, das folgendermaßen aussieht:

VoIP Gateway Routers. SmartNode Model 1200, 1400 & Quick Start Guide

Experience with the Use of Linux on a

Search Engines Chapter 2 Architecture Felix Naumann

APPLICATION PROGRAMMING INTERFACE

Programing the Microprocessor in C Microprocessor System Design and Interfacing ECE 362

Designing and Deploying Messaging Solutions with Microsoft Exchange Server 2010 MOC 10233

AJAX SSL- Wizard Reference

Update to V10. Automic Support: Best Practices Josef Scharl. Please ask your questions here Event code 6262

Introduction U41241-J-Z

GE Healthcare Life Sciences UNICORN Administration and Technical Manual

TECHNISCHE INFORMATION NR. SI SERVICE INFORMATION NO. SI36-053

BRFplus Field Configuration for Portfolio Management

CPU SHB210 BIOS Versionen V14.x

Microsoft Certified IT Professional (MCITP) MCTS: Windows 7, Configuration ( )

SAP Enterprise Portal 6.0 KM Platform Delta Features

SMTP-32 Library. Simple Mail Transfer Protocol Dynamic Link Library for Microsoft Windows. Version 5.2

QAS DEBUG - User und Computer

Application example AC500 Scalable PLC for Individual Automation Communication between AC500 and KNX network abb

Special FEATURE. By Heinrich Munz

MPLAB Harmony System Service Libraries Help

Heterogeneous ABAP System Copy Technical Overview

estos uacsta Server for SIP Phones

如 何 在 C#.2005 中 使 用 ICPDAS I/O Card 的 DLL 檔 案

Symantec Backup Exec (TM) 13 Installation Log

MODERN MATHEMATICS International Summer School for Students Participation Agreement

Project Cost Reporting for PPM

Software User Guide UG-461

SAP Solution Manager Change Request Management. SAP Solution Manager Product Management SAP AG

SYNERGY CONFIGURATION SOFTWARE AND HARDWARE SETUP V /02

How to install Magellan 6

Ethernet Interface Manual Thermal / Label Printer. Rev Metapace T-1. Metapace T-2 Metapace L-1 Metapace L-2

Upgrading Client Security and Policy Manager in 4 easy steps

Manual Visendo Fax Server 2007 Enterprise

Upgrading Your Skills to MCSA Windows Server 2012 MOC 20417

Lab Course Microcontroller Programming WS2011/12

User Manual Network Interface

SOP085 - HELLER OVEN SOFTWARE INSTALLATION PROCEDURE. For version 6.2.x.x

Manual. VIPA WinNCS. Order no.: VIPA HB91E Rev. 04/03

Chapter 5 Real time clock by John Leung

DATENBLATT USB-DIO32HS USB-DIO32HS-OEM. HABEN SIE FRAGEN ODER WÜNSCHEN SIE EIN INDIVIDUELLES ANGEBOT? Unser Team berät Sie gerne persönlich.

ezvsp User's Manual ( Version 2.1d ) Sollae Systems Co., Ltd.

RN-131-PICTAIL & RN-171-PICTAIL Evaluation Boards

Designing and Implementing a Server Infrastructure MOC 20413

Marc Grote. OCSP / CRL Schlüssel Archivierung CA-Konsole Certutil PKI Health

Freescale Semiconductor, I

SAP GLOBAL DIVERSITY POLICY

PnP Driver Installation

FTP Client Engine Library for Visual dbase. Programmer's Manual

Customer Surveys with SAP Contact Center

quick documentation Die Parameter der Installation sind in diesem Artikel zu finden:

Thomas Rümmler AIT GmbH & Co. KG Christian Schlag AIT GmbH & Co. KG. Central Build and Release Management with TFS

Registries: An alternative for clinical trials?

FAR 23 LOADS 6.0 Network Floating License Installation

Die SharePoint-Welt für den erfahrenen.net- Entwickler. Fabian Moritz MVP Office SharePoint Server

1Copyright 2013, Oracle and/or its affiliates. All rights reserved.

applicomio Profibus-DP

CONTROL OF MED INPUT/OUTPUT MODULES FROM OTHER LANGUAGES

SAP CRM Detailed View SAP CRM Web Service Tool

The main program should be added to the menu system (e.g ). Menu security should be set up to restrict user access. Frame in ASCII - Version

LEHMAN BROTHERS SECURITIES N.V. LEHMAN BROTHERS (LUXEMBOURG) EQUITY FINANCE S.A.

1-Port Wireless USB 2.0 Print Server Model # APSUSB201W. Quick Installation Guide. Ver. 2A

SAP Product Road Map SAP Mobile Documents

Application Note: AN00121 Using XMOS TCP/IP Library for UDP-based Networking

FAQ Communication over IE

Step by step installation of control card USER'S MANUAL (V1.0)

Run SAP Implementation Partner Program Guide 2009 ADOPTING THE RUN METHODOLOGY INTO YOUR SAP IMPLEMENTATIONS

INSRUCTION MANUAL AND GUARANTEE POLICY

Configuring and Administering Hyper-V in Windows Server 2012 MOC 55021

Fastboot Techniques for x86 Architectures. Marcus Bortel Field Application Engineer QNX Software Systems

Central Release and Build Management with TFS. Christian Schlag

Printer Management Software

Transcription:

Date: Jan, 5.2005 a SYBERA product

1 Introduction... 3 1.1 SHA... 3 1.2 Supported Platforms... 3 1.3 Installation... 4 2 CAN RealtimeCore Library... 5 3 Software Licensing... 6 3.1 Certificate of License... 6 3.1.1 Product Enabling Code (PEC)... 6 3.1.2 Certification Label... 6 3.2 Software Lizenzierung (German)... 7 3.3 Lizenznachweis... 7 3.3.1 Product Enabling Code (PEC)... 7 3.3.2 Zertifizierungsmarke... 7 4 SHA CAN RealtimeCore Interface... 8 4.1 ShaCanCreate... 8 4.2 ShaCanDestroy... 10 4.3 ShaResetTransmission... 10 4.4 ShaCheckStatus... 10 4.5 ShaTransmitFrame... 10 4.6 ShaReceiveFrame... 10 4.7 Sample program:... 12 5 SHA CAN Support Driver Installation... 15 SYBERA e.k., Hohenzollernstr. 2, 71088 Holzgerlingen, Germany, Tel: +49-7031-411-781 Page 2

1 Introduction The idea of further interface abstruction of the SHA X-Realtime for several fieldbus systems, like serial communication, CANBUS, ProfiBus, Ethernet (TCP/IP),... is realized by SYBERA AddOn Software Libraries, so called RealtimeCores. All RealtimeCores are based on the SHA X-Realtime system. The RealtimeCores are intended to fullfill Realtime- Level-1, which means collecting and buffering data in realtime without loss of data. Thus the RealtimeCores usually require simple passive harware. 1.1 SHA The CAN RealtimeCore allows handling of SJA1000 based communication data. Incoming and outgoing data will be collected and stored in a Ringbuffer for CAN-Frames. The CAN RealtimeCore is delivered with two sample programs called CORESNDTST for sending data and CORERCVTST for receiving data. 1.2 Supported Platforms SHA was build to support serveral development platforms. Currently following platforms are supported: Visual C++ (from Version 5.0) Borland C++Builder (from Version 4.0) (under construction Visual Basic (from Version 5.0)) (under construction Borland Delphi (from Version 5.0)) SYBERA e.k., Hohenzollernstr. 2, 71088 Holzgerlingen, Germany, Tel: +49-7031-411-781 Page 3

1.3 Installation For installation on Windows (NT, 2000, XP, Embedded) following steps are required: 1. First plug in your CAN adapter 2. Install the SHA CAN support driver (see chapter 5) 3. Install SHA (Run the program SYSETUP from the SHA directory) 4. Reboot your system 5. Install CANCore (Run the program SYSETUP from the CANCore directory) 6. Build your program with SHA CAN RealtimeCore Interface (Library and Header Files) 7. Run your program After start of SYSETUP the user name, company and keycode information must be entered. The keycode for the demo version is: 00001111-22223333 Note: After finishing installation, you must reboot your PC before!!! (this is only for the SHA demoversion and SHA installation without the dynamic load/unload module). For further installation notes see README.TXT. After installation check following registry keys: [HKEY_LOCAL_MACHINE\SOFTWARE\SYBERA\CAC SYBERA e.k., Hohenzollernstr. 2, 71088 Holzgerlingen, Germany, Tel: +49-7031-411-781 Page 4

2 CAN RealtimeCore Library The interface functions of the SHA CAN RealtimeCore are exported by a static link library. Following files are required: SHACANCORE.LIB SHACANCORE.H CANCOREDEF.H Sample Project: SYBERA e.k., Hohenzollernstr. 2, 71088 Holzgerlingen, Germany, Tel: +49-7031-411-781 Page 5

3 Software Licensing SYBERA distributes software through Developer-Licenses and Runtime-Licenses. A Developer-License authorize to the installation of the corresponding SYBERA software product on one (1) workstation. Any publishing or distribution of a compiled application or driver with SYBERA software require the purchase of corresponding Runtime-Licenses. A Runtime-License authorize to exclusive distribution of the SYBERA runtime (*.DLL and *.SYS) files which incorporate with a compiled application or driver on one (1) computing device or system and require at least the purchase of one (1) Developer- License. As unlimited declared Runtime-Licenses refer exclusively to a specified application or driver and require at least the purchase of one (1) Developer-License.. The use of the SYBERA software with further applications requires additional Runtime-Licenses. 3.1 Certificate of License The SYBERA software licenses are valid only in combination with all required license attributes. The SYBERA software licenses are certificated by following attributes: 3.1.1 Product Enabling Code (PEC) The PEC information consist of three parts exclusively generated by SYBERA. The KEYCODE is required for product enabling on the corresponding computing device. The KEYCODE identifies the product and has to be entered at installation with the corresponding USERNAME and COMPANY information. 3.1.2 Certification Label The certification label consist a serial number issued to a corresponding hardware. A valid license requires the direct attachment of the certification on the hardware. Sample Label: If there is any uncertainty about the correctness of the certification information, please contact SYBERA. SYBERA e.k., Hohenzollernstr. 2, 71088 Holzgerlingen, Germany, Tel: +49-7031-411-781 Page 6

3.2 Software Lizenzierung (German) SYBERA vertreibt Software mit Entwickler-Lizenzen und Laufzeit- (Runtime-) Lizenzen. Eine Entwickler-Lizenz autorisiert zur Installation des entsprechenden SYBERA Software-Produkts auf einer (1) Workstation. Jede Weiterverbreitung oder jeder Verkauf einer kompilierten Applikation oder eines Treibers mit SYBERA Software erfordert den Erwerb von zugehörigen Runtime-Lizenzen. Eine Runtime-Lizenz autorisiert zur ausschließlichen Weitergabe der SYBERA Runtime-Dateien (*.DLL and *.SYS), die zum Betrieb mit einer Applikation oder mit einem Treiber auf einem (1) Computer oder einem System erforderlich sind und setzen mindenstens den Erwerb einer (1) Entwickler-Lizenz voraus. Als unbegrenzt deklarierte Runtime-Lizenzen beziehen sich ausschließlich auf eine bestimmte Applikation oder auf einen bestimmten Treiber und setzen mindestens den Erwerb einer (1) Entwickler-Lizenz voraus. Der Einsatz der SYBERA Software mit anderen Applikationen oder Treibern erfordert den Erwerb weiterer Runtime-Lizenzen. 3.3 Lizenznachweis Die SYBERA Software Lizenzen sind nur in Verbindung mit allen dafür vorgesehenen Lizenz-Attributen gültig. Die SYBERA Software-Lizenzen sind durch folgende Attribute gekennzeichnet: 3.3.1 Product Enabling Code (PEC) Die PEC-Daten bestehen aus drei Teilen und werden ausschließlich von SYBERA erstellt. Der KEYCODE wird für die Produktaktivierung auf dem entsprechenden Computersystem benötigt. Der KEYCODE identifiziert das Produkt und muß zusammen mit den USERNAME und COMPANY Daten bei der Installation eingetragen werden. 3.3.2 Zertifizierungsmarke Die Zertifizierungsmarke besitzt eine Seriennummer und wird für eine entsprechende Hardware ausgestellt. Für eine gültige Lizenzierung muß die Zertifizierungsmarke direkt an der Hardware angebracht werden. Muster: Bitte kontaktieren Sie SYBERA, falls Unklarheit bei der Lizenzierung besteht. SYBERA e.k., Hohenzollernstr. 2, 71088 Holzgerlingen, Germany, Tel: +49-7031-411-781 Page 7

4 SHA CAN RealtimeCore Interface In the following all function prototypes will be discussed by samples. Since all platforms have their own syntax and dependencies, therefore the topics for the different platforms are marked as follow: VC : Visual C++, embedded VC and Borland C++ Builder VB : Visual Basic DP : Borland Delphi 4.1 ShaCanCreate This function opens the CAN port and installs the realtime ringbuffer system. On success the returning value is ERROR_SUCCESS, otherwise the returning value corresponds to that from GetLastError(). VC ULONG ShaCanCreate(CAN_PARAMS); Structure CAN Parameters (see CANCOREDEF.H): typedef struct _CAN_PARAMS ULONG dev_index; //PCI device index UCHAR dev_type; //PCI controller type UCHAR mode; //SJA CAN mode TYPE32 accr; //Acceptance code TYPE32 acmr; //Acceptance mask CAN_BUSTIMING0 btr0; //Bus timing0 CAN_BUSTIMING1 btr1; //Bus timing1 CAN_OUTCTRL ocr; //Output control CAN_CLOCKDIV cdr; //Clock divider //Output parameters CAN_STATUS sr; //Status CAN_ARBLOSTCAP alcr; //Arbitration lost comtrol CAN_ERRCODECAP eccr; //Error code control //Input - Output parameters CAN_FRAME frame; //CAN Frame CAN_PARAMS, *PCAN_PARAMS; SYBERA e.k., Hohenzollernstr. 2, 71088 Holzgerlingen, Germany, Tel: +49-7031-411-781 Page 8

[dev_index] : Number of desired PCI adapter (starting with 1) [dev_type] : PCI controller type (PLX_DEVICE or PITA_DEVICE) [mode] : SJA CAN mode (BASECAN or PELICAN) [accr] union : Acceptance code (see SJA1000 datasheet) [acmr] union : Acceptance mask union (see SJA1000 datasheet) [btr0] union : Bus timing0 union (see SJA1000 datasheet) [btr1] union : Bus timing1 union (see SJA1000 datasheet) [ocr] union : Output control union (see SJA1000 datasheet) [cdr] union : Clock divider (see SJA1000 datasheet) [sr] union : Status (see SJA1000 datasheet) [alcr] union : Arbitration lost capture (see SJA1000 datasheet) [eccr] union : Error code capture (see SJA1000 datasheet) [frame] union : CAN Frame, max. 13 Bytes (see SJA1000 datasheet) Sample: //Set CAN mode CanParams.mode = BASECAN; //Set clock divider register CanParams.cdr.bit8 = 0; CanParams.cdr.bits.cd = 0; CanParams.cdr.bits.clockoff = FALSE; CanParams.cdr.bits.rxinten = 0; CanParams.cdr.bits.cbp = TRUE; CanParams.cdr.bits.canmode = FALSE; //Fosc/2 //CLKOUT enabled //RX interrupt on TX1 disabled //Comperator bypass active //Basic CAN //Set accept code and mask register CanParams.accr.bit8[0] = 0x00; CanParams.acmr.bit8[0] = 0xFF; //Set bustiming registers CanParams.btr0.bit8 = 0; CanParams.btr0.bits.brp = 0x02; CanParams.btr0.bits.sjw = 0x03; CanParams.btr1.bit8 = 0; CanParams.btr1.bits.tseg = 0x49; CanParams.btr1.bits.sam = FALSE; //Set output control register CanParams.ocr.bit8 = 0; CanParams.ocr.bits.ocmode = 0x02; CanParams.ocr.bits.ocpol0 = FALSE; CanParams.ocr.bits.octn0 = TRUE; CanParams.ocr.bits.octp0 = TRUE; CanParams.ocr.bits.ocpol1 = FALSE; CanParams.ocr.bits.octn1 = FALSE; CanParams.ocr.bits.octp1 = FALSE; //Init CAN Error = ShaCanCreate(CanParams); SYBERA e.k., Hohenzollernstr. 2, 71088 Holzgerlingen, Germany, Tel: +49-7031-411-781 Page 9

4.2 ShaCanDestroy This function closes the CAN port and releases all resources for communication. VC void ShaCanDestroy(void); 4.3 ShaResetTransmission This function resets the SJA1000 and releases all resources for communication. VC void ShaResetTransmission(void); 4.4 ShaCheckStatus This function gets the status of the SJA1000. VC void ShaCheckStatus(PCAN_PARAMS); 4.5 ShaTransmitFrame This function gets a the frame from top of stack VC BOOLEAN ShaTransmitFrame(PCAN_PARAMS); 4.6 ShaReceiveFrame This function gets a the frame from top of stack VC BOOLEAN ShaReceiveFrame(PCAN_PARAMS); SYBERA e.k., Hohenzollernstr. 2, 71088 Holzgerlingen, Germany, Tel: +49-7031-411-781 Page 10

Sample: //Receive frame if available while (!ShaReceiveFrame(&CanParams)) char szframe[max_path]; char szdata[max_path]; int ByteNum = pcanparams->frame.bc.id.dlc; //Print ID information sprintf(szframe, "ID:[%02x][%02x] Data:", pcanparams->frame.bit8[0], pcanparams->frame.bit8[1]); //Print data information for (int i=0; i<bytenum; i++) sprintf(szdata, "[%02x]", pcanparams->frame.bc.data[i]); strcat(szframe, szdata); SYBERA e.k., Hohenzollernstr. 2, 71088 Holzgerlingen, Germany, Tel: +49-7031-411-781 Page 11

4.7 Sample program: #include <windows.h> #include <stdio.h> #include <conio.h> #include "c:\cac\shacancore.h" #include "c:\sha\shaexp.h" //Must be included last!!! void PrintFrameInfo( char* szprefix, PCAN_PARAMS pcanparams) char szframe[max_path]; char szdata[max_path]; int ByteNum = pcanparams->frame.bc.id.dlc; //Print ID information into buffer sprintf(szframe, "ID:[%02x][%02x] Data:", pcanparams->frame.bit8[0], pcanparams->frame.bit8[1]); //Print ID information into buffer for (int i=0; i<bytenum; i++) sprintf(szdata, "[%02x]", pcanparams->frame.bc.data[i]); strcat(szframe, szdata); printf("%s %s ByteNum: %i\n", szprefix, szframe, ByteNum); void main(void) CAN_PARAMS CanParams; char szprefix[max_path]; DWORD Error; UCHAR i = 0; UCHAR c = '\\'; printf("\n*** CAN Core Receive Test ***\n\n"); //Print driver and DLL version printf( "DRV Version: %.2f, DLL Version: %.2f\n", ddrvversion, ddllversion); //Reset parameters memset(&canparams, 0, sizeof(can_params)); //Get device index printf("\nenter DeviceIndex: "); scanf("%i", &CanParams.dev_index); SYBERA e.k., Hohenzollernstr. 2, 71088 Holzgerlingen, Germany, Tel: +49-7031-411-781 Page 12

printf("\n"); //Set CAN mode CanParams.mode = BASECAN; //Set clock divider register CanParams.cdr.bit8 = 0; CanParams.cdr.bits.cd = 0; CanParams.cdr.bits.clockoff = FALSE; CanParams.cdr.bits.rxinten = 0; CanParams.cdr.bits.cbp = TRUE; CanParams.cdr.bits.canmode = FALSE; //Fosc/2 //CLKOUT enabled //RX interrupt on TX1 disabled //Comperator bypass active //Basic CAN //Set accept code and mask register CanParams.accr.bit8[0] = 0x00; CanParams.acmr.bit8[0] = 0xFF; //Set bustiming registers CanParams.btr0.bit8 = 0; CanParams.btr0.bits.brp = 0x02; CanParams.btr0.bits.sjw = 0x03; CanParams.btr1.bit8 = 0; CanParams.btr1.bits.tseg = 0x49; CanParams.btr1.bits.sam = FALSE; //Set output control register CanParams.ocr.bit8 = 0; CanParams.ocr.bits.ocmode = 0x02; CanParams.ocr.bits.ocpol0 = FALSE; CanParams.ocr.bits.octn0 = TRUE; CanParams.ocr.bits.octp0 = TRUE; CanParams.ocr.bits.ocpol1 = FALSE; CanParams.ocr.bits.octn1 = FALSE; CanParams.ocr.bits.octp1 = FALSE; //Init CAN Error = ShaCanCreate(CanParams); if (ERROR_SUCCESS == Error) printf("press any key...\n"); while (!kbhit()) //Receive frame if available while ((!ShaReceiveFrame(&CanParams)) && (!kbhit())) //Print active char c = (c == '\\')? '/' : '\\'; printf("[%c]\r", c); //Print frame information sprintf(szprefix, "RX Frame %5i ", i); PrintFrameInfo(szPrefix, &CanParams); //Check for errors if (i!= CanParams.frame.bc.data[0]) ShaCheckStatus(&CanParams); SYBERA e.k., Hohenzollernstr. 2, 71088 Holzgerlingen, Germany, Tel: +49-7031-411-781 Page 13

i++; printf("\n*** Status: [%02x] ***\n\n", CanParams.sr.bit8); break; //Cleanup CAN ShaCanDestroy(); SYBERA e.k., Hohenzollernstr. 2, 71088 Holzgerlingen, Germany, Tel: +49-7031-411-781 Page 14

5 SHA CAN Support Driver Installation The SHA CAN Support Driver will be installed through the Hardware Wizard of Windows 2000 / XP. The SHA CAN Support Driver may be included several times, if more CAN devices are installed. Windows will ask for a PNP device driver. For installation of the Support Driver follow the Hardware Wizard. On installation ignore any setup warnings, since these depend on several device groups. For installing the SHA CAN Support Driver Choose the WDM directory of the CAN Core installation disk. SYBERA e.k., Hohenzollernstr. 2, 71088 Holzgerlingen, Germany, Tel: +49-7031-411-781 Page 15