Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
f9e7f984
Commit
f9e7f984
authored
Jan 16, 2006
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved to module profibus
parent
f590671d
Changes
32
Show whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
0 additions
and
8694 deletions
+0
-8694
src/lib/rt/src/os_linux/pb_conf.h
src/lib/rt/src/os_linux/pb_conf.h
+0
-255
src/lib/rt/src/os_linux/pb_dp.h
src/lib/rt/src/os_linux/pb_dp.h
+0
-1204
src/lib/rt/src/os_linux/pb_err.h
src/lib/rt/src/os_linux/pb_err.h
+0
-875
src/lib/rt/src/os_linux/pb_fmb.h
src/lib/rt/src/os_linux/pb_fmb.h
+0
-368
src/lib/rt/src/os_linux/pb_hw.h
src/lib/rt/src/os_linux/pb_hw.h
+0
-117
src/lib/rt/src/os_linux/pb_if.h
src/lib/rt/src/os_linux/pb_if.h
+0
-156
src/lib/rt/src/os_linux/pb_type.h
src/lib/rt/src/os_linux/pb_type.h
+0
-85
src/lib/rt/src/os_linux/rt_io_m_pb_ai.c
src/lib/rt/src/os_linux/rt_io_m_pb_ai.c
+0
-396
src/lib/rt/src/os_linux/rt_io_m_pb_ao.c
src/lib/rt/src/os_linux/rt_io_m_pb_ao.c
+0
-247
src/lib/rt/src/os_linux/rt_io_m_pb_di.c
src/lib/rt/src/os_linux/rt_io_m_pb_di.c
+0
-155
src/lib/rt/src/os_linux/rt_io_m_pb_do.c
src/lib/rt/src/os_linux/rt_io_m_pb_do.c
+0
-145
src/lib/rt/src/os_linux/rt_io_m_pb_dp_slave.c
src/lib/rt/src/os_linux/rt_io_m_pb_dp_slave.c
+0
-280
src/lib/rt/src/os_linux/rt_io_m_pb_ii.c
src/lib/rt/src/os_linux/rt_io_m_pb_ii.c
+0
-197
src/lib/rt/src/os_linux/rt_io_m_pb_io.c
src/lib/rt/src/os_linux/rt_io_m_pb_io.c
+0
-163
src/lib/rt/src/os_linux/rt_io_m_pb_module.c
src/lib/rt/src/os_linux/rt_io_m_pb_module.c
+0
-628
src/lib/rt/src/os_linux/rt_io_m_pb_profiboard.c
src/lib/rt/src/os_linux/rt_io_m_pb_profiboard.c
+0
-600
src/lib/rt/src/os_linux/rt_io_pb_locals.h
src/lib/rt/src/os_linux/rt_io_pb_locals.h
+0
-63
src/wbl/pwrb/src/pwrb_c_pb_ai.wb_load
src/wbl/pwrb/src/pwrb_c_pb_ai.wb_load
+0
-131
src/wbl/pwrb/src/pwrb_c_pb_ao.wb_load
src/wbl/pwrb/src/pwrb_c_pb_ao.wb_load
+0
-128
src/wbl/pwrb/src/pwrb_c_pb_di.wb_load
src/wbl/pwrb/src/pwrb_c_pb_di.wb_load
+0
-152
src/wbl/pwrb/src/pwrb_c_pb_do.wb_load
src/wbl/pwrb/src/pwrb_c_pb_do.wb_load
+0
-183
src/wbl/pwrb/src/pwrb_c_pb_dp_slave.wb_load
src/wbl/pwrb/src/pwrb_c_pb_dp_slave.wb_load
+0
-394
src/wbl/pwrb/src/pwrb_c_pb_et200m.wb_load
src/wbl/pwrb/src/pwrb_c_pb_et200m.wb_load
+0
-228
src/wbl/pwrb/src/pwrb_c_pb_euro2500.wb_load
src/wbl/pwrb/src/pwrb_c_pb_euro2500.wb_load
+0
-282
src/wbl/pwrb/src/pwrb_c_pb_ii.wb_load
src/wbl/pwrb/src/pwrb_c_pb_ii.wb_load
+0
-131
src/wbl/pwrb/src/pwrb_c_pb_io.wb_load
src/wbl/pwrb/src/pwrb_c_pb_io.wb_load
+0
-128
src/wbl/pwrb/src/pwrb_c_pb_module.wb_load
src/wbl/pwrb/src/pwrb_c_pb_module.wb_load
+0
-125
src/wbl/pwrb/src/pwrb_c_pb_npba12.wb_load
src/wbl/pwrb/src/pwrb_c_pb_npba12.wb_load
+0
-270
src/wbl/pwrb/src/pwrb_c_pb_profiboard.wb_load
src/wbl/pwrb/src/pwrb_c_pb_profiboard.wb_load
+0
-380
src/wbl/pwrb/src/pwrb_td_pbnumberrepenum.wb_load
src/wbl/pwrb/src/pwrb_td_pbnumberrepenum.wb_load
+0
-91
src/wbl/pwrb/src/pwrb_td_pborientationenum.wb_load
src/wbl/pwrb/src/pwrb_td_pborientationenum.wb_load
+0
-70
src/wbl/pwrb/src/pwrb_td_pbstallactionenum.wb_load
src/wbl/pwrb/src/pwrb_td_pbstallactionenum.wb_load
+0
-67
No files found.
src/lib/rt/src/os_linux/pb_conf.h
deleted
100644 → 0
View file @
f590671d
/*****************************************************************************/
/* */
/* SOFTING GmbH */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* Copyright (C) SOFTING GmbH 1995-1999 */
/* All Rights Reserved */
/* */
/*****************************************************************************/
/*****************************************************************************/
/* PROFIBUS CONFIGURATION AND IMPLEMENTATION DEFINITIONS */
/* */
/* Filename : PB_CONF.H */
/* Version : 5.22.0.00.release */
/* Date : 26-February-1999 */
/* Author : SOFTING-BG2 */
/* */
/* Description : This file contains the PROFIBUS configuration and */
/* implementation definitions */
/* */
/* CHANGE_NOTES */
/* */
/* date name change */
/* ----------------------------------------------------------------------- */
/* 18.03.97 BG2-BOE modify compiler switches */
/* 18.03.97 BG2-BOE rename #define PAGE_SIZE to #define DPR_PAGE_SIZE */
/* 18.03.97 BG2-BOE rename #define PB_VER 500 to #define PB_VER 511 */
/* 19.06.97 BG2-BOE correct macro _NAME_LENGTH */
/* 22.07.97 BG2-BOE remove #pragma pack(2) */
/* 22.07.97 BG2-BOE modify #define CMI_TIMEOUT */
/* 23.07.97 BG2-BOE add #define LOCK_UNLOCK_TIMEOUT */
/* 23.07.97 BG2-BOE add defines for supported services */
/* 15.09.97 BG2-BOE add new IRQ identifiers */
/* 16.09.97 BG2-BOE add new define EXPORT */
/* 06.02.98 BG2-BOE set MAX_COMREF 48 to MAX_COMREF 64 */
/* 06.02.98 BG2-BOE set #define CMI_V400 0xA1 */
/* 06.02.98 BG2-BOE set #define PB_VER 520 to #define PB_VER 521 */
/* 26.02.99 BG2-BOE set #define PB_VER 521 to #define PB_VER 522 */
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
#ifndef __PB_CONF__
#define __PB_CONF__
/*****************************************************************************/
/* COMPILER SWITCHES FOR COMPABLITY */
/*****************************************************************************/
#ifndef PB_VER
/* --- for new applications running with PROFIBUS V500 --------------------- */
/* --- NOTE: For applications developed with PROFIBUS V4XX invoke compiler */
/* with compiler switch "/DPB_VER=400" */
#define PB_VER 522
#endif
/*****************************************************************************/
/* COMPILER SWITCHES DEPENDING ON OPERATING SYSTEM */
/*****************************************************************************/
#undef FAR
#undef HUGE
#if defined (WIN32) || defined (_WIN32)
/* compiling as WIN32 */
#undef DOS16
#undef WIN32
#undef EXPORT
#define WIN32
#define EXPORT __export
#define FAR
#define HUGE
#define CALL_CONV APIENTRY
/* call convention using WIN32 */
#ifdef PB_API_FUNC_NOT_USED
#undef CALL_CONV
#define CALL_CONV
/* call convention using NT-DDK */
#endif
#else
/* compiling as WIN16 */
#if defined (WIN_DLL) || defined (_WINDOWS) || defined (_WINDLL)
#undef DOS16
#undef WIN16
#define WIN16
#endif
#if defined (WIN16) || defined (_WIN16)
#undef DOS16
#undef WIN16
#undef EXPORT
#define WIN16
#define EXPORT __export
#define FAR __far
#define HUGE __huge
#define CALL_CONV FAR pascal
/* calling convention using WIN16 */
#endif
#endif
#if !defined (WIN16) && !defined (WIN32)
/* compiling as DOS16 */
#undef DOS16
#undef EXPORT
#define DOS16
#define EXPORT
#define FAR __far
#define HUGE __huge
#define CALL_CONV
#endif
/*****************************************************************************/
/* SUPPORTED SERVICES */
/*****************************************************************************/
#define FMS_SERVICES_SUPPORTED
#define DP_SERVICES_SUPPORTED
/*****************************************************************************/
/* HW Implementation Constants */
/*****************************************************************************/
/* --- DPR access mode ---------------------------------------------------- */
#define USING_8BIT 1
#define USING_16BIT_LA 2
#define USING_16BIT_SA 3
#define DPR_ACCESS_MODE USING_16BIT_SA
/* --- DPR page size ------------------------------------------------------ */
#define USING_64K_PAGE 0
#define USING_16K_PAGES 1
#define DPR_PAGE_SIZE USING_16K_PAGES
/* --- IRQ line to host --------------------------------------------------- */
#define NO_INT 0x00
/* no PC-IRQ is used */
#define INT_5 0x10
/* PC-IRQ 5 */
#define INT_10 0x20
/* PC-IRQ 10 */
#define INT_11 0x30
/* PC-IRQ 11 */
#define INT_12 0x40
/* PC-IRQ 12 */
#define INT_15 0x50
/* PC-IRQ 15 */
#define NO_INT_TO_HOST NO_INT
#define H1_INT_5 INT_5
#define H1_INT_10 INT_10
#define H1_INT_11 INT_11
#define H1_INT_12 INT_12
#define H1_INT_15 INT_15
#define INT_TO_HOST NO_INT
/*****************************************************************************/
/* CMI Implementation Constants */
/*****************************************************************************/
/* --- timeouts to wait for controller response ---------------------------- */
#define CMI_TIMEOUT (03*19)
/* CMI timeout in 55ms units */
#define LOCK_UNLOCK_TIMEOUT 2
/* Lock/Unlock Data image in 55ms units */
/* --- host identifiers ---------------------------------------------------- */
#define CMI_V410 0xA1
/* host driver CMI version 4.10 */
#define HOST_TYPE CMI_V410
/* --- controller identifier ----------------------------------------------- */
#define ID_PROFI_BOARD 0xCA
/* PROFIboard */
#define ID_PROFI_104 0xCA
/* PROFI104 */
#define ID_PROFI_CARD 0xBA
/* PROFIcard */
#define TYPE_PCMCIA 0xBA
/* old PROFIcard */
#define CONTROLLER_TYPE ID_PROFI_BOARD
/* --- polling or interrupt mode --------------------------------------------*/
#define REQ_ACK_BY_POLLING 0
/* request and ackn. by polling */
#define REQ_BY_IR_ACK_BY_POLLING 1
/* request by IR, ackn. by polling */
#define REQ_BY_POLLING_ACK_BY_IR 2
/* request by polling, ackn. by IR */
#define REQ_ACK_BY_IR 3
/* request and acknowledge by IR */
#define POLL_INT_MODE REQ_ACK_BY_POLLING
/* --- address mode -------------------------------------------------------- */
#define ABS_32BIT_MOTOROLA 0
/* linear absolute 32 bit Motorola */
#define ABS_16BIT_MOTOROLA 1
/* linear absolute 16 bit Motorola */
#define REL_32BIT_MOTOROLA 2
/* linear relative 32 bit Motorola */
#define REL_16BIT_MOTOROLA 3
/* linear relative 16 bit Motorola */
#define ABS_32BIT_INTEL 8
/* linear absolute 32 bit Intel */
#define ABS_16BIT_INTEL 9
/* linear absolute 16 bit Intel */
#define REL_32BIT_INTEL 10
/* linear relative 32 bit Intel */
#define REL_16BIT_INTEL 11
/* linear relative 32 bit Intel */
#define SEGMENT_OFFSET_INTEL 12
/* SEGEMENT/OFFSET Intel */
#define ADDRESS_SWAP_MODE SEGMENT_OFFSET_INTEL
/*****************************************************************************/
/* Implementation Constants */
/* */
/* The constants given below define the sizes of various data structures in */
/* the protocol software and thus influence memory consumption. */
/* */
/* NOTE: Do not change the following constants without recompiling the */
/* the protocol software on the communication controller */
/*****************************************************************************/
#define VERSION_STRING_LENGTH 100
/* length of version string buffer */
/* -- constants of internal sizes of byte arrays --------------------------- */
#define VFD_STRING_LENGTH 32
/* max length of the VFD string */
#define IDENT_STRING_LENGTH 32
/* max length of the Ident string */
#define ACCESS_NAME_LENGTH 32
/* max length for name adressing */
#define OBJECT_NAME_LENGTH 32
/* max length of object name */
#define EXTENSION_LENGTH 32
/* max length of object extension */
#define EXECUTION_ARGUMENT_LENGTH 32
/* max length of exec. argument */
#define ERROR_DESCR_LENGTH 32
/* max length of error descript.*/
#define CRL_SYMBOL_LENGTH 32
/* max length of crl symbol name */
#define CRL_EXTENSION_LENGTH 2
/* max length of crl extension */
#if (PB_VER < 500)
#define KBL_SYMBOL_LENGTH CRL_SYMBOL_LENGTH
#define KBL_EXTENSION_LENGTH CRL_EXTENSION_LENGTH
#endif
#define MAX_FMS_PDU_LENGTH 241
/* max size of the FMS/FM7-PDU-Buffer */
#define MAX_VAR_LIST_ELEMENTS 50
/* max count of variable list elements */
#define MAX_DOM_LIST_ELEMENTS 50
/* max count of domain list elements */
#define MAX_VAR_RECORD_ELEMENTS 10
/* max count of record elements */
#define MAX_COMREF 64
/* max supported communication references */
#define MAX_VFD 5
/* max supported VFDs */
#if (PB_VER < 500)
#define MAX_KBL_LEN MAX_COMREF
/* max entries in CRL */
#define MAX_PARA_LOC_SERVICES 5
/* max parallel local FMS-Services*/
#endif
/*****************************************************************************/
/* USEFUL MACROS */
/*****************************************************************************/
/*****************************************************************************/
/* MACRO TO CALCULATE MAX_xxxx_NAME_LENGTH */
/* */
/* This macro calculates the internal sizes of byte arrays in a way that the */
/* desired alignment on byte, word or long word boundaries is achieved. */
/* The alignment is specified by the constant ALIGNMENT (e. g. longword = 4) */
/* */
/*****************************************************************************/
#define ALIGNMENT 0x02
/* alignment on word boundary */
#define _NAME_LENGTH(length) ((length) + ALIGNMENT - ((length) % ALIGNMENT))
#endif
src/lib/rt/src/os_linux/pb_dp.h
deleted
100644 → 0
View file @
f590671d
/*****************************************************************************/
/* */
/* SOFTING GmbH */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* Copyright (C) SOFTING GmbH 1995-1999 */
/* All Rights Reserved */
/* */
/*****************************************************************************/
/*****************************************************************************/
/* DP GLOBAL DEFINES and TYPES */
/* */
/* Filename : PB_DP.H */
/* Version : 5.22.0.00.release */
/* Date : 26-February-1999 */
/* Author : SOFTING-BG2 */
/* */
/* Description : This file contains the global defines and types of */
/* component DP */
/* */
/* CHANGE_NOTES */
/* */
/* date name change */
/* ----------------------------------------------------------------------- */
/* 22.07.97 BG2-BOE set #pragma pack(2) and reset to #pragma pack() */
/* 24.09.97 BG2-BOE add new baudrate #defines */
/* - #define DP_KBAUD_45_45 */
/* 07.10.97 BG2-NI add new types for DP/V1 */
/* 07.02.98 BG2-BOE set #pragma pack(1) */
/* 01.02.99 BG2-BOE add new service identifier and data structure for */
/* DP_DATA_TRANSPORT service */
/* */
/* */
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
#ifndef __PB_DP__
#define __PB_DP__
/****************************************************************************/
/*** DEFINES ****************************************************************/
/****************************************************************************/
/*--- COMMON DP CONSTANTS --------------------------------------------------*/
#define DP_MAX_NUMBER_STATIONS 127
#define DP_MAX_NUMBER_SLAVES 125
#define DP_GLOBAL_STATION_ADDRESS 127
#define DP_DEFAULT_SLAVE_ADDRESS 126
#define DP_NO_MASTER_ADDRESS 255
#define DP_MAX_SLAVE_ADDRESS 125
#define DP_MAX_TELEGRAM_LEN 244
/* 246 not supported */
#define DP_STATUS_INFO_LEN 128
#define DP_MASTER_USER_DATA_LEN 34
#define DP_MASTER_CLASS2_NAME_LEN 32
#define DP_MIN_SLAVE_DIAG_LEN 6
/* min/max length of service data */
#define DP_MIN_PRM_DATA_LEN 9
#define DP_MIN_CFG_DATA_LEN 3
#define DP_MIN_SLAVE_PARA_LEN 32
#define DP_MIN_BUS_PARA_LEN 66
#define DP_MAX_SLAVE_DIAG_DATA_LEN 244
/* SLAVE- != MASTER- MAX_DIAG_LEN */
#define DP_MAX_MASTER_DIAG_DATA_LEN 242
#define DP_MAX_EXT_DIAG_DATA_LEN 238
#define DP_MAX_OUTPUT_DATA_LEN 244
#define DP_MAX_INPUT_DATA_LEN 244
#define DP_MAX_PRM_DATA_LEN 244
#define DP_MAX_CFG_DATA_LEN 244
#define DP_MAX_AAT_DATA_LEN 492
#define DP_MAX_USER_PRM_DATA_LEN 234
#define DP_MAX_DOWNLOAD_DATA_LEN 240
#define DP_MAX_UPLOAD_DATA_LEN 240
#define DP_MAX_REM_SLAVE_DATA_LEN 238
#define DP_MAX_SLAVE_USER_DATA_LEN 65470
#define DP_MAX_MASTER_USER_DATA_LEN 65470
#define DP_MAX_SET_BUSPARAMETER_LEN 196
#define DP_MAX_MSAC2_DATA_LEN 220
/****************************************************************************/
/* DP USER SERVICE CODES */
/****************************************************************************/
/*--- DP USER SERVICE IDENTIFIERS ------------------------------------------*/
#define DP_SERVICE_USIF 0x80
#define DP_SERVICE_DDLM 0x00
#define DP_SERVICE_SERV (DP_SERVICE_USIF | 0x60)
#define DP_SERVICE_SCHED (DP_SERVICE_USIF | 0x40)
#define DP_SERVICE_SLAVE (DP_SERVICE_USIF | 0x20)
#define DP_SERVICE_MM (DP_SERVICE_DDLM | 0x60)
#define DP_SERVICE_MSAC2 (DP_SERVICE_DDLM | 0x40)
/*--- DP SERVICE HANDLER SERVICES ------------------------------------------*/
#define DP_DOWNLOAD_LOC (DP_SERVICE_SERV | 0x01)
#define DP_UPLOAD_LOC (DP_SERVICE_SERV | 0x02)
#define DP_START_SEQ_LOC (DP_SERVICE_SERV | 0x03)
#define DP_END_SEQ_LOC (DP_SERVICE_SERV | 0x04)
#define DP_GET_SLAVE_DIAG (DP_SERVICE_SERV | 0x05)
#define DP_SET_PRM_LOC (DP_SERVICE_SERV | 0x06)
#define DP_GET_MASTER_DIAG_LOC (DP_SERVICE_SERV | 0x07)
#define DP_GET_SLAVE_PARAM (DP_SERVICE_SERV | 0x08)
#define DP_SET_BUSPARAMETER (DP_SERVICE_SERV | 0x09)
#define DP_SET_MASTER_PARAM (DP_SERVICE_SERV | 0x0A)
/*--- DP SCHEDULER SERVICES ------------------------------------------------*/
#define DP_INIT_MASTER (DP_SERVICE_SCHED | 0x01)
#define DP_ACT_PARAM_LOC (DP_SERVICE_SCHED | 0x02)
#define DP_DATA_TRANSFER (DP_SERVICE_SCHED | 0x03)
#define DP_EXIT_MASTER (DP_SERVICE_SCHED | 0x04)
#define DP_CONFIGURATION (DP_SERVICE_SCHED | 0x05)
#define DP_TERMINATION (DP_SERVICE_SCHED | 0x06)
/*--- DP DDLM SERVICES -----------------------------------------------------*/
#define DP_SET_PRM (DP_SERVICE_DDLM | 0x00)
/* SRD: M/S */
#define DP_CHK_CFG (DP_SERVICE_DDLM | 0x01)
#define DP_GET_CFG (DP_SERVICE_DDLM | 0x02)
#define DP_SLAVE_DIAG (DP_SERVICE_DDLM | 0x03)
#define DP_RD_INP (DP_SERVICE_DDLM | 0x04)
#define DP_RD_OUTP (DP_SERVICE_DDLM | 0x05)
#define DP_DATA_EXCHANGE (DP_SERVICE_DDLM | 0x06)
#define DP_SET_SLAVE_ADD (DP_SERVICE_DDLM | 0x07)
#define DP_DOWNLOAD (DP_SERVICE_MM | 0x08)
/* SRD: M/M */
#define DP_UPLOAD (DP_SERVICE_MM | 0x09)
#define DP_START_SEQ (DP_SERVICE_MM | 0x0A)
#define DP_END_SEQ (DP_SERVICE_MM | 0x0B)
#define DP_ACT_PARAM (DP_SERVICE_MM | 0x0C)
#define DP_GET_MASTER_DIAG (DP_SERVICE_MM | 0x0D)
#define DP_GLOBAL_CONTROL (DP_SERVICE_DDLM | 0x0E)
/* SDN: M/S */
#define DP_ACT_PARA_BRCT (DP_SERVICE_MM | 0x0F)
/* SDN: M/M */
#define DP_FAULT (DP_SERVICE_DDLM | 0x10)
/* local */
/*--- DP DDLM SERVICE FOR DP/V1 --------------------------------------------*/
#define DP_INITIATE (DP_SERVICE_MSAC2 | 0x00)
#define DP_ABORT (DP_SERVICE_MSAC2 | 0x01)
#define DP_READ (DP_SERVICE_MSAC2 | 0x02)
#define DP_WRITE (DP_SERVICE_MSAC2 | 0x03)
#define DP_DATA_TRANSPORT (DP_SERVICE_MSAC2 | 0x04)
/****************************************************************************/
/* DP SERVICE CONSTANTS */
/****************************************************************************/
/*--- MASTER AUTOMATIC REMOTE SERVICES -------------------------------------*/
#define DP_AUTO_GET_MASTER_DIAG 0x80
#define DP_AUTO_UPLOAD_DOWNLOAD_SEQ 0x40
#define DP_AUTO_ACT_PARAM 0x20
#define DP_AUTO_REMOTE_SERVICES ( DP_AUTO_GET_MASTER_DIAG | \
DP_AUTO_UPLOAD_DOWNLOAD_SEQ | \
DP_AUTO_ACT_PARAM )
#define DP_USER_REMOTE_SERVICES 0x00
/*--- SLAVE DPRAM ADDRESS ASSIGNMENT MODES ---------------------------------*/
#define DP_AAM_ARRAY 0x00
#define DP_AAM_DEFINED 0x01
#define DP_AAM_COMPACT 0x02
#define DP_AAM_IO_BLOCKS 0x03
/*--- DP SLAVE FLAGS -------------------------------------------------------*/
#define DP_SL_ACTIVE 0x80
#define DP_SL_NEW_PRM 0x40
#define DP_SL_FAIL_SAFE 0x20
#define DP_SL_FLAGS ( DP_SL_ACTIVE | \
DP_SL_NEW_PRM | \
DP_SL_FAIL_SAFE )
/*--- DP BUS PARAMETER FLAGS -----------------------------------------------*/
#define DP_BP_ERROR_ACTION 0x80
#define DP_BP_FLAGS (DP_BP_ERROR_ACTION)
/*--- DP SLAVE TYPES -------------------------------------------------------*/
#define DP_SLAVE_TYPE_DP 0x00
/* default DP Slave type */
/*--- DP SLAVE PARAMETERIZATION STATION STATUS -----------------------------*/
#define DP_PRM_LOCK_REQ 0x80
#define DP_PRM_UNLOCK_REQ 0x40
#define DP_PRM_SYNC_REQ 0x20
#define DP_PRM_FREEZE_REQ 0x10
#define DP_PRM_WD_ON 0x08
#define DP_PRM_STATION_STATUS ( DP_PRM_LOCK_REQ | \
DP_PRM_UNLOCK_REQ | \
DP_PRM_SYNC_REQ | \
DP_PRM_FREEZE_REQ | \
DP_PRM_WD_ON )
/*--- DP SLAVE GLOBAL CONTROL BITS -----------------------------------------*/
#define DP_CONTROL_SYNC 0x20
#define DP_CONTROL_UNSYNC 0x10
#define DP_CONTROL_FREEZE 0x08
#define DP_CONTROL_UNFREEZE 0x04
#define DP_CONTROL_CLEAR_DATA 0x02
#define DP_CONTROL_COMMAND ( DP_CONTROL_SYNC | \
DP_CONTROL_UNSYNC | \
DP_CONTROL_FREEZE | \
DP_CONTROL_UNFREEZE | \
DP_CONTROL_CLEAR_DATA )
/*--- DP AREA CODES --------------------------------------------------------*/
#define DP_AREA_SLAVE_PARAM 0x00
#define DP_AREA_BUS_PARAM 0x7F
#define DP_AREA_SET_MODE 0x80
#define DP_AREA_STAT_COUNT 0x81
#define DP_AREA_NO_PROTECTION 0xFF
/*--- DP AREA / ACTIVATION CODES -------------------------------------------*/
#define DP_SLAVE_ACTIVATE 0x80
/* values are area code dependent */
#define DP_SLAVE_DEACTIVATE 0x00
#define DP_BUS_PAR_ACTIVATE 0xFF
#define DP_OP_MODE_OFFLINE 0x00
#define DP_OP_MODE_STOP 0x40
#define DP_OP_MODE_CLEAR 0x80
#define DP_OP_MODE_OPERATE 0xC0
/*--- DP MASTER DIAG IDENTIFIERS -------------------------------------------*/
#define DP_DIAG_SLAVE_DATA 0x00
#define DP_DIAG_SYSTEM_DIAGNOSTIC 0x7E
#define DP_DIAG_MASTER_STATUS 0x7F
#define DP_DIAG_DATA_TRANSFER_LIST 0x80
/*--- DP SLAVE PARAM IDENTIFIERS -------------------------------------------*/
#define DP_SLAVE_PARAM_HEADER 0x01
#define DP_SLAVE_PARAM_PRM_DATA 0x02
#define DP_SLAVE_PARAM_CFG_DATA 0x03
#define DP_SLAVE_PARAM_AAT_DATA 0x04
#define DP_SLAVE_PARAM_USER_DATA 0x05
#define DP_SLAVE_PARAM_SLAVE_INFO 0x06
#define DP_SLAVE_PARAM_SYS_INFO 0x07
#define DP_SLAVE_PARAM_FLUSH_DIAG 0x08
/*--- DP SET MASTER PARAM IDENTIFIERS --------------------------------------*/
#define DP_SET_IDENT_NUMBER 0x00
/*--- DP SLAVE DIAG BITS ---------------------------------------------------*/
#define DP_DIAG_1_MASTER_LOCK 0x80
/* influenced by DP Master */
#define DP_DIAG_1_PRM_FAULT 0x40
#define DP_DIAG_1_INVALID_SLAVE_RES 0x20
/* influenced by DP Master */
#define DP_DIAG_1_NOT_SUPPORTED 0x10
#define DP_DIAG_1_EXT_DIAG 0x08
#define DP_DIAG_1_CFG_FAULT 0x04
#define DP_DIAG_1_STATION_NOT_READY 0x02
#define DP_DIAG_1_STATION_NON_EXISTENT 0x01
/* influenced by DP Master */
#define DP_DIAG_1_STATUS 0xFF
#define DP_DIAG_2_DEACTIVATED 0x80
/* influenced by DP Master */
#define DP_DIAG_2_SYNC_MODE 0x20
#define DP_DIAG_2_FREEZE_MODE 0x10
#define DP_DIAG_2_WD_ON 0x08
#define DP_DIAG_2_DEFAULT 0x04
#define DP_DIAG_2_STAT_DIAG 0x02
#define DP_DIAG_2_PRM_REQ 0x01
#define DP_DIAG_2_STATUS ( DP_DIAG_2_DEACTIVATED | \
DP_DIAG_2_SYNC_MODE | \
DP_DIAG_2_FREEZE_MODE | \
DP_DIAG_2_WD_ON | \
DP_DIAG_2_PRM_REQ )
#define DP_DIAG_3_EXT_DIAG_OVERFLOW 0x80
#define DP_DIAG_3_STATUS ( DP_DIAG_3_EXT_DIAG_OVERFLOW )
#define DP_SLAVE_DIAG_OVERFLOW (-1)
#define DP_STATION_NON_EXISTENT 0x0100
#define DP_INVALID_SLAVE_RESPONSE 0x2000
/*--- DP STATION STATUS ----------------------------------------------------*/
#define DP_STATE_STATION_TYPE 0x80
/* station status bits */
#define DP_STATE_MASTER_STATION 0x80
#define DP_STATE_SLAVE_STATION 0x00
#define DP_STATE_SLAVE_DIAG_DATA 0x02
#define DP_STATE_MASTER_DIAG_DATA 0x02
#define DP_STATE_SLAVE_ERROR 0x01
#define DP_STATE_MASTER_UP_DOWN_LOAD 0x01
/*--- DP BAUDRATES ---------------------------------------------------------*/
#define DP_KBAUD_9_6 0x00
#define DP_KBAUD_19_2 0x01
#define DP_KBAUD_45_45 0x0B
#define DP_KBAUD_93_75 0x02
#define DP_KBAUD_187_5 0x03
#define DP_KBAUD_500 0x04
#define DP_KBAUD_750 0x05
#define DP_KBAUD_1500 0x06
#define DP_MBAUD_1_5 0x06
#define DP_KBAUD_3000 0x07
#define DP_MBAUD_3 0x07
#define DP_KBAUD_6000 0x08
#define DP_MBAUD_6 0x08
#define DP_KBAUD_12000 0x09
#define DP_MBAUD_12 0x09
/****************************************************************************/
/* DP DATA STRUCTURE DEFINITIONS */
/****************************************************************************/
/* PCI: Protocol Control Information */
/* SDU: Service Data Unit */
/* PDU: Protocol Data Unit = PCI + SDU */
/* */
/* !!! DATA STRUCTURES: MOTOROLA BYTE ORDERING (HIGH, LOW) !!! */
/****************************************************************************/
/*--- DP SLAVE PARAMETERIZATION DATA ---------------------------------------*/
typedef
struct
_T_DP_PRM_DATA
{
USIGN16
prm_data_len
;
/* 9..DP_MAX_PRM_DATA_LEN */
OCTET
station_status
;
/* DP_PRM_xxx */
OCTET
wd_fact_1
;
/* watch dog time factors */
OCTET
wd_fact_2
;
OCTET
min_tsdr
;
/* delay of DP-Slaves before response */
USIGN16
ident_number
;
/* PNO ident number */
OCTET
group_ident
;
/* groups for GLOBAL_CONTROL */
/* OCTET user_prm_data [DP_MAX_USER_PRM_DATA_LEN]; */
}
T_DP_PRM_DATA
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_CFG_DATA
{
USIGN16
cfg_data_len
;
/* 2..244 */
/* OCTET cfg_data [cfg_data_len - 2]; */
}
T_DP_CFG_DATA
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_AAT_DATA
{
USIGN16
aat_data_len
;
/* 2..2^16-31 */
USIGN8
number_inputs
;
/* 0..244 */
USIGN8
number_outputs
;
/* 0..244 */
/* USIGN16 offset_input [0..244]; */
/* USIGN16 offset_output [0..244]; */
}
T_DP_AAT_DATA
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SLAVE_USER_DATA
{
USIGN16
slave_user_data_len
;
/* 2..2^16-31 */
/* OCTET slave_user_data [slave_user_data_len - 2]; */
}
T_DP_SLAVE_USER_DATA
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SLAVE_PARA_SET
{
USIGN16
slave_para_len
;
/* 0..MAX_SLAVE_PARA_LEN */
USIGN8
sl_flag
;
/* DP_SL_ACTIVE, DP_SL_FLAG_NEW_PRM */
USIGN8
slave_type
;
/* DP_SLAVE_TYPE_DP */
OCTET
reserved
[
12
];
/* T_DP_PRM_DATA prm_data; */
/* T_DP_CFG_DATA cfg_data; */
/* T_DP_AAT_DATA aat_data; */
/* T_DP_USER_DATA user_data; */
}
T_DP_SLAVE_PARA_SET
;
/*==========================================================================*/
typedef
struct
_T_DP_BUS_PARA_SET
{
USIGN16
bus_para_len
;
/* 66..2^16-1 */
USIGN8
fdl_add
;
/* 0..125 */
USIGN8
baud_rate
;
/* DP_xBAUD_xxx */
USIGN16
tsl
;
/* see DIN 19245-1 for details */
USIGN16
min_tsdr
;
USIGN16
max_tsdr
;
USIGN8
tqui
;
USIGN8
tset
;
USIGN32
ttr
;
USIGN8
g
;
USIGN8
hsa
;
USIGN8
max_retry_limit
;
USIGN8
bp_flag
;
/* DP_BP_ERROR_ACTION */
USIGN16
min_slave_interval
;
/* 1..2^16-1 [100 micros] */
USIGN16
poll_timeout
;
/* 1..2^16-1 [1 ms] */
USIGN16
data_control_time
;
/* 1..2^16-1 [10 ms] */
OCTET
reserved
[
6
];
USIGN16
master_user_data_len
;
/* 34..2^16-33 */
STRINGV
master_class2_name
[
32
];
/* DP Master (class 2) vendor name */
/* OCTET master_user_data [DP_MASTER_USER_DATA_LEN - 34]; */
}
T_DP_BUS_PARA_SET
;
/*==========================================================================*/
typedef
struct
_T_DP_DIAG_DATA
{
OCTET
station_status_1
;
/* DP_DIAG_1_xxx */
OCTET
station_status_2
;
/* DP_DIAG_2_xxx */
OCTET
station_status_3
;
/* DP_DIAG_3_xxx */
USIGN8
master_add
;
/* DP Master which parameterized the DP Slave */
USIGN16
ident_number
;
/* PNO ident number of the DP Slave */
/* OCTET ext_diag_data [DP_MAX_EXT_DIAG_DATA_LEN]; */
}
T_DP_DIAG_DATA
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_MASTER_STATUS
{
OCTET
usif_state
;
/* DP_OP_MODE_xxx */
USIGN8
ident_number_high
;
/* alignment problem in DIN 19245-3 !!! */
USIGN8
ident_number_low
;
/* USIGN16 ident_number at odd address !!! */
OCTET
dp_hardware_version
;
/* DDLM/USIF release information */
OCTET
dp_firmware_version
;
OCTET
user_hardware_version
;
/* USER release information */
OCTET
user_firmware_version
;
OCTET
reserved
[
9
];
}
T_DP_MASTER_STATUS
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SLAVE_PARAM_SLAVE_INFO
{
USIGN16
diag_entries
;
/* available DIAG messages */
USIGN16
offset_inputs
;
/* offset of input area within I/O memory */
USIGN16
offset_outputs
;
/* offset of output area within I/O memory */
USIGN8
number_inputs
;
/* inputs of I/O memory */
USIGN8
number_outputs
;
/* outputs of I/O memory */
USIGN8
sl_flag
;
/* DP_SL_ACTIVE, DP_SL_FLAG_NEW_PRM */
USIGN8
slave_type
;
/* DP_SLAVE_TYPE_DP */
}
T_DP_SLAVE_PARAM_SLAVE_INFO
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SLAVE_PARAM_SYS_INFO
{
USIGN8
loaded_slaves
;
/* number downloaded slaves */
USIGN8
active_slaves
;
/* number active slaves */
INT16
diag_entries
;
/* number available DIAG messages */
USIGN16
slave_io_image_len
;
/* length of slave I/O memory */
}
T_DP_SLAVE_PARAM_SYS_INFO
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SET_IDENT_NUMBER
{
USIGN16
ident_number
;
/* new master ident_number */
OCTET
dp_hardware_version
;
/* vendor specific release information */
OCTET
dp_firmware_version
;
OCTET
user_hardware_version
;
OCTET
user_firmware_version
;
}
T_DP_SET_IDENT_NUMBER
;
/*--------------------------------------------------------------------------*/
/*--- DP USIF SERVICE STRUCTURES -------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_INIT_MASTER_REQ
{
USIGN8
master_default_address
;
/* station address for default BP */
PB_BOOL
master_class2
;
/* use M2 requester functionality ? */
STRINGV
master_class2_name
[
32
];
/* vendor name of M2 */
USIGN8
lowest_slave_address
;
/* station address of first DP Slave */
USIGN8
slave_io_address_mode
;
/* Address Assignment Mode of slave I/O */
PB_BOOL
clear_outputs
;
/* clear output areas in DP_OP_MODE_CLEAR ? */
USIGN8
auto_remote_services
;
/* DP_AUTO_xxx */
PB_BOOL
cyclic_data_transfer
;
/* no DATA_TRANSFER service requests ? */
USIGN8
dummy
;
/* alignment byte */
}
T_DP_INIT_MASTER_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_INIT_MASTER_CON
{
USIGN16
status
;
/* OK, IV, NO */
}
T_DP_INIT_MASTER_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_EXIT_MASTER_CON
{
USIGN16
status
;
/* OK, NO */
}
T_DP_EXIT_MASTER_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_START_SEQ_REQ
/* MM: function_num --> rem_add */
{
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
area_code
;
/* DP_AREA_xxx */
USIGN16
timeout
;
/* download timeout [1ms] */
}
T_DP_START_SEQ_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_START_SEQ_IND
/* MM: req_add --> function_num */
{
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
area_code
;
/* DP_AREA_xxx */
USIGN16
timeout
;
/* download timeout [1ms] */
}
T_DP_START_SEQ_IND
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_START_SEQ_RES_CON
{
USIGN16
status
;
/* status of start sequence service */
USIGN8
max_len_data_unit
;
/* 1..240 */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_START_SEQ_RES_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_END_SEQ_REQ
/* MM: function_num --> rem_add */
{
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_END_SEQ_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_END_SEQ_IND
/* MM: req_add --> function_num */
{
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_END_SEQ_IND
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_END_SEQ_RES_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, TO, FE, RE, */
/* NE, AD, IP, NI, SE, SC, EA, LE */
}
T_DP_END_SEQ_RES_CON
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_END_SEQ_LOC_IND
{
USIGN16
status
;
/* TO */
}
T_DP_END_SEQ_LOC_IND
;
/*==========================================================================*/
typedef
struct
_T_DP_DOWNLOAD_REQ
/* MM: function_num --> rem_add */
{
USIGN16
data_len
;
/* 0..DP_MAX_DOWNLOAD_DATA_LEN */
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
area_code
;
/* destination area of download service */
USIGN16
add_offset
;
/* starting offset within this area */
/* OCTET data [data_len]; download data */
}
T_DP_DOWNLOAD_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_DOWNLOAD_IND
/* MM: req_add --> function_num */
{
USIGN16
data_len
;
/* 0..DP_MAX_DOWNLOAD_DATA_LEN */
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
area_code
;
/* destination area of download service */
USIGN16
add_offset
;
/* starting offset within this area */
/* OCTET data [data_len]; download data */
}
T_DP_DOWNLOAD_IND
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_DOWNLOAD_RES_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, TO, FE, */
/* RE, NE, AD, EA, SC, NI, LE */
}
T_DP_DOWNLOAD_RES_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_UPLOAD_REQ
/* MM: function_num --> rem_add */
{
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
area_code
;
/* destination area of download service */
USIGN16
add_offset
;
/* starting offset within this area */
USIGN8
data_len
;
/* 1..240 */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_UPLOAD_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_UPLOAD_IND
/* MM: req_add --> function_num */
{
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
area_code
;
/* destination area of download service */
USIGN16
add_offset
;
/* starting offset within this area */
USIGN8
data_len
;
/* 1..240 */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_UPLOAD_IND
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_UPLOAD_RES_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, TO, FE, */
/* RE, NE, AD, EA, SC, NI, LE */
USIGN16
data_len
;
/* 1..DP_MAX_UPLOAD_DATA_LEN */
/* OCTET data [data_len]; upload data */
}
T_DP_UPLOAD_RES_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_ACT_PARAM_REQ
/* MM: function_num --> rem_add */
{
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
area_code
;
/* DP_AREA_xxx */
USIGN8
activate
;
/* DP_SLAVE_xxx, DP_BUS_PAR_ACTIVATE, DP_OP_MODE_xxx */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_ACT_PARAM_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_ACT_PARAM_IND
/* MM: req_add --> function_num */
{
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
area_code
;
/* DP_AREA_xxx */
USIGN8
activate
;
/* DP_SLAVE_xxx, DP_BUS_PAR_ACTIVATE, DP_OP_MODE_xxx */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_ACT_PARAM_IND
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_ACT_PARAM_RES_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, TO, FE, RE, */
/* NE, AD, IP, SC, NI, DI, EA, LE */
}
T_DP_ACT_PARAM_RES_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_GET_MASTER_DIAG_REQ
/* MM: function_num --> rem_add */
{
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
identifier
;
/* DP_DIAG_xxx */
}
T_DP_GET_MASTER_DIAG_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_GET_MASTER_DIAG_IND
/* MM: req_add --> function_num */
{
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
identifier
;
/* DP_DIAG_xxx */
}
T_DP_GET_MASTER_DIAG_IND
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_GET_MASTER_DIAG_RES_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, TO, */
/* FE, RE, NE, AD, IP, EA, LE */
USIGN16
data_len
;
/* 1..DP_MAX_MASTER_DIAG_DATA_LEN */
/* OCTET diagnostic_data [data_len]; */
}
T_DP_GET_MASTER_DIAG_RES_CON
;
/*==========================================================================*/
typedef
void
T_DP_GET_SLAVE_DIAG_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_GET_SLAVE_DIAG_CON
{
USIGN16
status
;
/* OK, NO */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* SDU alignment byte */
INT16
diag_entries
;
/* -1..DP_MAX_SLAVE_DIAG_ENTRIES */
USIGN16
diag_data_len
;
/* 0..DP_MAX_SLAVE_DIAG_DATA_LEN */
/* T_DP_DIAG_DATA diag_data; diag_data_len */
}
T_DP_GET_SLAVE_DIAG_CON
;
/*--------------------------------------------------------------------------*/
typedef
T_DP_GET_SLAVE_DIAG_CON
T_DP_GET_SLAVE_DIAG_IND
;
/* dito */
/*==========================================================================*/
typedef
void
T_DP_DATA_TRANSFER_REQ
;
/* no SDU */
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_DATA_TRANSFER_CON
{
USIGN16
status
;
/* OK, NO */
INT16
diag_entries
;
/* -1..DP_MAX_SLAVE_DIAG_ENTRIES */
}
T_DP_DATA_TRANSFER_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_GET_SLAVE_PARAM_REQ
{
USIGN8
identifier
;
/* DP_SLAVE_PARAM_xxx */
USIGN8
rem_add
;
/* 0..126 */
}
T_DP_GET_SLAVE_PARAM_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_GET_SLAVE_PARAM_CON
{
USIGN16
status
;
/* OK, NO, IV, NE */
USIGN16
data_len
;
/* 0..244 */
/* OCTET slave_param_data [data_len]; data_len */
}
T_DP_GET_SLAVE_PARAM_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_SET_BUSPARAMETER_REQ
{
USIGN8
bp_flag
;
/* DP_BP_ERROR_ACTION */
USIGN8
dummy
;
/* alignment byte */
USIGN16
min_slave_interval
;
/* 1..2^16-1 [100 micros] */
USIGN16
poll_timeout
;
/* 1..2^16-1 [1 ms] */
USIGN16
data_control_time
;
/* 1..2^16-1 [10 ms] */
USIGN16
master_user_data_len
;
/* 34..DP_MAX_SET_BUSPARAMETER_LEN */
STRINGV
master_class2_name
[
32
];
/* DP Master (class 2) vendor name */
/* OCTET master_user_data [0..DP_MAX_SET_BUSPARAMETER_LEN - 34]; */
}
T_DP_SET_BUSPARAMETER_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SET_BUSPARAMETER_CON
{
USIGN16
status
;
/* OK, IV, NO */
}
T_DP_SET_BUSPARAMETER_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_SET_MASTER_PARAM_REQ
{
USIGN8
identifier
;
/* DP_SET_xxx */
USIGN8
data_len
;
/* 0..DP_MAX_TELEGRAM_LEN */
/* OCTET data [data_len]; data dependent on identifier */
}
T_DP_SET_MASTER_PARAM_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SET_MASTER_PARAM_CON
{
USIGN16
status
;
/* OK, IV, NO */
}
T_DP_SET_MASTER_PARAM_CON
;
/*--------------------------------------------------------------------------*/
/*--- DP DDLM SERVICE STRUCTURES -------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SLAVE_DIAG_REQ
{
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_SLAVE_DIAG_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SLAVE_DIAG_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, UE, NR, RE */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* PCI alignment byte */
USIGN16
diag_data_len
;
/* 0..DP_MAX_SLAVE_DIAG_DATA_LEN */
/* OCTET diag_data [diag_data_len]; */
}
T_DP_SLAVE_DIAG_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_DATA_EXCHANGE_REQ
{
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* PCI alignment byte */
USIGN16
outp_data_len
;
/* 0..DP_MAX_OUTPUT_DATA_LEN */
/* OCTET outp_data [outp_data_len]; */
}
T_DP_DATA_EXCHANGE_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_DATA_EXCHANGE_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, RE */
USIGN8
rem_add
;
/* 0..126 */
PB_BOOL
diag_flag
;
/* DP_TRUE: DP Slave diagnostic data available */
USIGN16
inp_data_len
;
/* 0..DP_MAX_INPUT_DATA_LEN */
/* OCTET inp_data [inp_data_len]; */
}
T_DP_DATA_EXCHANGE_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_RD_INP_REQ
{
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_RD_INP_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_RD_INP_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, UE, NR, RE */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* PCI alignment byte */
USIGN16
inp_data_len
;
/* 0..DP_MAX_INPUT_DATA_LEN */
/* OCTET inp_data [inp_data_len]; */
}
T_DP_RD_INP_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_RD_OUTP_REQ
{
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_RD_OUTP_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_RD_OUTP_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, UE, NR, RE */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* PCI alignment byte */
USIGN16
outp_data_len
;
/* 0..DP_MAX_OUTPUT_DATA_LEN */
/* OCTET outp_data [outp_data_len]; */
}
T_DP_RD_OUTP_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_SET_PRM_REQ
{
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* PCI alignment byte */
T_DP_PRM_DATA
prm_data
;
/* 9..DP_MAX_PRM_DATA_LEN */
}
T_DP_SET_PRM_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SET_PRM_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, RE */
}
T_DP_SET_PRM_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_CHK_CFG_REQ
{
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* PCI alignment byte */
T_DP_CFG_DATA
cfg_data
;
/* 3..DP_MAX_CFG_DATA_LEN */
}
T_DP_CHK_CFG_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_CHK_CFG_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, RE */
}
T_DP_CHK_CFG_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_GET_CFG_REQ
{
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_GET_CFG_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_GET_CFG_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, UE, NR, RE */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* PCI alignment byte */
T_DP_CFG_DATA
real_cfg_data
;
/* 3..DP_MAX_CFG_DATA_LEN */
}
T_DP_GET_CFG_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_GLOBAL_CONTROL_REQ
{
USIGN8
rem_add
;
/* 0..126, 127 DP_GLOBAL_STATION_ADDRESS */
USIGN8
dummy
;
/* PCI alignment byte */
USIGN8
control_command
;
/* DP_CONTROL_xxx */
USIGN8
group_select
;
/* group_ident see T_DP_PRM_DATA */
}
T_DP_GLOBAL_CONTROL_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_GLOBAL_CONTROL_CON
{
USIGN16
status
;
/* OK, DS, NO, IV */
USIGN8
rem_add
;
/* 0..126, 127 DP_GLOBAL_STATION_ADDRESS */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_GLOBAL_CONTROL_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_SET_SLAVE_ADD_REQ
{
USIGN8
rem_add
;
/* 0..125, 126 DP_DEFAULT_SLAVE_ADDRESS */
USIGN8
dummy
;
/* PCI alignment byte */
USIGN16
rem_slave_data_len
;
/* 0..DP_MAX_REM_SLAVE_DATA_LEN */
USIGN8
new_slave_add
;
/* 0..125 */
USIGN8
ident_number_high
;
/* alignment problem in DIN 19245-3 !!! */
USIGN8
ident_number_low
;
/* USIGN16 ident_number at odd address !!! */
PB_BOOL
no_add_chg
;
/* DP_TRUE: address change after reset only */
/* OCTET rem_slave_data [rem_slave_data_len]; */
}
T_DP_SET_SLAVE_ADD_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SET_SLAVE_ADD_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, RE */
USIGN8
rem_add
;
/* 0..125, 126 DP_DEFAULT_SLAVE_ADDRESS */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_SET_SLAVE_ADD_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_ACT_PARA_BRCT_REQ
/* MM: function_num --> rem_add */
{
USIGN8
rem_add
;
/* 0..125, 127 DP_GLOBAL_STATION_ADDRESS */
USIGN8
area_code
;
/* DP_AREA_BUS_PARAM */
}
T_DP_ACT_PARA_BRCT_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_ACT_PARA_BRCT_CON
{
USIGN16
status
;
/* OK, DS */
}
T_DP_ACT_PARA_BRCT_CON
;
/*==========================================================================*/
typedef
struct
_T_DP_FM2_EVENT_IND
{
USIGN16
reason
;
/* FM2 event message */
}
T_DP_FM2_EVENT_IND
;
/*--------------------------------------------------------------------------*/
/*--- DPV1 DATA STRUCTURES -------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_ADDR
{
USIGN8
api
;
/* default: set to 0 */
USIGN8
scl
;
/* default: set to 0 */
OCTET
network_address
[
6
];
/* use only when [d|s]_type is set to 1 */
/* OCTET mac_address[x_len-8]; *//* use only when [d|s]_type is set to 1 */
}
T_ADDR
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_ADD_ADDR
{
USIGN8
s_type
;
/* default: set to 0 */
USIGN8
s_len
;
/* default: set to 2 */
USIGN8
d_type
;
/* default: set to 0 */
USIGN8
d_len
;
/* default: set to 2 */
/* USIGN8 s_addr[s_len]; */
/* USIGN8 d_addr[d_len]; */
}
T_ADD_ADDR
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_INITIATE_REQ
{
USIGN8
rem_add
;
/* 0..126 */
USIGN8
reserved
[
3
];
USIGN16
send_timeout
;
/* 1..2^16-1 [10 ms] */
OCTET
features_supported
[
2
];
/* 0x01, 0x00 */
OCTET
profile_features_supported
[
2
];
/* profile specific */
USIGN16
profile_ident_number
;
/* profile specific */
T_ADD_ADDR
add_addr_param
;
/* additional address information */
}
T_DP_INITIATE_REQ
;
/*--------------------------------------------------------------------------*/
#define DP_INITIATE_S_ADDR(x) ((T_ADDR FAR*)(((USIGN8 FAR*)&((x)->add_addr_param))+sizeof(T_ADD_ADDR)))
#define DP_INITIATE_D_ADDR(x) ((T_ADDR FAR*)(((USIGN8 FAR*)&((x)->add_addr_param))+sizeof(T_ADD_ADDR)+(x)->add_addr_param.s_len))
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_INITIATE_CON
{
USIGN16
status
;
USIGN8
rem_add
;
/* 0..126 */
USIGN8
max_len_data_unit
;
/* 0..DP_MSAC2_DATA_LEN */
OCTET
features_supported
[
2
];
/* 0x01, 0x00 */
OCTET
profile_features_supported
[
2
];
/* profile specific */
USIGN16
profile_ident_number
;
/* profile specific */
T_ADD_ADDR
add_addr_param
;
/* additional address information */
}
T_DP_INITIATE_CON
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_READ_REQ
{
USIGN8
rem_add
;
/* 0..126, interpreted only when MSAC_C1 */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
}
T_DP_READ_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_READ_CON
{
USIGN16
status
;
USIGN8
rem_add
;
/* 0..126 */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
/* OCTET data [length] */
}
T_DP_READ_CON
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_WRITE_REQ
{
USIGN8
rem_add
;
/* 0..126, interpreted only when MSAC_C1 */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
/* OCTET data [length] */
}
T_DP_WRITE_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_WRITE_CON
{
USIGN16
status
;
USIGN8
rem_add
;
/* 0..126 */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
}
T_DP_WRITE_CON
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_DATA_TRANSPORT_REQ
{
USIGN8
rem_add
;
/* 0..126 */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
/* OCTET data [length] */
}
T_DP_DATA_TRANSPORT_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_DATA_TRANSPORT_CON
{
USIGN16
status
;
USIGN8
rem_add
;
/* 0..126 */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
/* OCTET data [length] */
}
T_DP_DATA_TRANSPORT_CON
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_ABORT_REQ
{
USIGN8
subnet
;
/* 0, 1, 2, others reserved */
USIGN8
reason
;
/* user reason code: 0..0x3F */
}
T_DP_ABORT_REQ
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_ABORT_IND
{
PB_BOOL
locally_generated
;
USIGN8
subnet
;
/* 0, 1, 2, others reserved */
USIGN8
reason
;
/* reason codes: see DPV1 specification */
USIGN8
dummy
;
/* alignment byte */
USIGN16
additional_detail
;
/* received timeout with RM-REQ */
}
T_DP_ABORT_IND
;
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_ERROR_CON
{
USIGN16
status
;
USIGN8
rem_add
;
USIGN8
error_decode
;
USIGN8
error_code_1
;
USIGN8
error_code_2
;
}
T_DP_ERROR_CON
;
/****************************************************************************/
#endif
/* __PB_DP__ */
src/lib/rt/src/os_linux/pb_err.h
deleted
100644 → 0
View file @
f590671d
/*****************************************************************************/
/* */
/* SOFTING GmbH */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* Copyright (C) SOFTING GmbH 1995-1999 */
/* All Rights Reserved */
/* */
/*****************************************************************************/
/*****************************************************************************/
/* PROFIBUS ABORT-, REJECT-, EVENT- and ERROR DEFINES and -TYPES */
/* */
/* Filename : PB_ERR.H */
/* Version : 5.21.0.00.release */
/* Date : 27-February-1998 */
/* Author : SOFTING-FE3 */
/* */
/* Description : This file contains the ABORT, REJECT, EVENT and ERROR */
/* types and defines and the according reason codes. */
/* */
/* CHANGE_NOTES */
/* */
/* date name change */
/* ----------------------------------------------------------------------- */
/* 22.07.97 BG2-BOE set #pragma pack(2) and reset to #pragma pack() */
/* 24.09.97 BG2-BOE add additional error codes */
/* 25.09.97 BG2-NI add DP/V1 abort reason codes and DP/V1 errors */
/* 27.02.98 BG2-BOE modify add. interface error codes */
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
#ifndef __PB_ERR__
#define __PB_ERR__
/*****************************************************************************/
/************* ABORT REASON CODES *********************/
/*****************************************************************************/
/* --- USER abort reasons -------------------------------------------------- */
#define USR_ABT_RC1 0
/* disconnected by user */
#define USR_ABT_RC2 1
/* version object dictionary incompatible */
#define USR_ABT_RC3 2
/* password error */
#define USR_ABT_RC4 3
/* profile number incompatible */
#define USR_ABT_RC5 4
/* limited services permitted */
#define USR_ABT_RC6 5
/* OD loading interacting (OD is beeing loaded)*/
/* --- FMS abort reasons --------------------------------------------------- */
#define FMS_ABT_RC1 0
/* FMS-CRL error (CRL entry invalid) */
#define FMS_ABT_RC2 1
/* user error (protocol violation by user) */
#define FMS_ABT_RC3 2
/* FMS-PDU error (invalid FMS PDU received) */
#define FMS_ABT_RC4 3
/* connection state conflict LLI */
#define FMS_ABT_RC5 4
/* LLI error */
#define FMS_ABT_RC6 5
/* PDU size exceeds maximum PDU size */
#define FMS_ABT_RC7 6
/* feature not supported */
#define FMS_ABT_RC8 7
/* invoke id error in service response */
#define FMS_ABT_RC9 8
/* max services overflow */
#define FMS_ABT_RC10 9
/* connection state conflict FMS (Initiate.req) */
#define FMS_ABT_RC11 10
/* service error (res != ind or con != req) */
#define FMS_ABT_RC12 11
/* invoke id error in service request */
#define FMS_ABT_RC13 12
/* FMS is disabled */
/* --- FM7 abort reasons -------------------------------------------------- */
#define FM7_ABT_RC1 0
/* FM7-CRL error */
#define FM7_ABT_RC2 1
/* user error */
#define FM7_ABT_RC3 2
/* FM7-PDU error */
#define FM7_ABT_RC4 3
/* connection state conflict LLI */
#define FM7_ABT_RC5 4
/* LLI error */
#define FM7_ABT_RC6 5
/* PDU size */
#define FM7_ABT_RC7 6
/* feature not supported */
#define FM7_ABT_RC8 7
/* response error */
#define FM7_ABT_RC9 8
/* max services overflow */
#define FM7_ABT_RC10 9
/* connection state conflict FM7 */
#define FM7_ABT_RC11 10
/* service error */
#if (PB_VER < 500)
#define FMA_ABT_RC1 FM7_ABT_RC1
#define FMA_ABT_RC2 FM7_ABT_RC2
#define FMA_ABT_RC3 FM7_ABT_RC3
#define FMA_ABT_RC4 FM7_ABT_RC4
#define FMA_ABT_RC5 FM7_ABT_RC5
#define FMA_ABT_RC6 FM7_ABT_RC6
#define FMA_ABT_RC7 FM7_ABT_RC7
#define FMA_ABT_RC8 FM7_ABT_RC8
#define FMA_ABT_RC9 FM7_ABT_RC9
#define FMA_ABT_RC10 FM7_ABT_RC10
#define FMA_ABT_RC11 FM7_ABT_RC11
#endif
/* --- LLI abort reasons --------------------------------------------------- */
#define LLI_ABT_RC1 0
/* LLI context check neg., remote context in AD */
#define LLI_ABT_RC2 1
/* invalid LLI PDU during associate or abort */
#define LLI_ABT_RC3 2
/* invalid LLI PDU during data transfer phase */
#define LLI_ABT_RC4 3
/* unknown or invalid LLI PDU received */
#define LLI_ABT_RC5 4
/* DTA_ACK_PDU received and SAC = 0 */
#define LLI_ABT_RC6 5
/* max no of parallel services exceeded (by PDU)*/
#define LLI_ABT_RC7 6
/* unkown invoke id */
#define LLI_ABT_RC8 7
/* priority error */
#define LLI_ABT_RC9 8
/* local error at remote station */
#define LLI_ABT_RC10 9
/* timer 1 expired (associate) */
#define LLI_ABT_RC11 10
/* timer 3 expired (supervision of connection) */
#define LLI_ABT_RC12 11
/* receive timer expired */
#define LLI_ABT_RC13 12
/* error while activating LSAP (state in AD) */
#define LLI_ABT_RC14 13
/* illegal FDL prim. during ASS or ABT (see AD) */
#define LLI_ABT_RC15 14
/* illegal FDL prim. in data transfer (see AD) */
#define LLI_ABT_RC16 15
/* unkown FDL primitive */
#define LLI_ABT_RC17 16
/* unkown LLI primitive */
#define LLI_ABT_RC18 17
/* illegal LLI prim. during ASS or ABT (see AD) */
#define LLI_ABT_RC19 18
/* illegal LLI prim. in data transfer (see AD) */
#define LLI_ABT_RC20 19
/* invalid CRL entry */
#define LLI_ABT_RC21 20
/* conflict during associate */
#define LLI_ABT_RC22 21
/* procedural error on cyclic connection */
#define LLI_ABT_RC23 22
/* max no of parallel services exceeded (by FMS)*/
#define LLI_ABT_RC24 23
/* CRL beeing loaded, LLI disabled */
#define LLI_ABT_RC25 24
/* confirm / indication mode error */
#define LLI_ABT_RC26 25
/* illegal FM1/2 primitive received */
#define LLI_ABT_RC27 26
/* illegal FMS service on cyclic connection */
#define LLI_ABT_RC28 27
/* FMS PDU too large on cyclic connection */
#define LLI_ABT_RC29 28
/* resource error during associate */
#define LLI_ABT_RC30 29
/* resource error in data transfer phase */
#define LLI_ABT_RC31 30
/* resource error during abort */
#define LLI_ABT_RC32 31
/* LLI state error */
#define LLI_ABT_RC33 32
/* timer error */
#define LLI_ABT_RC34 33
/* resource transfer to FDL failed */
/* --- LLI abort details --------------------------------------------------- */
#define LLI_ABT_AD1 0
/* error in the loading of the update buffer */
#define LLI_ABT_AD2 1
/* error in the activating of a poll list entry */
#define LLI_ABT_AD3 2
/* error in the deactivating of apoll list entry*/
#define LLI_ABT_AD4 3
/* transmit error (SDA.con) */
#define LLI_ABT_AD5 4
/* transmit error (CSRD.con) */
#define LLI_ABT_AD6 5
/* transmit error (SRD.con) */
#define LLI_ABT_AD7 6
/* receive error (CSRD.con) */
/* --- FDL abort reasons --------------------------------------------------- */
#define FDL_ABT_UE 1
/* remote user interface error */
#define FDL_ABT_RR 2
/* no remote resources available */
#define FDL_ABT_RS 3
/* service not activated at remote sap */
#define FDL_ABT_RA 4
/* no access to remote sap */
#define FDL_ABT_RDL 12
/* no resource for send response data low */
#define FDL_ABT_RDH 13
/* no resource for send response data high */
#define FDL_ABT_LS 16
/* service not activated at local sap */
#define FDL_ABT_NA 17
/* no reaction from remote station */
#define FDL_ABT_DS 18
/* disconnected station (NLT) */
#define FDL_ABT_NO 19
/* FDL servcice not OK */
#define FDL_ABT_LR 20
/* no local resources available */
#define FDL_ABT_IV 21
/* invalid request parameters */
/*****************************************************************************/
/************* DP/V1 ABORT INSTANCES AND REASON CODES *********************/
/*****************************************************************************/
#define DP_ABORT_SUBNET_NO 0
/* abort: subnet */
#define DP_ABORT_SUBNET_LOCAL 1
#define DP_ABORT_SUBNET_REMOTE 2
#define DP_ABORT_REASON_MASK 0x3F
/* abort: instance+reason */
#define DP_ABORT_INSTANCE_MASK 0xC0
#define DP_ABORT_INSTANCE_FDL 0x00
/* abort: instance */
#define DP_ABORT_INSTANCE_DDLM 0x40
#define DP_ABORT_INSTANCE_USER 0x80
/*abort: fdl-reason as defined in draft */
#define DP_ABORT_FDL_UE (DP_ABORT_INSTANCE_FDL|0x01)
#define DP_ABORT_FDL_RR (DP_ABORT_INSTANCE_FDL|0x02)
#define DP_ABORT_FDL_RS (DP_ABORT_INSTANCE_FDL|0x03)
#define DP_ABORT_FDL_NR (DP_ABORT_INSTANCE_FDL|0x09)
#define DP_ABORT_FDL_DH (DP_ABORT_INSTANCE_FDL|0x0A)
#define DP_ABORT_FDL_RDL (DP_ABORT_INSTANCE_FDL|0x0C)
#define DP_ABORT_FDL_RDH (DP_ABORT_INSTANCE_FDL|0x0D)
/* abort: fdl-reason locally softing specific */
#define DP_ABORT_FDL_LS (DP_ABORT_INSTANCE_FDL|0x10)
#define DP_ABORT_FDL_NA (DP_ABORT_INSTANCE_FDL|0x11)
#define DP_ABORT_FDL_DS (DP_ABORT_INSTANCE_FDL|0x12)
#define DP_ABORT_FDL_NO (DP_ABORT_INSTANCE_FDL|0x13)
#define DP_ABORT_FDL_LR (DP_ABORT_INSTANCE_FDL|0x14)
#define DP_ABORT_FDL_IV (DP_ABORT_INSTANCE_FDL|0x15)
/* abort: ddlm-reason as defined in draft */
#define DP_ABORT_DDLM_ABT_SE (DP_ABORT_INSTANCE_DDLM|0x01)
#define DP_ABORT_DDLM_ABT_FE (DP_ABORT_INSTANCE_DDLM|0x02)
#define DP_ABORT_DDLM_ABT_TO (DP_ABORT_INSTANCE_DDLM|0x03)
#define DP_ABORT_DDLM_ABT_RE (DP_ABORT_INSTANCE_DDLM|0x04)
#define DP_ABORT_DDLM_ABT_IV (DP_ABORT_INSTANCE_DDLM|0x05)
#define DP_ABORT_DDLM_ABT_STO (DP_ABORT_INSTANCE_DDLM|0x06)
#define DP_ABORT_DDLM_ABT_IA (DP_ABORT_INSTANCE_DDLM|0x07)
#define DP_ABORT_DDLM_ABT_OC (DP_ABORT_INSTANCE_DDLM|0x08)
/*****************************************************************************/
/************* REJECT PDU TYPES and REASON CODES *********************/
/*****************************************************************************/
/* --- PDU types ----------------------------------------------------------- */
#define CONFIRMED_REQUEST_PDU 1
#define CONFIRMED_RESPONSE_PDU 2
#define UNCONFIRMED_PDU 3
#define UNKNOWN_PDU_TYPE 4
/* --- reason codes -------------------------------------------------------- */
#define REJ_RC0 0
/* other than RC1 to RC6 */
#define REJ_RC1 1
/* invoke id exists already */
#define REJ_RC2 2
/* max services overflow (max. SCC exceeded) */
#define REJ_RC3 3
/* feature not supported - connection oriented */
#define REJ_RC4 4
/* feature not supported - connectionless */
#define REJ_RC5 5
/* PDU size exceeds maximum PDU size allowed */
#define REJ_RC6 6
/* user error on connectionless relation */
/*****************************************************************************/
/************* FMS ERROR CLASSES and ERROR CODES *********************/
/*****************************************************************************/
/* The error class is encoded in the high byte of the 16-bit-result, */
/* the error code in the low byte. */
#define E_FMS_INIT 0x0000
#define E_FMS_INIT_OTHER 0x0000
#define E_FMS_INIT_MAX_PDU_SIZE_INSUFF 0x0001
#define E_FMS_INIT_FEAT_NOT_SUPPORTED 0x0002
#define E_FMS_INIT_OD_VERSION_INCOMP 0x0003
#define E_FMS_INIT_USER_DENIED 0x0004
#define E_FMS_INIT_PASSWORD_ERROR 0x0005
#define E_FMS_INIT_PROFILE_NUMB_INCOMP 0x0006
#define E_FMS_VFD_STATE_OTHER 0x0100
#define E_FMS_APPLICATION_OTHER 0x0200
#define E_FMS_APPLICATION_UNREACHABLE 0x0201
#define E_FMS_DEF_OTHER 0x0300
#define E_FMS_DEF_OBJ_UNDEF 0x0301
#define E_FMS_DEF_OBJ_ATTR_INCONSIST 0x0302
#define E_FMS_DEF_OBJECT_ALREADY_EXISTS 0x0303
#define E_FMS_RESOURCE_OTHER 0x0400
#define E_FMS_RESOURCE_MEM_UNAVAILABLE 0x0401
#define E_FMS_SERV_OTHER 0x0500
#define E_FMS_SERV_OBJ_STATE_CONFLICT 0x0501
#define E_FMS_SERV_PDU_SIZE 0x0502
#define E_FMS_SERV_OBJ_CONSTR_CONFLICT 0x0503
#define E_FMS_SERV_PARAM_INCONSIST 0x0504
#define E_FMS_SERV_ILLEGAL_PARAM 0x0505
#define E_FMS_ACCESS_OTHER 0x0600
#define E_FMS_ACCESS_OBJ_INVALIDATED 0x0601
#define E_FMS_ACCESS_HARDWARE_FAULT 0x0602
#define E_FMS_ACCESS_OBJ_ACCESS_DENIED 0x0603
#define E_FMS_ACCESS_ADDR_INVALID 0x0604
#define E_FMS_ACCESS_OBJ_ATTR_INCONST 0x0605
#define E_FMS_ACCESS_OBJ_ACCESS_UNSUPP 0x0606
#define E_FMS_ACCESS_OBJ_NON_EXIST 0x0607
#define E_FMS_ACCESS_TYPE_CONFLICT 0x0608
#define E_FMS_ACCESS_NAME_ACCESS_UNSUP 0x0609
#define E_FMS_OD_OTHER 0x0700
#define E_FMS_OD_NAME_LEN_OVERFLOW 0x0701
#define E_FMS_OD_OVERFLOW 0x0702
#define E_FMS_OD_WRITE_PROTECT 0x0703
#define E_FMS_OD_EXTENSION_LEN_OVERFLOW 0x0704
#define E_FMS_OD_OBJ_DESCR_OVERFLOW 0x0705
#define E_FMS_OD_OPERAT_PROBLEM 0x0706
#define E_FMS_OTHER 0x0800
#if (PB_VER < 500)
#define E_INIT 0x0000
#define E_INIT_OTHER 0x0000
#define E_INIT_MAX_PDU_SIZE_INSUFF 0x0001
#define E_INIT_FEAT_NOT_SUPPORTED 0x0002
#define E_INIT_OV_VERSION_INCOMP 0x0003
#define E_INIT_USER_DENIED 0x0004
#define E_INIT_PASSWORD_ERROR 0x0005
#define E_INIT_PROFILE_NUMB_INCOMP 0x0006
#define E_VFD_STATE_OTHER 0x0100
#define E_APPLICATION_OTHER 0x0200
#define E_APPLICATION_UNREACHABLE 0x0201
#define E_DEF_OTHER 0x0300
#define E_DEF_OBJ_UNDEF 0x0301
#define E_DEF_OBJ_ATTR_INCONSIST 0x0302
#define E_DEF_OBJECT_ALREADY_EXISTS 0x0303
#define E_RESOURCE_OTHER 0x0400
#define E_RESOURCE_MEM_UNAVAILABLE 0x0401
#define E_SERV_OTHER 0x0500
#define E_SERV_OBJ_STATE_CONFLICT 0x0501
#define E_SERV_PDU_SIZE 0x0502
#define E_SERV_OBJ_CONSTR_CONFLICT 0x0503
#define E_SERV_PARAM_INCONSIST 0x0504
#define E_SERV_ILLEGAL_PARAM 0x0505
#define E_ACCESS_OTHER 0x0600
#define E_ACCESS_OBJ_INVALIDATED 0x0601
#define E_ACCESS_HARDWARE_FAULT 0x0602
#define E_ACCESS_OBJ_ACCESS_DENIED 0x0603
#define E_ACCESS_ADDR_INVALID 0x0604
#define E_ACCESS_OBJ_ATTR_INCONST 0x0605
#define E_ACCESS_OBJ_ACCESS_UNSUPP 0x0606
#define E_ACCESS_OBJ_NON_EXIST 0x0607
#define E_ACCESS_TYPE_CONFLICT 0x0608
#define E_ACCESS_NAME_ACCESS_UNSUP 0x0609
#define E_OV_OTHER 0x0700
#define E_OV_NAME_LEN_OVERFLOW 0x0701
#define E_OV_OVERFLOW 0x0702
#define E_OV_WRITE_PROTECT 0x0703
#define E_OV_EXTENSION_LEN_OVERFLOW 0x0704
#define E_OV_OBJ_DESCR_OVERFLOW 0x0705
#define E_OV_OPERAT_PROBLEM 0x0706
#define E_OTHER 0x0800
#endif
/*****************************************************************************/
/************* FM7 ERROR CLASSES and ERROR CODES *********************/
/*****************************************************************************/
/* The error class is encoded in the high byte of the 16-bit-result, */
/* the error code in the low byte. */
#define E_FM7_INIT_OTHER 0x0000
#define E_FM7_INIT_MAX_PDU_SIZE_INSUFF 0x0001
#define E_FM7_INIT_FEAT_NOT_SUPPORTED 0x0002
#define E_FM7_INIT_USER_DENIED 0x0003
#define E_FM7_APPLICATION_OTHER 0x0100
#define E_FM7_APPLICATION_UNREACHABLE 0x0101
#define E_FM7_RESOURCE_OTHER 0x0200
#define E_FM7_RESOURCE_MEM_UNAVAILABLE 0x0201
#define E_FM7_SERV_OTHER 0x0300
#define E_FM7_SERV_OBJ_STATE_CONFLICT 0x0301
#define E_FM7_SERV_OBJ_CONSTR_CONFLICT 0x0302
#define E_FM7_SERV_PARAM_INCONSIST 0x0303
#define E_FM7_SERV_ILLEGAL_PARAM 0x0304
#define E_FM7_SERV_PERM_INTERN_FAULT 0x0305
#define E_FM7_USR_OTHER 0x0400
#define E_FM7_USR_DONT_WORRY_BE_HAPPY 0x0401
#define E_FM7_USR_MEM_UNAVAILABLE 0x0402
#define E_FM7_ACCESS_OTHER 0x0500
#define E_FM7_ACCESS_OBJ_ACC_UNSUP 0x0501
#define E_FM7_ACCESS_OBJ_NON_EXIST 0x0502
#define E_FM7_ACCESS_OBJ_ACCESS_DENIED 0x0503
#define E_FM7_ACCESS_HARDWARE_FAULT 0x0504
#define E_FM7_ACCESS_TYPE_CONFLICT 0x0505
#define E_FM7_CRL_OTHER 0x0600
#define E_FM7_CRL_INVALID_ENTRY 0x0601
#define E_FM7_CRL_NO_CRL_ENTRY 0x0602
#define E_FM7_CRL_INVALID_CRL 0x0603
#define E_FM7_CRL_NO_CRL 0x0604
#define E_FM7_CRL_WRITE_PROTECTED 0x0605
#define E_FM7_CRL_NO_ENTRY_FOUND 0x0606
#define E_FM7_CRL_NO_MULT_VFD_SUPP 0x0607
#define E_FM7_OTHER 0x0700
#if (PB_VER < 500)
#define E_FMA7_INIT_OTHER 0x0000
#define E_FMA7_INIT_MAX_PDU_SIZE_INSUFF 0x0001
#define E_FMA7_INIT_FEAT_NOT_SUPPORTED 0x0002
#define E_FMA7_INIT_USER_DENIED 0x0003
#define E_FMA7_APPLICATION_OTHER 0x0100
#define E_FMA7_APPLICATION_UNREACHABLE 0x0101
#define E_FMA7_RESOURCE_OTHER 0x0200
#define E_FMA7_RESOURCE_MEM_UNAVAILABLE 0x0201
#define E_FMA7_SERV_OTHER 0x0300
#define E_FMA7_SERV_OBJ_STATE_CONFLICT 0x0301
#define E_FMA7_SERV_OBJ_CONSTR_CONFLICT 0x0302
#define E_FMA7_SERV_PARAM_INCONSIST 0x0303
#define E_FMA7_SERV_ILLEGAL_PARAM 0x0304
#define E_FMA7_SERV_PERM_INTERN_FAULT 0x0305
#define E_FMA7_USR_OTHER 0x0400
#define E_FMA7_USR_DONT_WORRY_BE_HAPPY 0x0401
#define E_FMA7_USR_MEM_UNAVAILABLE 0x0402
#define E_FMA7_ACCESS_OTHER 0x0500
#define E_FMA7_ACCESS_OBJ_ACC_UNSUP 0x0501
#define E_FMA7_ACCESS_OBJ_NON_EXIST 0x0502
#define E_FMA7_ACCESS_OBJ_ACCESS_DENIED 0x0503
#define E_FMA7_ACCESS_HARDWARE_FAULT 0x0504
#define E_FMA7_ACCESS_TYPE_CONFLICT 0x0505
#define E_FMA7_KBL_OTHER 0x0600
#define E_FMA7_KBL_INVALID_ENTRY 0x0601
#define E_FMA7_KBL_NO_KBL_ENTRY 0x0602
#define E_FMA7_KBL_INVALID_KBL 0x0603
#define E_FMA7_KBL_NO_KBL 0x0604
#define E_FMA7_KBL_WRITE_PROTECTED 0x0605
#define E_FMA7_OTHER 0x0700
#endif
/*****************************************************************************/
/************* ADDITIONAL ERROR CODES *******************************/
/*****************************************************************************/
#define NO_ADD_DETAIL 0x00
#define AD_LLI_UNEXP_FDL_OR_TIMER_EVT 0x01
#define AD_LLI_LSAP_ACT_FAILED 0x02
#define AD_LLI_POLL_LIST_LOAD_FAILED 0x03
#define AD_LLI_PUT_RESRC_FAILED 0x04
#define AD_LLI_FDL_RESET_FAILED 0x05
#define AD_LLI_INVAL_SERV 0x01
#define AD_LLI_INVAL_SERV_CHANGE 0x02
#define AD_LLI_INVAL_INDEX_CHANGE 0x03
#define AD_FM7_TO_MANY_CRL_ENTRIES 0x10
#define AD_FM7_COMM_REF_NOT_ALLOWED 0x11
#define AD_FM7_TO_MANY_PARALLEL_SERV 0x12
#define AD_FM7_ILLEGAL_FMS_PDU_SIZE 0x13
#if (PB_VER < 500)
#define AD_FMA7_TO_MANY_KBL_ENTRIES 0x10
#define AD_FMA7_COMM_REF_NOT_ALLOWED 0x11
#define AD_FMA7_TO_MANY_PARALLEL_SERV 0x12
#define AD_FMA7_ILLEGAL_FMS_PDU_SIZE 0x13
#endif
/*****************************************************************************/
/************* FM7 EVENTS *******************************/
/*****************************************************************************/
/* --- LLI-Fault-Indications ---------------------------------------------- */
#define LLI_FM7_RC1 1
/* error while activating SAP (result in AD) */
#define LLI_FM7_RC2 2
/* error while deactivating SAP (result in AD) */
#define LLI_FM7_RC3 3
/* error during FDL_XXX_UPDATE (result in AD) */
#define LLI_FM7_RC4 4
/* error while activ. poll list entry (see AD) */
#define LLI_FM7_RC5 5
/* error while deactiv. poll list entry (see AD)*/
#define LLI_FM7_RC6 6
/* illegal FDL prim. during ASS or ABT (see AD) */
#define LLI_FM7_RC7 7
/* illegal FDL prim. in data transfer (see AD) */
#define LLI_FM7_RC8 8
/* unknown FDL primitive */
#define LLI_FM7_RC9 9
/* unknown LLI primitive */
#define LLI_FM7_RC10 10
/* illegal LLI prim. during ASS or ABT (see AD) */
#define LLI_FM7_RC11 11
/* illegal LLI prim. in data transfer (see AD) */
#define LLI_FM7_RC12 12
/* SDA failed (result in AD) */
#define LLI_FM7_RC13 13
/* CSRD transmission failed (result in AD) */
#define LLI_FM7_RC14 14
/* SRD failed (result in AD) */
#define LLI_FM7_RC15 15
/* SDN failed (result in AD) */
#define LLI_FM7_RC16 16
/* CSRD reception failed (result in AD) */
#define LLI_FM7_RC17 17
/* poll list loading failed (result in AD) */
#define LLI_FM7_RC18 18
/* timer 1 expired (associate) */
#define LLI_FM7_RC19 19
/* timer 2 expired (abort) */
#define LLI_FM7_RC20 20
/* poll list deactivation failed (result in AD) */
#define LLI_FM7_RC21 21
/* no matching comm. reference found */
#define LLI_FM7_RC22 22
/* illegal FM1/2 prim. (see AD) */
#define LLI_FM7_RC23 23
/* illegal FDL prim. during LLI start (see AD) */
#define LLI_FM7_RC24 24
/* confirm / indication mode error */
#define LLI_FM7_RC25 25
/* timer error */
#define LLI_FM7_RC26 26
/* resource transfer to FDL failed */
#define LLI_FM7_RC27 27
/* resource error during associate */
#define LLI_FM7_RC28 28
/* resource error in data transfer phase */
#define LLI_FM7_RC29 29
/* resource error during abort */
#define LLI_FM7_RC30 30
/* LLI state error */
#if (PB_VER < 500)
#define LLI_FMA7_RC1 1
/* error while activating SAP (result in AD) */
#define LLI_FMA7_RC2 2
/* error while deactivating SAP (result in AD) */
#define LLI_FMA7_RC3 3
/* error during FDL_XXX_UPDATE (result in AD) */
#define LLI_FMA7_RC4 4
/* error while activ. poll list entry (see AD) */
#define LLI_FMA7_RC5 5
/* error while deactiv. poll list entry (see AD)*/
#define LLI_FMA7_RC6 6
/* illegal FDL prim. during ASS or ABT (see AD) */
#define LLI_FMA7_RC7 7
/* illegal FDL prim. in data transfer (see AD) */
#define LLI_FMA7_RC8 8
/* unknown FDL primitive */
#define LLI_FMA7_RC9 9
/* unknown LLI primitive */
#define LLI_FMA7_RC10 10
/* illegal LLI prim. during ASS or ABT (see AD) */
#define LLI_FMA7_RC11 11
/* illegal LLI prim. in data transfer (see AD) */
#define LLI_FMA7_RC12 12
/* SDA failed (result in AD) */
#define LLI_FMA7_RC13 13
/* CSRD transmission failed (result in AD) */
#define LLI_FMA7_RC14 14
/* SRD failed (result in AD) */
#define LLI_FMA7_RC15 15
/* SDN failed (result in AD) */
#define LLI_FMA7_RC16 16
/* CSRD reception failed (result in AD) */
#define LLI_FMA7_RC17 17
/* poll list loading failed (result in AD) */
#define LLI_FMA7_RC18 18
/* timer 1 expired (associate) */
#define LLI_FMA7_RC19 19
/* timer 2 expired (abort) */
#define LLI_FMA7_RC20 20
/* poll list deactivation failed (result in AD) */
#define LLI_FMA7_RC21 21
/* no matching comm. reference found */
#define LLI_FMA7_RC22 22
/* illegal FMA1/2 prim. (see AD) */
#define LLI_FMA7_RC23 23
/* illegal FDL prim. during LLI start (see AD) */
#define LLI_FMA7_RC24 24
/* confirm / indication mode error */
#define LLI_FMA7_RC25 25
/* timer error */
#define LLI_FMA7_RC26 26
/* resource transfer to FDL failed */
#define LLI_FMA7_RC27 27
/* resource error during associate */
#define LLI_FMA7_RC28 28
/* resource error in data transfer phase */
#define LLI_FMA7_RC29 29
/* resource error during abort */
#define LLI_FMA7_RC30 30
/* LLI state error */
#endif
/****************************************************************************/
/*********************** FM2 EVENT CODES *****************************/
/****************************************************************************/
#define FM2_FAULT_ADDRESS 0x01
/* duplicate address recognized */
#define FM2_FAULT_PHY 0x02
/* phys.layer is malfunctioning */
#define FM2_FAULT_TTO 0x03
/* time out on bus detected */
#define FM2_FAULT_SYN 0x04
/* no receiver synchronization */
#define FM2_FAULT_OUT_OF_RING 0x05
/* station out of ring */
#define FM2_GAP_EVENT 0x06
/* new station in ring */
#if (PB_VER < 500)
#define FMA2_FAULT_ADDRESS 0x01
/* duplicate address recognized */
#define FMA2_FAULT_TRANSCEIVER 0x02
/* transceiver error occured */
#define FMA2_FAULT_TTO 0x03
/* time out on bus detected */
#define FMA2_FAULT_SYN 0x04
/* no receiver synchronization */
#define FMA2_FAULT_OUT_OF_RING 0x05
/* station out of ring */
#define FMA2_GAP_EVENT 0x06
/* new station in ring */
#endif
/* --- Additional FM2-Events ---------------------------------------------- */
#define FM2_MAC_ERROR 0x13
/* fatal MAC error */
#define FM2_HW_ERROR 0x14
/* fatal HW error */
/****************************************************************************/
/************* FMB ERROR CLASSES and ERROR CODES *********************/
/****************************************************************************/
#define E_FMB_RESOURCE_OTHER 0x0200
#define E_FMB_RESOURCE_MEM_UNAVAILABLE 0x0201
#define E_FMB_SERV_OTHER 0x0300
#define E_FMB_SERV_OBJ_STATE_CONFLICT 0x0301
#define E_FMB_SERV_OBJ_CONSTR_CONFLICT 0x0302
#define E_FMB_SERV_PARAM_INCONSIST 0x0303
#define E_FMB_SERV_ILLEGAL_PARAM 0x0304
#define E_FMB_SERV_PERM_INTERN_FAULT 0x0305
#define E_FMB_ACCESS_OTHER 0x0500
#define E_FMB_ACCESS_OBJ_ACC_UNSUP 0x0501
#define E_FMB_ACCESS_OBJ_NON_EXIST 0x0502
#define E_FMB_ACCESS_OBJ_ACCESS_DENIED 0x0503
#define E_FMB_ACCESS_HARDWARE_FAULT 0x0504
#define E_FMB_ACCESS_TYPE_CONFLICT 0x0505
#define E_FMB_OTHER 0x0700
#define E_FMB_CFG_DP_TOO_MANY_SLAVES 0x0901
#define E_FMB_CFG_DP_WRONG_IO_DATA_LEN 0x0902
#define E_FMB_CFG_DP_IO_ALIGNMENT_ERROR 0x0903
#define E_FMB_CFG_DP_TOO_FEW_DIAG_ENTRIES 0x0904
#define E_FMB_CFG_DP_WRONG_DIAG_DATA_LEN 0x0905
#define E_FMB_CFG_DP_WRONG_BUS_PARA_LEN 0x0906
#define E_FMB_CFG_DP_WRONG_SLAVE_PARA_LEN 0x0907
#define E_FMB_CFG_DP_DPRAM_ERROR 0x0908
/****************************************************************************/
/************* DP ERROR CLASSES and ERROR CODES *********************/
/****************************************************************************/
/*--- DP SERVICE RESULTS ---------------------------------------------------*/
#define E_DP_OK 0x0000
/* acknowledgement positive */
#define E_DP_UE 0x0001
/* remote user error */
#define E_DP_RR 0x0002
/* remote resource insufficient */
#define E_DP_RS 0x0003
/* remote service/SAP deactivated */
#define E_DP_RA 0x0004
/* access of remote SAP blocked */
#define E_DP_NA 0x0011
/* no reaction from remote station */
#define E_DP_DS 0x0012
/* local entity disconnected */
#define E_DP_NO 0x0013
/* not possible in this state */
#define E_DP_LR 0x0014
/* local resource not available */
#define E_DP_IV 0x0015
/* invalid parameter in request */
#define E_DP_TO 0x0016
/* timeout expired */
#define E_DP_FE 0x00C1
/* format error in request frame */
#define E_DP_NI 0x00C2
/* function not implemented */
#define E_DP_AD 0x00C3
/* access denied */
#define E_DP_EA 0x00C4
/* area too large */
#define E_DP_LE 0x00C5
/* data block length exceeded */
#define E_DP_RE 0x00C6
/* format error in response frame */
#define E_DP_IP 0x00C7
/* invalid parameter */
#define E_DP_SC 0x00C8
/* sequence conflict */
#define E_DP_SE 0x00C9
/* sequence error */
#define E_DP_NE 0x00CA
/* area non-existent */
#define E_DP_DI 0x00CB
/* data incomplete */
#define E_DP_NC 0x00CC
/* not connected */
#define E_DP_DATA_ALIGNMENT 0x0100
#define E_DP_TOO_MANY_SLAVES 0x0200
#define E_DP_WRONG_SLAVE_ADD 0x0300
#define E_DP_AAM_NOT_SUPPORTED 0x0400
#define E_DP_TOO_FEW_DIAG_ENTRIES 0x0500
#define E_DP_WRONG_PRM_DATA_LEN 0x0600
#define E_DP_WRONG_CFG_DATA_LEN 0x0700
#define E_DP_WRONG_DIAG_LEN 0x0800
#define E_DP_WRONG_BUS_PARA_LEN 0x0900
#define E_DP_WRONG_SLAVE_PARA_LEN 0x0A00
#define E_DP_WRONG_IO_DATA_LEN 0x0B00
#define E_DP_NOT_ENOUGH_MEMORY 0x0C00
#define E_DP_WRONG_USIF_STATE 0x0D00
#define E_DP_SLAVE_ACCESS_DENIED 0x0E00
#define E_DP_WRONG_AREA_CODE 0x0F00
#define E_DP_NOT_SUPPORTED 0x1000
#define E_DP_PRM_DATA_FAULT 0x1100
#define E_DP_CFG_DATA_FAULT 0x1200
#define E_DP_AAT_DATA_FAULT 0x1300
#define E_DP_USER_DATA_FAULT 0x1400
#define E_DP_SLAVE_PARA_FAULT 0x1500
#define E_DP_AREA_NOT_ACCESSED 0x1600
#define E_DP_WRONG_BAUDRATE 0x1700
#define E_DP_WRONG_BP_FLAG 0x1800
#define E_DP_WRONG_FDL_STATE 0x1900
#define E_DP_WRONG_ACTIVATION 0x1A00
#define E_DP_WRONG_MASTER_ADD 0x1B00
#define E_DP_DPRAM_INIT_ERROR 0x1C00
#define E_DP_WRONG_LEN 0x1D00
#define E_DP_WRONG_IDENTIFIER 0x1F00
#define E_DP_LOAD_BUS_PARAMETER 0x2000
#define E_DP_ACTIVATE_SAP 0x2100
#define E_DP_WRONG_REMOTE_SERVICE 0x2200
#define E_DP_ILLEGAL_INDEX 0x2300
#define E_DP_ILLEGAL_SLOT 0x2400
#define E_DP_ILLEGAL_LENGTH 0x2500
#define E_DP_ILLEGAL_EXTENSION 0x2600
/*****************************************************************************/
/************* DP/V1 ERROR PDU CODING *********************/
/*****************************************************************************/
#define DP_ERROR_DECODE_DPV1 128
/* error_decode */
#define DP_ERROR_DECODE_FMS 254
#define DP_ERROR_DECODE_HART 255
/* error_code_1 */
/* If error_decode is DP_ERROR_DECODE_DPV1, the following is valid */
/* error classes 0 to 9 are reserved, classes 13 to 15 are slave specific */
#define DP_ERROR_CLASS_APPLICATION 0xA0
/* errors 3 to 7 are reserved, errors 10 to 15 are slave specific */
#define DP_ERROR_APP_READ (DP_ERROR_CLASS_APPLICATION | 0x00)
#define DP_ERROR_APP_WRITE (DP_ERROR_CLASS_APPLICATION | 0x01)
#define DP_ERROR_APP_MODUL_FAILURE (DP_ERROR_CLASS_APPLICATION | 0x02)
#define DP_ERROR_APP_VERSION_CONFLICT (DP_ERROR_CLASS_APPLICATION | 0x08)
#define DP_ERROR_APP_FEATURE (DP_ERROR_CLASS_APPLICATION | 0x09)
#define DP_ERROR_CLASS_ACCESS 0xB0
/* errors 10 to 15 are slave specific */
#define DP_ERROR_ACCESS_INVALID_INDEX (DP_ERROR_CLASS_ACCESS | 0x00)
#define DP_ERROR_ACCESS_INVALID_LENGTH (DP_ERROR_CLASS_ACCESS | 0x01)
#define DP_ERROR_ACCESS_INVALID_SLOT (DP_ERROR_CLASS_ACCESS | 0x02)
#define DP_ERROR_ACCESS_TYPE_CONFLICT (DP_ERROR_CLASS_ACCESS | 0x03)
#define DP_ERROR_ACCESS_INVALID_AREA (DP_ERROR_CLASS_ACCESS | 0x04)
#define DP_ERROR_ACCESS_STATE_CONFLICT (DP_ERROR_CLASS_ACCESS | 0x05)
#define DP_ERROR_ACCESS_DENIED_ACCESS (DP_ERROR_CLASS_ACCESS | 0x06)
#define DP_ERROR_ACCESS_INVALID_RANGE (DP_ERROR_CLASS_ACCESS | 0x07)
#define DP_ERROR_ACCESS_INVALID_PARAM (DP_ERROR_CLASS_ACCESS | 0x08)
#define DP_ERROR_ACCESS_INVALID_TYPE (DP_ERROR_CLASS_ACCESS | 0x09)
#define DP_ERROR_CLASS_RESOURCE 0xC0
/* errors 4 to 7 are reserved, errors 8 to 15 are slave specific */
#define DP_ERROR_RES_READ_CONFLICT (DP_ERROR_CLASS_RESOURCE | 0x00)
#define DP_ERROR_RES_WRITE_CONFLICT (DP_ERROR_CLASS_RESOURCE | 0x01)
#define DP_ERROR_RES_BUSY (DP_ERROR_CLASS_RESOURCE | 0x02)
#define DP_ERROR_RES_UNAVAILABLE (DP_ERROR_CLASS_RESOURCE | 0x03)
/* error_code_2 */
/* If error_decode is DP_ERROR_DECODE_DPV1, the following is valid */
/* error_code_2 is completely slave specific */
/*****************************************************************************/
/************* INTERFACE ERRORS *********************/
/*****************************************************************************/
#if (PB_VER < 500)
#define E_FATAL_ERROR 7
/* unrecoverable error on board */
#define E_INIT_INVALID_PARAMETER 8
/* invalid initialize parameter*/
#define E_LOADER_ERROR 9
/* download error */
#define E_NO_CNTRL_RES 10
/* controller does not respond */
#define E_INVALID_CNTRL_TYPE_VERSION 11
/* inv. controller type or SW vers.*/
#define E_INVALID_LAYER 12
/* invalid layer */
#define E_INVALID_SERVICE 13
/* invalid service identifier */
#define E_INVALID_PRIMITIVE 14
/* invalid service primitive */
#define E_INVALID_DATA_SIZE 15
/* not enough cmi data block memory*/
#define E_INVALID_COMM_REF 16
/* invalid communication reference */
#define E_INVALID_FMS_COMM_REF 17
/* invalid FMS comm. reference */
#define E_INVALID_FMA_COMM_REF 18
/* invalid FMA7 comm. reference */
#define E_INVALID_CMI_CALL 19
/* invalid CMI call */
#define E_CMI_ERROR 20
/* error occured in CMI */
#define E_RESOURCE_UNAVAILABLE 21
/* no resource available */
#define E_NO_PARALLEL_SERVICES 22
/* no parallel services allowed */
#define E_SERVICE_CONSTR_CONFLICT 23
/* serv. tempor. not executable */
#define E_SERVICE_NOT_SUPPORTED 24
/* service not supported */
#define E_SERVICE_NOT_EXECUTABLE 25
/* service not executable */
#endif
#define E_IF_FATAL_ERROR 7
/* unrecoverable error on board */
#define E_IF_INIT_INVALID_PARAMETER 8
/* invalid initialize parameter */
#define E_IF_LOADER_ERROR 9
/* download firmware error */
#define E_IF_NO_CNTRL_RES 10
/* controller does not respond */
#define E_IF_INVALID_CNTRL_TYPE_VERSION 11
/* inv. controller type or SW vers.*/
#define E_IF_INVALID_LAYER 12
/* invalid layer */
#define E_IF_INVALID_SERVICE 13
/* invalid service identifier */
#define E_IF_INVALID_PRIMITIVE 14
/* invalid service primitive */
#define E_IF_INVALID_DATA_SIZE 15
/* not enough cmi data block memory*/
#define E_IF_INVALID_COMM_REF 16
/* invalid communication reference */
#define E_IF_INVALID_CMI_CALL 19
/* invalid CMI call */
#define E_IF_CMI_ERROR 20
/* error occured in CMI */
#define E_IF_RESOURCE_UNAVAILABLE 21
/* no resource available */
#define E_IF_NO_PARALLEL_SERVICES 22
/* no parallel services allowed */
#define E_IF_SERVICE_CONSTR_CONFLICT 23
/* serv. tempor. not executable */
#define E_IF_SERVICE_NOT_SUPPORTED 24
/* service not supported */
#define E_IF_SERVICE_NOT_EXECUTABLE 25
/* service not executable */
#define E_IF_INVALID_VERSION 26
/* invalid version */
#define E_IF_NO_CNTRL_PRESENT 28
#define E_IF_INVALID_PARAMETER 30
/* wrong parameter in REQ or RES */
#define E_IF_INIT_FAILED 31
/* init. API or Controller failed */
#define E_IF_EXIT_FAILED 32
/* exit API or Controller failed */
#define E_IF_PAPI_NOT_INITIALIZED 33
/* API not initialized */
/* error codes available only in Win NT --------------------------------------- */
#define E_IF_SLAVE_DIAG_DATA 0xF0
/* no data available */
/* new diagnostics data available */
#define E_IF_SLAVE_ERROR 0xF1
/* no data exchange */
#define E_IF_INVALID_DP_STATE 0xF2
/* DP is not in state operate */
#define E_IF_OS_ERROR 0xFF
/* OS system (WIN,DOS) error */
/* get detail with GetLastError */
/* INTERFACE ERROR DETAIL CODES ----------------------------------------------- */
/* for folLowing INTERFACE-ERRORS */
/* - E_IF_NO_CNTRL_PRESENT */
/* - E_IF_INIT_FAILED */
/* - E_IF_EXIT_FAILED */
#define PBDRV PROFIBRD
#define PROFIBRD_INTERNAL_ERROR 0x0030
/* internal driver error */
#define PROFIBRD_GENERAL_ERROR 0x0031
/* general driver error */
#define PROFIBRD_IO_PENDING 0x0032
/* driver timeout */
#define PROFIBRD_IO_CANCELLED 0x0033
/* driver call not finished */
#define PROFIBRD_ILLEGAL_CALL 0x0034
/* driver call cancelled */
#define PROFIBRD_NOT_SUPPORTED 0x0035
/* driver call not supported */
#define PROFIBRD_VERSION_ERROR 0x0036
/* driver interface version */
#define PROFIBRD_DRIVER_VERSION_ERROR 0x0037
/* driver version */
#define PROFIBRD_DRIVER_NOT_FOUND 0x0038
/* driver not found */
#define PROFIBRD_NOT_ENOUGH_MEMORY 0x0039
/* not enough memory */
#define PROFIBRD_TOO_MANY_DEVICES 0x003A
/* to many devices */
#define PROFIBRD_UNKNOWN_DEVICE 0x003B
/* unknown device */
#define PROFIBRD_DEVICE_ACCESS_ERROR 0x003C
/* device access error */
#define PROFIBRD_DPRAM_ALREADY_USED 0x003D
/* device already exists */
#define PROFIBRD_MAP_MEMORY_ERROR 0x003E
/* memory mapping error */
#define PROFIBRD_MEMORY_UNKNOWN 0x003F
/* unknown phys. memory */
#define PROFIBRD_READ_REGISTRY_ERROR 0x0040
/* read registry error */
#define PROFIBRD_DEVICE_NOT_FOUND 0x0041
/* device not found */
#define PROFIBRD_DEVICE_ALREADY_OPEN 0x0042
/* device already opened */
#define PROFIBRD_PORT_ALREADY_USED 0x0043
/* IO port already in use */
/*****************************************************************************/
/************* ERROR DATA STRUCTURES *****************************/
/*****************************************************************************/
#define MAX_ERROR_DESCR_LENGTH ERROR_DESCR_LENGTH
/* --- standard error data structure --------------------------------------- */
typedef
struct
_T_ERROR
{
USIGN16
class_code
;
/* class and code */
INT16
add_detail
;
/* additional detail */
STRINGV
add_description
[
MAX_ERROR_DESCR_LENGTH
];
/* additional description */
}
T_ERROR
;
/* --- PI error data structure --------------------------------------------- */
typedef
struct
_T_PI_ERROR
{
T_ERROR
error
;
/* standard error type */
USIGN8
pi_state
;
/* pi state */
USIGN8
dummy
;
/* alignment */
}
T_PI_ERROR
;
/* --- PI-LOC error data structure ----------------------------------------- */
typedef
struct
_T_PI_LOC_ERROR
{
T_ERROR
error
;
/* standard error type */
USIGN8
pi_state
;
/* pi state */
USIGN8
dummy
;
/* alignment */
USIGN32
vfd_number
;
/* vfd number */
}
T_PI_LOC_ERROR
;
/* --- OD error data structure --------------------------------------------- */
typedef
struct
_T_OD_ERROR
{
T_ERROR
error
;
/* standard error type */
USIGN16
index
;
/* error index */
}
T_OD_ERROR
;
#if (PB_VER < 500)
typedef
T_OD_ERROR
T_OV_ERROR
;
#endif
/* --- source OD error data structure -------------------------------------- */
typedef
struct
_T_SRC_OD_ERROR
{
T_ERROR
error
;
/* standard error type */
USIGN32
vfd_number
;
/* vfd number */
USIGN16
index
;
/* error index */
}
T_SRC_OD_ERROR
;
#if (PB_VER < 500)
typedef
T_SRC_OD_ERROR
T_SRC_OV_ERROR
;
#endif
/* --- VFD error data structure -------------------------------------------- */
typedef
struct
_T_VFD_ERROR
{
T_ERROR
error
;
/* standard error type */
USIGN32
vfd_number
;
/* vfd number */
}
T_VFD_ERROR
;
/* --- CRL error data structure -------------------------------------------- */
typedef
struct
_T_CRL_ERROR
{
T_ERROR
error
;
/* standard error type */
USIGN16
error_cr
;
/* error cr */
}
T_CRL_ERROR
;
#if (PB_VER < 500)
typedef
T_CRL_ERROR
T_KBL_ERROR
;
#endif
/*****************************************************************************/
/************* FDLIF-ERROR DATA STRUCTURES *****************************/
/*****************************************************************************/
typedef
struct
_T_FDLIF_ERROR
{
USIGN8
result
;
/* class and code */
USIGN8
dummy
;
/* alignment byte */
USIGN16
add_detail
;
/* additional detail */
}
T_FDLIF_ERROR
;
/*****************************************************************************/
/************* EXCEPTION STRUCTURES *****************************/
/*****************************************************************************/
typedef
struct
_T_EXCEPTION
{
USIGN8
task_id
;
/* task identifier in which execption occurs */
USIGN8
par1
;
/* parameter 1 */
USIGN16
par2
;
/* parameter 2 */
USIGN16
par3
;
/* parameter 3 */
}
T_EXCEPTION
;
#endif
src/lib/rt/src/os_linux/pb_fmb.h
deleted
100644 → 0
View file @
f590671d
/*****************************************************************************/
/* */
/* SOFTING GmbH */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* Copyright (C) SOFTING GmbH 1995-1999 */
/* All Rights Reserved */
/* */
/*****************************************************************************/
/*****************************************************************************/
/* FMB-USER-INTERFACE DEFINES and TYPES */
/* */
/* Filename : PB_FMB.H */
/* Version : 5.21.0.00.release */
/* Date : 27-February-1998 */
/* Author : SOFTING-BG2 */
/* */
/* */
/* Description : This file contains the types and defines of the Fieldbus- */
/* Basic Management User-Interface */
/* CHANGE_NOTES */
/* */
/* date name change */
/* ----------------------------------------------------------------------- */
/* 22.07.97 BG2-BOE set #pragma pack(2) and reset to #pragma pack() */
/* 24.09.97 BG2-BOE add new baudrate #defines */
/* - #define KBAUD_45_45 */
/* */
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
#ifndef __PB_FMB__
#define __PB_FMB__
/*
#pragma warning (disable : 4103)
#ifdef WIN32
#pragma pack(push,2)
#else
#pragma pack(2)
#endif
#pragma warning (default : 4103)
*/
/*****************************************************************************/
/*** FMB service identifier ***/
/*****************************************************************************/
#define FMB_SET_VALUE 15
#define FMB_READ_VALUE 16
#define FMB_LSAP_STATUS 17
#define FMB_FM2_EVENT 19
#define FMB_RESET 20
#define FMB_EXIT 21
#define FMB_SET_BUSPARAMETER 22
#define FMB_READ_BUSPARAMETER 24
#define FMB_GET_LIVE_LIST 26
#define FMB_SET_CONFIGURATION 27
#define FMB_EXCEPTION 28
/*****************************************************************************/
/*** FMB data structures ***/
/*****************************************************************************/
/*****************************************************************************/
/* FMB-Configuration-Management */
/*****************************************************************************/
/* VFD-Configuration ------------------------------------------------------- */
typedef
struct
_T_FMB_CONFIG_VFD
{
USIGN16
max_no_vfds
;
/* max. number of VFD's */
USIGN16
max_no_obj_descr
;
/* max. number of OD object descr.*/
USIGN8
max_obj_name_length
;
/* max. size of OD object name */
USIGN8
max_obj_ext_length
;
/* max. size of OD object extension */
}
T_FMB_CONFIG_VFD
;
/* --- CRL-Configuration --------------------------------------------------- */
typedef
struct
_T_FMB_CONFIG_CRL
{
USIGN16
max_no_fal_sdbs
;
/* max. number of FAL-SDBs */
USIGN16
max_no_fdl_sdbs
;
/* max. number of FDL-SDBs */
USIGN16
max_no_data_buffer
;
/* max. number of PDU buffers */
USIGN16
max_no_api_buffer
;
/* max. number of API buffers */
USIGN16
max_no_poll_entries
;
/* max. number of poll list entries */
USIGN16
max_no_subscr_entries
;
/* max. number of subscr.list entries */
PB_BOOL
resrc_check
;
/* for future use */
USIGN8
max_no_parallel_req
;
/* for future use */
USIGN8
max_no_parallel_ind
;
/* for future use */
USIGN8
dummy
;
/* alignment byte */
}
T_FMB_CONFIG_CRL
;
/* Notes on T_FMB_CONFIG_CRL: ------------------------------------------------
component 'max_no_subscr_entries' is of significance for PROFIBUS-PA only
component 'resrc_check' is introduced for future use - for version 5.10
set "resrc_check = PB_TRUE;"
component 'max_no_parallel_req' is introduced for future use - for
version 5.10 set "max_no_parallel_req = 0;"
component 'max_no_parallel_ind' is introduced for future use - for
version 5.10 set "max_no_parallel_ind = 0;"
end of notes on T_FMB_CONFIG_CRL ------------------------------------------ */
/* DP-Configuration -------------------------------------------------------- */
typedef
struct
_T_FMB_CONFIG_DP
{
USIGN8
max_number_slaves
;
/* maximum number DP Slaves supported */
USIGN8
max_slave_output_len
;
/* max. length of slave output data */
USIGN8
max_slave_input_len
;
/* max. length of slave input data */
USIGN8
max_slave_diag_len
;
/* max. length of one diag entry */
USIGN16
max_slave_diag_entries
;
/* max. number entries in diag buffer */
USIGN16
max_bus_para_len
;
/* max. length of bus parameter set */
USIGN16
max_slave_para_len
;
/* max. length of slave parameter set */
}
T_FMB_CONFIG_DP
;
/* FDLIF-Configuration ----------------------------------------------------- */
typedef
struct
_T_FMB_CONFIG_FDLIF
{
USIGN8
send_req_credits
;
/* max. number of send credits for SDA and SDN services */
USIGN8
srd_req_credits
;
/* max. number of send credits for SRD services */
USIGN8
receive_credits
;
/* max. number of receive credits */
USIGN8
max_no_resp_saps
;
/* max. number of FDL responder SAPs */
}
T_FMB_CONFIG_FDLIF
;
/* SM7-Configuration ------------------------------------------------------- */
typedef
struct
_T_FMB_CONFIG_SM7
{
USIGN16
reserved
;
}
T_FMB_CONFIG_SM7
;
/* Fieldbus-Basic-Management-Configuration --------------------------------- */
typedef
struct
_T_FMB_SET_CONFIGURATION_REQ
{
PB_BOOL
fms_active
;
/* FMS and FM7 services are usable */
PB_BOOL
dp_active
;
/* DP services are usable */
PB_BOOL
fdlif_active
;
/* FDLIF services are usable */
PB_BOOL
sm7_active
;
/* SM7 services are usable */
USIGN16
fdl_evt_receiver
;
/* receiver of FDL events:
FMB_USR,FM7_USR,DP_USR,FDLIF_USR */
USIGN16
data_buffer_length
;
/* max. size of PDU buffer */
T_FMB_CONFIG_VFD
vfd
;
/* VFD configuration parameters */
T_FMB_CONFIG_CRL
crl
;
/* CRL configuration parameters */
T_FMB_CONFIG_DP
dp
;
/* DP configuration parameter */
T_FMB_CONFIG_FDLIF
fdlif
;
/* FDLIF configuration parameter */
T_FMB_CONFIG_SM7
sm7
;
/* SM7 configuration parameters */
}
T_FMB_SET_CONFIGURATION_REQ
;
/*****************************************************************************/
/* FMB-Set-FDL-Busparameter */
/*****************************************************************************/
/* Baudrate ---------------------------------------------------------------- */
#define KBAUD_9_6 0x00
#define KBAUD_19_2 0x01
#define KBAUD_45_45 0x0B
#define KBAUD_93_75 0x02
#define KBAUD_187_5 0x03
#define KBAUD_500 0x04
#define KBAUD_750 0x05
#define MBAUD_1_5 0x06
#define MBAUD_3 0x07
#define MBAUD_6 0x08
#define MBAUD_12 0x09
/* Medium-Redundancy ------------------------------------------------------- */
#define NO_REDUNDANCY 0x00
#define BUS_A_HIGHPRIOR 0x01
#define BUS_B_HIGHPRIOR 0x02
#define REDUNDANCY 0x03
/* In-Ring-Desired --------------------------------------------------------- */
#define IN_RING_DESIRED PB_TRUE
#define NOT_IN_RING_DESIRED PB_FALSE
typedef
struct
_T_FMB_SET_BUSPARAMETER_REQ
{
USIGN8
loc_add
;
/* local station */
USIGN8
loc_segm
;
/* local segment */
USIGN8
baud_rate
;
/* baud rate */
USIGN8
medium_red
;
/* medium redundancy */
USIGN16
tsl
;
/* slot time */
USIGN16
min_tsdr
;
/* min. station delay time resp. */
USIGN16
max_tsdr
;
/* max. station delay time resp. */
USIGN8
tqui
;
/* quiet time */
USIGN8
tset
;
/* setup time */
USIGN32
ttr
;
/* target token rotation time */
USIGN8
g
;
/* gap update factor */
PB_BOOL
in_ring_desired
;
/* active or passive station */
USIGN8
hsa
;
/* highest station address */
USIGN8
max_retry_limit
;
/* max. retry limit */
}
T_FMB_SET_BUSPARAMETER_REQ
;
/*****************************************************************************/
/* FMB-Read-FDL-Busparameter */
/*****************************************************************************/
typedef
struct
_T_FMB_READ_BUSPARAMETER_CNF
{
USIGN8
loc_add
;
/* local station */
USIGN8
loc_segm
;
/* local segment */
USIGN8
baud_rate
;
/* baud rate */
USIGN8
medium_red
;
/* medium redundancy */
USIGN16
tsl
;
/* slot time */
USIGN16
min_tsdr
;
/* min. station delay time resp. */
USIGN16
max_tsdr
;
/* max. station delay time resp. */
USIGN8
tqui
;
/* quiet time */
USIGN8
tset
;
/* setup time */
USIGN32
ttr
;
/* target token rotation time */
USIGN8
g
;
/* gap update factor */
PB_BOOL
in_ring_desired
;
/* active or passive station */
USIGN8
hsa
;
/* highest station address */
USIGN8
max_retry_limit
;
/* max. retry limit */
USIGN16
reserved
;
/* not used */
USIGN8
ident
[
202
];
/* FDL-Ident-String */
}
T_FMB_READ_BUSPARAMETER_CNF
;
/*****************************************************************************/
/* FMB-Set-Value Service */
/*****************************************************************************/
#if !defined (__PB_FM7__)
/* FDL-Variable-Identifiers ------------------------------------------------ */
#define ID_TS 1
#define ID_BAUD_RATE 2
#define ID_MEDIUM_RED 3
#define ID_HW_RELEASE 4
#define ID_SW_RELEASE 5
#define ID_TSL 6
#define ID_MIN_TSDR 7
#define ID_MAX_TSDR 8
#define ID_TQUI 9
#define ID_TSET 10
#define ID_TTR 11
#define ID_G 12
#define ID_IN_RING_DESIRED 13
#define ID_HSA 14
#define ID_MAX_RETRY_LIMIT 15
#define ID_TRR 16
#define ID_LAS 17
#define ID_GAPL 18
/* Statistic-Counter-Identifiers ------------------------------------------- */
#define ID_FRAME_SENT_COUNT 20
#define ID_RETRY_COUNT 21
#define ID_SD_COUNT 22
#define ID_SD_ERROR_COUNT 23
#endif
typedef
struct
_T_FMB_SET_VALUE_REQ
{
USIGN8
id
;
/* value identifier */
USIGN8
length
;
/* # of values in byte */
/* USIGN8 value[length]; list of values */
}
T_FMB_SET_VALUE_REQ
;
/*****************************************************************************/
/* FMB-Read-Value Service */
/*****************************************************************************/
typedef
struct
_T_FMB_READ_VALUE_REQ
{
USIGN8
id
;
/* value identifier */
USIGN8
dummy
;
/* alignment */
}
T_FMB_READ_VALUE_REQ
;
typedef
struct
_T_FMB_READ_VALUE_CNF
{
USIGN8
id
;
/* value identifier */
USIGN8
length
;
/* # of values in byte */
/* USIGN8 value[length]; list of values */
}
T_FMB_READ_VALUE_CNF
;
/*****************************************************************************/
/* FMB-LSAP-Status Service */
/*****************************************************************************/
typedef
struct
_T_FMB_LSAP_STATUS_REQ
{
USIGN8
lsap
;
/* desired LSAP */
USIGN8
dummy
;
/* alignment byte */
}
T_FMB_LSAP_STATUS_REQ
;
typedef
struct
_T_FMB_LSAP_STATUS_CNF
{
USIGN8
access
;
/* station address or all */
USIGN8
addr_extension
;
/* segment number */
USIGN8
sda
;
/* SDA */
USIGN8
sdn
;
/* SDN */
USIGN8
srd
;
/* SRD */
USIGN8
csrd
;
/* CSRD */
}
T_FMB_LSAP_STATUS_CNF
;
/*****************************************************************************/
/* FMB-Get-Live-List Service */
/*****************************************************************************/
/* Status of Stations in Live-List ----------------------------------------- */
#define PASSIVE 0x00
#define ACTIVE_NOT_READY 0x01
#define ACTIVE_READY 0x02
#define ACTIVE_IN_RING 0x03
typedef
struct
_T_FMB_LIVE_LIST
{
USIGN8
station
;
/* station number */
USIGN8
status
;
/* current station of station */
}
T_FMB_LIVE_LIST
;
typedef
struct
_T_FMB_GET_LIVE_LIST_CNF
{
USIGN8
dummy
;
/* alignment */
USIGN8
no_of_elements
;
/* # of live list elements */
/* T_FMB_LIVE_LIST live_list[no_of_elements]; list of live list elements */
}
T_FMB_GET_LIVE_LIST_CNF
;
/****************************************************************************/
/* FMB-Event-Management */
/****************************************************************************/
#define FM2_FAULT_ADDRESS 0x01
/* duplicate address recognized */
#define FM2_FAULT_PHY 0x02
/* phys.layer is malfunctioning */
#define FM2_FAULT_TTO 0x03
/* time out on bus detected */
#define FM2_FAULT_SYN 0x04
/* no receiver synchronization */
#define FM2_FAULT_OUT_OF_RING 0x05
/* station out of ring */
#define FM2_GAP_EVENT 0x06
/* new station in ring */
/* Additional FM2-Events (Error messages from ASPC2) ---------------------- */
#define FM2_MAC_ERROR 0x13
/* fatal MAC error */
#define FM2_HW_ERROR 0x14
/* fatal HW error */
typedef
struct
_T_FMB_FM2_EVENT_IND
{
USIGN16
reason
;
/* reason code */
}
T_FMB_FM2_EVENT_IND
;
/*
#pragma warning (disable : 4103)
#ifdef WIN32
#pragma pack(pop)
#else
#pragma pack()
#endif
#pragma warning (default : 4103)
*/
#endif
/* __PB_FMB__ */
src/lib/rt/src/os_linux/pb_hw.h
deleted
100644 → 0
View file @
f590671d
/*****************************************************************************/
/* */
/* SOFTING GmbH */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* Copyright (C) SOFTING GmbH 1995-1999 */
/* All Rights Reserved */
/* */
/*****************************************************************************/
/*****************************************************************************/
/* PROFIBoard SPECIFIC DEFINES */
/* Filename : PB_HW.H */
/* Version : 5.22.0.00.release */
/* Date : 26-February-1999 */
/* Author : SOFTING-BG2 */
/* */
/* Description : This file contains the PROFIboard specific defines */
/* */
/* CHANGE_NOTES */
/* */
/* date name change */
/* ----------------------------------------------------------------------- */
/* 03.03.98 BOE new/modify #defines for DPRAM SIZES and IRQ-VAL */
/* offset in DPR */
/* */
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
#ifndef __PB_HW__
#define __PB_HW__
/* --- macros to access DPR ----------------------------------------------- */
#define _GET_DPR_BYTE(var) var
#define _SET_DPR_BYTE(out_var,in_var) out_var = in_var
#define _GET_DPR_WORD(var) var
#define _SET_DPR_WORD(out_var,in_var) out_var = in_var
#define _SET_CHIP_SELECT_ADDR(addr)
/* --- DPRAM SIZES / IRQ-VAL offset in DPR --------------------------------- */
#define DPRAM_SIZE_PROFIBOARD 0x4000
/* 16 KB DPRAM */
#define DPRAM_SIZE_PROFI_104 0x4000
/* 16 KB DPRAM */
#define DPRAM_H_TO_C_IRQ_OFFSET 0x2
/* IRQ memory cells at DPRAM end */
#define DPRAM_C_TO_H_IRQ_OFFSET 0x4
/* --- IRQ-VALUE ----------------------------------------------------------- */
#define RST_IRQ_VALUE 0xAA
/* Reset */
#define REQ_IRQ_VALUE 0xF0
/* SND/RCV Request */
#define ACK_IRQ_VALUE 0x0F
/* SND/RCV Acknowledge */
#define DP_SLAVE_IO_REQ_IRQ_VALUE 0xE0
/* DP-SLAVE-IO Request */
#define DP_SLAVE_IO_ACK_IRQ_VALUE 0x0E
/* DP-SLAVE-IO Acknowldege */
#define DP_DATA_STOP_REQ_IRQ_VALUE 0xD0
/* data transfer stop Request */
#define DP_DATA_STOP_ACK_IRQ_VALUE 0x0D
/* data transfer stop Acknowldege */
/* --- Read Registers in the I/O Area of the PC ---------------------------- */
#define IDENT_1 (IO_BASE_ADD + 0)
/* Identification Byte 1 */
#define IDENT_2 (IO_BASE_ADD + 1)
/* Identification Byte 2 */
#define IDENT_3 (IO_BASE_ADD + 2)
/* Identification Byte 3 */
#define IDENT_4 (IO_BASE_ADD + 3)
/* Identification Byte 4 */
/* --- Write Registers in the I/O Area of the PC --------------------------- */
#define BOARD_CTRL (IO_BASE_ADD + 0)
/* Board Control Register */
#define BASE_ADD (IO_BASE_ADD + 1)
/* DPRAM Base Address Register */
#define PAGE_SEL (IO_BASE_ADD + 2)
/* Page Select Register */
#define CP_IRQ (IO_BASE_ADD + 3)
/* Interrupt Register */
/* -- Pindefinition of the Board Control Register -------------------------- */
#define C165_RESET 0x01
/* Reset of the C165 (low active)*/
#define EN_DPRAM 0x02
/* Enable DPRAM for PC (high active)*/
#define SIZE_16_64 0x04
/* DPRAM size 1:16 kByte 0:64kByte*/
/* 64 kByte (low) */
#define BASE_A14 0x08
/* Address low within the 64 kByte */
#define BASE_A15 0x10
/* Address high within the 64 kByte */
#define DPR_WIDTH_8_16 0x20
/* DPRAM width 0:16Bit 1:8Bit */
#define MEMCS16_LA_SA 0x40
/* MEMCS16 generation 0:LA 1:SA */
/* --- Pindefinition of the DPRAM Base Adress Register --------------------- */
/* Bit 7: Base Address 23 (MSB) to */
/* Bit 0: Base Address 16 (LSB) */
/* --- Pindefinition of the Page Select Register --------------------------- */
#define PAGE_A0 0x01
/* Page Address low within the 64 kByte window */
#define PAGE_A1 0x02
/* Page Address high within the 64 kByte window */
#define PAGE_0 0x00
/* Page 0 0KB - 16KB */
#define PAGE_1 0x01
/* Page 1 16KB - 32KB */
#define PAGE_2 0x02
/* Page 2 32KB - 48KB */
#define PAGE_3 0x03
/* Page 3 48KB - 64KB */
/* --- Macros to Set or Clear Page ----------------------------------------- */
#define CLEAR_PAGE(reg) \
((reg) & ~(PAGE_A0 | PAGE_A1))
#define SET_PAGE(reg, page) \
(CLEAR_PAGE(reg) | page)
/* --- Board I/O identifier ------------------------------------------------ */
#define HW_IO_ID_PROFIBOARD_0 0x96
#define HW_IO_ID_PROFIBOARD_1 0x26
#define HW_IO_ID_PROFIBOARD_2 0x6B
#define HW_IO_ID_PROFI104_0 0x2C
#define HW_IO_ID_PROFI104_1 0x12
#define HW_IO_ID_PROFI104_2 0x41
#endif
src/lib/rt/src/os_linux/pb_if.h
deleted
100644 → 0
View file @
f590671d
/**********************************************************************************/
/* */
/* SOFTING GmbH */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* Copyright (C) SOFTING GmbH 1995-1999 */
/* All Rights Reserved */
/* */
/**********************************************************************************/
/**********************************************************************************/
/* PROFIBUS APPLICATION PROGRAM INTERFACE */
/* */
/* Filename : PB_IF.H */
/* Version : 5.22.0.00.release */
/* Date : 26-February-1999 */
/* Author : SOFTING-BG2 */
/* */
/* Description : This file contains the global function declarations, */
/* defines and types of the PROFIBUS Communication Interface */
/* */
/* CHANGE_NOTES */
/* */
/* date name change */
/* ------------------------------------------------------------------------ */
/* 18.03.97 BG2-BOE use compiler switch PB_API_FUNC_NOT_USED */
/* to switch off PAPI-functions */
/* 22.07.97 BG2-BOE remove layer identifier SM7 and SM7_USR */
/* 22.07.97 BG2-BOE set #pragma pack(2) and reset to #pragma pack() */
/* 24.09.97 BG2-BOE add new identifiers for data description interface */
/* - ID_SERIAL_DEVICE_NUMBER */
/* 24.07.97 BG2-BOE add new function prototypes */
/* - profi_get_serial_device_number() */
/* - profi_get_add_error() */
/* 10.02.99 BG2-BOE remove WIN32 function prototypes */
/**********************************************************************************/
/**********************************************************************************/
/**********************************************************************************/
#ifndef __PB_IF__
#define __PB_IF__
/*
#pragma warning (disable : 4103)
#ifdef WIN32
#pragma pack(push,2)
#else
#pragma pack(2)
#endif
#pragma warning (default : 4103)
*/
/**********************************************************************************/
/* INTERFACE DEFINES */
/**********************************************************************************/
/* --- contants for IRQ values -(only used for 16BIT-Interface) */
#define REQ_IRQ 0xF0
/* IND/CON IRQ is received */
#define ACK_IRQ 0x0F
/* acknowledge REQ/RES */
#define DP_SLAVE_IO_REQ_IRQ 0xE0
/* MASTER: DP-SLAVE-IO IND/REQ */
#define DP_SLAVE_IO_ACK_IRQ 0x0E
/* MASTER: DP-SLAVE-IO acknowldege IND/REQ */
#define DP_DATA_STOP_REQ_IRQ 0xD0
/* MASTER: data transfer stop REQ received */
#define DP_DATA_STOP_ACK_IRQ 0x0D
/* MASTER: data transfer stop Acknowldege */
#define EXCEPTION_REQ_IRQ 0xB0
/* Exception Request */
#define EXCEPTION_ACK_IRQ 0x0B
/* Exception Acknowledge */
/* --- contants to receive an indication or confirmation ------------------------ */
#define CON_IND_RECEIVED 0x0001
/* ind. or con. has been received */
#define NO_CON_IND_RECEIVED 0x0000
/* nothing has been received */
/* --- values > CON_IND_RECEIVED are error returns (see pb_err.h) -------------- */
/* --- OK return value ---------------------------------------------------------- */
#define E_OK 0
/* no errors */
/* --- values != E_OK are error returns (see pb_err.h) -------------------------- */
/* --- service result ----------------------------------------------------------- */
#define NEG 0x01
/* result for negative response */
#define POS 0x00
/* result for positive response */
/* --- service priority --------------------------------------------------------- */
#define LOW 0x00
/* high priority */
#define HIGH 0x01
/* low priority */
/* --- service primitives ------------------------------------------------------- */
#define REQ 0x00
/* request primitive */
#define CON 0x01
/* confirmation primitive */
#define IND 0x02
/* indication primitive */
#define RES 0x03
/* response primitive */
#define RET 0x04
/* return primitive not used by application */
/* --- layer identifiers -------------------------------------------------------- */
#define USR 0x00
/* identifier USER */
#define FMS 0x01
/* identifier FMS */
#define LLI 0x02
/* identifier LLI */
#define FDL 0x03
/* identifier FDL */
#define FM7 0x04
/* identifier FM7 */
#define FMB 0x05
/* identifier FMB */
#define FMS_USR 0x06
/* identifier FMS-USER */
#define FM7_USR 0x07
/* identifier FM7-USER */
#define FMB_USR 0x08
/* identifier FMB-USER */
#define DP 0x0B
/* identifier DP */
#define DP_USR 0x0C
/* identifier DP-USER */
#define FDLIF 0x0D
/* identifier FDLIF */
#define FDLIF_USR 0x0E
/* identifier FDLIF-USER */
#define PAPI 0xF0
/* identifier Application-Layer-IF */
#if (PB_VER < 500)
#define FMA7 FM7
/* identifier FMA7 */
#define FMA2 FMB
/* identifier FMA2 */
#define FMA7_USR FM7_USR
/* identifier FMA7-USER */
#endif
/* --- identifiers for data description interface ------------------------------- */
/* --- 0x00 - 0x3F used by FMS -- (no identifiers defined) ---------------------- */
/* --- 0x40 - 0x7F reserved by management -- (no identifiers defined) ----------- */
/* --- 0x80 - 0x9F reserved by DP ----------------------------------------------- */
/* --- DP-MASTER ---------------------------------------------------------------- */
#define ID_DP_SLAVE_IO_IMAGE 0x80
/* MASTER: image for slave io datas */
#define ID_DP_STATUS_IMAGE 0x81
/* MASTER: image for status datas */
/* --- 0xA0 - 0xEF reserved for future use --- (no identifiers defined) --------- */
/* --- 0xF0 - 0xFF reserved for diagonsis -------------------------------------- */
#define ID_EXCEPTION_IMAGE 0xF0
/* image for exeption datas */
#define ID_FW_VERS_IMAGE 0xF1
/* image for firmware version */
#define ID_SERIAL_DEVICE_NUMBER 0xF2
/* image for serial device number */
/* --- idebtifier for end of data description list ------------------------------ */
#define EOF_DATA_DESCR_LIST 0x00
/* end of data description list */
/**********************************************************************************/
/* PROFI SERVICE DESCRIPTION BLOCK */
/**********************************************************************************/
typedef
struct
_T_PROFI_SERVICE_DESCR
{
USIGN16
comm_ref
;
/* communication reference */
USIGN8
layer
;
/* layer identifier */
USIGN8
service
;
/* service identifier */
USIGN8
primitive
;
/* service primitive */
INT8
invoke_id
;
/* invoke id */
INT16
result
;
/* service result (POS or NEG) */
}
T_PROFI_SERVICE_DESCR
;
#endif
src/lib/rt/src/os_linux/pb_type.h
deleted
100644 → 0
View file @
f590671d
/*****************************************************************************/
/* */
/* SOFTING GmbH */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* Copyright (C) SOFTING GmbH 1995-1999 */
/* All Rights Reserved */
/* */
/*****************************************************************************/
/*****************************************************************************/
/* PROFIBUS BASIC TYPES */
/* */
/* Filename : PB_TYPE.H */
/* Version : 5.22.0.00.release */
/* Date : 26-February-1999 */
/* Author : SOFTING-BG2 */
/* */
/* Description : This file contains the PROFIBUS basic types */
/* */
/* CHANGE_NOTES */
/* */
/* date name change */
/* ----------------------------------------------------------------------- */
/* 18.03.97 BG2-BOE include header file 'pb_conf.h' */
/* 18.03.97 BG2-BOE remove #define FAR and #define HUGE */
/* 02.02.99 BG2-BOE define INT32 as int using WIN32 */
/* (compatibility to MSVC60) */
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
#ifndef __PB_TYPE__
#define __PB_TYPE__
#include "pb_conf.h"
/* PAPI configuration parameters */
/* --- global type definitions --------------------------------------------- */
#ifndef VOID
#define VOID void
#endif
#define PB_BOOL unsigned char
#if (PB_VER < 500)
#undef BOOL
#define BOOL PB_BOOL
#endif
#define OCTET unsigned char
#define USIGN8 unsigned char
#define USIGN16 unsigned short
#define USIGN32 unsigned int
#define INT8 signed char
#define INT16 signed short
#define INT32 signed int
#define FLOAT float
#define DOUBLE double
#define STRINGV char
#define CSTRING char
/* --- PROFIBUS true and false definitions --------------------------------- */
#define PB_TRUE 0xFF
#define PB_FALSE 0x00
#if (PB_VER < 500)
#undef TRUE
#undef FALSE
#define TRUE PB_TRUE
#define FALSE PB_FALSE
#endif
/* --- PROFIBUS function declarations -------------------------------------- */
#define LOCAL static
#define PUBLIC
#define GLOBAL
#endif
src/lib/rt/src/os_linux/rt_io_m_pb_ai.c
deleted
100644 → 0
View file @
f590671d
/*
* Proview $Id: rt_io_m_pb_ai.c,v 1.4 2005-09-01 14:57:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* rt_io_m_pb_ai.c
PROVIEW/R */
#pragma pack(1)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <math.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include "pb_type.h"
#include "pb_if.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
/*----------------------------------------------------------------------------*\
Convert ai from rawvalue to actualvalue.
\*----------------------------------------------------------------------------*/
void
ConvertAi
(
pwr_sClass_ChanAi
*
cop
,
pwr_tInt16
nobits
,
pwr_tUInt8
rawvalue8
,
pwr_tUInt16
rawvalue16
,
pwr_tUInt32
rawvalue32
,
pwr_tFloat32
*
actvalue_p
,
pwr_tEnum
representation
)
{
pwr_tFloat32
sigvalue
;
pwr_tFloat32
actvalue
;
pwr_tFloat32
*
polycoef_p
;
pwr_tFloat32
f_raw
;
int
i
;
if
(
nobits
==
32
)
{
if
(
representation
==
PB_NUMREP_SIGNEDINT
)
f_raw
=
(
float
)
((
int
)
rawvalue32
);
else
f_raw
=
(
float
)
rawvalue32
;
}
else
if
(
nobits
==
16
){
if
(
representation
==
PB_NUMREP_SIGNEDINT
)
f_raw
=
(
float
)
((
short
)
rawvalue16
);
else
f_raw
=
(
float
)
rawvalue16
;
}
else
if
(
nobits
==
8
){
if
(
representation
==
PB_NUMREP_SIGNEDINT
)
f_raw
=
(
float
)
((
char
)
rawvalue8
);
else
f_raw
=
(
float
)
rawvalue8
;
}
switch
(
cop
->
SensorPolyType
)
{
case
0
:
*
actvalue_p
=
cop
->
SigValPolyCoef0
+
cop
->
SigValPolyCoef1
*
f_raw
;
break
;
case
1
:
*
actvalue_p
=
cop
->
SensorPolyCoef0
+
cop
->
SensorPolyCoef1
*
f_raw
;
break
;
case
2
:
sigvalue
=
cop
->
SigValPolyCoef0
+
cop
->
SigValPolyCoef1
*
f_raw
;
polycoef_p
=
&
cop
->
SensorPolyCoef2
;
actvalue
=
0
;
for
(
i
=
0
;
i
<
3
;
i
++
)
{
actvalue
=
sigvalue
*
actvalue
+
*
polycoef_p
;
polycoef_p
--
;
}
*
actvalue_p
=
actvalue
;
break
;
case
3
:
sigvalue
=
cop
->
SigValPolyCoef0
+
cop
->
SigValPolyCoef1
*
f_raw
;
actvalue
=
cop
->
SensorPolyCoef0
+
cop
->
SensorPolyCoef1
*
sigvalue
;
if
(
actvalue
>=
0
)
*
actvalue_p
=
cop
->
SensorPolyCoef2
*
sqrt
(
actvalue
);
else
*
actvalue_p
=
0
;
break
;
case
4
:
sigvalue
=
cop
->
SigValPolyCoef0
+
cop
->
SigValPolyCoef1
*
f_raw
;
actvalue
=
cop
->
SensorPolyCoef0
+
cop
->
SensorPolyCoef1
*
sigvalue
;
if
(
actvalue
>=
0
)
*
actvalue_p
=
cop
->
SensorPolyCoef2
*
sqrt
(
actvalue
);
else
*
actvalue_p
=
-
cop
->
SensorPolyCoef2
*
sqrt
(
-
actvalue
);
break
;
}
}
/*----------------------------------------------------------------------------*\
Convert ait from rawvalue to actualvalue.
\*----------------------------------------------------------------------------*/
void
ConvertAit
(
pwr_sClass_ChanAit
*
cop
,
pwr_tInt16
nobits
,
pwr_tUInt16
rawvalue8
,
pwr_tUInt16
rawvalue16
,
pwr_tUInt32
rawvalue32
,
pwr_tFloat32
*
actvalue_p
,
pwr_tEnum
representation
)
{
pwr_tFloat32
Slope
;
pwr_tFloat32
Intercept
;
pwr_tFloat32
TransTabValue
;
pwr_tUInt16
First
=
0
;
pwr_tUInt16
Middle
;
pwr_tUInt16
Last
;
pwr_tFloat32
sigvalue
;
pwr_tFloat32
f_raw
;
if
(
nobits
==
32
)
{
if
(
representation
==
PB_NUMREP_SIGNEDINT
)
f_raw
=
(
float
)
((
int
)
rawvalue32
);
else
f_raw
=
(
float
)
rawvalue32
;
}
else
if
(
nobits
==
16
)
{
if
(
representation
==
PB_NUMREP_SIGNEDINT
)
f_raw
=
(
float
)
((
short
)
rawvalue16
);
else
f_raw
=
(
float
)
rawvalue16
;
}
else
if
(
nobits
==
8
)
{
if
(
representation
==
PB_NUMREP_SIGNEDINT
)
f_raw
=
(
float
)
((
char
)
rawvalue8
);
else
f_raw
=
(
float
)
rawvalue8
;
}
sigvalue
=
cop
->
SigValPolyCoef0
+
cop
->
SigValPolyCoef1
*
f_raw
;
Last
=
cop
->
NoOfCoordinates
;
while
(
(
Last
-
First
)
>
1
)
{
Middle
=
(
First
+
Last
)
/
2
;
TransTabValue
=
cop
->
InValue
[
Middle
];
if
(
sigvalue
<
TransTabValue
)
Last
=
Middle
;
else
First
=
Middle
;
}
Intercept
=
cop
->
Intercept
[
First
];
Slope
=
cop
->
Slope
[
First
];
*
actvalue_p
=
Intercept
+
sigvalue
*
Slope
;
}
/*----------------------------------------------------------------------------*\
Init method for the Pb module Ai
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
pwr_sClass_Pb_Ai
*
op
;
int
i
;
io_sChannel
*
chanp
;
op
=
(
pwr_sClass_Pb_Ai
*
)
cp
->
op
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
if
(
rp
->
Class
!=
pwr_cClass_Pb_DP_Slave
)
{
errh_Info
(
"Illegal object type %s"
,
cp
->
Name
);
return
1
;
}
if
(
op
->
Status
>=
PB_MODULE_STATE_OPERATE
)
{
for
(
i
=
0
;
i
<
IO_MAXCHAN
;
i
++
)
{
local
->
scancount
[
i
]
=
0
;
}
// Calculate polycoeff
for
(
i
=
0
;
i
<
cp
->
ChanListSize
;
i
++
)
{
chanp
=
&
cp
->
chanlist
[
i
];
if
(
!
chanp
->
cop
)
continue
;
io_AiRangeToCoef
(
chanp
);
}
}
else
errh_Info
(
"Error initializing Pb module Ai %s"
,
cp
->
Name
);
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Read method for the Pb Ai card
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardRead
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
pwr_sClass_Pb_Ai
*
op
;
pwr_sClass_Pb_DP_Slave
*
slave
;
io_sChannel
*
chanp
;
pwr_sClass_ChanAi
*
cop
;
pwr_sClass_Ai
*
sop
;
pwr_tInt8
data8
=
0
;
pwr_tUInt8
udata8
=
0
;
pwr_tInt16
data16
=
0
;
pwr_tUInt16
udata16
=
0
;
pwr_tInt32
data32
=
0
;
pwr_tUInt32
udata32
=
0
;
pwr_tFloat32
actvalue
;
int
i
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
op
=
(
pwr_sClass_Pb_Ai
*
)
cp
->
op
;
slave
=
(
pwr_sClass_Pb_DP_Slave
*
)
rp
->
op
;
if
(
op
->
Status
>=
PB_MODULE_STATE_OPERATE
&&
slave
->
DisableSlave
!=
1
)
{
for
(
i
=
0
;
i
<
cp
->
ChanListSize
;
i
++
)
{
chanp
=
&
cp
->
chanlist
[
i
];
if
(
!
chanp
->
cop
)
continue
;
cop
=
(
pwr_sClass_ChanAi
*
)
chanp
->
cop
;
sop
=
(
pwr_sClass_Ai
*
)
chanp
->
sop
;
if
(
cop
->
CalculateNewCoef
)
io_AiRangeToCoef
(
chanp
);
if
(
cop
->
ConversionOn
)
{
if
(
local
->
scancount
[
i
]
<=
1
)
{
if
(
op
->
BytesPerChannel
==
4
)
{
memcpy
(
&
udata32
,
local
->
input_area
+
op
->
OffsetInputs
+
4
*
i
,
4
);
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
udata32
=
swap32
(
udata32
);
data32
=
(
pwr_tInt32
)
udata32
;
sop
->
RawValue
=
0
;
if
(
op
->
NumberRepresentation
==
PB_NUMREP_UNSIGNEDINT
)
sop
->
SigValue
=
udata32
*
cop
->
SigValPolyCoef1
+
cop
->
SigValPolyCoef0
;
else
sop
->
SigValue
=
data32
*
cop
->
SigValPolyCoef1
+
cop
->
SigValPolyCoef0
;
switch
(
chanp
->
ChanClass
)
{
case
pwr_cClass_ChanAi
:
ConvertAi
(
cop
,
32
,
0
,
0
,
udata32
,
&
actvalue
,
op
->
NumberRepresentation
);
break
;
case
pwr_cClass_ChanAit
:
ConvertAit
((
pwr_sClass_ChanAit
*
)
cop
,
32
,
0
,
0
,
udata32
,
&
actvalue
,
op
->
NumberRepresentation
);
break
;
}
}
else
if
(
op
->
BytesPerChannel
==
3
)
{
udata32
=
0
;
memcpy
(
&
udata32
,
local
->
input_area
+
op
->
OffsetInputs
+
3
*
i
,
3
);
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
udata32
=
swap32
(
udata32
);
data32
=
(
pwr_tInt32
)
udata32
;
sop
->
RawValue
=
0
;
if
(
op
->
NumberRepresentation
==
PB_NUMREP_UNSIGNEDINT
)
sop
->
SigValue
=
udata32
*
cop
->
SigValPolyCoef1
+
cop
->
SigValPolyCoef0
;
else
sop
->
SigValue
=
data32
*
cop
->
SigValPolyCoef1
+
cop
->
SigValPolyCoef0
;
switch
(
chanp
->
ChanClass
)
{
case
pwr_cClass_ChanAi
:
ConvertAi
(
cop
,
32
,
0
,
0
,
udata32
,
&
actvalue
,
op
->
NumberRepresentation
);
break
;
case
pwr_cClass_ChanAit
:
ConvertAit
((
pwr_sClass_ChanAit
*
)
cop
,
32
,
0
,
0
,
udata32
,
&
actvalue
,
op
->
NumberRepresentation
);
break
;
}
}
else
if
(
op
->
BytesPerChannel
==
2
)
{
memcpy
(
&
udata16
,
local
->
input_area
+
op
->
OffsetInputs
+
2
*
i
,
2
);
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
udata16
=
swap16
(
udata16
);
data16
=
(
pwr_tInt16
)
udata16
;
sop
->
RawValue
=
udata16
;
if
(
op
->
NumberRepresentation
==
PB_NUMREP_UNSIGNEDINT
)
sop
->
SigValue
=
udata16
*
cop
->
SigValPolyCoef1
+
cop
->
SigValPolyCoef0
;
else
sop
->
SigValue
=
data16
*
cop
->
SigValPolyCoef1
+
cop
->
SigValPolyCoef0
;
switch
(
chanp
->
ChanClass
)
{
case
pwr_cClass_ChanAi
:
ConvertAi
(
cop
,
16
,
0
,
udata16
,
0
,
&
actvalue
,
op
->
NumberRepresentation
);
break
;
case
pwr_cClass_ChanAit
:
ConvertAit
((
pwr_sClass_ChanAit
*
)
cop
,
16
,
0
,
udata16
,
0
,
&
actvalue
,
op
->
NumberRepresentation
);
break
;
}
}
else
if
(
op
->
BytesPerChannel
==
1
)
{
memcpy
(
&
udata8
,
local
->
input_area
+
op
->
OffsetInputs
+
i
,
1
);
data8
=
(
pwr_tInt8
)
udata8
;
sop
->
RawValue
=
udata8
;
if
(
op
->
NumberRepresentation
==
PB_NUMREP_UNSIGNEDINT
)
sop
->
SigValue
=
udata8
*
cop
->
SigValPolyCoef1
+
cop
->
SigValPolyCoef0
;
else
sop
->
SigValue
=
data8
*
cop
->
SigValPolyCoef1
+
cop
->
SigValPolyCoef0
;
switch
(
chanp
->
ChanClass
)
{
case
pwr_cClass_ChanAi
:
ConvertAi
(
cop
,
8
,
udata8
,
0
,
0
,
&
actvalue
,
op
->
NumberRepresentation
);
break
;
case
pwr_cClass_ChanAit
:
ConvertAit
((
pwr_sClass_ChanAit
*
)
cop
,
8
,
udata8
,
0
,
0
,
&
actvalue
,
op
->
NumberRepresentation
);
break
;
}
}
// Filter
if
(
sop
->
FilterType
==
1
&&
sop
->
FilterAttribute
[
0
]
>
0
&&
sop
->
FilterAttribute
[
0
]
>
ctx
->
ScanTime
)
{
actvalue
=
*
(
pwr_tFloat32
*
)
chanp
->
vbp
+
ctx
->
ScanTime
/
sop
->
FilterAttribute
[
0
]
*
(
actvalue
-
*
(
pwr_tFloat32
*
)
chanp
->
vbp
);
}
*
(
pwr_tFloat32
*
)
chanp
->
vbp
=
actvalue
;
local
->
scancount
[
i
]
=
cop
->
ScanInterval
+
1
;
}
local
->
scancount
[
i
]
--
;
}
// if ...ConversionOn
}
// for
}
// if ...op->Status
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Close method for the Pb Ai card
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardClose
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
local
=
cp
->
Local
;
free
((
char
*
)
local
);
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport
pwr_BindIoMethods
(
Pb_Ai
)
=
{
pwr_BindIoMethod
(
IoCardInit
),
pwr_BindIoMethod
(
IoCardRead
),
pwr_BindIoMethod
(
IoCardClose
),
pwr_NullMethod
};
src/lib/rt/src/os_linux/rt_io_m_pb_ao.c
deleted
100644 → 0
View file @
f590671d
/*
* Proview $Id: rt_io_m_pb_ao.c,v 1.4 2005-09-01 14:57:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* rt_io_m_pb_ao.c
PROVIEW/R */
#pragma pack(1)
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include "pb_type.h"
#include "pb_if.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
/*----------------------------------------------------------------------------*\
Init method for the Pb module Ao
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
pwr_sClass_Pb_Ao
*
op
;
io_sChannel
*
chanp
;
int
i
;
op
=
(
pwr_sClass_Pb_Ao
*
)
cp
->
op
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
if
(
rp
->
Class
!=
pwr_cClass_Pb_DP_Slave
)
{
errh_Info
(
"Illegal object type %s"
,
cp
->
Name
);
return
IO__SUCCESS
;
}
if
(
op
->
Status
>=
PB_MODULE_STATE_OPERATE
)
{
// Calculate polycoeff
for
(
i
=
0
;
i
<
cp
->
ChanListSize
;
i
++
)
{
chanp
=
&
cp
->
chanlist
[
i
];
if
(
!
chanp
->
cop
)
continue
;
io_AoRangeToCoef
(
chanp
);
}
}
else
errh_Info
(
"Error initializing Pb module Ao %s"
,
cp
->
Name
);
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Write method for the Pb module Ao
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardWrite
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
pwr_sClass_Pb_Ao
*
op
;
pwr_sClass_Pb_DP_Slave
*
slave
;
int
i
;
pwr_tInt8
data8
=
0
;
pwr_tInt16
data16
=
0
;
pwr_tInt32
data32
=
0
;
pwr_tUInt8
udata8
=
0
;
pwr_tUInt16
udata16
=
0
;
pwr_tUInt32
udata32
=
0
;
pwr_sClass_ChanAo
*
cop
;
pwr_sClass_Ao
*
sop
;
io_sChannel
*
chanp
;
int
fixout
;
pwr_tFloat32
value
;
pwr_tFloat32
rawvalue
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
op
=
(
pwr_sClass_Pb_Ao
*
)
cp
->
op
;
slave
=
(
pwr_sClass_Pb_DP_Slave
*
)
rp
->
op
;
if
(
op
->
Status
>=
PB_MODULE_STATE_OPERATE
&&
slave
->
DisableSlave
!=
1
)
{
fixout
=
ctx
->
Node
->
EmergBreakTrue
&&
ctx
->
Node
->
EmergBreakSelect
==
FIXOUT
;
for
(
i
=
0
;
i
<
cp
->
ChanListSize
;
i
++
)
{
chanp
=
&
cp
->
chanlist
[
i
];
if
(
!
chanp
->
cop
)
continue
;
cop
=
(
pwr_sClass_ChanAo
*
)
chanp
->
cop
;
sop
=
(
pwr_sClass_Ao
*
)
chanp
->
sop
;
// Determine what actual value we actually want!
if
(
fixout
)
value
=
cop
->
FixedOutValue
;
else
if
(
cop
->
TestOn
)
value
=
cop
->
TestValue
;
else
value
=
*
(
pwr_tFloat32
*
)
chanp
->
vbp
;
// Make new coeff.. if necessary
if
(
cop
->
CalculateNewCoef
)
io_AoRangeToCoef
(
chanp
);
// Convert to rawvalue
if
(
value
>
cop
->
ActValRangeHigh
)
value
=
cop
->
ActValRangeHigh
;
else
if
(
value
<
cop
->
ActValRangeLow
)
value
=
cop
->
ActValRangeLow
;
rawvalue
=
cop
->
OutPolyCoef1
*
value
+
cop
->
OutPolyCoef0
;
if
(
rawvalue
>
0
)
rawvalue
=
rawvalue
+
0
.
5
;
else
rawvalue
=
rawvalue
-
0
.
5
;
// We dont use RawValue in Profibus I/O
sop
->
RawValue
=
0
;
// Calculate signal value
sop
->
SigValue
=
cop
->
SigValPolyCoef1
*
value
+
cop
->
SigValPolyCoef0
;
if
(
op
->
BytesPerChannel
==
4
)
{
if
(
op
->
NumberRepresentation
==
PB_NUMREP_UNSIGNEDINT
)
{
udata32
=
(
pwr_tUInt32
)
rawvalue
;
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
udata32
=
swap32
(
udata32
);
memcpy
(
local
->
output_area
+
op
->
OffsetOutputs
+
4
*
i
,
&
udata32
,
4
);
}
else
if
(
op
->
NumberRepresentation
==
PB_NUMREP_SIGNEDINT
)
{
data32
=
(
pwr_tInt32
)
rawvalue
;
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
data32
=
swap32
(
data32
);
memcpy
(
local
->
output_area
+
op
->
OffsetOutputs
+
4
*
i
,
&
data32
,
4
);
}
}
else
if
(
op
->
BytesPerChannel
==
3
)
{
if
(
op
->
NumberRepresentation
==
PB_NUMREP_UNSIGNEDINT
)
{
udata32
=
(
pwr_tUInt32
)
rawvalue
;
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
udata32
=
swap32
(
udata32
);
memcpy
(
local
->
output_area
+
op
->
OffsetOutputs
+
3
*
i
,
&
udata32
,
3
);
}
else
if
(
op
->
NumberRepresentation
==
PB_NUMREP_SIGNEDINT
)
{
data32
=
(
pwr_tInt32
)
rawvalue
;
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
data32
=
swap32
(
data32
);
memcpy
(
local
->
output_area
+
op
->
OffsetOutputs
+
3
*
i
,
&
data32
,
3
);
}
}
else
if
(
op
->
BytesPerChannel
==
2
)
{
if
(
op
->
NumberRepresentation
==
PB_NUMREP_UNSIGNEDINT
)
{
udata16
=
(
pwr_tUInt16
)
rawvalue
;
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
udata16
=
swap16
(
udata16
);
memcpy
(
local
->
output_area
+
op
->
OffsetOutputs
+
2
*
i
,
&
udata16
,
2
);
}
else
if
(
op
->
NumberRepresentation
==
PB_NUMREP_SIGNEDINT
)
{
data16
=
(
pwr_tInt16
)
rawvalue
;
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
data16
=
swap16
(
data16
);
memcpy
(
local
->
output_area
+
op
->
OffsetOutputs
+
2
*
i
,
&
data16
,
2
);
}
}
else
if
(
op
->
BytesPerChannel
==
1
)
{
if
(
op
->
NumberRepresentation
==
PB_NUMREP_UNSIGNEDINT
)
{
udata8
=
(
pwr_tUInt8
)
rawvalue
;
memcpy
(
local
->
output_area
+
op
->
OffsetOutputs
+
i
,
&
udata8
,
1
);
}
else
if
(
op
->
NumberRepresentation
==
PB_NUMREP_SIGNEDINT
)
{
data8
=
(
pwr_tInt8
)
rawvalue
;
memcpy
(
local
->
output_area
+
op
->
OffsetOutputs
+
i
,
&
data8
,
1
);
}
}
}
}
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardClose
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
local
=
cp
->
Local
;
free
((
char
*
)
local
);
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport
pwr_BindIoMethods
(
Pb_Ao
)
=
{
pwr_BindIoMethod
(
IoCardInit
),
pwr_BindIoMethod
(
IoCardWrite
),
pwr_BindIoMethod
(
IoCardClose
),
pwr_NullMethod
};
src/lib/rt/src/os_linux/rt_io_m_pb_di.c
deleted
100644 → 0
View file @
f590671d
/*
* Proview $Id: rt_io_m_pb_di.c,v 1.4 2005-09-01 14:57:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* rt_io_m_pb_di.c
PROVIEW/R */
#pragma pack(1)
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include "pb_type.h"
#include "pb_if.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
/*----------------------------------------------------------------------------*\
Init method for the Pb module Di
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
pwr_sClass_Pb_Di
*
op
;
op
=
(
pwr_sClass_Pb_Di
*
)
cp
->
op
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
// Check configuration
if
(
op
->
NumberOfChannels
!=
8
&&
op
->
NumberOfChannels
!=
16
&&
op
->
NumberOfChannels
!=
32
)
op
->
Status
=
PB_MODULE_STATE_NOTINIT
;
if
(
op
->
Orientation
>
op
->
NumberOfChannels
)
op
->
Status
=
PB_MODULE_STATE_NOTINIT
;
if
(
op
->
Status
<
PB_MODULE_STATE_OPERATE
)
errh_Info
(
"Error initializing Pb module Di %s"
,
cp
->
Name
);
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Read method for the Pb module Di
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardRead
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
pwr_sClass_Pb_Di
*
op
;
pwr_sClass_Pb_DP_Slave
*
slave
;
pwr_tUInt16
data
[
2
]
=
{
0
,
0
};
pwr_tUInt32
*
data32
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
op
=
(
pwr_sClass_Pb_Di
*
)
cp
->
op
;
slave
=
(
pwr_sClass_Pb_DP_Slave
*
)
rp
->
op
;
if
(
op
->
Status
>=
PB_MODULE_STATE_OPERATE
&&
slave
->
DisableSlave
!=
1
)
{
memcpy
(
&
data
,
local
->
input_area
+
op
->
OffsetInputs
,
op
->
BytesOfInput
);
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
{
if
(
op
->
Orientation
==
PB_ORIENTATION_WORD
)
{
data
[
0
]
=
swap16
(
data
[
0
]);
data
[
1
]
=
swap16
(
data
[
1
]);
}
else
if
(
op
->
Orientation
==
PB_ORIENTATION_DWORD
)
{
data32
=
(
pwr_tUInt32
*
)
&
data
;
*
data32
=
swap32
(
*
data32
);
}
}
// Packa upp
data
[
0
]
=
data
[
0
]
^
op
->
InvMask1
;
io_DiUnpackWord
(
cp
,
data
[
0
],
op
->
ConvMask1
,
0
);
if
(
op
->
NumberOfChannels
>
16
)
{
data
[
1
]
=
data
[
1
]
^
op
->
InvMask2
;
io_DiUnpackWord
(
cp
,
data
[
1
],
op
->
ConvMask2
,
1
);
}
}
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardClose
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
local
=
cp
->
Local
;
free
((
char
*
)
local
);
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport
pwr_BindIoMethods
(
Pb_Di
)
=
{
pwr_BindIoMethod
(
IoCardInit
),
pwr_BindIoMethod
(
IoCardRead
),
pwr_BindIoMethod
(
IoCardClose
),
pwr_NullMethod
};
src/lib/rt/src/os_linux/rt_io_m_pb_do.c
deleted
100644 → 0
View file @
f590671d
/*
* Proview $Id: rt_io_m_pb_do.c,v 1.4 2005-09-01 14:57:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* rt_io_m_pb_do.c
PROVIEW/R */
#pragma pack(1)
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include "pb_type.h"
#include "pb_if.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
/*----------------------------------------------------------------------------*\
Init method for the Pb module Do
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
pwr_sClass_Pb_Do
*
op
;
op
=
(
pwr_sClass_Pb_Do
*
)
cp
->
op
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
if
(
op
->
NumberOfChannels
!=
8
&&
op
->
NumberOfChannels
!=
16
&&
op
->
NumberOfChannels
!=
32
)
op
->
Status
=
PB_MODULE_STATE_NOTINIT
;
if
(
op
->
Orientation
>
op
->
NumberOfChannels
)
op
->
Status
=
PB_MODULE_STATE_NOTINIT
;
if
(
op
->
Status
<
PB_MODULE_STATE_OPERATE
)
errh_Info
(
"Error initializing Pb module Do %s"
,
cp
->
Name
);
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Write method for the Pb module Do
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardWrite
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
pwr_sClass_Pb_Do
*
op
;
pwr_sClass_Pb_DP_Slave
*
slave
;
pwr_tUInt16
data
[
2
]
=
{
0
,
0
};
pwr_tUInt32
*
data32
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
op
=
(
pwr_sClass_Pb_Do
*
)
cp
->
op
;
slave
=
(
pwr_sClass_Pb_DP_Slave
*
)
rp
->
op
;
if
(
op
->
Status
>=
PB_MODULE_STATE_OPERATE
&&
slave
->
DisableSlave
!=
1
)
{
io_DoPackWord
(
cp
,
&
data
[
0
],
0
);
if
(
op
->
NumberOfChannels
>
16
)
io_DoPackWord
(
cp
,
&
data
[
1
],
1
);
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
{
if
(
op
->
Orientation
==
PB_ORIENTATION_WORD
)
{
data
[
0
]
=
swap16
(
data
[
0
]);
data
[
1
]
=
swap16
(
data
[
1
]);
}
else
if
(
op
->
Orientation
==
PB_ORIENTATION_DWORD
)
{
data32
=
(
pwr_tUInt32
*
)
&
data
;
*
data32
=
swap32
(
*
data32
);
}
}
memcpy
(
local
->
output_area
+
op
->
OffsetOutputs
,
&
data
,
op
->
BytesOfOutput
);
}
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardClose
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
local
=
cp
->
Local
;
free
((
char
*
)
local
);
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport
pwr_BindIoMethods
(
Pb_Do
)
=
{
pwr_BindIoMethod
(
IoCardInit
),
pwr_BindIoMethod
(
IoCardWrite
),
pwr_BindIoMethod
(
IoCardClose
),
pwr_NullMethod
};
src/lib/rt/src/os_linux/rt_io_m_pb_dp_slave.c
deleted
100644 → 0
View file @
f590671d
/*
* Proview $Id: rt_io_m_pb_dp_slave.c,v 1.5 2005-09-01 14:57:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* rt_io_m_pb_dp_slave.c -- io methods for a profibus DP slave */
#pragma pack(1)
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include "pb_type.h"
#include "pb_if.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "co_cdh.h"
#include "pwr_baseclasses.h"
#include "rt_gdh.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "co_cdh.h"
#include "rt_io_profiboard.h"
#include "rt_pb_msg.h"
/*----------------------------------------------------------------------------*\
Init method for the Pb DP slave
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoRackInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
)
{
io_sCardLocal
*
local_card
;
io_sCard
*
cardp
;
short
input_counter
;
short
output_counter
;
pwr_sClass_Pb_DP_Slave
*
op
;
pwr_sClass_Pb_Di
*
dip
;
pwr_sClass_Pb_Do
*
dop
;
pwr_sClass_Pb_Ai
*
aip
;
pwr_sClass_Pb_Ao
*
aop
;
pwr_sClass_Pb_Ii
*
iip
;
pwr_sClass_Pb_Io
*
iop
;
pwr_sClass_Pb_Module
*
mp
;
char
name
[
196
];
pwr_tStatus
sts
;
pwr_tCid
cid
;
sts
=
gdh_ObjidToName
(
rp
->
Objid
,
(
char
*
)
&
name
,
sizeof
(
name
),
cdh_mNName
);
errh_Info
(
"Init of Profibus DP Slave and modules %s"
,
name
);
op
=
(
pwr_sClass_Pb_DP_Slave
*
)
rp
->
op
;
// Do configuration check and initialize modules.
cardp
=
rp
->
cardlist
;
input_counter
=
0
;
output_counter
=
0
;
op
->
NumberModules
=
0
;
while
(
cardp
)
{
local_card
=
calloc
(
1
,
sizeof
(
*
local_card
));
cardp
->
Local
=
local_card
;
local_card
->
input_area
=
(
void
*
)
&
(
op
->
Inputs
);
local_card
->
output_area
=
(
void
*
)
&
(
op
->
Outputs
);
cid
=
cardp
->
Class
;
while
(
ODD
(
gdh_GetSuperClass
(
cid
,
&
cid
,
cardp
->
Objid
)))
;
switch
(
cid
)
{
case
pwr_cClass_Pb_Di
:
dip
=
(
pwr_sClass_Pb_Di
*
)
cardp
->
op
;
dip
->
OffsetInputs
=
input_counter
;
dip
->
BytesOfInput
=
dip
->
NumberOfChannels
/
8
;
input_counter
+=
dip
->
BytesOfInput
;
dip
->
Status
=
PB_MODULE_STATE_OPERATE
;
break
;
case
pwr_cClass_Pb_Do
:
dop
=
(
pwr_sClass_Pb_Do
*
)
cardp
->
op
;
dop
->
OffsetOutputs
=
output_counter
;
dop
->
BytesOfOutput
=
dop
->
NumberOfChannels
/
8
;
output_counter
+=
dop
->
BytesOfOutput
;
dop
->
Status
=
PB_MODULE_STATE_OPERATE
;
break
;
case
pwr_cClass_Pb_Ai
:
aip
=
(
pwr_sClass_Pb_Ai
*
)
cardp
->
op
;
aip
->
OffsetInputs
=
input_counter
;
aip
->
BytesOfInput
=
aip
->
NumberOfChannels
*
aip
->
BytesPerChannel
;
input_counter
+=
aip
->
BytesOfInput
;
aip
->
Status
=
PB_MODULE_STATE_OPERATE
;
break
;
case
pwr_cClass_Pb_Ao
:
aop
=
(
pwr_sClass_Pb_Ao
*
)
cardp
->
op
;
aop
->
OffsetOutputs
=
output_counter
;
aop
->
BytesOfOutput
=
aop
->
NumberOfChannels
*
aop
->
BytesPerChannel
;
output_counter
+=
aop
->
BytesOfOutput
;
aop
->
Status
=
PB_MODULE_STATE_OPERATE
;
break
;
case
pwr_cClass_Pb_Ii
:
iip
=
(
pwr_sClass_Pb_Ii
*
)
cardp
->
op
;
iip
->
OffsetInputs
=
input_counter
;
iip
->
BytesOfInput
=
iip
->
NumberOfChannels
*
iip
->
BytesPerChannel
;
input_counter
+=
iip
->
BytesOfInput
;
iip
->
Status
=
PB_MODULE_STATE_OPERATE
;
break
;
case
pwr_cClass_Pb_Io
:
iop
=
(
pwr_sClass_Pb_Io
*
)
cardp
->
op
;
iop
->
OffsetOutputs
=
output_counter
;
iop
->
BytesOfOutput
=
iop
->
NumberOfChannels
*
iop
->
BytesPerChannel
;
output_counter
+=
iop
->
BytesOfOutput
;
iop
->
Status
=
PB_MODULE_STATE_OPERATE
;
break
;
case
pwr_cClass_Pb_Module
:
mp
=
(
pwr_sClass_Pb_Module
*
)
cardp
->
op
;
// iop->OffsetOutputs = output_counter;
// iop->BytesOfOutput = iop->NumberOfChannels * iop->BytesPerChannel;
// output_counter += iop->BytesOfOutput;
mp
->
Status
=
PB__SUCCESS
;
break
;
}
op
->
NumberModules
++
;
cardp
=
cardp
->
next
;
}
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Read method for the Pb DP slave
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoRackRead
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
)
{
pwr_sClass_Pb_Profiboard
*
mp
;
pwr_sClass_Pb_DP_Slave
*
sp
;
int
fp
;
unsigned
char
diag
;
pwr_tUInt16
sts
;
fp
=
((
io_sAgentLocal
*
)
(
ap
->
Local
))
->
Pb_fp
;
sp
=
(
pwr_sClass_Pb_DP_Slave
*
)
rp
->
op
;
mp
=
(
pwr_sClass_Pb_Profiboard
*
)
ap
->
op
;
if
(
sp
->
Status
>
PB_SLAVE_STATE_NOTINIT
&&
mp
->
Status
==
PB_MASTER_STATE_OPERATE
&&
sp
->
DisableSlave
!=
1
&&
mp
->
DisableBus
!=
1
)
{
sts
=
pb_cmi_get_data
(
fp
,
ID_DP_STATUS_IMAGE
,
sp
->
SlaveAddress
,
1
,
&
diag
);
if
((
sts
!=
PB_OK
)
||
(
diag
&
1
))
{
sp
->
Status
=
PB_SLAVE_STATE_STOPPED
;
sp
->
ErrorCount
++
;
if
(
sp
->
ErrorCount
>
sp
->
ErrorSoftLimit
&&
sp
->
StallAction
>=
PB_STALLACTION_RESET
)
{
memset
(
&
sp
->
Inputs
,
0
,
sp
->
BytesOfInput
);
}
}
else
{
sp
->
Status
=
PB_SLAVE_STATE_OPERATE
;
}
if
((
sp
->
Status
>
PB_SLAVE_STATE_STOPPED
)
&&
sp
->
BytesOfInput
>
0
)
{
sts
=
pb_cmi_get_data
(
fp
,
ID_DP_SLAVE_IO_IMAGE
,
sp
->
OffsetInputs
,
sp
->
BytesOfInput
,
&
sp
->
Inputs
);
if
(
sts
!=
PB_OK
)
sp
->
ErrorCount
++
;
else
sp
->
ErrorCount
=
0
;
}
if
(
sp
->
ErrorCount
>
sp
->
ErrorHardLimit
&&
sp
->
StallAction
>=
PB_STALLACTION_BREAK
)
ctx
->
Node
->
EmergBreakTrue
=
1
;
}
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Write method for the Pb DP slave
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoRackWrite
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
)
{
pwr_sClass_Pb_Profiboard
*
mp
;
pwr_sClass_Pb_DP_Slave
*
sp
;
int
fp
;
pwr_tUInt16
sts
;
fp
=
((
io_sAgentLocal
*
)
(
ap
->
Local
))
->
Pb_fp
;
sp
=
(
pwr_sClass_Pb_DP_Slave
*
)
rp
->
op
;
mp
=
(
pwr_sClass_Pb_Profiboard
*
)
ap
->
op
;
// Write the whole I/O output area from local area
if
(
sp
->
Status
>
PB_SLAVE_STATE_NOTINIT
&&
mp
->
Status
==
PB_MASTER_STATE_OPERATE
&&
sp
->
DisableSlave
!=
1
&&
mp
->
DisableBus
!=
1
)
{
if
(
sp
->
BytesOfOutput
>
0
)
{
sts
=
pb_cmi_set_data
(
fp
,
ID_DP_SLAVE_IO_IMAGE
,
sp
->
OffsetOutputs
,
sp
->
BytesOfOutput
,
&
sp
->
Outputs
);
if
(
sts
!=
PB_OK
)
sp
->
ErrorCount
++
;
}
}
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoRackClose
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
)
{
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport
pwr_BindIoMethods
(
Pb_DP_Slave
)
=
{
pwr_BindIoMethod
(
IoRackInit
),
pwr_BindIoMethod
(
IoRackRead
),
pwr_BindIoMethod
(
IoRackWrite
),
pwr_BindIoMethod
(
IoRackClose
),
pwr_NullMethod
};
src/lib/rt/src/os_linux/rt_io_m_pb_ii.c
deleted
100644 → 0
View file @
f590671d
/*
* Proview $Id: rt_io_m_pb_ii.c,v 1.3 2005-09-01 14:57:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#pragma pack(1)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <math.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include "pb_type.h"
#include "pb_if.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
/*----------------------------------------------------------------------------*\
Init method for the Pb module Ii
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
pwr_sClass_Pb_Ii
*
op
;
op
=
(
pwr_sClass_Pb_Ii
*
)
cp
->
op
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
if
(
rp
->
Class
!=
pwr_cClass_Pb_DP_Slave
)
{
errh_Info
(
"Illegal object type %s"
,
cp
->
Name
);
return
IO__SUCCESS
;
}
if
(
op
->
Status
<
PB_MODULE_STATE_OPERATE
)
errh_Info
(
"Error initializing Pb module Ii %s"
,
cp
->
Name
);
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Read method for the Pb Ii card
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardRead
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
pwr_sClass_Pb_Ii
*
op
;
pwr_sClass_Pb_DP_Slave
*
slave
;
io_sChannel
*
chanp
;
pwr_sClass_ChanIi
*
cop
;
pwr_sClass_Ii
*
sop
;
pwr_tUInt8
udata8
=
0
;
pwr_tUInt16
udata16
=
0
;
pwr_tUInt32
udata32
=
0
;
pwr_tInt8
data8
=
0
;
pwr_tInt16
data16
=
0
;
pwr_tInt32
data32
=
0
;
int
i
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
op
=
(
pwr_sClass_Pb_Ii
*
)
cp
->
op
;
slave
=
(
pwr_sClass_Pb_DP_Slave
*
)
rp
->
op
;
if
(
op
->
Status
>=
PB_MODULE_STATE_OPERATE
&&
slave
->
DisableSlave
!=
1
)
{
for
(
i
=
0
;
i
<
cp
->
ChanListSize
;
i
++
)
{
chanp
=
&
cp
->
chanlist
[
i
];
if
(
!
chanp
->
cop
)
continue
;
cop
=
(
pwr_sClass_ChanIi
*
)
chanp
->
cop
;
sop
=
(
pwr_sClass_Ii
*
)
chanp
->
sop
;
if
(
cop
->
ConversionOn
)
{
if
(
op
->
BytesPerChannel
==
4
)
{
if
(
op
->
NumberRepresentation
==
PB_NUMREP_UNSIGNEDINT
)
{
memcpy
(
&
udata32
,
local
->
input_area
+
op
->
OffsetInputs
+
4
*
i
,
4
);
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
udata32
=
swap32
(
udata32
);
*
(
pwr_tInt32
*
)
chanp
->
vbp
=
(
pwr_tInt32
)
udata32
;
}
else
if
(
op
->
NumberRepresentation
==
PB_NUMREP_SIGNEDINT
)
{
memcpy
(
&
data32
,
local
->
input_area
+
op
->
OffsetInputs
+
4
*
i
,
4
);
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
data32
=
swap32
(
data32
);
*
(
pwr_tInt32
*
)
chanp
->
vbp
=
data32
;
}
}
else
if
(
op
->
BytesPerChannel
==
3
)
{
if
(
op
->
NumberRepresentation
==
PB_NUMREP_UNSIGNEDINT
)
{
udata32
=
0
;
memcpy
(
&
udata32
,
local
->
input_area
+
op
->
OffsetInputs
+
3
*
i
,
3
);
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
udata32
=
swap32
(
udata32
);
*
(
pwr_tInt32
*
)
chanp
->
vbp
=
(
pwr_tInt32
)
udata32
;
}
else
if
(
op
->
NumberRepresentation
==
PB_NUMREP_SIGNEDINT
)
{
data32
=
0
;
memcpy
(
&
data32
,
local
->
input_area
+
op
->
OffsetInputs
+
3
*
i
,
3
);
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
data32
=
swap32
(
data32
);
*
(
pwr_tInt32
*
)
chanp
->
vbp
=
data32
;
}
}
else
if
(
op
->
BytesPerChannel
==
2
)
{
if
(
op
->
NumberRepresentation
==
PB_NUMREP_UNSIGNEDINT
)
{
memcpy
(
&
udata16
,
local
->
input_area
+
op
->
OffsetInputs
+
2
*
i
,
2
);
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
udata16
=
swap16
(
udata16
);
*
(
pwr_tInt32
*
)
chanp
->
vbp
=
(
pwr_tInt32
)
udata16
;
}
else
if
(
op
->
NumberRepresentation
==
PB_NUMREP_SIGNEDINT
)
{
memcpy
(
&
data16
,
local
->
input_area
+
op
->
OffsetInputs
+
2
*
i
,
2
);
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
data16
=
swap16
(
data16
);
*
(
pwr_tInt32
*
)
chanp
->
vbp
=
(
pwr_tInt32
)
data16
;
}
}
else
if
(
op
->
BytesPerChannel
==
1
)
{
if
(
op
->
NumberRepresentation
==
PB_NUMREP_UNSIGNEDINT
)
{
memcpy
(
&
udata8
,
local
->
input_area
+
op
->
OffsetInputs
+
i
,
1
);
*
(
pwr_tInt32
*
)
chanp
->
vbp
=
(
pwr_tInt32
)
udata8
;
}
else
if
(
op
->
NumberRepresentation
==
PB_NUMREP_SIGNEDINT
)
{
memcpy
(
&
data8
,
local
->
input_area
+
op
->
OffsetInputs
+
i
,
1
);
*
(
pwr_tInt32
*
)
chanp
->
vbp
=
(
pwr_tInt32
)
data8
;
}
}
}
}
}
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Close method for the Pb Ii card
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardClose
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
local
=
cp
->
Local
;
free
((
char
*
)
local
);
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport
pwr_BindIoMethods
(
Pb_Ii
)
=
{
pwr_BindIoMethod
(
IoCardInit
),
pwr_BindIoMethod
(
IoCardRead
),
pwr_BindIoMethod
(
IoCardClose
),
pwr_NullMethod
};
src/lib/rt/src/os_linux/rt_io_m_pb_io.c
deleted
100644 → 0
View file @
f590671d
/*
* Proview $Id: rt_io_m_pb_io.c,v 1.3 2005-09-01 14:57:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#pragma pack(1)
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include "pb_type.h"
#include "pb_if.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
/*----------------------------------------------------------------------------*\
Init method for the Pb module Io
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
pwr_sClass_Pb_Io
*
op
;
op
=
(
pwr_sClass_Pb_Io
*
)
cp
->
op
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
if
(
rp
->
Class
!=
pwr_cClass_Pb_DP_Slave
)
{
errh_Info
(
"Illegal object type %s"
,
cp
->
Name
);
return
IO__SUCCESS
;
}
if
(
op
->
Status
<
PB_MODULE_STATE_OPERATE
)
{
errh_Info
(
"Error initializing Pb module Io %s"
,
cp
->
Name
);
}
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Write method for the Pb module Io
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardWrite
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
pwr_sClass_Pb_Io
*
op
;
pwr_sClass_Pb_DP_Slave
*
slave
;
int
i
;
pwr_tInt8
data8
=
0
;
pwr_tInt16
data16
=
0
;
pwr_tInt32
data32
=
0
;
pwr_sClass_ChanIo
*
cop
;
pwr_sClass_Io
*
sop
;
io_sChannel
*
chanp
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
op
=
(
pwr_sClass_Pb_Io
*
)
cp
->
op
;
slave
=
(
pwr_sClass_Pb_DP_Slave
*
)
rp
->
op
;
if
(
op
->
Status
>=
PB_MODULE_STATE_OPERATE
&&
slave
->
DisableSlave
!=
1
)
{
for
(
i
=
0
;
i
<
cp
->
ChanListSize
;
i
++
)
{
chanp
=
&
cp
->
chanlist
[
i
];
if
(
!
chanp
->
cop
)
continue
;
cop
=
(
pwr_sClass_ChanIo
*
)
chanp
->
cop
;
sop
=
(
pwr_sClass_Io
*
)
chanp
->
sop
;
if
(
cop
->
TestOn
!=
0
)
continue
;
data32
=
*
(
pwr_tInt32
*
)
chanp
->
vbp
;
if
(
op
->
BytesPerChannel
==
4
)
{
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
data32
=
swap32
(
data32
);
memcpy
(
local
->
output_area
+
op
->
OffsetOutputs
+
4
*
i
,
&
data32
,
4
);
}
else
if
(
op
->
BytesPerChannel
==
3
)
{
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
data32
=
swap32
(
data32
);
memcpy
(
local
->
output_area
+
op
->
OffsetOutputs
+
3
*
i
,
&
data32
,
3
);
}
else
if
(
op
->
BytesPerChannel
==
2
)
{
data16
=
(
pwr_tInt16
)
data32
;
if
(
slave
->
ByteOrdering
==
PB_BYTEORDERING_BE
)
data16
=
swap16
(
data16
);
memcpy
(
local
->
output_area
+
op
->
OffsetOutputs
+
2
*
i
,
&
data16
,
2
);
}
else
if
(
op
->
BytesPerChannel
==
1
)
{
data8
=
(
pwr_tInt8
)
data32
;
memcpy
(
local
->
output_area
+
op
->
OffsetOutputs
+
i
,
&
data8
,
1
);
}
}
}
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardClose
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
local
=
cp
->
Local
;
free
((
char
*
)
local
);
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport
pwr_BindIoMethods
(
Pb_Io
)
=
{
pwr_BindIoMethod
(
IoCardInit
),
pwr_BindIoMethod
(
IoCardWrite
),
pwr_BindIoMethod
(
IoCardClose
),
pwr_NullMethod
};
src/lib/rt/src/os_linux/rt_io_m_pb_module.c
deleted
100644 → 0
View file @
f590671d
/*
* Proview $Id: rt_io_m_pb_module.c,v 1.4 2005-12-13 15:14:27 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#pragma pack(1)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <math.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include "pb_type.h"
#include "pb_if.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
#include "rt_pb_msg.h"
pwr_tInt32
GetChanSize
(
pwr_eDataRepEnum
rep
)
{
switch
(
rep
)
{
case
pwr_eDataRepEnum_Int64
:
case
pwr_eDataRepEnum_UInt64
:
case
pwr_eDataRepEnum_Float64
:
return
8
;
break
;
case
pwr_eDataRepEnum_Int32
:
case
pwr_eDataRepEnum_UInt32
:
case
pwr_eDataRepEnum_Float32
:
return
4
;
break
;
case
pwr_eDataRepEnum_Int16
:
case
pwr_eDataRepEnum_UInt16
:
return
2
;
break
;
default:
return
1
;
break
;
}
}
/*----------------------------------------------------------------------------*\
Convert ai from raw float value to signal value and actual value
\*----------------------------------------------------------------------------*/
void
PbConvertAi
(
io_tCtx
ctx
,
pwr_tFloat32
f_raw
,
pwr_sClass_ChanAi
*
chan_ai
,
pwr_sClass_Ai
*
sig_ai
,
io_sChannel
*
chanp
)
{
pwr_tFloat32
sigvalue
;
pwr_tFloat32
actvalue
;
pwr_tFloat32
*
polycoef_p
;
int
i
;
sigvalue
=
chan_ai
->
SigValPolyCoef0
+
chan_ai
->
SigValPolyCoef1
*
f_raw
;
switch
(
chan_ai
->
SensorPolyType
)
{
case
0
:
actvalue
=
sigvalue
;
break
;
case
1
:
actvalue
=
chan_ai
->
SensorPolyCoef0
+
chan_ai
->
SensorPolyCoef1
*
f_raw
;
break
;
case
2
:
polycoef_p
=
&
chan_ai
->
SensorPolyCoef2
;
actvalue
=
0
;
for
(
i
=
0
;
i
<
3
;
i
++
)
{
actvalue
=
sigvalue
*
actvalue
+
*
polycoef_p
;
polycoef_p
--
;
}
break
;
case
3
:
actvalue
=
chan_ai
->
SensorPolyCoef0
+
chan_ai
->
SensorPolyCoef1
*
sigvalue
;
if
(
actvalue
>=
0
)
actvalue
=
chan_ai
->
SensorPolyCoef2
*
sqrt
(
actvalue
);
else
actvalue
=
0
;
break
;
case
4
:
actvalue
=
chan_ai
->
SensorPolyCoef0
+
chan_ai
->
SensorPolyCoef1
*
sigvalue
;
if
(
actvalue
>=
0
)
actvalue
=
chan_ai
->
SensorPolyCoef2
*
sqrt
(
actvalue
);
else
actvalue
=
-
chan_ai
->
SensorPolyCoef2
*
sqrt
(
-
actvalue
);
break
;
}
if
(
sig_ai
->
FilterType
==
1
&&
sig_ai
->
FilterAttribute
[
0
]
>
0
&&
sig_ai
->
FilterAttribute
[
0
]
>
ctx
->
ScanTime
)
{
actvalue
=
*
(
sig_ai
->
ActualValue
)
+
ctx
->
ScanTime
/
sig_ai
->
FilterAttribute
[
0
]
*
(
actvalue
-
*
(
sig_ai
->
ActualValue
));
}
sig_ai
->
SigValue
=
sigvalue
;
*
(
pwr_tFloat32
*
)
chanp
->
vbp
=
actvalue
;
return
;
}
/*----------------------------------------------------------------------------*\
Init method for the Pb module
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
pwr_sClass_Pb_Module
*
op
;
int
i
,
input_count
,
output_count
,
chan_size
,
bit_pos
;
io_sChannel
*
chanp
;
pwr_sClass_ChanAi
*
chan_ai
;
pwr_sClass_ChanAit
*
chan_ait
;
pwr_sClass_ChanIi
*
chan_ii
;
pwr_sClass_ChanAo
*
chan_ao
;
pwr_sClass_ChanIo
*
chan_io
;
op
=
(
pwr_sClass_Pb_Module
*
)
cp
->
op
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
if
(
op
->
Status
==
PB__SUCCESS
)
{
input_count
=
0
;
output_count
=
0
;
bit_pos
=
0
;
for
(
i
=
0
;
i
<
cp
->
ChanListSize
;
i
++
)
{
chanp
=
&
cp
->
chanlist
[
i
];
switch
(
chanp
->
ChanClass
)
{
/*
case pwr_cClass_ChanDi:
printf("Di channel found in %s\n", cp->Name);
chan_di = (pwr_sClass_ChanDi *) chanp->cop;
chanp->offset = byte_count;
chan_size = GetChanSize(chan_di->Representation);
chanp->mask = 1<<bit_pos;
bit_pos++;
if (bit_pos >= 8) {
byte_count++;
bit_pos = 0;
}
break;
*/
case
pwr_cClass_ChanAi
:
// printf("Ai channel found in %s\n", cp->Name);
chan_ai
=
(
pwr_sClass_ChanAi
*
)
chanp
->
cop
;
chanp
->
offset
=
input_count
;
chan_size
=
GetChanSize
(
chan_ai
->
Representation
);
chanp
->
size
=
chan_size
;
chanp
->
mask
=
0
;
input_count
+=
chan_size
;
io_AiRangeToCoef
(
chanp
);
break
;
case
pwr_cClass_ChanAit
:
// printf("Ait channel found in %s\n", cp->Name);
chan_ait
=
(
pwr_sClass_ChanAit
*
)
chanp
->
cop
;
chanp
->
offset
=
input_count
;
chan_size
=
GetChanSize
(
chan_ait
->
Representation
);
chanp
->
size
=
chan_size
;
chanp
->
mask
=
0
;
input_count
+=
chan_size
;
io_AiRangeToCoef
(
chanp
);
break
;
case
pwr_cClass_ChanIi
:
// printf("Ii channel found in %s\n", cp->Name);
chan_ii
=
(
pwr_sClass_ChanIi
*
)
chanp
->
cop
;
chanp
->
offset
=
input_count
;
chan_size
=
GetChanSize
(
chan_ii
->
Representation
);
chanp
->
size
=
chan_size
;
chanp
->
mask
=
0
;
input_count
+=
chan_size
;
break
;
case
pwr_cClass_ChanAo
:
// printf("Ao channel found in %s\n", cp->Name);
chan_ao
=
(
pwr_sClass_ChanAo
*
)
chanp
->
cop
;
chanp
->
offset
=
output_count
;
chan_size
=
GetChanSize
(
chan_ao
->
Representation
);
chanp
->
size
=
chan_size
;
chanp
->
mask
=
0
;
output_count
+=
chan_size
;
io_AoRangeToCoef
(
chanp
);
break
;
case
pwr_cClass_ChanIo
:
// printf("Io channel found in %s\n", cp->Name);
chan_io
=
(
pwr_sClass_ChanIo
*
)
chanp
->
cop
;
chanp
->
offset
=
output_count
;
chan_size
=
GetChanSize
(
chan_io
->
Representation
);
chanp
->
size
=
chan_size
;
chanp
->
mask
=
0
;
output_count
+=
chan_size
;
break
;
}
}
for
(
i
=
0
;
i
<
IO_MAXCHAN
;
i
++
)
{
local
->
scancount
[
i
]
=
0
;
}
}
else
{
errh_Info
(
"Error initializing Pb module %s"
,
cp
->
Name
);
op
->
Status
=
PB__INITFAIL
;
}
printf
(
"Method Pb_Module-IoCardInit
\n
"
);
printf
(
"Module size: input %d, output %d
\n
"
,
input_count
,
output_count
);
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Read method for the Pb module
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardRead
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
pwr_sClass_Pb_Module
*
op
;
io_sChannel
*
chanp
;
// pwr_sClass_ChanDi *chan_di;
pwr_sClass_ChanAi
*
chan_ai
;
pwr_sClass_Ai
*
sig_ai
;
// pwr_sClass_ChanAit *chan_ait;
pwr_sClass_ChanIi
*
chan_ii
;
pwr_sClass_Ii
*
sig_ii
;
pwr_sClass_Pb_DP_Slave
*
slave
;
pwr_tUInt8
udata8
=
0
;
pwr_tUInt16
udata16
=
0
;
pwr_tUInt32
udata32
=
0
;
pwr_tInt8
data8
=
0
;
pwr_tInt16
data16
=
0
;
pwr_tInt32
data32
=
0
;
pwr_tFloat32
f_raw
=
0
.
0
;
int
i
;
op
=
(
pwr_sClass_Pb_Module
*
)
cp
->
op
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
slave
=
(
pwr_sClass_Pb_DP_Slave
*
)
rp
->
op
;
if
(
slave
->
Status
==
PB_SLAVE_STATE_NOTINIT
)
{
op
->
Status
=
PB__INITFAIL
;
}
else
if
(
slave
->
Status
==
PB_SLAVE_STATE_STOPPED
)
{
op
->
Status
=
PB__NOCONN
;
}
else
if
(
slave
->
Status
==
PB_SLAVE_STATE_OPERATE
)
{
op
->
Status
=
PB__NORMAL
;
}
if
(
slave
->
DisableSlave
==
1
)
{
op
->
Status
=
PB__DISABLED
;
}
else
{
for
(
i
=
0
;
i
<
cp
->
ChanListSize
;
i
++
)
{
chanp
=
&
cp
->
chanlist
[
i
];
switch
(
chanp
->
ChanClass
)
{
case
pwr_cClass_ChanDi
:
break
;
// Channel type is Ai (analog input)
case
pwr_cClass_ChanAi
:
chan_ai
=
(
pwr_sClass_ChanAi
*
)
chanp
->
cop
;
sig_ai
=
(
pwr_sClass_Ai
*
)
chanp
->
sop
;
if
(
chan_ai
&&
sig_ai
&&
chan_ai
->
ConversionOn
)
{
if
(
chan_ai
->
CalculateNewCoef
)
io_AiRangeToCoef
(
chanp
);
switch
(
chan_ai
->
Representation
)
{
case
pwr_eDataRepEnum_Int8
:
memcpy
(
&
data8
,
local
->
input_area
+
cp
->
offset
+
chanp
->
offset
,
1
);
f_raw
=
(
float
)
data8
;
break
;
case
pwr_eDataRepEnum_UInt8
:
memcpy
(
&
udata8
,
local
->
input_area
+
cp
->
offset
+
chanp
->
offset
,
1
);
f_raw
=
(
float
)
udata8
;
break
;
case
pwr_eDataRepEnum_Int16
:
memcpy
(
&
data16
,
local
->
input_area
+
cp
->
offset
+
chanp
->
offset
,
2
);
if
(
slave
->
ByteOrdering
==
pwr_eByteOrdering_BigEndian
)
data16
=
swap16
(
data16
);
f_raw
=
(
float
)
data16
;
break
;
case
pwr_eDataRepEnum_UInt16
:
memcpy
(
&
udata16
,
local
->
input_area
+
cp
->
offset
+
chanp
->
offset
,
2
);
if
(
slave
->
ByteOrdering
==
pwr_eByteOrdering_BigEndian
)
data16
=
swap16
(
udata16
);
f_raw
=
(
float
)
udata16
;
break
;
case
pwr_eDataRepEnum_Int32
:
memcpy
(
&
data32
,
local
->
input_area
+
cp
->
offset
+
chanp
->
offset
,
4
);
if
(
slave
->
ByteOrdering
==
pwr_eByteOrdering_BigEndian
)
data32
=
swap32
(
data32
);
f_raw
=
(
float
)
data32
;
break
;
case
pwr_eDataRepEnum_UInt32
:
memcpy
(
&
udata32
,
local
->
input_area
+
cp
->
offset
+
chanp
->
offset
,
4
);
if
(
slave
->
ByteOrdering
==
pwr_eByteOrdering_BigEndian
)
udata32
=
swap32
(
udata32
);
f_raw
=
(
float
)
udata32
;
break
;
}
sig_ai
->
RawValue
=
0
;
PbConvertAi
(
ctx
,
f_raw
,
chan_ai
,
sig_ai
,
chanp
);
}
break
;
// Channel type is Ait (analog input with table conversion)
case
pwr_cClass_ChanAit
:
break
;
// Channel type is Ii (integer input)
case
pwr_cClass_ChanIi
:
chan_ii
=
(
pwr_sClass_ChanIi
*
)
chanp
->
cop
;
sig_ii
=
(
pwr_sClass_Ii
*
)
chanp
->
sop
;
if
(
chan_ii
&&
sig_ii
/* && chan_ii->ConversionOn */
)
{
switch
(
chan_ii
->
Representation
)
{
case
pwr_eDataRepEnum_Int8
:
memcpy
(
&
data8
,
local
->
input_area
+
cp
->
offset
+
chanp
->
offset
,
1
);
*
(
pwr_tInt32
*
)
chanp
->
vbp
=
(
pwr_tInt32
)
data8
;
break
;
case
pwr_eDataRepEnum_UInt8
:
memcpy
(
&
udata8
,
local
->
input_area
+
cp
->
offset
+
chanp
->
offset
,
1
);
*
(
pwr_tInt32
*
)
chanp
->
vbp
=
(
pwr_tInt32
)
udata8
;
break
;
case
pwr_eDataRepEnum_Int16
:
memcpy
(
&
data16
,
local
->
input_area
+
cp
->
offset
+
chanp
->
offset
,
2
);
if
(
slave
->
ByteOrdering
==
pwr_eByteOrdering_BigEndian
)
data16
=
swap16
(
data16
);
*
(
pwr_tInt32
*
)
chanp
->
vbp
=
(
pwr_tInt32
)
data16
;
break
;
case
pwr_eDataRepEnum_UInt16
:
memcpy
(
&
udata16
,
local
->
input_area
+
cp
->
offset
+
chanp
->
offset
,
2
);
if
(
slave
->
ByteOrdering
==
pwr_eByteOrdering_BigEndian
)
udata16
=
swap16
(
udata16
);
*
(
pwr_tInt32
*
)
chanp
->
vbp
=
(
pwr_tInt32
)
udata16
;
break
;
case
pwr_eDataRepEnum_Int32
:
memcpy
(
&
data32
,
local
->
input_area
+
cp
->
offset
+
chanp
->
offset
,
4
);
if
(
slave
->
ByteOrdering
==
pwr_eByteOrdering_BigEndian
)
data32
=
swap32
(
data32
);
*
(
pwr_tInt32
*
)
chanp
->
vbp
=
data32
;
break
;
case
pwr_eDataRepEnum_UInt32
:
memcpy
(
&
udata32
,
local
->
input_area
+
cp
->
offset
+
chanp
->
offset
,
4
);
if
(
slave
->
ByteOrdering
==
pwr_eByteOrdering_BigEndian
)
udata32
=
swap32
(
udata32
);
*
(
pwr_tInt32
*
)
chanp
->
vbp
=
(
pwr_tInt32
)
udata32
;
break
;
}
}
break
;
}
}
}
// printf("Method Pb_Module-IoCardRead\n");
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Write method for the Pb module
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardWrite
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
pwr_sClass_Pb_Module
*
op
;
io_sChannel
*
chanp
;
// pwr_sClass_ChanDo *chan_do;
// pwr_sClass_Do *sig_do;
pwr_sClass_ChanAo
*
chan_ao
;
pwr_sClass_Ao
*
sig_ao
;
pwr_sClass_ChanIo
*
chan_io
;
pwr_sClass_Io
*
sig_io
;
pwr_sClass_Pb_DP_Slave
*
slave
;
pwr_tUInt8
udata8
=
0
;
pwr_tUInt16
udata16
=
0
;
pwr_tUInt32
udata32
=
0
;
pwr_tInt8
data8
=
0
;
pwr_tInt16
data16
=
0
;
pwr_tInt32
data32
=
0
;
pwr_tFloat32
value
,
rawvalue
;
int
fixout
;
int
i
;
op
=
(
pwr_sClass_Pb_Module
*
)
cp
->
op
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
slave
=
(
pwr_sClass_Pb_DP_Slave
*
)
rp
->
op
;
if
(
slave
->
Status
==
PB_SLAVE_STATE_NOTINIT
)
{
op
->
Status
=
PB__INITFAIL
;
}
else
if
(
slave
->
Status
==
PB_SLAVE_STATE_STOPPED
)
{
op
->
Status
=
PB__NOCONN
;
}
else
if
(
slave
->
Status
==
PB_SLAVE_STATE_OPERATE
)
{
op
->
Status
=
PB__NORMAL
;
}
if
(
slave
->
DisableSlave
==
1
)
{
op
->
Status
=
PB__DISABLED
;
}
else
{
fixout
=
ctx
->
Node
->
EmergBreakTrue
&&
ctx
->
Node
->
EmergBreakSelect
==
FIXOUT
;
for
(
i
=
0
;
i
<
cp
->
ChanListSize
;
i
++
)
{
chanp
=
&
cp
->
chanlist
[
i
];
switch
(
chanp
->
ChanClass
)
{
case
pwr_cClass_ChanDo
:
break
;
// Channel type is Ao (analog output)
case
pwr_cClass_ChanAo
:
chan_ao
=
(
pwr_sClass_ChanAo
*
)
chanp
->
cop
;
sig_ao
=
(
pwr_sClass_Ao
*
)
chanp
->
sop
;
if
(
chan_ao
&&
sig_ao
)
{
if
(
fixout
)
value
=
chan_ao
->
FixedOutValue
;
else
if
(
chan_ao
->
TestOn
)
value
=
chan_ao
->
TestValue
;
else
value
=
*
(
pwr_tFloat32
*
)
chanp
->
vbp
;
if
(
chan_ao
->
CalculateNewCoef
)
io_AoRangeToCoef
(
chanp
);
if
(
value
>
chan_ao
->
ActValRangeHigh
)
value
=
chan_ao
->
ActValRangeHigh
;
else
if
(
value
<
chan_ao
->
ActValRangeLow
)
value
=
chan_ao
->
ActValRangeLow
;
rawvalue
=
chan_ao
->
OutPolyCoef1
*
value
+
chan_ao
->
OutPolyCoef0
;
if
(
rawvalue
>
0
)
rawvalue
=
rawvalue
+
0
.
5
;
else
rawvalue
=
rawvalue
-
0
.
5
;
sig_ao
->
RawValue
=
0
;
sig_ao
->
SigValue
=
chan_ao
->
SigValPolyCoef1
*
value
+
chan_ao
->
SigValPolyCoef0
;
switch
(
chan_ao
->
Representation
)
{
case
pwr_eDataRepEnum_Int8
:
data8
=
(
pwr_tInt8
)
rawvalue
;
memcpy
(
local
->
output_area
+
cp
->
offset
+
chanp
->
offset
,
&
data8
,
1
);
break
;
case
pwr_eDataRepEnum_UInt8
:
udata8
=
(
pwr_tUInt8
)
rawvalue
;
memcpy
(
local
->
output_area
+
cp
->
offset
+
chanp
->
offset
,
&
udata8
,
1
);
break
;
case
pwr_eDataRepEnum_Int16
:
data16
=
(
pwr_tInt16
)
rawvalue
;
if
(
slave
->
ByteOrdering
==
pwr_eByteOrdering_BigEndian
)
data16
=
swap16
(
data16
);
memcpy
(
local
->
output_area
+
cp
->
offset
+
chanp
->
offset
,
&
data16
,
2
);
break
;
case
pwr_eDataRepEnum_UInt16
:
udata16
=
(
pwr_tUInt16
)
rawvalue
;
if
(
slave
->
ByteOrdering
==
pwr_eByteOrdering_BigEndian
)
udata16
=
swap16
(
udata16
);
memcpy
(
local
->
output_area
+
cp
->
offset
+
chanp
->
offset
,
&
udata16
,
2
);
break
;
case
pwr_eDataRepEnum_Int32
:
data32
=
(
pwr_tInt32
)
rawvalue
;
if
(
slave
->
ByteOrdering
==
pwr_eByteOrdering_BigEndian
)
data32
=
swap32
(
data32
);
memcpy
(
local
->
output_area
+
cp
->
offset
+
chanp
->
offset
,
&
data32
,
4
);
break
;
case
pwr_eDataRepEnum_UInt32
:
udata32
=
(
pwr_tUInt32
)
rawvalue
;
if
(
slave
->
ByteOrdering
==
pwr_eByteOrdering_BigEndian
)
udata32
=
swap32
(
udata32
);
memcpy
(
local
->
output_area
+
cp
->
offset
+
chanp
->
offset
,
&
udata32
,
4
);
break
;
}
}
break
;
// Channel type is Io (integer output)
case
pwr_cClass_ChanIo
:
chan_io
=
(
pwr_sClass_ChanIo
*
)
chanp
->
cop
;
sig_io
=
(
pwr_sClass_Io
*
)
chanp
->
sop
;
if
(
chan_io
&&
sig_io
)
{
if
(
fixout
)
data32
=
(
pwr_tInt32
)
chan_io
->
FixedOutValue
;
else
if
(
chan_io
->
TestOn
)
data32
=
(
pwr_tInt32
)
chan_io
->
TestValue
;
else
data32
=
*
(
pwr_tInt32
*
)
chanp
->
vbp
;
switch
(
chan_io
->
Representation
)
{
case
pwr_eDataRepEnum_Int8
:
data8
=
(
pwr_tInt8
)
data32
;
memcpy
(
local
->
output_area
+
cp
->
offset
+
chanp
->
offset
,
&
data8
,
1
);
break
;
case
pwr_eDataRepEnum_UInt8
:
udata8
=
(
pwr_tUInt8
)
data32
;
memcpy
(
local
->
output_area
+
cp
->
offset
+
chanp
->
offset
,
&
udata8
,
1
);
break
;
case
pwr_eDataRepEnum_Int16
:
data16
=
(
pwr_tInt16
)
data32
;
if
(
slave
->
ByteOrdering
==
pwr_eByteOrdering_BigEndian
)
data16
=
swap16
(
data16
);
memcpy
(
local
->
output_area
+
cp
->
offset
+
chanp
->
offset
,
&
data16
,
2
);
break
;
case
pwr_eDataRepEnum_UInt16
:
udata16
=
(
pwr_tUInt16
)
data32
;
if
(
slave
->
ByteOrdering
==
pwr_eByteOrdering_BigEndian
)
udata16
=
swap16
(
udata16
);
memcpy
(
local
->
output_area
+
cp
->
offset
+
chanp
->
offset
,
&
udata16
,
2
);
break
;
case
pwr_eDataRepEnum_Int32
:
if
(
slave
->
ByteOrdering
==
pwr_eByteOrdering_BigEndian
)
data32
=
swap32
(
data32
);
memcpy
(
local
->
output_area
+
cp
->
offset
+
chanp
->
offset
,
&
data32
,
4
);
break
;
case
pwr_eDataRepEnum_UInt32
:
udata32
=
(
pwr_tUInt32
)
data32
;
if
(
slave
->
ByteOrdering
==
pwr_eByteOrdering_BigEndian
)
udata32
=
swap32
(
udata32
);
memcpy
(
local
->
output_area
+
cp
->
offset
+
chanp
->
offset
,
&
udata32
,
4
);
break
;
}
}
break
;
}
}
}
// printf("Method Pb_Module-IoCardWrite\n");
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Close method for the Pb module
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardClose
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
local
=
cp
->
Local
;
free
((
char
*
)
local
);
printf
(
"Method Pb_Module-IoCardClose
\n
"
);
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport
pwr_BindIoMethods
(
Pb_Module
)
=
{
pwr_BindIoMethod
(
IoCardInit
),
pwr_BindIoMethod
(
IoCardRead
),
pwr_BindIoMethod
(
IoCardWrite
),
pwr_BindIoMethod
(
IoCardClose
),
pwr_NullMethod
};
src/lib/rt/src/os_linux/rt_io_m_pb_profiboard.c
deleted
100644 → 0
View file @
f590671d
/*
* Proview $Id: rt_io_m_pb_profiboard.c,v 1.5 2005-12-13 15:14:27 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* rt_io_m_pb_profiboard.c -- io methods for the profibus master object
The PbMaster object serves as agent for one Profibus DP bus
The board we use is Profiboard from Softing
*/
#pragma pack(1)
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include "pb_type.h"
#include "pb_if.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "co_cdh.h"
#include "pwr_baseclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_agent_init.h"
#include "rt_io_profiboard.h"
static
int
count
;
static
pwr_tStatus
IoAgentInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
);
static
pwr_tStatus
IoAgentRead
(
io_tCtx
ctx
,
io_sAgent
*
ap
);
static
pwr_tStatus
IoAgentWrite
(
io_tCtx
ctx
,
io_sAgent
*
ap
);
static
pwr_tStatus
IoAgentClose
(
io_tCtx
ctx
,
io_sAgent
*
ap
);
/*----------------------------------------------------------------------------*\
Sends request to Profiboard for setting FMB parameters
\*----------------------------------------------------------------------------*/
static
short
fmb_set_configuration
(
int
fp
,
pwr_sClass_Pb_Profiboard
*
op
)
{
T_PROFI_SERVICE_DESCR
sdb
;
T_FMB_SET_CONFIGURATION_REQ
data
;
pwr_tUInt16
retval
;
sdb
.
comm_ref
=
0
;
sdb
.
layer
=
FMB
;
sdb
.
service
=
FMB_SET_CONFIGURATION
;
sdb
.
primitive
=
REQ
;
sdb
.
invoke_id
=
0
;
sdb
.
result
=
0
;
data
.
fms_active
=
PB_FALSE
;
data
.
dp_active
=
PB_TRUE
;
data
.
fdlif_active
=
PB_FALSE
;
data
.
fdl_evt_receiver
=
DP_USR
;
data
.
sm7_active
=
PB_FALSE
;
data
.
data_buffer_length
=
256
;
data
.
dp
.
max_number_slaves
=
op
->
MaxNumberSlaves
;
data
.
dp
.
max_slave_output_len
=
op
->
MaxSlaveOutputLen
;
data
.
dp
.
max_slave_input_len
=
op
->
MaxSlaveInputLen
;
data
.
dp
.
max_slave_diag_entries
=
op
->
MaxNumberSlaves
;
data
.
dp
.
max_slave_diag_len
=
244
;
data
.
dp
.
max_bus_para_len
=
1024
;
data
.
dp
.
max_slave_para_len
=
1024
;
retval
=
pb_cmi_flush
(
fp
);
if
(
retval
!=
PB_OK
)
return
retval
;
retval
=
pb_cmi_write
(
fp
,
&
sdb
,
&
data
,
sizeof
(
T_FMB_SET_CONFIGURATION_REQ
));
if
(
retval
!=
PB_OK
)
return
retval
;
retval
=
pb_cmi_read
(
fp
,
NULL
,
NULL
,
NULL
);
return
retval
;
}
/*----------------------------------------------------------------------------*\
Sends request to Profiboard for setting DP master parameters
\*----------------------------------------------------------------------------*/
static
short
dp_init_master
(
int
fp
,
pwr_sClass_Pb_Profiboard
*
op
)
{
T_PROFI_SERVICE_DESCR
sdb
;
T_DP_INIT_MASTER_REQ
data
;
pwr_tUInt16
retval
;
sdb
.
comm_ref
=
0
;
sdb
.
layer
=
DP
;
sdb
.
service
=
DP_INIT_MASTER
;
sdb
.
primitive
=
REQ
;
sdb
.
invoke_id
=
0
;
sdb
.
result
=
0
;
data
.
master_default_address
=
0
;
data
.
master_class2
=
PB_FALSE
;
data
.
lowest_slave_address
=
2
;
data
.
slave_io_address_mode
=
DP_AAM_ARRAY
;
data
.
clear_outputs
=
PB_TRUE
;
data
.
auto_remote_services
=
DP_AUTO_REMOTE_SERVICES
;
data
.
cyclic_data_transfer
=
PB_TRUE
;
retval
=
pb_cmi_flush
(
fp
);
if
(
retval
!=
PB_OK
)
return
retval
;
retval
=
pb_cmi_write
(
fp
,
&
sdb
,
&
data
,
sizeof
(
T_DP_INIT_MASTER_REQ
));
if
(
retval
!=
PB_OK
)
return
retval
;
retval
=
pb_cmi_read
(
fp
,
NULL
,
NULL
,
NULL
);
return
retval
;
}
/*----------------------------------------------------------------------------*\
Sends request to Profiboard for setting DP bus parameters
\*----------------------------------------------------------------------------*/
static
short
dp_init_bus
(
int
fp
,
pwr_sClass_Pb_Profiboard
*
op
)
{
T_PROFI_SERVICE_DESCR
sdb
;
struct
{
T_DP_DOWNLOAD_REQ
drp
;
T_DP_BUS_PARA_SET
dbp
;
}
data
;
pwr_tUInt16
retval
;
int
i
;
sdb
.
comm_ref
=
0
;
sdb
.
layer
=
DP
;
sdb
.
service
=
DP_DOWNLOAD_LOC
;
sdb
.
primitive
=
REQ
;
sdb
.
invoke_id
=
0
;
sdb
.
result
=
0
;
data
.
drp
.
data_len
=
66
;
data
.
drp
.
rem_add
=
0
;
data
.
drp
.
area_code
=
DP_AREA_BUS_PARAM
;
data
.
drp
.
add_offset
=
0
;
data
.
dbp
.
bus_para_len
=
swap16
(
66
);
data
.
dbp
.
fdl_add
=
0
;
switch
(
op
->
BaudRate
)
{
case
500
:
data
.
dbp
.
baud_rate
=
DP_KBAUD_500
;
break
;
case
750
:
data
.
dbp
.
baud_rate
=
DP_KBAUD_750
;
break
;
case
1500
:
data
.
dbp
.
baud_rate
=
DP_KBAUD_1500
;
break
;
case
3000
:
data
.
dbp
.
baud_rate
=
DP_KBAUD_3000
;
break
;
case
6000
:
data
.
dbp
.
baud_rate
=
DP_KBAUD_6000
;
break
;
case
12000
:
data
.
dbp
.
baud_rate
=
DP_KBAUD_12000
;
break
;
default:
data
.
dbp
.
baud_rate
=
DP_KBAUD_1500
;
break
;
}
data
.
dbp
.
tsl
=
swap16
(
op
->
Tsl
);
data
.
dbp
.
min_tsdr
=
swap16
(
op
->
MinTsdr
);
data
.
dbp
.
max_tsdr
=
swap16
(
op
->
MaxTsdr
);
data
.
dbp
.
tqui
=
op
->
Tqui
;
data
.
dbp
.
tset
=
op
->
Tset
;
data
.
dbp
.
ttr
=
swap32
(
op
->
Ttr
);
data
.
dbp
.
g
=
op
->
G
;
data
.
dbp
.
hsa
=
op
->
Hsa
;
data
.
dbp
.
max_retry_limit
=
op
->
MaxRetryLimit
;
data
.
dbp
.
bp_flag
=
op
->
BpFlag
;
data
.
dbp
.
min_slave_interval
=
swap16
(
op
->
MinSlaveInterval
);
data
.
dbp
.
poll_timeout
=
swap16
(
op
->
PollTimeout
);
data
.
dbp
.
data_control_time
=
swap16
(
op
->
DataControlTime
);
for
(
i
=
0
;
i
<
6
;
i
++
)
data
.
dbp
.
reserved
[
i
]
=
0
;
data
.
dbp
.
master_user_data_len
=
swap16
(
DP_MASTER_USER_DATA_LEN
);
for
(
i
=
0
;
i
<
32
;
i
++
)
data
.
dbp
.
master_class2_name
[
i
]
=
0
;
retval
=
pb_cmi_flush
(
fp
);
if
(
retval
!=
PB_OK
)
return
retval
;
retval
=
pb_cmi_write
(
fp
,
&
sdb
,
&
data
,
72
);
if
(
retval
!=
PB_OK
)
return
retval
;
retval
=
pb_cmi_read
(
fp
,
NULL
,
NULL
,
NULL
);
return
retval
;
}
/*----------------------------------------------------------------------------*\
Sends request for selecting operation mode to the Profiboard
\*----------------------------------------------------------------------------*/
static
short
act_param_loc
(
int
fp
,
pwr_sClass_Pb_Profiboard
*
op
,
short
arg
)
{
T_PROFI_SERVICE_DESCR
sdb
;
T_DP_ACT_PARAM_REQ
apr
;
pwr_tUInt16
retval
;
/* Fill the service description block */
sdb
.
comm_ref
=
0
;
sdb
.
layer
=
DP
;
sdb
.
service
=
DP_ACT_PARAM_LOC
;
sdb
.
primitive
=
REQ
;
sdb
.
invoke_id
=
0
;
sdb
.
result
=
0
;
apr
.
rem_add
=
0
;
apr
.
area_code
=
DP_AREA_SET_MODE
;
apr
.
activate
=
arg
;
apr
.
dummy
=
0
;
retval
=
pb_cmi_flush
(
fp
);
if
(
retval
!=
PB_OK
)
return
retval
;
retval
=
pb_cmi_write
(
fp
,
&
sdb
,
&
apr
,
sizeof
(
T_DP_ACT_PARAM_REQ
));
if
(
retval
!=
PB_OK
)
return
retval
;
retval
=
pb_cmi_read
(
fp
,
NULL
,
NULL
,
NULL
);
return
retval
;
}
/*----------------------------------------------------------------------------*\
Initializes one DP slave in the master card
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
init_dp_slave
(
io_sAgent
*
ap
,
pwr_tObjid
oid
)
{
pwr_sClass_Pb_DP_Slave
*
op
;
io_sAgentLocal
*
local_agent
;
int
i
;
char
name
[
196
];
pwr_tUInt16
sts
;
pwr_tStatus
status
;
struct
timespec
rqtp
,
rmtp
;
status
=
gdh_ObjidToPointer
(
oid
,
(
pwr_tAddress
*
)
&
op
);
status
=
gdh_ObjidToName
(
oid
,
(
char
*
)
&
name
,
sizeof
(
name
),
cdh_mNName
);
local_agent
=
(
io_sAgentLocal
*
)
(
ap
->
Local
);
op
->
Status
=
PB_SLAVE_STATE_NOTINIT
;
errh_Info
(
"Config of Profibus DP Slave %s"
,
name
);
// Try to initialize slave, make three attempts before we give up
for
(
i
=
0
;
i
<
3
;
i
++
)
{
if
(
op
->
AutoConfigure
==
1
)
{
sts
=
pb_get_slave_cfg
(
local_agent
->
Pb_fp
,
op
->
SlaveAddress
,
&
op
->
ConfigDataLen
,
&
op
->
ConfigData
);
}
else
{
sts
=
PB_OK
;
}
if
(
sts
==
PB_OK
)
{
sts
=
pb_download_all
(
local_agent
->
Pb_fp
,
op
->
SlaveAddress
,
op
->
WdFact1
,
op
->
WdFact2
,
0
,
op
->
PNOIdent
,
op
->
GroupIdent
,
op
->
PrmUserDataLen
,
&
op
->
PrmUserData
,
op
->
ConfigDataLen
,
&
op
->
ConfigData
);
}
if
(
sts
==
PB_OK
)
{
sts
=
pb_get_slave_info
(
local_agent
->
Pb_fp
,
op
->
SlaveAddress
,
&
op
->
OffsetInputs
,
&
op
->
OffsetOutputs
,
&
op
->
BytesOfInput
,
&
op
->
BytesOfOutput
);
}
if
(
sts
==
PB_OK
)
break
;
rqtp
.
tv_sec
=
1
;
rqtp
.
tv_nsec
=
0
;
nanosleep
(
&
rqtp
,
&
rmtp
);
}
if
(
sts
!=
PB_OK
)
{
errh_Info
(
"ERROR Init Profibus DP slave %s"
,
name
);
return
IO__ERRINIDEVICE
;
}
op
->
Status
=
PB_SLAVE_STATE_STOPPED
;
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Init method for the Pb_profiboard agent
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoAgentInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
)
{
pwr_sClass_Pb_Profiboard
*
op
;
pwr_tUInt16
sts
;
pwr_tStatus
status
;
io_sAgentLocal
*
local
;
char
devname
[
25
];
struct
timespec
rqtp
,
rmtp
;
int
i
;
char
ok
;
pwr_tObjid
slave_objid
;
pwr_tClassId
slave_class
;
count
=
0
;
/* Allocate area for local data structure */
ap
->
Local
=
calloc
(
1
,
sizeof
(
io_sAgentLocal
));
if
(
!
ap
->
Local
)
{
errh_Info
(
"ERROR config Profibus DP Master %s - %s"
,
ap
->
Name
,
"calloc"
);
return
IO__ERRINIDEVICE
;
}
local
=
(
io_sAgentLocal
*
)
ap
->
Local
;
op
=
(
pwr_sClass_Pb_Profiboard
*
)
ap
->
op
;
/* Open Pb driver */
sprintf
(
devname
,
"/dev/pbus%1d"
,
(
int
)
op
->
BusNumber
);
local
->
Pb_fp
=
open
(
devname
,
O_RDWR
);
if
(
local
->
Pb_fp
==
-
1
)
{
/* Can't open driver */
errh_Info
(
"ERROR config Profibus DP Master %s - %s"
,
ap
->
Name
,
"open device"
);
ctx
->
Node
->
EmergBreakTrue
=
1
;
return
IO__ERRDEVICE
;
}
/* If this is not the Profibus I/O process, return */
if
((
op
->
Process
&
io_mProcess_Profibus
)
&&
(
ctx
->
Process
!=
io_mProcess_Profibus
))
{
errh_Info
(
"Init template I/O agent for Profibus DP Master %s, %d"
,
ap
->
Name
,
ctx
->
Process
);
return
IO__SUCCESS
;
}
errh_Info
(
"Config of Profibus DP Master %s"
,
ap
->
Name
);
if
(
op
->
DisableBus
!=
1
)
{
ok
=
FALSE
;
while
(
!
ok
)
{
/* Initialize CMI */
sts
=
pb_cmi_init
(
local
->
Pb_fp
);
if
(
sts
!=
PB_OK
)
{
errh_Info
(
"ERROR config Profibus DP Master %s - %s"
,
ap
->
Name
,
"cmi init"
);
return
IO__ERRINIDEVICE
;
}
/* Set FMB configuration */
sts
=
fmb_set_configuration
(
local
->
Pb_fp
,
op
);
if
(
sts
!=
PB_OK
)
{
errh_Info
(
"ERROR config Profibus DP Master %s - %s"
,
ap
->
Name
,
"fmb set configuration"
);
return
IO__ERRINIDEVICE
;
}
/* Set DP master parameters */
sts
=
dp_init_master
(
local
->
Pb_fp
,
op
);
if
(
sts
!=
PB_OK
)
{
errh_Info
(
"ERROR config Profibus DP Master %s - %s"
,
ap
->
Name
,
"dp init master"
);
return
IO__ERRINIDEVICE
;
}
/* Set DP bus parameters */
sts
=
dp_init_bus
(
local
->
Pb_fp
,
op
);
if
(
sts
!=
PB_OK
)
{
errh_Info
(
"ERROR config Profibus DP Master %s - %s"
,
ap
->
Name
,
"dp init bus"
);
return
IO__ERRINIDEVICE
;
}
/* Set stalltime */
sts
=
pb_set_stalltime
(
local
->
Pb_fp
,
op
->
StallTime
);
if
(
sts
!=
PB_OK
)
{
errh_Info
(
"ERROR config Profibus DP Master %s - %s"
,
ap
->
Name
,
"set stalltime"
);
return
IO__ERRINIDEVICE
;
}
/* Move to STOP mode */
sts
=
act_param_loc
(
local
->
Pb_fp
,
op
,
DP_OP_MODE_STOP
);
if
(
sts
!=
PB_OK
)
{
errh_Info
(
"ERROR config Profibus DP Master %s - %s"
,
ap
->
Name
,
"act param loc to STOPPED"
);
return
IO__ERRINIDEVICE
;
}
op
->
Status
=
PB_MASTER_STATE_STOPPED
;
/* Loop through all slaves (traverse agent's children) and initialize them */
op
->
NumberSlaves
=
0
;
status
=
gdh_GetChild
(
ap
->
Objid
,
&
slave_objid
);
while
(
ODD
(
status
))
{
status
=
gdh_GetObjectClass
(
slave_objid
,
&
slave_class
);
if
(
slave_class
==
pwr_cClass_Pb_DP_Slave
)
{
status
=
init_dp_slave
(
ap
,
slave_objid
);
op
->
NumberSlaves
++
;
}
status
=
gdh_GetNextSibling
(
slave_objid
,
&
slave_objid
);
}
/* Move to CLEAR and OPERATE mode */
sts
=
act_param_loc
(
local
->
Pb_fp
,
op
,
DP_OP_MODE_CLEAR
);
if
(
sts
==
PB_OK
)
{
op
->
Status
=
PB_MASTER_STATE_CLEARED
;
sts
=
act_param_loc
(
local
->
Pb_fp
,
op
,
DP_OP_MODE_OPERATE
);
if
(
sts
==
PB_OK
)
{
op
->
Status
=
PB_MASTER_STATE_OPERATE
;
errh_Info
(
"Profibus DP Master %s to state OPERATE"
,
ap
->
Name
);
}
else
{
errh_Info
(
"ERROR config Profibus DP Master %s - %s"
,
ap
->
Name
,
"act param loc to OPERATE"
);
return
IO__ERRINIDEVICE
;
}
}
else
{
errh_Info
(
"ERROR config Profibus DP Master %s - %s"
,
ap
->
Name
,
"act param loc to CLEAR"
);
return
IO__ERRINIDEVICE
;
}
ok
=
TRUE
;
for
(
i
=
0
;
i
<
4
;
i
++
)
{
if
(
ok
)
{
sts
=
pb_cmi_poll
(
local
->
Pb_fp
,
NULL
,
NULL
,
NULL
);
if
(
sts
==
PB_DEVICE_ERROR
)
{
errh_Info
(
"Init problems, Reconfig - %d"
,
i
);
ok
=
FALSE
;
}
rqtp
.
tv_sec
=
0
;
rqtp
.
tv_nsec
=
200000000
;
nanosleep
(
&
rqtp
,
&
rmtp
);
}
}
}
}
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Read method for the Pb_Profiboard agent
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoAgentRead
(
io_tCtx
ctx
,
io_sAgent
*
ap
)
{
io_sAgentLocal
*
local
;
pwr_sClass_Pb_Profiboard
*
op
;
pwr_tUInt16
sts
;
static
int
count
;
local
=
(
io_sAgentLocal
*
)
ap
->
Local
;
op
=
(
pwr_sClass_Pb_Profiboard
*
)
ap
->
op
;
/* If everything is fine we should be in state OPERATE
Make a poll to see if there are diagnostics, the answer also tell us
if there are any hardware faults. In that case, make a reset and a new init. */
count
++
;
if
((
op
->
Process
&
io_mProcess_Profibus
)
&&
(
ctx
->
Process
!=
io_mProcess_Profibus
))
return
IO__SUCCESS
;
if
(
op
->
DisableBus
!=
1
)
{
switch
(
op
->
Status
)
{
case
PB_MASTER_STATE_OPERATE
:
sts
=
pb_cmi_poll
(
local
->
Pb_fp
,
NULL
,
NULL
,
NULL
);
/* In case of device error, move to state NOTINIT */
if
(
sts
==
PB_DEVICE_ERROR
)
{
op
->
Status
=
PB_MASTER_STATE_NOTINIT
;
}
/* In case of diagnostic message, just mark it.
in the future, take care of it */
else
if
(
sts
!=
PB_NO_CON_IND_RECEIVED
)
{
op
->
Diag
[
0
]
++
;
}
break
;
default:
op
->
Status
=
PB_MASTER_STATE_NOTINIT
;
errh_Info
(
"Reconfig of Profibus DP Master %s - %d"
,
ap
->
Name
,
count
);
IoAgentClose
(
ctx
,
ap
);
IoAgentInit
(
ctx
,
ap
);
break
;
}
}
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Write method for the Pb_Profiboard agent
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoAgentWrite
(
io_tCtx
ctx
,
io_sAgent
*
ap
)
{
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoAgentClose
(
io_tCtx
ctx
,
io_sAgent
*
ap
)
{
io_sAgentLocal
*
local
;
/* Close Pb driver */
local
=
ap
->
Local
;
close
(
local
->
Pb_fp
);
free
(
(
char
*
)
local
);
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport
pwr_BindIoMethods
(
Pb_Profiboard
)
=
{
pwr_BindIoMethod
(
IoAgentInit
),
pwr_BindIoMethod
(
IoAgentRead
),
pwr_BindIoMethod
(
IoAgentWrite
),
pwr_BindIoMethod
(
IoAgentClose
),
pwr_NullMethod
};
src/lib/rt/src/os_linux/rt_io_pb_locals.h
deleted
100644 → 0
View file @
f590671d
/*
* Proview $Id: rt_io_pb_locals.h,v 1.5 2005-09-01 14:57:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define IO_MAXCHAN 96
#define PB_MODULE_STATE_NOTINIT 0
#define PB_MODULE_STATE_OPERATE 1
#define PB_SLAVE_STATE_NOTINIT 0
#define PB_SLAVE_STATE_STOPPED 1
#define PB_SLAVE_STATE_OPERATE 2
#define PB_MASTER_STATE_NOTINIT 0
#define PB_MASTER_STATE_STOPPED 1
#define PB_MASTER_STATE_CLEARED 2
#define PB_MASTER_STATE_OPERATE 3
#define PB_STALLACTION_NONE 0
#define PB_STALLACTION_RESET 1
#define PB_STALLACTION_BREAK 2
#define PB_NUMREP_UNSIGNEDINT 0
#define PB_NUMREP_SIGNEDINT 1
#define PB_NUMREP_FLOATIEEE 2
#define PB_NUMREP_FLOATVAX 3
#define PB_NUMREP_FLOATINTEL 4
#define PB_BYTEORDERING_LE 0
#define PB_BYTEORDERING_BE 1
#define PB_ORIENTATION_BYTE 8
#define PB_ORIENTATION_WORD 16
#define PB_ORIENTATION_DWORD 32
typedef
struct
{
int
Pb_fp
;
}
io_sAgentLocal
;
typedef
struct
{
int
initialized
;
}
io_sRackLocal
;
typedef
struct
{
void
*
input_area
;
void
*
output_area
;
int
scancount
[
IO_MAXCHAN
];
}
io_sCardLocal
;
src/wbl/pwrb/src/pwrb_c_pb_ai.wb_load
deleted
100644 → 0
View file @
f590671d
!
! Proview $Id: pwrb_c_pb_ai.wb_load,v 1.7 2005-09-01 14:58:02 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
SObject pwrb:Class
!
Object Pb_Ai $ClassDef 293
!
!
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
Attr Flags |= pwr_mClassDef_IOCard
EndBody
!
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "Pb_Ai"
EndBody
!
! Description of object
!
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!
Object Process $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object ThreadObject $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
!
Object NumberRepresentation $Attribute 4
Body SysBody
Attr TypeRef = "pwrb:Type-PbNumberRepEnum"
EndBody
EndObject
!
Object NumberOfChannels $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object BytesPerChannel $Attribute 6
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object Status $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object BytesOfInput $Attribute 8
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object OffsetInputs $Attribute 9
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
EndObject ! Rt body
!
Object Template Pb_Ai
Body RtBody
Attr NumberRepresentation = 0
Attr NumberOfChannels = 4
Attr BytesPerChannel = 2
Attr Process = 1
Attr Status = 0
Attr BytesOfInput = 0
Attr OffsetInputs = 0
EndBody
EndObject ! Template
Object IoMethods $RtMethod
Object IoCardInit $Method
Body SysBody
Attr MethodName = "Pb_Ai-IoCardInit"
EndBody
EndObject
Object IoCardClose $Method
Body SysBody
Attr MethodName = "Pb_Ai-IoCardClose"
EndBody
EndObject
Object IoCardRead $Method
Body SysBody
Attr MethodName = "Pb_Ai-IoCardRead"
EndBody
EndObject
EndObject
!
EndObject ! Pb_Ai
!
!
EndSObject
src/wbl/pwrb/src/pwrb_c_pb_ao.wb_load
deleted
100644 → 0
View file @
f590671d
!
! Proview $Id: pwrb_c_pb_ao.wb_load,v 1.6 2005-09-01 14:58:02 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
SObject pwrb:Class
!
Object Pb_Ao $ClassDef 294
!
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
Attr Flags |= pwr_mClassDef_IOCard
EndBody
!
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "Pb_Ao"
EndBody
!
! Description of object
!
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
Object Process $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object ThreadObject $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
!
Object NumberRepresentation $Attribute 4
Body SysBody
Attr TypeRef = "pwrb:Type-PbNumberRepEnum"
EndBody
EndObject
!
Object NumberOfChannels $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object BytesPerChannel $Attribute 6
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object Status $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object BytesOfOutput $Attribute 8
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object OffsetOutputs $Attribute 9
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
EndObject ! Rt body
!
Object Template Pb_Ao
Body RtBody
Attr NumberOfChannels = 4
Attr BytesPerChannel = 2
Attr Process = 1
Attr Status = 0
Attr BytesOfOutput = 0
Attr OffsetOutputs = 0
EndBody
EndObject ! Template
Object IoMethods $RtMethod
Object IoCardInit $Method
Body SysBody
Attr MethodName = "Pb_Ao-IoCardInit"
EndBody
EndObject
Object IoCardClose $Method
Body SysBody
Attr MethodName = "Pb_Ao-IoCardClose"
EndBody
EndObject
Object IoCardWrite $Method
Body SysBody
Attr MethodName = "Pb_Ao-IoCardWrite"
EndBody
EndObject
EndObject
!
EndObject ! Pb_Ao
!
!
EndSObject
src/wbl/pwrb/src/pwrb_c_pb_di.wb_load
deleted
100644 → 0
View file @
f590671d
!
! Proview $Id: pwrb_c_pb_di.wb_load,v 1.6 2005-09-01 14:58:02 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
!
SObject pwrb:Class
!
Object Pb_Di $ClassDef 291
!
!
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
Attr Flags |= pwr_mClassDef_IOCard
EndBody
!
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "Pb_Di"
EndBody
!
! Description of object
!
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!
Object Process $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object ThreadObject $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
!
Object Orientation $Attribute 4
Body SysBody
Attr TypeRef = "pwrb:Type-PbOrientationEnum"
EndBody
EndObject
!
Object NumberOfChannels $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object Status $Attribute 6
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object ConvMask1 $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object ConvMask2 $Attribute 8
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object InvMask1 $Attribute 9
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object InvMask2 $Attribute 10
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object BytesOfInput $Attribute 11
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object OffsetInputs $Attribute 12
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
EndObject ! Rt body
!
Object Template Pb_Di
Body RtBody
Attr Process = 1
Attr Status = 0
Attr Orientation = 8
Attr NumberOfChannels = 32
Attr ConvMask1 = 65535
Attr ConvMask2 = 65535
Attr InvMask1 = 0
Attr InvMask2 = 0
Attr BytesOfInput = 0
Attr OffsetInputs = 0
EndBody
EndObject ! Template
Object IoMethods $RtMethod
Object IoCardInit $Method
Body SysBody
Attr MethodName = "Pb_Di-IoCardInit"
EndBody
EndObject
Object IoCardClose $Method
Body SysBody
Attr MethodName = "Pb_Di-IoCardClose"
EndBody
EndObject
Object IoCardRead $Method
Body SysBody
Attr MethodName = "Pb_Di-IoCardRead"
EndBody
EndObject
EndObject
!
EndObject ! Pb_Di
!
EndSObject
src/wbl/pwrb/src/pwrb_c_pb_do.wb_load
deleted
100644 → 0
View file @
f590671d
!
! Proview $Id: pwrb_c_pb_do.wb_load,v 1.6 2005-09-01 14:58:02 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
!
SObject pwrb:Class
!
!
Object Pb_Do $ClassDef 292
!
!
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
Attr Flags |= pwr_mClassDef_IOCard
EndBody
!
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "Pb_Do"
EndBody
!
! Description of object
!
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!
!
Object Process $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object ThreadObject $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
!
Object Orientation $Attribute 4
Body SysBody
Attr TypeRef = "pwrb:Type-PbOrientationEnum"
EndBody
EndObject
!
Object NumberOfChannels $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object Status $Attribute 6
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object TestMask1 $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object TestMask2 $Attribute 8
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object InvMask1 $Attribute 9
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object InvMask2 $Attribute 10
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object TestValue1 $Attribute 11
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object TestValue2 $Attribute 12
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object FixedOutValue1 $Attribute 13
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object FixedOutValue2 $Attribute 14
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object BytesOfOutput $Attribute 15
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object OffsetOutputs $Attribute 16
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
EndObject ! Rt body
!
Object Template Pb_Do
Body RtBody
Attr TestMask1 = 0
Attr TestMask2 = 0
Attr InvMask1 = 0
Attr InvMask2 = 0
Attr TestValue1 = 0
Attr TestValue2 = 0
Attr FixedOutValue1 = 0
Attr FixedOutValue2 = 0
Attr Process = 1
Attr Status = 0
Attr Orientation = 8
Attr NumberOfChannels = 32
Attr BytesOfOutput = 0
Attr OffsetOutputs = 0
EndBody
EndObject ! Template
Object IoMethods $RtMethod
Object IoCardInit $Method
Body SysBody
Attr MethodName = "Pb_Do-IoCardInit"
EndBody
EndObject
Object IoCardClose $Method
Body SysBody
Attr MethodName = "Pb_Do-IoCardClose"
EndBody
EndObject
Object IoCardWrite $Method
Body SysBody
Attr MethodName = "Pb_Do-IoCardWrite"
EndBody
EndObject
EndObject
!
EndObject ! Pb_Do
!
EndSObject
src/wbl/pwrb/src/pwrb_c_pb_dp_slave.wb_load
deleted
100644 → 0
View file @
f590671d
!
! Proview $Id: pwrb_c_pb_dp_slave.wb_load,v 1.6 2005-09-01 14:58:02 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Group IO,IO_Profibus
! Object that configure one Profibus DP slave.
!*/
!
Object Pb_DP_Slave $ClassDef 298
!
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
Attr Flags |= pwr_mClassDef_IORack
EndBody
!
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "Pb_DP_Slave"
EndBody
!
! Description of object
!
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!
Object GSDfile $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!
Object Status $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object Process $Attribute 4
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object ThreadObject $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
!
Object SlaveAddress $Attribute 6
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object ByteOrdering $Attribute 7
Body SysBody
Attr TypeRef = "pwrb:Type-ByteOrderingEnum"
EndBody
EndObject
!
Object FloatRepresentation $Attribute 37
Body SysBody
Attr TypeRef = "pwrb:Type-FloatRepEnum"
EndBody
EndObject
!
Object StallAction $Attribute 8
Body SysBody
Attr TypeRef = "pwrb:Type-PbStallActionEnum"
EndBody
EndObject
!
!
Object DisableSlave $Attribute 9
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
!
Object ErrorCount $Attribute 10
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object ErrorSoftLimit $Attribute 11
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object ErrorHardLimit $Attribute 12
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
!
Object VendorName $Attribute 13
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!
Object ModelName $Attribute 14
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!
Object Revision $Attribute 15
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!
Object HardwareRelease $Attribute 35
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!
Object SoftwareRelease $Attribute 36
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!
Object PNOIdent $Attribute 16
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
!
Object GroupIdent $Attribute 17
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object WdFact1 $Attribute 18
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object WdFact2 $Attribute 19
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object PrmUserDataLen $Attribute 20
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
!
Object PrmUserData $Attribute 21
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 256
EndBody
EndObject
!
Object AutoConfigure $Attribute 22
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object ConfigDataLen $Attribute 23
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object ConfigData $Attribute 24
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 256
EndBody
EndObject
!
Object SlaveUserDataLen $Attribute 25
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object SlaveUserData $Attribute 26
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 256
EndBody
EndObject
!
Object BytesOfInput $Attribute 27
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object BytesOfOutput $Attribute 28
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object OffsetInputs $Attribute 29
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object OffsetOutputs $Attribute 30
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object NumberModules $Attribute 31
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object Inputs $Attribute 32
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 256
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object Outputs $Attribute 33
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 256
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object Diag $Attribute 34
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 256
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
!
EndObject ! Rt body
!
Object ConfiguratorPosnn $Menu
Object Pointed $Menu
Object HelpClass $MenuButton
Body SysBody
Attr ButtonName = "Configure"
Attr MethodName = "Pb_DP_Slave-Configure"
Attr FilterName = "Pb_DP_Slave-ConfigureFilter"
EndBody
EndObject
EndObject
EndObject
Object ConfiguratorPoscn $Menu
Object Pointed $Menu
Object HelpClass $MenuButton
Body SysBody
Attr ButtonName = "Configure"
Attr MethodName = "Pb_DP_Slave-Configure"
Attr FilterName = "Pb_DP_Slave-ConfigureFilter"
EndBody
EndObject
EndObject
EndObject
Object ConfiguratorPosos $Menu
Object Pointed $Menu
Object HelpClass $MenuButton
Body SysBody
Attr ButtonName = "Configure"
Attr MethodName = "Pb_DP_Slave-Configure"
Attr FilterName = "Pb_DP_Slave-ConfigureFilter"
EndBody
EndObject
EndObject
EndObject
Object ConfiguratorPoson $Menu
Object Pointed $Menu
Object HelpClass $MenuButton
Body SysBody
Attr ButtonName = "Configure"
Attr MethodName = "Pb_DP_Slave-Configure"
Attr FilterName = "Pb_DP_Slave-ConfigureFilter"
EndBody
EndObject
EndObject
EndObject
Object Template Pb_DP_Slave
Body RtBody
Attr Process = 1
Attr SlaveAddress = 0
Attr StallAction = 1
Attr ByteOrdering = 0
Attr Status = 0
Attr DisableSlave = 0
Attr ErrorCount = 0
Attr ErrorSoftLimit = 15
Attr ErrorHardLimit = 50
Attr WdFact1 = 100
Attr WdFact2 = 10
Attr GroupIdent = 0
Attr AutoConfigure = 0
Attr ConfigDataLen = 0
Attr BytesOfInput = 0
Attr BytesOfOutput = 0
Attr OffsetInputs = 0
Attr OffsetOutputs = 0
Attr NumberModules = 0
EndBody
EndObject ! Template
Object IoMethods $RtMethod
Object IoRackInit $Method
Body SysBody
Attr MethodName = "Pb_DP_Slave-IoRackInit"
EndBody
EndObject
Object IoRackClose $Method
Body SysBody
Attr MethodName = "Pb_DP_Slave-IoRackClose"
EndBody
EndObject
Object IoRackRead $Method
Body SysBody
Attr MethodName = "Pb_DP_Slave-IoRackRead"
EndBody
EndObject
Object IoRackWrite $Method
Body SysBody
Attr MethodName = "Pb_DP_Slave-IoRackWrite"
EndBody
EndObject
EndObject
!
EndObject ! Pb_DP_Slave
!
EndSObject
src/wbl/pwrb/src/pwrb_c_pb_et200m.wb_load
deleted
100644 → 0
View file @
f590671d
!
! Proview $Id: pwrb_c_pb_et200m.wb_load,v 1.3 2005-09-01 14:58:02 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
SObject pwrb:Class
Object Pb_ET200M $ClassDef 288
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "Pb_ET200M"
EndBody
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
Object Process $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object ThreadObject $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
Object SlaveAddress $Attribute 4
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object Status $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object DisableSlave $Attribute 6
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object StallAction $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
Object ErrorCount $Attribute 8
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object ErrorSoftLimit $Attribute 9
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object ErrorHardLimit $Attribute 10
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object WdFact1 $Attribute 11
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
Object WdFact2 $Attribute 12
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
Object GroupIdent $Attribute 13
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
Object PNOIdent $Attribute 14
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
Object PrmUserDataLen $Attribute 15
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
Object PrmUserData $Attribute 16
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 32
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
Object AutoConfigure $Attribute 17
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
Object ConfigDataLen $Attribute 18
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object ConfigData $Attribute 19
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 128
EndBody
EndObject
Object BytesOfInput $Attribute 20
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object BytesOfOutput $Attribute 21
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object OffsetInputs $Attribute 22
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object OffsetOutputs $Attribute 23
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object NumberModules $Attribute 24
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object Inputs $Attribute 25
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 128
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object Outputs $Attribute 26
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 128
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
Object Diag $Attribute 27
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 128
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject ! Rt body
Object Template Pb_ET200M
Body RtBody
Attr Process = 1
Attr SlaveAddress = 0
Attr StallAction = 2
Attr Status = 0
Attr DisableSlave = 0
Attr ErrorCount = 0
Attr ErrorSoftLimit = 15
Attr ErrorHardLimit = 50
Attr WdFact1 = 100
Attr WdFact2 = 10
Attr GroupIdent = 0
Attr PNOIdent = 32797
Attr PrmUserDataLen = 3
Attr PrmUserData[0] = 64
Attr PrmUserData[1] = 96
Attr PrmUserData[2] = 0
Attr AutoConfigure = 1
Attr ConfigDataLen = 0
Attr BytesOfInput = 0
Attr BytesOfOutput = 0
Attr OffsetInputs = 0
Attr OffsetOutputs = 0
Attr NumberModules = 0
EndBody
EndObject ! Template
EndObject ! Pb_ET200M
EndSObject
src/wbl/pwrb/src/pwrb_c_pb_euro2500.wb_load
deleted
100644 → 0
View file @
f590671d
!
! Proview $Id: pwrb_c_pb_euro2500.wb_load,v 1.3 2005-09-01 14:58:02 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
SObject pwrb:Class
!
Object Pb_Euro2500 $ClassDef 290
!
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
EndBody
!
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "Pb_Euro2500"
EndBody
!
! Description of object
!
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!
Object Process $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object ThreadObject $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
!
Object SlaveAddress $Attribute 4
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
!
Object Status $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object DisableSlave $Attribute 6
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object StallAction $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object ErrorCount $Attribute 8
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object ErrorSoftLimit $Attribute 9
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object ErrorHardLimit $Attribute 10
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object WdFact1 $Attribute 11
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object WdFact2 $Attribute 12
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object GroupIdent $Attribute 13
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object PNOIdent $Attribute 14
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!
!
Object PrmUserDataLen $Attribute 15
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!
!
Object PrmUserData $Attribute 16
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 32
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!
Object AutoConfigure $Attribute 17
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object ConfigDataLen $Attribute 18
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object ConfigData $Attribute 19
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 128
EndBody
EndObject
!
Object BytesOfInput $Attribute 20
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object BytesOfOutput $Attribute 21
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object OffsetInputs $Attribute 22
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object OffsetOutputs $Attribute 23
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object NumberModules $Attribute 24
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object Inputs $Attribute 25
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 128
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object Outputs $Attribute 26
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 128
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object Diag $Attribute 27
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 128
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
!
EndObject ! Rt body
!
Object Template Pb_Euro2500
Body RtBody
Attr Process = 1
Attr SlaveAddress = 0
Attr StallAction = 2
Attr Status = 0
Attr DisableSlave = 0
Attr ErrorCount = 0
Attr ErrorSoftLimit = 15
Attr ErrorHardLimit = 50
Attr WdFact1 = 100
Attr WdFact2 = 10
Attr GroupIdent = 0
Attr PNOIdent = 9216
Attr PrmUserDataLen = 17
Attr PrmUserData[0] = 0
Attr PrmUserData[1] = 0
Attr PrmUserData[2] = 1
Attr PrmUserData[3] = 0
Attr PrmUserData[4] = 5
Attr PrmUserData[5] = 0
Attr PrmUserData[6] = 3
Attr PrmUserData[7] = 0
Attr PrmUserData[8] = 75
Attr PrmUserData[9] = 0
Attr PrmUserData[10] = 24
Attr PrmUserData[11] = 0
Attr PrmUserData[12] = 25
Attr PrmUserData[13] = 0
Attr PrmUserData[14] = 15
Attr PrmUserData[15] = 1
Attr PrmUserData[16] = 18
Attr AutoConfigure = 1
Attr ConfigDataLen = 0
Attr BytesOfInput = 0
Attr BytesOfOutput = 0
Attr OffsetInputs = 0
Attr OffsetOutputs = 0
Attr NumberModules = 0
EndBody
EndObject ! Template
!
EndObject ! Pb_Euro2500
!
EndSObject
src/wbl/pwrb/src/pwrb_c_pb_ii.wb_load
deleted
100644 → 0
View file @
f590671d
!
! Proview $Id: pwrb_c_pb_ii.wb_load,v 1.4 2005-09-01 14:58:02 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
SObject pwrb:Class
!
Object Pb_Ii $ClassDef 371
!
!
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
Attr Flags |= pwr_mClassDef_IOCard
EndBody
!
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "Pb_Ii"
EndBody
!
! Description of object
!
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!
Object Process $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object ThreadObject $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
!
Object NumberRepresentation $Attribute 4
Body SysBody
Attr TypeRef = "pwrb:Type-PbNumberRepEnum"
EndBody
EndObject
!
Object NumberOfChannels $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object BytesPerChannel $Attribute 6
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object Status $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object BytesOfInput $Attribute 8
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object OffsetInputs $Attribute 9
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
EndObject ! Rt body
!
Object Template Pb_Ii
Body RtBody
Attr NumberRepresentation = 0
Attr NumberOfChannels = 4
Attr BytesPerChannel = 2
Attr Process = 1
Attr Status = 0
Attr BytesOfInput = 0
Attr OffsetInputs = 0
EndBody
EndObject ! Template
Object IoMethods $RtMethod
Object IoCardInit $Method
Body SysBody
Attr MethodName = "Pb_Ii-IoCardInit"
EndBody
EndObject
Object IoCardClose $Method
Body SysBody
Attr MethodName = "Pb_Ii-IoCardClose"
EndBody
EndObject
Object IoCardRead $Method
Body SysBody
Attr MethodName = "Pb_Ii-IoCardRead"
EndBody
EndObject
EndObject
!
EndObject ! Pb_Ai
!
!
EndSObject
src/wbl/pwrb/src/pwrb_c_pb_io.wb_load
deleted
100644 → 0
View file @
f590671d
!
! Proview $Id: pwrb_c_pb_io.wb_load,v 1.4 2005-09-01 14:58:02 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
SObject pwrb:Class
!
Object Pb_Io $ClassDef 372
!
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
Attr Flags |= pwr_mClassDef_IOCard
EndBody
!
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "Pb_Io"
EndBody
!
! Description of object
!
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
Object Process $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object ThreadObject $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
!
Object NumberRepresentation $Attribute 4
Body SysBody
Attr TypeRef = "pwrb:Type-PbNumberRepEnum"
EndBody
EndObject
!
Object NumberOfChannels $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object BytesPerChannel $Attribute 6
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object Status $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object BytesOfOutput $Attribute 8
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object OffsetOutputs $Attribute 9
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
EndObject ! Rt body
!
Object Template Pb_Io
Body RtBody
Attr NumberOfChannels = 4
Attr BytesPerChannel = 2
Attr Process = 1
Attr Status = 0
Attr BytesOfOutput = 0
Attr OffsetOutputs = 0
EndBody
EndObject ! Template
Object IoMethods $RtMethod
Object IoCardInit $Method
Body SysBody
Attr MethodName = "Pb_Io-IoCardInit"
EndBody
EndObject
Object IoCardClose $Method
Body SysBody
Attr MethodName = "Pb_Io-IoCardClose"
EndBody
EndObject
Object IoCardWrite $Method
Body SysBody
Attr MethodName = "Pb_Io-IoCardWrite"
EndBody
EndObject
EndObject
!
EndObject ! Pb_Ao
!
!
EndSObject
src/wbl/pwrb/src/pwrb_c_pb_module.wb_load
deleted
100644 → 0
View file @
f590671d
!
! Proview $Id: pwrb_c_pb_module.wb_load,v 1.2 2005-09-01 14:58:02 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
! pwrb_c_pb_module.wb_load -- Defines the class Pb_Module.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Group IO,IO_Profibus
! @Summary Configuration of a Profibus module
! Configuration of a Profibus module.
!
!*/
Object Pb_Module $ClassDef 426
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Flags |= pwr_mClassDef_IOCard
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "Pb_Module"
EndBody
!/**
! Optional description.
!*/
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Module specification.
!*/
Object Specification $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! @Summary Process that handles the card. Plc(1), rt_io_comm(2) or application process(4).
! Process that handles the card.
!
! 1: The card is read by the plc process, and is handled by a specific
! thread in the plc, which is specified in the ThreadObject attribute.
! 2: The card is read by the rt_io_comm process.
! 4: The card is handled by an application program.
!*/
Object Process $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
!/**
! @Summary Plc thread that handles the card.
! The PlcThread object of the plc thread that handles the card.
! The card is read with the scantime of the thread.
!*/
Object ThreadObject $Attribute 4
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
!/**
! Communication status.
!*/
Object Status $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$Status"
EndBody
EndObject
!/**
! @Summary A URL to the data sheet for the equipment in this object.
! A URL to the data sheet for the equipment of this object.
! The data sheet can be displayed from the popup menu for this object.
!*/
Object DataSheet $Attribute 6
Body SysBody
Attr TypeRef = "pwrs:Type-$URL"
EndBody
EndObject
EndObject
Object Template Pb_Module
Body RtBody
Attr Process = 1
EndBody
EndObject
Object IoMethods $RtMethod
Object IoCardInit $Method
Body SysBody
Attr MethodName = "Pb_Module-IoCardInit"
EndBody
EndObject
Object IoCardClose $Method
Body SysBody
Attr MethodName = "Pb_Module-IoCardClose"
EndBody
EndObject
Object IoCardRead $Method
Body SysBody
Attr MethodName = "Pb_Module-IoCardRead"
EndBody
EndObject
Object IoCardWrite $Method
Body SysBody
Attr MethodName = "Pb_Module-IoCardWrite"
EndBody
EndObject
EndObject
EndObject
EndSObject
src/wbl/pwrb/src/pwrb_c_pb_npba12.wb_load
deleted
100644 → 0
View file @
f590671d
!
! Proview $Id: pwrb_c_pb_npba12.wb_load,v 1.3 2005-09-01 14:58:02 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
SObject pwrb:Class
!
!
Object Pb_NPBA12 $ClassDef 289
!
!
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
EndBody
!
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "Pb_NPBA12"
EndBody
!
! Description of object
!
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!
Object Process $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object ThreadObject $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
!
Object SlaveAddress $Attribute 4
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
!
Object Status $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object DisableSlave $Attribute 6
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object StallAction $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object ErrorCount $Attribute 8
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object ErrorSoftLimit $Attribute 9
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object ErrorHardLimit $Attribute 10
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object WdFact1 $Attribute 11
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object WdFact2 $Attribute 12
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object GroupIdent $Attribute 13
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object PNOIdent $Attribute 14
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!
!
Object PrmUserDataLen $Attribute 15
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!
!
Object PrmUserData $Attribute 16
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 32
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!
Object AutoConfigure $Attribute 17
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!
Object ConfigDataLen $Attribute 18
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!
Object ConfigData $Attribute 19
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 128
EndBody
EndObject
!
Object BytesOfInput $Attribute 20
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object BytesOfOutput $Attribute 21
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object OffsetInputs $Attribute 22
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object OffsetOutputs $Attribute 23
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object NumberModules $Attribute 24
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object Inputs $Attribute 25
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 128
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object Outputs $Attribute 26
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 128
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
Object Diag $Attribute 27
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 128
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
!
EndObject ! Rt body
!
Object Template Pb_NPBA12
Body RtBody
Attr Process = 1
Attr SlaveAddress = 0
Attr StallAction = 2
Attr Status = 0
Attr DisableSlave = 0
Attr ErrorCount = 0
Attr ErrorSoftLimit = 15
Attr ErrorHardLimit = 50
Attr WdFact1 = 100
Attr WdFact2 = 10
Attr GroupIdent = 0
Attr PNOIdent = 24594
Attr PrmUserDataLen = 0
Attr PrmUserData[0] = 0
Attr PrmUserData[1] = 0
Attr PrmUserData[2] = 0
Attr AutoConfigure = 1
Attr ConfigDataLen = 0
Attr BytesOfInput = 0
Attr BytesOfOutput = 0
Attr OffsetInputs = 0
Attr OffsetOutputs = 0
Attr NumberModules = 0
EndBody
EndObject ! Template
!
EndObject ! Pb_NPBA12
!
EndSObject
src/wbl/pwrb/src/pwrb_c_pb_profiboard.wb_load
deleted
100644 → 0
View file @
f590671d
!
! Proview $Id: pwrb_c_pb_profiboard.wb_load,v 1.5 2005-09-01 14:58:02 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
! pwrb_c_pb_profiboard.wb_load -- Defines the class pb_profiboard
!
SObject pwrb:Class
!/**
! @Author Claes Jurstrand
! @Version 1.0
! @Group IO,IO_Profibus
! @Summary Configurates a Profibus PCI master card (Softing profiboard)
! Configurates a Profibus PCI master card (Softing Profiboard). Available on LynxOS and Linux.
! The object should be named Px, where x is the number of the device, eg P1.
! You can have maximum two buses (master cards) on each system.
!*/
Object Pb_Profiboard $ClassDef 287
!
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
Attr Flags |= pwr_mClassDef_IOAgent
EndBody
!
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "Pb_Profiboard"
EndBody
!/**
! Text description of the object (comment).
!*/
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Defines the Proview process that will handle I/O for the bus.
! 1 for the PLC process (default).
!*/
Object Process $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!/**
! Defines which of the PLC threads that will handle I/O for the bus (if Process = 1).
!*/
Object ThreadObject $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
!/**
! Indicates the current state of the bus in runtime. Updated by the I/O-handler.
! 0 : Bus is not initialized.
! 1 : Bus is in stopped mode.
! 2 : Bus is in cleared mode.
! 3 : Bus is in operating mode (this should be the normal state when running).
!*/
Object Status $Attribute 4
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Flag that disables the initialization of the bus. Cant be set dynamically.
!*/
Object DisableBus $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Number of configured slaves in the bus. Updated by the I/O-handler.
!*/
Object NumberSlaves $Attribute 6
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Number of the bus. You can have one or two buses (master cards) on each system.
!*/
Object BusNumber $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!/**
! Maximum number of slaves allowed on the bus. Range 0..127.
!*/
Object MaxNumberSlaves $Attribute 8
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!/**
! Maximum size of each slaves output area.
!*/
Object MaxSlaveOutputLen $Attribute 9
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!/**
! Maximum size of each slaves input area.
!*/
Object MaxSlaveInputLen $Attribute 10
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!/**
! Baud rate for the bus in Kbit/s. Possible values are 500, 1500, 3000, 6000, 12000.
! Note that the values for some of the following attributes are depending on the
! baud rate. For further information about these bus parameters, please refer to the
! documentation from Softing.
!*/
Object BaudRate $Attribute 11
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!/**
! Watchdog timer for write supervision in the master card. This watchdog is
! activated at the first write operation after initialization. If the timer later
! elapses without a write operation, the master card will reset itself, and the bus
! will stop, leaving all slaves to stall when their own stalltime elapses.
! Range 100..10000 ms
!*/
Object StallTime $Attribute 12
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!/**
! Slot time, the maximum time a master station must wait for a transaction response.
! Range 37..16383 Bit Times.
! Recommended values for each baudrate:
! 500 kbit/s - 200
! 1500 kbit/s - 300
! 3000 kbit/s - 400
! 6000 kbit/s - 600
! 12000 kbit/s - 1000
!*/
Object Tsl $Attribute 13
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!/**
! Minimum station delay time for responder, the period of time which may elapse before
! the responder can send the response frame. Range 11..1023 Bit Times.
! Recommended values for each baudrate:
! 500 kbit/s - 11
! 1500 kbit/s - 11
! 3000 kbit/s - 11
! 6000 kbit/s - 11
! 12000 kbit/s - 11
!*/
Object MinTsdr $Attribute 14
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!/**
! Maximum station delay time for responder, the responder has to send the response frame
! before this time is elapsed. Range 37..2^16-1 Bit Times.
! Recommended values for each baudrate:
! 500 kbit/s - 100
! 1500 kbit/s - 150
! 3000 kbit/s - 250
! 6000 kbit/s - 450
! 12000 kbit/s - 800
!*/
Object MaxTsdr $Attribute 15
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!/**
! Quiet time, the period of time which a transmitting station must wait after the end of a frame
! before enabling its receiver. It is significant when using repeaters. Range 0..493 Bit Times.
! Recommended values for each baudrate:
! 500 kbit/s - 0
! 1500 kbit/s - 0
! 3000 kbit/s - 3
! 6000 kbit/s - 6
! 12000 kbit/s - 9
!*/
Object Tqui $Attribute 16
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!/**
! Setup time, the time between the occurance of an interrupt request and the necessary request
! action is performed. Range 1..494-Tqui BitTimes.
! Recommended values for each baudrate:
! 500 kbit/s - 1
! 1500 kbit/s - 1
! 3000 kbit/s - 4
! 6000 kbit/s - 8
! 12000 kbit/s - 16
!*/
Object Tset $Attribute 17
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!/**
! Target rotation time, the anticipated time for one token rotation on the bus, including
! allowances for high and low priority transactions and GAP maintenance.
! Range 256..2^24-1 Bit Times.
! The value is irrelevant in Profibus DP operations.
!*/
Object Ttr $Attribute 18
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
!/**
! Gap update factor, defines the number of token rotations between GAP maintenance cycles.
! Range 1..100.
! Recommended values for each baudrate:
! 500 kbit/s - 1
! 1500 kbit/s - 10
! 3000 kbit/s - 10
! 6000 kbit/s - 10
! 12000 kbit/s - 10
!*/
Object G $Attribute 19
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!/**
! Highest station address. Range 1..126.
!*/
Object Hsa $Attribute 20
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!/**
! Maximum retry limit, indicates how often FDL has to repeat the request frame when no response
! or acknowledge frame is receive from the recognized station within the slot time. Range 0..7.
! Recommended values for each baudrate:
! 500 kbit/s - 1
! 1500 kbit/s - 1
! 3000 kbit/s - 2
! 6000 kbit/s - 3
! 12000 kbit/s - 4
!*/
Object MaxRetryLimit $Attribute 21
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!/**
! Bus parameter flag. Should not be changed from the default value.
!*/
Object BpFlag $Attribute 22
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!/**
! Data exchange cycle time in 100 us. Should not be changed from the default value.
!*/
Object MinSlaveInterval $Attribute 23
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!/**
! Watchdog timer for Master to Master communication.
!*/
Object PollTimeout $Attribute 24
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!/**
! Control interval for global control status reports of the DP master.
!*/
Object DataControlTime $Attribute 25
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!/**
! Area for receiving diagnostic data from the master. Not implemented yet.
!*/
Object Diag $Attribute 26
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt8"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 256
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
EndObject ! Rt body
!
Object Template Pb_Profiboard
Body RtBody
Attr BusNumber = 1
Attr MaxNumberSlaves = 48
Attr MaxSlaveOutputLen = 128
Attr MaxSlaveInputLen = 128
Attr BaudRate = 12000
Attr StallTime = 3000
Attr Tsl = 1000
Attr MinTsdr = 11
Attr MaxTsdr = 800
Attr Tqui = 9
Attr Tset = 16
Attr Ttr = 300000
Attr G = 10
Attr Hsa = 126
Attr MaxRetryLimit = 4
Attr NumberSlaves = 0
Attr Status = 0
Attr DisableBus = 0
Attr Process = 1
Attr BpFlag = 0
Attr MinSlaveInterval = 1
Attr PollTimeout = 1000
Attr DataControlTime = 100
EndBody
EndObject ! Template
Object IoMethods $RtMethod
Object IoAgentInit $Method
Body SysBody
Attr MethodName = "Pb_Profiboard-IoAgentInit"
EndBody
EndObject
Object IoAgentClose $Method
Body SysBody
Attr MethodName = "Pb_Profiboard-IoAgentClose"
EndBody
EndObject
Object IoAgentRead $Method
Body SysBody
Attr MethodName = "Pb_Profiboard-IoAgentRead"
EndBody
EndObject
Object IoAgentWrite $Method
Body SysBody
Attr MethodName = "Pb_Profiboard-IoAgentWrite"
EndBody
EndObject
EndObject
!
EndObject ! Pb_Profiboard
!
EndSObject
src/wbl/pwrb/src/pwrb_td_pbnumberrepenum.wb_load
deleted
100644 → 0
View file @
f590671d
!
! Proview $Id: pwrb_td_pbnumberrepenum.wb_load,v 1.2 2005-09-01 14:58:02 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
! pwrb_td_pbnumberrepenum.wb_load -- Defines the enum type PbNumberRepEmum
!
SObject pwrb:Type
!/**
! @Version 1.0
! @Group Types
! Enumeration for number representation.
!*/
Object PbNumberRepEnum $TypeDef 28
Body SysBody
Attr TypeRef = "pwrs:Type-$Enum"
Attr PgmName = "PbNumberRep"
EndBody
!/**
! Integer Unsigned.
!*/
Object IntUnsigned $Value
Body SysBody
Attr PgmName = "IntUnsigned"
Attr Text = "Integer Unsigned"
Attr Value = 0
EndBody
EndObject
!/**
! Integer Signed.
!*/
Object IntSigned $Value
Body SysBody
Attr PgmName = "IntSigned"
Attr Text = "Integer Signed"
Attr Value = 1
EndBody
EndObject
!/**
! Floating Point IEEE.
!*/
Object FloatIEEE $Value
Body SysBody
Attr PgmName = "FloatIEEE"
Attr Text = "Floating Point IEEE"
Attr Value = 2
EndBody
EndObject
!/**
! Floating Point VAX.
!*/
Object FloatVAX $Value
Body SysBody
Attr PgmName = "FloatVAX"
Attr Text = "Floating Point VAX"
Attr Value = 3
EndBody
EndObject
!/**
! Floating Point Intel.
!*/
Object FloatIntel $Value
Body SysBody
Attr PgmName = "FloatIntel"
Attr Text = "Floating Point Intel"
Attr Value = 4
EndBody
EndObject
EndObject
EndSObject
src/wbl/pwrb/src/pwrb_td_pborientationenum.wb_load
deleted
100644 → 0
View file @
f590671d
!
! Proview $Id: pwrb_td_pborientationenum.wb_load,v 1.2 2005-09-01 14:58:02 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
! pwrb_td_pborientationenum.wb_load -- Defines the enum type PbOrientationEnum
!
SObject pwrb:Type
!/**
! @Version 1.0
! @Group Types
! Enumeration for orientation.
!*/
Object PbOrientationEnum $TypeDef 26
Body SysBody
Attr TypeRef = "pwrs:Type-$Enum"
Attr PgmName = "PbOrientation"
EndBody
!/**
! Byte.
!*/
Object Byte $Value
Body SysBody
Attr PgmName = "Byte"
Attr Text = "Byte"
Attr Value = 16
EndBody
EndObject
!/**
! Word.
!*/
Object Word $Value
Body SysBody
Attr PgmName = "Word"
Attr Text = "Word"
Attr Value = 16
EndBody
EndObject
!/**
! DoubleWord.
!*/
Object DoubleWord $Value
Body SysBody
Attr PgmName = "DoubleWord"
Attr Text = "DoubleWord"
Attr Value = 32
EndBody
EndObject
EndObject
EndSObject
src/wbl/pwrb/src/pwrb_td_pbstallactionenum.wb_load
deleted
100644 → 0
View file @
f590671d
!
! Proview $Id: pwrb_td_pbstallactionenum.wb_load,v 1.2 2005-09-01 14:58:02 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
! pwrb_td_pbstallactionenum.wb_load -- Defines the enum type PbStallActionEnum
!
SObject pwrb:Type
!/**
! @Version 1.0
! @Group Types
! Enumeration for profibus stall action.
!*/
Object PbStallActionEnum $TypeDef 24
Body SysBody
Attr TypeRef = "pwrs:Type-$Enum"
Attr PgmName = "PbStallAction"
EndBody
!/**
! No action.
!*/
Object No $Value
Body SysBody
Attr PgmName = "No"
Attr Text = "No action"
Attr Value = 0
EndBody
EndObject
!/**
! Reset inputs.
!*/
Object ResetInputs $Value
Body SysBody
Attr PgmName = "ResetInputs"
Attr Text = "Reset inputs"
Attr Value = 1
EndBody
EndObject
!/**
! Set emergency break.
!*/
Object EmergencyBreak $Value
Body SysBody
Attr PgmName = "EmergencyBreak"
Attr Text = "Set emergency break"
Attr Value = 2
EndBody
EndObject
EndObject
EndSObject
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment