asix5 User s Manual see and get more Driver BUFOR User s Manual

Similar documents
BUFOR - Driver of General Purpose User s Manual

AM_SA85 - Driver of MODBUS PLUS Protocol for AM-SA Card User s Manual

OPC Driver User s Manual

SRTP - Driver of SRTP Protocol User s Manual

OMRON - Driver of HOSTLINK Protocol User s Manual

DP Driver of PROFIBUS DP Protocol for CP5412 Card User s Manual

SINECL2 - Driver of PROFIBUS Protocol for SIMATIC S5 PLCs User s Manual

CANOPEN - Driver of CANBUS Protocol for PCI 712 NT Card User s Manual

MELSECA - Driver of MITSUBISHI MELSEC-A PLC Protocol User s Manual

AsLogger Quick-Change Measurement Series Recorder

asix5 User s Manual see and get more AslView User s Manual

MACMAT - Driver of GAZ_MODEM Protocol for MACMAT Station User s Manual

MEC - Driver of MEC07 and MEC08 Heat Meter Protocol User s Manual

User s Manual for Asix 8. Asix.Evo - Asix Mobile. Doc. No ENP8E017 Version:

PPI - Driver of PPI Protocol for SIMATIC S7 200 PLCs User s Manual

User s Manual for asix6. AsBase Recipes and Production Tracking

MES SYSTEMS SGL CARBON. Tracing & Tracking System R E L I A B L E S O L U T I O N S O F A U T O M A T I O N S Y S T E M S

Asix.Evo - Asix Mobile

Asix.Evo - Visualization Elements

Monitoring and Control Using Mobile Devices

What is New in asix v

TIP570-SW-95 QNX-Neutrino Device Driver TIP570 16/8 Channel 12 Bit ADC and 8 Channel 12 Bit DAC on SBS PCI40 Carrier

AET60 API version 1.4 February Introduction...3 Features...3 Application Programming Interface...4

TPMC500-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. 32 Channel 12 Bit ADC. Version 2.0.x. Issue 2.0.

AET60 BioCARDKey. Application Programming Interface. Subject to change without prior notice

TPMC901-SW-95. QNX4 - Neutrino Device Driver. User Manual. The Embedded I/O Company. 6/4/2 Channel Extended CAN-Bus PMC

The OpenVX User Data Object Extension

Avigilon Control Center System Integration Guide

ASPRS LiDAR SPRS Data Exchan LiDAR Data Exchange Format Standard LAS ge Format Standard LAS IIT Kanp IIT Kan ur

TPMC821-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. INTERBUS Master G4 PMC. Version 1.4. Issue 1.

USB Dynamic Industrial Interface V A Universal Application Programming Interface To Data Acquisition Products Users Manual

Documentation QuickHMI Database Data Source

Page Fault Monitor. by Software Verify

TIP120-SW-42. VxWorks Device Driver. Motion Controller with Incremental Encoder Interface. Version 2.1.x. User Manual. Issue 2.1.

Proficy* HMI/SCADA - ifix S IMULATION 2 D RIVER

TIP700-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. Digital Output 24V DC. Version 2.0.x. Issue June 2008.

Mellanox Scalable Hierarchical Aggregation and Reduction Protocol (SHARP) API Guide. Version 1.0

The ZL_PMBus API Programmer s Guide

Call DLL from Limnor Applications

TIP610-SW-95 QNX-Neutrino Device Driver TIP610 16/20 Channel Digital I/O on SBS PCI40 Carrier

ECEN 449 Microprocessor System Design. Review of C Programming

ANKARA UNIVERSITY COMPUTER ENGINEERING DEPARTMENT BLM334-COM334 PROJECT

DYNAMIC ENGINEERING 150 DuBois, Suite C Santa Cruz, CA (831) Fax (831) Est.

Device Statistics Solid State

ECEN 449 Microprocessor System Design. Review of C Programming. Texas A&M University

Avigilon Control Center System Integration Guide

DYNAMIC ENGINEERING. 150 DuBois, Suite C Santa Cruz, CA (831) Fax (831) Est.

Key Switch Control Software Windows driver software for Touch Panel Classembly Devices

The Embedded I/O Company TIP700-SW-82 Linux Device Driver User Manual TEWS TECHNOLOGIES GmbH TEWS TECHNOLOGIES LLC

COMMON-ISDN-API. Version 2.0. Part II. 4 th Edition. Operating Systems

Generic Fieldbus Application Program Interface for Windows

ETSI TS V ( )

Administrivia. Introduction to Computer Systems. Pointers, cont. Pointer example, again POINTERS. Project 2 posted, due October 6

BEA TUXEDO System Messages. TxRPC Catalog

User Guide. Avigilon Control Center Gateway. Version 5.0. UG-ACCGateway5-A-Rev1

X Generic Event Extension. Peter Hutterer

Chapter 4: Threads. Operating System Concepts with Java 8 th Edition

GE Fanuc Automation CIMPLICITY HMI. Historical Data Analyzer. CIMPLICITY Monitoring and Control Products. Operation Manual

COMMON-ISDN-API Version 2.0 Extension for Fax Paper Formats and Resolutions

TM-H6000V. WebConfig API User's Manual. Overview. Web API Specification. Reference. M Rev.A. Describes an overview of WebConfig API.

Proficy* Historian OSI PI C OLLECTOR G UIDE. Version 6.0 June 2015

OPC XML-DA Client Driver PTC Inc. All Rights Reserved.

Call-back API. Polyhedra Ltd

ETSI TS V ( )

MOXA Sync Board API Programmer s Manual

Tokens, Expressions and Control Structures

eprosima Dynamic Fast Buffers User Manual Version 0.2.0

Data Structures Unit 02

VComm Signal File Specification

ARMv8-A Synchronization primitives. primitives. Version 0.1. Version 1.0. Copyright 2017 ARM Limited or its affiliates. All rights reserved.

DYNAMIC ENGINEERING 150 DuBois St., Suite C Santa Cruz, CA Fax Est.

ICC. EtherNet/IP Client Driver Manual INDUSTRIAL CONTROL COMMUNICATIONS, INC Industrial Control Communications, Inc.

Small Logger File System

int result; int waitstat; int stat = PmcaAsyncGetGain(&result); // stat receives request id

APPLICATION NOTE 9.15

LPE-C122. Programming Manual TPM. Version: V D25. To properly use the product, read this manual thoroughly is necessary.

NVJPEG. DA _v0.2.0 October nvjpeg Libary Guide

ProvideX. C-Library File IO Routines

Pacific Knowledge Systems RippleDown: Report Validator

WinCE6.0 I2C SMDKV210. Revision 1.00 October Samsung Electronics Co., Ltd. All rights reserved.

Developer s Guide. BlackBerry. Address Book API. Version 2.0

Custom Interface Driver PTC Inc. All Rights Reserved.

Data Representation. Variable Precision and Storage Information. Numeric Variables in the Alpha Environment CHAPTER 9

3GPP TS V ( )

ETSI TS V (201

Short Notes of CS201

ISO/IEC INTERNATIONAL STANDARD. Information technology Multimedia application format (MPEG-A) Part 4: Musical slide show application format

Connection Guide (RS-232C) OMRON Corporation

TDRV006-SW-42. VxWorks Device Driver. 64 Digital Inputs/Outputs (Bit I/O) Version 4.0.x. User Manual. Issue December 2017

In the CERTAINTY project, an application is defined as a network of independent processes with the following features:

High Performance Real-Time Operating Systems. Device Driver. User s and Reference Manual

WDF File Access Library

Set up a Data Tagging Group

CS201 - Introduction to Programming Glossary By

PcieAltBase & PcieAltChan

ASAM AE COMMON. Seed&Key and Checksum Calculation API

Holtek C and ANSI C Feature Comparison User s Guide

Artemis SDK. Copyright Artemis CCD Limited October 2011 Version

Assembler Programming. Lecture 10

UNWIND PA64 Functional Specification.

Transcription:

asix5 User s Manual see and get more Driver BUFOR User s Manual Doc. No. ENP5026 Version: 28-10-2007

User s Manual asix5 ASKOM and asix are registered trademarks of ASKOM Spółka z o.o., Gliwice. Other brand names, trademarks, and registered trademarks are the property of their respective holders. All rights reserved including the right of reproduction in whole or in part in any form. No part of this publication may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system, without prior written permission from the ASKOM. ASKOM sp. z o. o. shall not be liable for any damages arising out of the use of information included in the publication content. Copyright 2007, ASKOM Sp. z o. o., Gliwice ASKOM Sp. z o. o., ul. Józefa Sowińskiego 13, 44-121 Gliwice, tel. +48 (0) 32 3018100, fax +48 (0) 32 3018101, http://www.askom.com.pl, e-mail: office@askom.com.pl

Driver Bufor manual Description 1. Bufor A comprehensive transmission channel named BUFOR was implemented in asix visualization system. The channel allows exchanging data between ASMEN communication manager and any process data transmission software developed by the user. The BUFOR channel is realized by two programs: a general purpose driver (hereinafter referred to as BUFOR, supplied by ASKOM), which ensures communication between ASMEN communication manager and any user program, a user driver (hereinafter referred to as USERDRV), implemented as a process operating in WINDOWS /NT/2000 environment. Data exchange between the programs under consideration is realized by a memory mapped file. Synchronization of access to the memory mapped file takes place with the use of a mutex object. 2. Description of User Driver Resources The memory mapped file used to exchange data between USERDRV and BUFOR must be created by USERDRV. Structures of the data that describe process variables contained in this file must be prepared by USERDRV on the driver initialization stage and made accessible via UserDesc descriptor located in the beginning of the memory mapped file. Below the UserDesc descriptor structure is presented: struct UserDesc { #define USER_NAME 15 byte name[user_name]; // driver name word progmajor // USERDRV version number word progminor; // USERDRV version minor number word major; // protocol version major number word minor; // protocol version minor number word flags; // operation characteristics word status; // driver status word items; // number of variables handled // (number of variable descriptors in VarDesc // table) DWORD vardescoffset; // location of the variable descriptors table // in memory mapped file (offset with respect to the beginning // of memory mapped file) HANDLE synchromutex; // handle of mutex synchronization object word globalread; // global read flag word globalwrite; // global write flag word rezerwa1; word rezerwa2; }; Below the meanings of the UserDesc structure fields are presented: Name - information meaning ASKOM, Gliwice October 2007 3

Description Driver Bufor manual progmajor progminor major minor flags Status globalread globalwrite synchromutex - information meaning - information meaning - for verification of BUFOR and USERDRV version conformity - for verification of BUFOR and USERDRV version conformity - defines operating mode of USERDRV. The field is a bit flag. The following flags are defined at present: BFLAG_USERTIME - USERDRV sets read times for BFLAG_AUTOREFRESH variables - USERDRV automatically refreshes data without waiting for signal from BUFOR. The remaining bits of the flags field must be cleared. - current status of USERDRV. It has not been defined how the field is to be used yet. It should be cleared at beginning. - the flag is used to transfer read orders from BUFOR to USERDRV. Detailed description of their usage can be found in read operation description. The field should be initialized to 0, - the flag is used to transfer write orders from BUFOR to USERDRV. Detailed description of their usage can be found in write operation description. The field should be initialized for the value of 0, - handle of mutex synchronization object used to synchronize BUFOR and USERDRV's access to the common memory mapped file. rezerwa1 - reserve field, initialized to 0, rezerwa2 - reserve field, initialized to 0. The user program name, memory mapped file name and parameters transferred to the user program as command line parameters are declared when the BUFOR is being parameterized (section ASMEN in 'ini' file). 3. Process Variable Descriptors Process variables are described by descriptors included in the VarDesc table. The VarDesc table can be found in the memory mapped file. Position of the table with respect to the beginning of the memory mapped file is defined in vardescoffset field in UserDesc descriptor. Any operations performed by the BUFOR and USERDRV are based on the contents of VarDesc descriptors. Descriptors are initialized partially by USERDRV on USERDRV process setup (entering the type, number of variables, read and write buffer offsets), whereas their full initialization is completed by BUFOR driver during ASMEN process variables database creation stage. Below the VarDesc descriptor structure is presented: typedef struct VarDesc VARD struct VarDesc { word type; word items; // type of variable // maximum number of variable components (variable can be 4 October 2007 ASKOM, Gliwice

Driver Bufor manual Description // represented by a table) dword period; // intervals (in seconds) between variable value refreshing operations /* fields used during the read/refreshing operations */ DWORD readbuffer; // position of the beginning of the read/refreshing operation buffer // with respect to the beginning of the memory mapped file word readdatastat; // status of the variable value read out word readquery; // status of read/refreshing commands word readresponse; // status of read/refreshing command realization dword readtime; // time of read operation sent to ASMEN byte readrez1; // reserved field word readrez2; // reserved field /* fields used during write operations */ DWORD writebuffer; // position of the beginning of the read/refreshing operation buffer // with respect to the beginning of the memory mapped file word writedatastat; // status of variable value write operation word writequery; // status of write commands word writeresponse; // status of write command realization byte writerez1; // reserved field word writerez2; // reserved field }; USERDRV initializes the following fields of VARD structure: type items readbuffer writebuffer - used by BUFOR to check whether the variable type conforms to the type expected by the calculation function declared for this variable. List of variable types can be found in bufor.h header file, - maximum number of items (for tabular variables), - position of the buffer, used to read variables, with respect to the beginning of the memory mapped file. The buffer size should be the same as the variable size, - position of the buffer, used to write variables, with respect to the beginning of the memory mapped file. The buffer size should be the same as the variable size. When it is equal to NULL, the variable write operation is denied, readrez1 - reserve field. Initialized to 0, readrez2 - reserve field. Initialized to 0, writerez1 - reserve field. Initialized to 0, writerez2 - reserve field. Initialized to 0, The remaining fields are set by BUFOR when creating the list of variables. Alternatively, they are synchronizing fields. In any case, the fields should be initially set to 0. The meanings of the fields initialized by BUFOR are as follows: period - refreshing time (in seconds). Set by BUFOR. It is designed for information purpose only. ASMEN counts the refreshing times and will order the read operations at appropriate times. USERDRV, which automatically refreshes variables, can use the period field to define the intervals between read operations, readtime - in readtime field, USERDRV passes the variable read time as a number of seconds since 01.01.1980. When the ASKOM, Gliwice October 2007 5

Description readdatastat readquery readresponse writedatastat writequery writeresponse Driver Bufor manual BFLAG_USERTIME flag has not been set in UserDesc descriptor, the driver has not to handle this field. - read operation synchronization fields. Meaning described in Read Operation, - write operation synchronization fields. Meaning described in Write Operation, 4. BUFOR Driver Parameterization BUFOR parameterization requires that the following information should be given: name of the memory mapped file, which is used to exchange data between BUFOR and USERDRV, name of the program to be loaded by BUFOR as USERDRV, command line parameters to be sent to USERDRV. Below the user driver declaration is given. It is performed by USER.EXE, which exchanges data with BUFOR driver via PLIK_MMF memory mapped file. Three parameters are passed to USER.EXE. TEST = BUFOR, PLIK_MMF, USER, PAR1 PAR2 PAR3 whereas TEST is the name of the logical channel that uses the user driver. 5. Process Variable Declaration Symbolic address of a process variable is as follows: Iindex where: index - index of a given variable from the driver (VarDesc) variable descriptors' table. Index of the first variable is 1. The remaining parameters in the process variable declaration have typical meaning. 6. Obtaining Access to Common Data Due to independent operation of BUFOR and USERDRV it is necessary to ensure synchronized access to common data during performing the variable read /write operations via common memory mapped file. 6 October 2007 ASKOM, Gliwice

Driver Bufor manual Description Synchronization of that access is performed basing on API WIN32 procedures that operate on mutex object. It is assumed that mutex, which synchronizes access to memory mapped file will be created by USERDRV on its initialization stage and that mutex s handle will be passed to BUFOR via synchromutex field in UserDesc descriptor. Below there is an example of a source code to create mutex: HANDLE TestMutex; struct UserDesc UserDesc; short CreateSemaphore(void) { if (TestMutex = CreateMutex(NULL, FALSE, NULL) == NULL) { /* mutex creation error. Return with error */ return ERROR; } /* passing the handle to BUFOR */ up->synchromutex = TestMutex; return OK; } Below there is an example code that performs synchronized access to the memory mapped file: void HandleCommonData(void) { /* waiting for access to memory mapped file */ WaitForSingleObject(TestMutex,INFINITE); /* safe operation on common data */ }... /* release of access right to memory mapped file */ ReleaseMutex(TestMutex); 7. Read Operation The following fields of VARD structure are involved in read operations: readbuffer, readdatastat, readquery, readresponse, readtime. The readtime, readdatastat fields and readbuffer buffer may only be changed by USERDRV. The readresponse and readquery fields are changed by both parties. Definitions of the flags used in the description and operation execution status are defined in bufor.h header file. The following operations are performed for USERDRV that does not refresh of process variable values automatically. Operation sequence of BUFOR driver initialization of read operation : ASKOM, Gliwice October 2007 7

Description Driver Bufor manual 1) obtain access right, 2) if INREAD bit in readresponse field is set (previous read is still performed), read initialization is given up, 3) clear readresponse field, 4) set the REQUEST flag in readquery field, 5) repeat steps 2/, 3/ and 4/ for all the variables for which read operation is being initialized, 6) set READ_REQUEST value in globalread field in UserDesc descriptor, 7) release access right. Operation sequence for USERDRV driver initialization of read operation on BUFOR request: 1) check globalread field in UserDesc descriptor. If it is different from 0, clear it and then review all the variables according to steps 2/ to 7/, 2) obtain access right, 3) heck REQUEST flag in readquery field, If flag is set, perform steps 4/ and 5/, 4) lear readquery field, 5) execute the internal initialization of physical read operation and set INREAD flag in readresponse field, 6) execute steps 3/, 4/ and 5/ for all variables, 7) release access right. Operation sequence for USERDRV completion of read operation: 1) obtain access right, 2) enter new value into readbuffer, set readdatastat and readtime fields (if USERDRV sets the read time on its own), 3) set DONE flag and clear INREAD flag in readresponse field, 4) repeat steps 2/ and 3/ for all the variables, which read operation has been completed, 5) release access right. Operation sequence for BUFOR read operation completion: 1) obtain access right, 2) for all the variables, which DONE flag is set in readresponse field, retrieve the contents of readbuffer buffer and readdatastat and readtime fields, 3) release access right. 8. Write Operation The following fields are involved in write operations of process variable : writebuffer, writedatastat, writequery, writeresponse. The writedatastat field may be changed by USERDRV only. The writebuffer buffer is changed by BUFOR only. The writeresponse and writequery fields are changed by both the parties. Definitions of any flags used in the description and status of operation execution are defined in bufor.h header file. Operation sequence for BUFOR initialization of write operation: 1) obtain access right, 2) if INWRITE bit in writeresponse field is set (previous write operation is still being performed), initialization is given up (error status or retry to perform write operation after some time), 8 October 2007 ASKOM, Gliwice

Driver Bufor manual Description 3) clear writeresponse field, 4) enter a new value in writebuffer, setting REQUEST flag in writequery field, 5) repeat steps 2/, 3/ and 4/ for all variables written in a specific cycle of BUFOR operation, 6) set WRITE_REQUEST value in globalwrite field in UserDesc descriptor, 7) release access right. Operation sequence for USERDRV write operation initialization: 1) check globalwrite field in UserDesc descriptor. If it is different from 0, clear it and then review all the variables in a way described below, 2) obtain access right, 3) if REQUEST flag is set in writequery field, perform steps 4/ and 5/, 4) clear writequery field, 5) perform internal initialization of physical write operation and set INWRITE flag in writeresponse field, 6) repeat steps 3/, 4/ and 5/ for all the process variables, 7) release access right. Operation sequence for USERDRV completion of write operation: 1) obtain access right, 2) set writedatastat field, 3) clear INWRITE flag and set DONE flag in writeresponse field, 4) repeat steps 2/ and 3/ for all variables, which write operation has been completed, 5) release access right. Operation sequence for BUFOR completion of write operation: 1) obtain access right, 2) if DONE flag is set in writeresponse field, then the status is retrieved from writedatastat field, 3) repeat step 2/ for all variables, which write operation has been initialized, 4) release access right. 9. Bufor.h Header File Definitions of any flags used in the description and status of operation execution are defined in bufor.h header file. Below the content of this file is presented. #define BFLAG_USERTIME 1 #define BFLAG_AUTOREFRESH 2 /* read or write operation request flag */ #define REQUEST 1 /* flags that describe statue of read or write operation */ #define INREAD 1 #define INWRITE 1 #define DONE 2 /* types of process variables */ ASKOM, Gliwice October 2007 9

Description Driver Bufor manual #define BTYPE 1 // byte #define ITYPE 2 // integer #define WTYPE 3 // unsigned integer #define LTYPE 4 // long #define DWTYPE 5 // unsigned long #define FPTYPE 6 // float type /* status of operation completion returned by driver */ #define AVD_GOOD 0 // o.k. #define AVD_BAD 1 // data does not exist #define AVD_FAIR 2 // data from previous read operation. Current // read operation has completed with error #define AVD_POOR 3 // data indicated by driver as // not valid #define AVD_ERROR 4 // data indicated by driver as bad 10 October 2007 ASKOM, Gliwice

Driver Bufor manual Index Index BUFOR driver parameterization 6 Bufor.h header file 9 Description of user driver resources 3 Introduction 3 Obtaining access to common data 6 Process variable declaration 6 Process variable descriptors 4 Read operation 7 Write operation 8 ASKOM, Gliwice October 2007 11

Index Driver Bufor manual 12 October 2007 ASKOM, Gliwice

Driver Bufor manual Contents 1. BUFOR... 3 2. DESCRIPTION OF USER DRIVER RESOURCES... 3 3. PROCESS VARIABLE DESCRIPTORS... 4 4. BUFOR DRIVER PARAMETERIZATION... 6 5. PROCESS VARIABLE DECLARATION... 6 6. OBTAINING ACCESS TO COMMON DATA... 6 7. READ OPERATION...7 8. WRITE OPERATION... 8 9. BUFOR.H HEADER FILE... 9 ASKOM, Gliwice October 2007 13