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
ce758cd3
Commit
ce758cd3
authored
Jun 26, 2019
by
Marcus Nordenberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update profibus api
parent
9344a78b
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
3817 additions
and
4376 deletions
+3817
-4376
profibus/lib/rt/src/Papi.c
profibus/lib/rt/src/Papi.c
+344
-701
profibus/lib/rt/src/buildnr.papi.h
profibus/lib/rt/src/buildnr.papi.h
+0
-35
profibus/lib/rt/src/busparam.c
profibus/lib/rt/src/busparam.c
+48
-85
profibus/lib/rt/src/ccrl.c
profibus/lib/rt/src/ccrl.c
+174
-189
profibus/lib/rt/src/cif_api.c
profibus/lib/rt/src/cif_api.c
+682
-343
profibus/lib/rt/src/dpgdl.c
profibus/lib/rt/src/dpgdl.c
+106
-126
profibus/lib/rt/src/dpm_user.h
profibus/lib/rt/src/dpm_user.h
+240
-176
profibus/lib/rt/src/dpsgdl.c
profibus/lib/rt/src/dpsgdl.c
+49
-79
profibus/lib/rt/src/fdlgdl.c
profibus/lib/rt/src/fdlgdl.c
+35
-61
profibus/lib/rt/src/fm7gdl.c
profibus/lib/rt/src/fm7gdl.c
+62
-78
profibus/lib/rt/src/fmbgdl.c
profibus/lib/rt/src/fmbgdl.c
+40
-63
profibus/lib/rt/src/fmsgdl.c
profibus/lib/rt/src/fmsgdl.c
+188
-154
profibus/lib/rt/src/keywords.h
profibus/lib/rt/src/keywords.h
+4
-39
profibus/lib/rt/src/papiaux.c
profibus/lib/rt/src/papiaux.c
+33
-67
profibus/lib/rt/src/pb_conf.h
profibus/lib/rt/src/pb_conf.h
+21
-57
profibus/lib/rt/src/pb_dp.h
profibus/lib/rt/src/pb_dp.h
+293
-266
profibus/lib/rt/src/pb_dps.h
profibus/lib/rt/src/pb_dps.h
+65
-82
profibus/lib/rt/src/pb_err.h
profibus/lib/rt/src/pb_err.h
+174
-199
profibus/lib/rt/src/pb_fdl.h
profibus/lib/rt/src/pb_fdl.h
+98
-123
profibus/lib/rt/src/pb_fm7.h
profibus/lib/rt/src/pb_fm7.h
+226
-231
profibus/lib/rt/src/pb_fmb.h
profibus/lib/rt/src/pb_fmb.h
+115
-133
profibus/lib/rt/src/pb_fms.h
profibus/lib/rt/src/pb_fms.h
+418
-368
profibus/lib/rt/src/pb_hw.h
profibus/lib/rt/src/pb_hw.h
+0
-164
profibus/lib/rt/src/pb_if.h
profibus/lib/rt/src/pb_if.h
+133
-168
profibus/lib/rt/src/pb_ioctl.h
profibus/lib/rt/src/pb_ioctl.h
+32
-57
profibus/lib/rt/src/pb_ntdrv.h
profibus/lib/rt/src/pb_ntdrv.h
+54
-86
profibus/lib/rt/src/pb_tools.h
profibus/lib/rt/src/pb_tools.h
+12
-46
profibus/lib/rt/src/pb_type.h
profibus/lib/rt/src/pb_type.h
+10
-41
profibus/wbl/mcomp/src/profibus.wb_load
profibus/wbl/mcomp/src/profibus.wb_load
+161
-159
No files found.
profibus/lib/rt/src/Papi.c
View file @
ce758cd3
/*
/******************************************************************************
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*******************************************************************************
* *
* *
*
SOFTING AG
*
*
SOFTING Industrial Automation GmbH
*
* Richard-Reitzner-Allee 6 *
* Richard-Reitzner-Allee 6 *
* D-85540 Haar *
* D-85540 Haar *
* Phone: (++49)-(0)89-45656-0 *
* Phone: (++49)-(0)89-45656-0 *
* Fax: (++49)-(0)89-45656-399 *
* Fax: (++49)-(0)89-45656-399 *
* *
* *
*
Copyright (C) SOFTING AG 1995-2003
*
*
Copyright (C) SOFTING Industrial Automation GmbH 1995-2012
*
* All Rights Reserved *
* All Rights Reserved *
* *
* *
*******************************************************************************
*******************************************************************************
...
@@ -55,11 +20,11 @@ MODULE PAPI
...
@@ -55,11 +20,11 @@ MODULE PAPI
COMPONENT_LIBRARY PAPI Lib
COMPONENT_LIBRARY PAPI Lib
PAPI DLL
PAPI DLL
AUTHOR SOFTING
AG
AUTHOR SOFTING
VERSION 5.
26.1
.00.release
VERSION 5.
46.0
.00.release
DATE
27-June-2003
DATE
October-2011
STATUS finished
STATUS finished
...
@@ -67,12 +32,12 @@ STATUS finished
...
@@ -67,12 +32,12 @@ STATUS finished
FUNCTIONAL_MODULE_DESCRIPTION
FUNCTIONAL_MODULE_DESCRIPTION
PROFIBUS
FMS/DPV1 Master and DP-Slave Application Program Interface (PAPI) for
PROFIBUS
DP Master, FMS/DPV1 Master and DP-Slave Application Program Interface
WinXP/Win2K/WinNT
(PAPI) for Linux
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
This modul contains the PROFIBUS
FMS/DPV1 Master and DP-Slave Application
This modul contains the PROFIBUS
DP Master, FMS/DPV1 Master and DP-Slave
Program Interface
Application
Program Interface
functions.
functions.
...
@@ -142,14 +107,35 @@ extern INT16 fmbgdl_get_data_len(INT16, USIGN8, USIGN8, USIGN8*, INT16*);
...
@@ -142,14 +107,35 @@ extern INT16 fmbgdl_get_data_len(INT16, USIGN8, USIGN8, USIGN8*, INT16*);
EXPORT_DATA
EXPORT_DATA
// --- global variables used for compatibility mode
HANDLE
hServiceReadDevice
=
0
;
// Handle for Service device
HANDLE
hServiceWriteDevice
=
(
HANDLE
)
0
;
// Handle for Service device
HANDLE
hDpDataDevice
=
(
HANDLE
)
0
;
// Handle for DP-Data device
HANDLE
hDpsInputDataDevice
=
(
HANDLE
)
0
;
// Handle for DP-Slave Input-Data device
HANDLE
hDpsOutputDataDevice
=
(
HANDLE
)
0
;
// Handle for DP-Slave Output-Data device
USIGN8
CurrentBoardNumber
=
0
;
USIGN16
last_error
=
0
;
IMPORT_DATA
IMPORT_DATA
LOCAL_DATA
LOCAL_DATA
// --- copyright
// --- copyright
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
static
const
char
copyright
[]
=
"PROFIBUS WinXP/Win2K/WinNT API (c) Copyright "
"1995-2005. SOFTING AG. All Rights Reserved."
;
// --- Operation Mode
// --- Operation Mode
static
USIGN32
OperationMode
;
static
USIGN32
OperationMode
;
#endif
#ifdef _LINUX
static
const
char
copyright
[]
=
"PROFIBUS Linux API (c) Copyright 1995-2005. "
"SOFTING AG. All Rights Reserved."
;
#endif
#endif
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
...
@@ -240,12 +226,12 @@ Possible return values:
...
@@ -240,12 +226,12 @@ Possible return values:
Channel
=
0
;
// for future use
Channel
=
0
;
// for future use
// --- open basic management device
// --- open basic management device
sprintf
(
sprintf
(
DeviceName
,
"
\\\\
.
\\
PROFIBUS
\\
Board%u
\\
Pb%u
\\
Management"
,
Board
,
DeviceName
,
"
\\\\
.
\\
PROFIBUS
\\
Board%u
\\
Pb%u
\\
Management"
,
Board
,
Channel
);
Channel
);
return
(
return
(
CreateFile
(
DeviceName
,
DesiredAccess
,
CreateFile
(
DeviceName
,
DesiredAccess
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
));
FILE_ATTRIBUTE_NORMAL
,
NULL
));
}
}
#endif
#endif
...
@@ -253,7 +239,9 @@ Possible return values:
...
@@ -253,7 +239,9 @@ Possible return values:
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
FUNCTION
GLOBAL
HANDLE
CALL_CONV
profi_open
(
IN
HANDLE
hBasicMgmtDevice
,
FUNCTION
GLOBAL
HANDLE
CALL_CONV
profi_open
(
IN
HANDLE
hBasicMgmtDevice
,
IN
INT32
DeviceType
,
IN
USIGN32
Index
,
IN
INT32
DesiredAccess
)
IN
INT32
DeviceType
,
IN
USIGN32
Index
,
IN
INT32
DesiredAccess
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -293,7 +281,8 @@ Possible return values:
...
@@ -293,7 +281,8 @@ Possible return values:
FUNCTION_BODY
FUNCTION_BODY
// --- select IOCTL code specified by device type
// --- select IOCTL code specified by device type
switch
(
DeviceType
)
{
switch
(
DeviceType
)
{
case
DEVICE_DP_MANAGEMENT
:
case
DEVICE_DP_MANAGEMENT
:
IOControlCode
=
(
DWORD
)
IOCTL_PROFI_CREATE_DP_MANAGEMENT
;
IOControlCode
=
(
DWORD
)
IOCTL_PROFI_CREATE_DP_MANAGEMENT
;
break
;
break
;
...
@@ -333,15 +322,16 @@ Possible return values:
...
@@ -333,15 +322,16 @@ Possible return values:
// --- get device name
// --- get device name
if
(
!
DeviceIoControl
((
HANDLE
)
hBasicMgmtDevice
,
(
DWORD
)
IOControlCode
,
if
(
!
DeviceIoControl
((
HANDLE
)
hBasicMgmtDevice
,
(
DWORD
)
IOControlCode
,
(
LPVOID
)
&
Index
,
(
DWORD
)
sizeof
(
ULONG
),
(
LPVOID
)
DeviceName
,
(
DWORD
)
128
,
(
LPVOID
)
&
Index
,
(
DWORD
)
sizeof
(
ULONG
),
(
LPVOID
)
DeviceName
,
(
LPDWORD
)
&
BytesReturned
,
NULL
))
{
(
DWORD
)
128
,
(
LPDWORD
)
&
BytesReturned
,
NULL
))
{
return
(
INVALID_HANDLE_VALUE
);
return
(
INVALID_HANDLE_VALUE
);
}
}
// --- open device
// --- open device
return
(
return
(
CreateFile
(
DeviceName
,
DesiredAccess
,
CreateFile
(
DeviceName
,
DesiredAccess
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_ALWAYS
,
NULL
,
OPEN_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
));
FILE_ATTRIBUTE_NORMAL
,
NULL
));
}
}
#endif
#endif
...
@@ -376,9 +366,9 @@ Possible return values:
...
@@ -376,9 +366,9 @@ Possible return values:
#endif
#endif
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_read_service
(
IN
HANDLE
hDevice
,
FUNCTION
GLOBAL
INT16
CALL_CONV
OUT
T_PROFI_SERVICE_DESCR
*
pSdb
,
OUT
VOID
*
pData
,
profi_read_service
(
IN
HANDLE
hDevice
,
OUT
T_PROFI_SERVICE_DESCR
*
pSdb
,
INOUT
USIGN16
*
pDataLength
)
OUT
VOID
*
pData
,
INOUT
USIGN16
*
pDataLength
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -415,19 +405,25 @@ received
...
@@ -415,19 +405,25 @@ received
// printf("papi: profi_read_service\n");
// printf("papi: profi_read_service\n");
// --- allocate memory for SDB and DATABLOCK
// --- allocate memory for SDB and DATABLOCK
if
(
!
(
pSdbData
=
malloc
((
*
pDataLength
+
sizeof
(
T_PROFI_SERVICE_DESCR
)))))
{
if
(
!
(
pSdbData
=
malloc
((
*
pDataLength
+
sizeof
(
T_PROFI_SERVICE_DESCR
)))))
{
return
(
E_IF_OS_ERROR
);
return
(
E_IF_OS_ERROR
);
}
}
while
((
BytesRead
=
read
(
hDevice
,
pSdbData
,
while
((
BytesRead
=
(
int
)(
*
pDataLength
+
sizeof
(
T_PROFI_SERVICE_DESCR
))))
read
(
hDevice
,
pSdbData
,
<
0
)
{
(
int
)(
*
pDataLength
+
sizeof
(
T_PROFI_SERVICE_DESCR
))))
<
0
)
if
(
errno
!=
EAGAIN
)
{
{
if
(
errno
!=
EAGAIN
)
{
free
(
pSdbData
);
free
(
pSdbData
);
printf
(
"%s
\n
"
,
strerror
(
errno
));
printf
(
"%s
\n
"
,
strerror
(
errno
));
// printf("bytesRead=%u\n",BytesRead);
// printf("bytesRead=%u\n",BytesRead);
return
(
papi_get_last_error
());
return
(
papi_get_last_error
());
}
else
{
}
else
{
*
pDataLength
=
0
;
*
pDataLength
=
0
;
free
(
pSdbData
);
free
(
pSdbData
);
// printf("bytesRead=%u\n",BytesRead);
// printf("bytesRead=%u\n",BytesRead);
...
@@ -439,12 +435,15 @@ received
...
@@ -439,12 +435,15 @@ received
// printf("bytesRead=%u\n",BytesRead);
// printf("bytesRead=%u\n",BytesRead);
// --- check if IND or CON is available
// --- check if IND or CON is available
if
(
BytesRead
==
0
)
{
if
(
BytesRead
==
0
)
{
*
pDataLength
=
0
;
*
pDataLength
=
0
;
// printf ("%s 3\n", strerror (errno));
// printf ("%s 3\n", strerror (errno));
free
(
pSdbData
);
free
(
pSdbData
);
return
(
NO_CON_IND_RECEIVED
);
return
(
NO_CON_IND_RECEIVED
);
}
else
{
}
else
{
// printf("bytesRead=%u\n",BytesRead);
// printf("bytesRead=%u\n",BytesRead);
}
}
...
@@ -456,7 +455,8 @@ received
...
@@ -456,7 +455,8 @@ received
*
pDataLength
=
(
USIGN16
)
BytesRead
-
sizeof
(
T_PROFI_SERVICE_DESCR
);
*
pDataLength
=
(
USIGN16
)
BytesRead
-
sizeof
(
T_PROFI_SERVICE_DESCR
);
// --- copy DATABLOCK
// --- copy DATABLOCK
if
(
*
pDataLength
)
{
if
(
*
pDataLength
)
{
memcpy
(
pData
,
&
pSdbData
[
sizeof
(
T_PROFI_SERVICE_DESCR
)],
*
pDataLength
);
memcpy
(
pData
,
&
pSdbData
[
sizeof
(
T_PROFI_SERVICE_DESCR
)],
*
pDataLength
);
}
}
...
@@ -504,7 +504,7 @@ RES
...
@@ -504,7 +504,7 @@ RES
{
{
LOCAL_VARIABLES
LOCAL_VARIABLES
INT16
RetVal
;
// return value
INT16
RetVal
;
// return value
INT16
DataLength
;
// size of DATABLOCK
INT16
DataLength
;
// size of DATABLOCK
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
DWORD
BytesWritten
;
DWORD
BytesWritten
;
...
@@ -519,7 +519,8 @@ RES
...
@@ -519,7 +519,8 @@ RES
pSdb
->
comm_ref
&=
0x00FF
;
// clear all BITs in upper byte
pSdb
->
comm_ref
&=
0x00FF
;
// clear all BITs in upper byte
// --- check Service-Primitive
// --- check Service-Primitive
if
((
pSdb
->
primitive
==
IND
)
||
(
pSdb
->
primitive
==
CON
))
{
if
((
pSdb
->
primitive
==
IND
)
||
(
pSdb
->
primitive
==
CON
))
{
return
(
E_IF_INVALID_PRIMITIVE
);
return
(
E_IF_INVALID_PRIMITIVE
);
}
}
...
@@ -528,35 +529,36 @@ RES
...
@@ -528,35 +529,36 @@ RES
pSdb
->
result
=
POS
;
pSdb
->
result
=
POS
;
// --- get service specific data length
// --- get service specific data length
switch
(
pSdb
->
layer
)
{
switch
(
pSdb
->
layer
)
{
case
FMS
:
case
FMS
:
RetVal
=
fmsgdl_get_data_len
(
RetVal
=
fmsgdl_get_data_len
(
pSdb
->
result
,
pSdb
->
service
,
pSdb
->
primitive
,
pSdb
->
result
,
pSdb
->
service
,
pSdb
->
primitive
,
pData
,
&
DataLength
);
pData
,
&
DataLength
);
break
;
break
;
case
FM7
:
case
FM7
:
RetVal
=
fm7gdl_get_data_len
(
RetVal
=
fm7gdl_get_data_len
(
pSdb
->
result
,
pSdb
->
service
,
pSdb
->
primitive
,
pSdb
->
result
,
pSdb
->
service
,
pSdb
->
primitive
,
pData
,
&
DataLength
);
pData
,
&
DataLength
);
break
;
break
;
case
FDLIF
:
case
FDLIF
:
RetVal
=
fdlgdl_get_data_len
(
RetVal
=
fdlgdl_get_data_len
(
pSdb
->
result
,
pSdb
->
service
,
pSdb
->
primitive
,
pSdb
->
result
,
pSdb
->
service
,
pSdb
->
primitive
,
pData
,
&
DataLength
);
pData
,
&
DataLength
);
break
;
break
;
case
DP
:
case
DP
:
RetVal
=
dpgdl_get_data_len
(
RetVal
=
dpgdl_get_data_len
(
pSdb
->
result
,
pSdb
->
service
,
pSdb
->
primitive
,
pSdb
->
result
,
pSdb
->
service
,
pSdb
->
primitive
,
pData
,
&
DataLength
);
pData
,
&
DataLength
);
break
;
break
;
case
FMB
:
case
FMB
:
RetVal
=
fmbgdl_get_data_len
(
RetVal
=
fmbgdl_get_data_len
(
pSdb
->
result
,
pSdb
->
service
,
pSdb
->
primitive
,
pSdb
->
result
,
pSdb
->
service
,
pSdb
->
primitive
,
pData
,
&
DataLength
);
pData
,
&
DataLength
);
break
;
break
;
case
DPS
:
case
DPS
:
RetVal
=
dpsgdl_get_data_len
(
RetVal
=
dpsgdl_get_data_len
(
pSdb
->
result
,
pSdb
->
service
,
pSdb
->
primitive
,
pSdb
->
result
,
pSdb
->
service
,
pSdb
->
primitive
,
pData
,
&
DataLength
);
pData
,
&
DataLength
);
break
;
break
;
default:
default:
...
@@ -564,10 +566,12 @@ RES
...
@@ -564,10 +566,12 @@ RES
break
;
break
;
}
}
if
(
RetVal
==
E_OK
)
{
if
(
RetVal
==
E_OK
)
{
// allocate memory for SDB and DATABLOCK
// allocate memory for SDB and DATABLOCK
if
(
!
(
pSdbData
if
(
!
(
pSdbData
=
=
(
USIGN8
*
)
malloc
((
DataLength
+
sizeof
(
T_PROFI_SERVICE_DESCR
)))))
{
(
USIGN8
*
)
malloc
((
DataLength
+
sizeof
(
T_PROFI_SERVICE_DESCR
)))))
{
return
(
E_IF_OS_ERROR
);
return
(
E_IF_OS_ERROR
);
}
}
...
@@ -578,13 +582,13 @@ RES
...
@@ -578,13 +582,13 @@ RES
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
// write SDB and DATABLOCK
// write SDB and DATABLOCK
if
(
!
WriteFile
((
HANDLE
)
hDevice
,
(
LPVOID
)
pSdbData
,
if
(
!
WriteFile
((
HANDLE
)
hDevice
,
(
LPVOID
)
pSdbData
,
(
DWORD
)(
DataLength
+
sizeof
(
T_PROFI_SERVICE_DESCR
)),
(
DWORD
)(
DataLength
+
sizeof
(
T_PROFI_SERVICE_DESCR
)),
(
LPDWORD
)
&
BytesWritten
,
NULL
))
(
LPDWORD
)
&
BytesWritten
,
NULL
))
#endif
#endif
#ifdef _LINUX
#ifdef _LINUX
if
((
write
(
hDevice
,
pSdbData
,
DataLength
+
sizeof
(
T_PROFI_SERVICE_DESCR
)))
if
((
write
(
hDevice
,
pSdbData
,
<
0
)
DataLength
+
sizeof
(
T_PROFI_SERVICE_DESCR
)))
<
0
)
#endif
#endif
{
{
free
(
pSdbData
);
free
(
pSdbData
);
...
@@ -639,22 +643,25 @@ received
...
@@ -639,22 +643,25 @@ received
FUNCTION_BODY
FUNCTION_BODY
// --- allocate memory for SDB and DATABLOCK
// --- allocate memory for SDB and DATABLOCK
if
(
!
(
pSdbData
=
malloc
((
*
pDataLength
+
sizeof
(
T_PROFI_SERVICE_DESCR
)))))
{
if
(
!
(
pSdbData
=
malloc
((
*
pDataLength
+
sizeof
(
T_PROFI_SERVICE_DESCR
)))))
{
return
(
E_IF_OS_ERROR
);
return
(
E_IF_OS_ERROR
);
}
}
// --- read service data from device
// --- read service data from device
if
(
!
DeviceIoControl
((
HANDLE
)
*
phDevices
,
(
DWORD
)
IOCTL_PROFI_READ_MULTI
,
if
(
!
DeviceIoControl
((
HANDLE
)
*
phDevices
,
(
DWORD
)
IOCTL_PROFI_READ_MULTI
,
(
LPVOID
)
phDevices
,
(
DWORD
)
NrOfHandles
*
sizeof
(
HANDLE
),
(
LPVOID
)
phDevices
,
(
DWORD
)
NrOfHandles
*
sizeof
(
HANDLE
),
(
LPVOID
)
pSdbData
,
(
LPVOID
)
pSdbData
,
(
DWORD
)(
*
pDataLength
+
sizeof
(
T_PROFI_SERVICE_DESCR
)),
(
DWORD
)(
*
pDataLength
+
sizeof
(
T_PROFI_SERVICE_DESCR
)),
(
LPDWORD
)
&
BytesRead
,
NULL
))
{
(
LPDWORD
)
&
BytesRead
,
NULL
))
{
free
(
pSdbData
);
free
(
pSdbData
);
return
(
papi_get_last_error
());
return
(
papi_get_last_error
());
}
}
// --- check if IND or CON is available
// --- check if IND or CON is available
if
(
BytesRead
==
0
)
{
if
(
BytesRead
==
0
)
{
*
pDataLength
=
0
;
*
pDataLength
=
0
;
free
(
pSdbData
);
free
(
pSdbData
);
return
(
NO_CON_IND_RECEIVED
);
return
(
NO_CON_IND_RECEIVED
);
...
@@ -668,7 +675,8 @@ received
...
@@ -668,7 +675,8 @@ received
*
pDataLength
=
(
USIGN16
)
BytesRead
-
sizeof
(
T_PROFI_SERVICE_DESCR
);
*
pDataLength
=
(
USIGN16
)
BytesRead
-
sizeof
(
T_PROFI_SERVICE_DESCR
);
// --- copy DATABLOCK
// --- copy DATABLOCK
if
(
*
pDataLength
)
{
if
(
*
pDataLength
)
{
memcpy
(
pData
,
&
pSdbData
[
sizeof
(
T_PROFI_SERVICE_DESCR
)],
*
pDataLength
);
memcpy
(
pData
,
&
pSdbData
[
sizeof
(
T_PROFI_SERVICE_DESCR
)],
*
pDataLength
);
}
}
...
@@ -680,94 +688,10 @@ received
...
@@ -680,94 +688,10 @@ received
#endif
#endif
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_read_data
(
IN
HANDLE
hDevice
,
OUT
VOID
*
pData
,
INOUT
USIGN16
*
pDataLength
)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to read DP-Slave-I/O-Data from a DP SLAVE DATA DEVICE.
IN: hDevice -> device handle
OUT: pData -> pointer to data buffer
INOUT: pDataLength -> IN: length of data buffer
OUT: length of received data
Possible return values:
- E_OK -> no error occured
- E_IF_INVALID_DP_STATE -> DP is not in operational state
- E_IF_SLAVE_ERROR -> no valid communication with DP-Slave
- E_IF_SLAVE_DIAG_DATA -> new DP diagnostics data available
- E_IF_INVALID_CMI_CALL -> invalid offset inside data image
- E_IF_CMI_ERROR -> serious CMI error
- E_IF_INVALID_DATA_SIZE -> size of data block provided not sufficient
- E_IF_SERVICE_CONSTR_CONFLICT -> service not executable at time
- E_IF_OS_ERROR -> NT system error
-----------------------------------------------------------------------------*/
{
LOCAL_VARIABLES
DWORD
BytesRead
=
0
;
FUNCTION_BODY
if
(
!
ReadFile
(
hDevice
,
pData
,
*
pDataLength
,
&
BytesRead
,
NULL
))
{
*
pDataLength
=
0
;
return
(
papi_get_last_error
());
}
else
{
*
pDataLength
=
(
USIGN16
)
BytesRead
;
return
(
E_OK
);
}
}
#endif
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_write_data
(
IN
HANDLE
hDevice
,
IN
VOID
*
pData
,
IN
USIGN16
DataLength
)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to write DP-Slave-I/O-Data to a DP SLAVE DATA DEVICE.
IN: hDevice -> device handle
IN: pData -> pointer to data buffer
IN: DataLength -> length of data to write
Possible return values:
- E_OK -> no error occured
- E_IF_INVALID_DP_STATE -> DP is not in operational state
- E_IF_SLAVE_ERROR -> no valid communication with DP-Slave
- E_IF_SLAVE_DIAG_DATA -> new DP diagnostics data available
- E_IF_INVALID_CMI_CALL -> invalid offset inside data image
- E_IF_CMI_ERROR -> serious CMI error
- E_IF_INVALID_DATA_SIZE -> size of data block provided not sufficient
- E_IF_SERVICE_CONSTR_CONFLICT -> service not executable at time
- E_IF_OS_ERROR -> NT system error
-----------------------------------------------------------------------------*/
{
LOCAL_VARIABLES
DWORD
BytesWritten
=
0
;
FUNCTION_BODY
// write data
if
(
!
WriteFile
(
hDevice
,
pData
,
DataLength
,
&
BytesWritten
,
NULL
))
{
return
(
papi_get_last_error
());
}
else
{
return
(
E_OK
);
}
}
#endif
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_read_dps_data
(
IN
HANDLE
hDevice
,
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_read_dps_data
(
IN
HANDLE
hDevice
,
OUT
USIGN8
*
pData
,
INOUT
USIGN8
*
pDataLength
,
OUT
USIGN8
*
pState
)
OUT
USIGN8
*
pData
,
INOUT
USIGN8
*
pDataLength
,
OUT
USIGN8
*
pState
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -810,7 +734,7 @@ Possible return values:
...
@@ -810,7 +734,7 @@ Possible return values:
// --- read DPS input/output data and status
// --- read DPS input/output data and status
if
(
ReadFile
(
hDevice
,
(
LPVOID
)
DataBuffer
,
(
DWORD
)(
*
pDataLength
+
1
),
if
(
ReadFile
(
hDevice
,
(
LPVOID
)
DataBuffer
,
(
DWORD
)(
*
pDataLength
+
1
),
(
LPDWORD
)
&
BytesRead
,
NULL
))
(
LPDWORD
)
&
BytesRead
,
NULL
))
#endif
#endif
#ifdef _LINUX
#ifdef _LINUX
...
@@ -821,14 +745,18 @@ Possible return values:
...
@@ -821,14 +745,18 @@ Possible return values:
*
pDataLength
=
(
USIGN8
)(
BytesRead
-
1
);
*
pDataLength
=
(
USIGN8
)(
BytesRead
-
1
);
memcpy
(
pData
,
DataBuffer
,
*
pDataLength
);
memcpy
(
pData
,
DataBuffer
,
*
pDataLength
);
return
(
E_OK
);
return
(
E_OK
);
}
else
{
}
else
{
*
pDataLength
=
0
;
*
pDataLength
=
0
;
return
(
papi_get_last_error
());
return
(
papi_get_last_error
());
}
}
}
}
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_write_dps_data
(
IN
HANDLE
hDevice
,
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_write_dps_data
(
IN
HANDLE
hDevice
,
IN
USIGN8
*
pData
,
IN
USIGN8
DataLength
,
OUT
USIGN8
*
pState
)
IN
USIGN8
*
pData
,
IN
USIGN8
DataLength
,
OUT
USIGN8
*
pState
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -857,6 +785,7 @@ data size
...
@@ -857,6 +785,7 @@ data size
#ifdef _LINUX
#ifdef _LINUX
NTIoctl
SlaveInput
;
NTIoctl
SlaveInput
;
char
FirstByte
;
#endif
#endif
FUNCTION_BODY
FUNCTION_BODY
...
@@ -865,8 +794,8 @@ data size
...
@@ -865,8 +794,8 @@ data size
// --- write DPS input data and read status
// --- write DPS input data and read status
if
(
!
DeviceIoControl
((
HANDLE
)
hDevice
,
(
DWORD
)
IOCTL_PROFI_SET_DPS_DATA
,
if
(
!
DeviceIoControl
((
HANDLE
)
hDevice
,
(
DWORD
)
IOCTL_PROFI_SET_DPS_DATA
,
(
LPVOID
)
pData
,
(
DWORD
)
DataLength
,
(
LPVOID
)
pState
,
(
LPVOID
)
pData
,
(
DWORD
)
DataLength
,
(
LPVOID
)
pState
,
(
DWORD
)
sizeof
(
USIGN8
),
(
LPDWORD
)
&
BytesReturned
,
NULL
))
(
DWORD
)
sizeof
(
USIGN8
),
(
LPDWORD
)
&
BytesReturned
,
NULL
))
#endif
#endif
#ifdef _LINUX
#ifdef _LINUX
...
@@ -875,271 +804,31 @@ data size
...
@@ -875,271 +804,31 @@ data size
SlaveInput
.
OutBuf
=
(
USIGN8
*
)
pData
;
SlaveInput
.
OutBuf
=
(
USIGN8
*
)
pData
;
SlaveInput
.
OutBufLength
=
DataLength
;
SlaveInput
.
OutBufLength
=
DataLength
;
if
(
ioctl
(
hDevice
,
IOCTL_PROFI_SET_SLAVE_IN
,
&
SlaveInput
)
==
-
1
)
if
(
DataLength
)
#endif
{
{
return
(
papi_get_last_error
());
FirstByte
=
pData
[
0
];
}
else
{
return
(
E_OK
);
}
}
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
FUNCTION
GLOBAL
BOOL
CALL_CONV
profi_get_cntrl_info
(
IN
USIGN8
Board
,
OUT
char
*
pFirmwareVersion
,
OUT
USIGN32
*
pSerialDeviceNumber
)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to get the version of the firmware and the serial
device number of PROFIBUS controller.
IN: Board -> board number
OUT: pFirmwareVersion -> data buffer for firmware version string
OUT: pSerialDeviceNumber -> serial device number
NOTE: There must be at least 100 Bytes (VERSION_STRING_LENGTH) free space for
firmware version buffer.
Possible return values:
- TRUE -> function returns sucessfully
- FALSE -> function returns not successfully
-----------------------------------------------------------------------------*/
{
LOCAL_VARIABLES
DWORD
BytesRead
=
0
;
HANDLE
hDevice
;
PROFI_DATA_IMAGE_DESCR
DataImageDescr
;
char
DeviceName
[
64
];
FUNCTION_BODY
// --- open BOARD device
sprintf
(
DeviceName
,
"
\\\\
.
\\
PROFIBUS
\\
Board%u
\\
Board"
,
Board
);
if
(
INVALID_HANDLE_VALUE
==
(
hDevice
=
CreateFile
(
DeviceName
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
)))
{
return
(
FALSE
);
}
// --- get FIRMWARE VERSION
DataImageDescr
.
imageId
=
ID_FW_VERS_IMAGE
;
DataImageDescr
.
offset
=
0
;
DataImageDescr
.
bus
=
0
;
if
(
!
DeviceIoControl
((
HANDLE
)
hDevice
,
(
DWORD
)
IOCTL_PROFI_GET_DATA_IMAGE
,
(
LPVOID
)
&
DataImageDescr
,
(
DWORD
)
sizeof
(
DataImageDescr
),
(
LPVOID
)
pFirmwareVersion
,
(
DWORD
)
VERSION_STRING_LENGTH
,
(
LPDWORD
)
&
BytesRead
,
NULL
))
{
CloseHandle
(
hDevice
);
return
(
FALSE
);
}
}
// printf("\nprofi_get_data: buf=%p, len=%u, size=%lu\n",
// SlaveInput.InBuf,
// SlaveInput.InBufLength,
// sizeof(SlaveInput));
// --- get SERIAL DEVICE NUMBER
if
(
ioctl
(
hDevice
,
IOCTL_PROFI_SET_SLAVE_IN
,
&
SlaveInput
)
==
-
1
)
DataImageDescr
.
imageId
=
ID_SERIAL_DEVICE_NUMBER
;
DataImageDescr
.
offset
=
0
;
DataImageDescr
.
bus
=
0
;
if
(
!
DeviceIoControl
((
HANDLE
)
hDevice
,
(
DWORD
)
IOCTL_PROFI_GET_DATA_IMAGE
,
(
LPVOID
)(
VOID
*
)
&
DataImageDescr
,
(
DWORD
)
sizeof
(
DataImageDescr
),
(
LPVOID
)
pSerialDeviceNumber
,
(
DWORD
)
sizeof
(
USIGN32
),
(
LPDWORD
)
&
BytesRead
,
NULL
))
{
CloseHandle
(
hDevice
);
return
(
FALSE
);
}
CloseHandle
(
hDevice
);
return
(
TRUE
);
}
#endif
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
FUNCTION
GLOBAL
BOOL
CALL_CONV
profi_set_timeout
(
IN
HANDLE
hBasicMgmtDevice
,
IN
USIGN32
ReadTimeout
,
IN
USIGN32
WriteTimeout
)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to set send and receive TIMEOUTs for SEND/RECEIVE
interface
functions
IN: hBasicMgmtDevice -> basic management device handle
IN: ReadTimeout -> receive timeout in ms (WAIT_FOREVER for infinite wait)
IN: WriteTimeout -> send timeout in ms (WAIT_FOREVER for infinite wait)
Possible return values:
- TRUE -> function returns sucessfully
- FALSE -> function returns not successfully
-----------------------------------------------------------------------------*/
{
LOCAL_VARIABLES
DWORD
BytesReturned
;
USIGN32
ReadWriteTimeout
[
2
];
FUNCTION_BODY
ReadWriteTimeout
[
0
]
=
ReadTimeout
;
ReadWriteTimeout
[
1
]
=
WriteTimeout
;
return
(
DeviceIoControl
((
HANDLE
)
hBasicMgmtDevice
,
(
DWORD
)
IOCTL_PROFI_SET_TIMEOUT
,
(
LPVOID
)
ReadWriteTimeout
,
(
DWORD
)
2
*
sizeof
(
USIGN32
),
(
LPVOID
)
NULL
,
(
DWORD
)
0
,
(
LPDWORD
)
&
BytesReturned
,
NULL
));
}
#endif
#endif
{
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
return
(
papi_get_last_error
());
FUNCTION
GLOBAL
BOOL
CALL_CONV
profi_get_timeout
(
IN
HANDLE
hBasicMgmtDevice
,
OUT
USIGN32
*
pReadTimeout
,
OUT
USIGN32
*
pWriteTimeout
)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to get the set send and receive TIMEOUTs for SEND/RECEIVE
interface functions
IN: hBasicMgmtDevice -> basic management device handle
OUT: pReadTimeout -> pointer to receive timeout in ms (WAIT_FOREVER for
infinite wait)
OUT: pWriteTimeout -> pointer to send timeout in ms (WAIT_FOREVER for
infinite wait)
Possible return values:
- TRUE -> function returns sucessfully
- FALSE -> function returns not successfully
-----------------------------------------------------------------------------*/
{
LOCAL_VARIABLES
DWORD
BytesReturned
;
USIGN32
ReadWriteTimeout
[
2
];
FUNCTION_BODY
if
(
!
DeviceIoControl
((
HANDLE
)
hBasicMgmtDevice
,
(
DWORD
)
IOCTL_PROFI_GET_TIMEOUT
,
(
LPVOID
)
NULL
,
(
DWORD
)
0
,
(
LPVOID
)
ReadWriteTimeout
,
(
DWORD
)
2
*
sizeof
(
USIGN32
),
(
LPDWORD
)
&
BytesReturned
,
NULL
))
{
return
(
FALSE
);
}
}
else
{
if
(
DataLength
)
{
pData
[
0
]
=
FirstByte
;
}
if
(
BytesReturned
==
8
)
{
return
(
E_OK
);
*
pReadTimeout
=
ReadWriteTimeout
[
0
];
*
pWriteTimeout
=
ReadWriteTimeout
[
1
];
return
(
TRUE
);
}
else
{
SetLastError
(
ERROR_INVALID_DATA
);
return
(
FALSE
);
}
}
}
}
#endif
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
FUNCTION
GLOBAL
BOOL
CALL_CONV
profi_set_queue_size
(
IN
HANDLE
hBasicMgmtDevice
,
IN
USIGN32
QueueSize
)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to set the max. receive queue size for the PROFIBUS
driver.
IN: hBasicMgmtDevice -> basic management device handle
IN: QueueSize -> max. receive queue size
Possible return values:
- TRUE -> function returns sucessfully
- FALSE -> function returns not successfully
-----------------------------------------------------------------------------*/
{
LOCAL_VARIABLES
DWORD
BytesReturned
;
FUNCTION_BODY
return
(
DeviceIoControl
((
HANDLE
)
hBasicMgmtDevice
,
(
DWORD
)
IOCTL_PROFI_SET_QUEUE_SIZE
,
(
LPVOID
)
&
QueueSize
,
(
DWORD
)
sizeof
(
USIGN32
),
(
LPVOID
)
NULL
,
(
DWORD
)
0
,
(
LPDWORD
)
&
BytesReturned
,
NULL
));
}
#endif
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
FUNCTION
GLOBAL
BOOL
CALL_CONV
profi_get_queue_size
(
IN
HANDLE
hBasicMgmtDevice
,
OUT
USIGN32
*
pQueueSize
)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to get the set max. receive queue size for the PROFIBUS
driver.
IN: hBasicMgmtDevice -> basic management device handle
OUT: pQueueSize -> pointer to max. receive queue size
Possible return values:
- TRUE -> function returns sucessfully
- FALSE -> function returns not successfully
-----------------------------------------------------------------------------*/
{
LOCAL_VARIABLES
DWORD
BytesReturned
;
FUNCTION_BODY
return
(
DeviceIoControl
((
HANDLE
)
hBasicMgmtDevice
,
(
DWORD
)
IOCTL_PROFI_GET_QUEUE_SIZE
,
(
LPVOID
)
NULL
,
(
DWORD
)
0
,
(
LPVOID
)
pQueueSize
,
(
DWORD
)
sizeof
(
USIGN32
),
(
LPDWORD
)
&
BytesReturned
,
NULL
));
}
#endif
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
FUNCTION
GLOBAL
BOOL
CALL_CONV
profi_get_overrun_count
(
IN
HANDLE
hBasicMgmtDevice
,
OUT
USIGN32
*
pOverrunCount
)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
IN: hBasicMgmtDevice -> basic management device handle
OUT: pOverrunCount -> pointer to overrun counts
Possible return values:
- TRUE -> function returns sucessfully
- FALSE -> function returns not successfully
-----------------------------------------------------------------------------*/
{
LOCAL_VARIABLES
DWORD
BytesReturned
;
FUNCTION_BODY
return
(
DeviceIoControl
((
HANDLE
)
hBasicMgmtDevice
,
(
DWORD
)
IOCTL_PROFI_GET_OVERRUN_COUNT
,
(
LPVOID
)
NULL
,
(
DWORD
)
0
,
(
LPVOID
)
pOverrunCount
,
(
DWORD
)
sizeof
(
USIGN32
),
(
LPDWORD
)
&
BytesReturned
,
NULL
));
}
#endif
// ***************************************************************************
// ***************************************************************************
// ***************************************************************************
// ***************************************************************************
// *
// *
...
@@ -1149,9 +838,10 @@ Possible return values:
...
@@ -1149,9 +838,10 @@ Possible return values:
// ***************************************************************************
// ***************************************************************************
// ***************************************************************************
// ***************************************************************************
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_set_default
(
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_set_default
(
IN
USIGN8
Board
,
OUT
T_PROFI_DEVICE_HANDLE
*
hDevice
,
IN
USIGN8
Board
,
IN
USIGN8
Channel
,
IN
USIGN8
Channel
,
IN
USIGN32
ReadTimeout
,
IN
USIGN32
WriteTimeout
)
IN
USIGN32
ReadTimeout
,
IN
USIGN32
WriteTimeout
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -1182,55 +872,63 @@ version
...
@@ -1182,55 +872,63 @@ version
USIGN32
ReadWriteTimeout
[
2
];
USIGN32
ReadWriteTimeout
[
2
];
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
DWORD
BytesReturned
;
DWORD
BytesReturned
;
#endif
#endif
FUNCTION_BODY
FUNCTION_BODY
if
(
h
Device
->
hServiceReadDevice
||
hDevice
->
hServiceWriteDevice
if
(
h
ServiceReadDevice
||
hServiceWriteDevice
||
hDpDataDevice
)
||
hDevice
->
hDpDataDevice
)
{
{
return
E_IF_SERVICE_NOT_EXECUTABLE
;
// Application has called init_profibus
return
E_IF_SERVICE_NOT_EXECUTABLE
;
// Application has called init_profibus
// before
// before
}
}
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
if
(
!
ReadBoardRegistryEntries
(
Board
,
&
OperationMode
))
{
if
(
!
ReadBoardRegistryEntries
(
Board
,
&
OperationMode
))
{
return
(
E_IF_READING_REGISTRY
);
return
(
E_IF_READING_REGISTRY
);
}
}
// get service device name
// get service device name
sprintf
(
sprintf
(
DeviceName
,
"
\\\\
.
\\
PROFIBUS
\\
Board%u
\\
Pb%u
\\
Service"
,
Board
,
DeviceName
,
"
\\\\
.
\\
PROFIBUS
\\
Board%u
\\
Pb%u
\\
Service"
,
Board
,
Channel
);
Channel
);
// Open service device for read access
// Open service device for read access
hServiceReadDevice
=
CreateFile
(
DeviceName
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
hServiceReadDevice
=
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
CreateFile
(
DeviceName
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
hServiceReadDevice
==
INVALID_HANDLE_VALUE
)
{
if
(
hServiceReadDevice
==
INVALID_HANDLE_VALUE
)
{
hServiceReadDevice
=
NULL
;
hServiceReadDevice
=
NULL
;
return
(
E_IF_OS_ERROR
);
return
(
E_IF_OS_ERROR
);
}
}
// Open service device for write access
// Open service device for write access
hServiceWriteDevice
=
CreateFile
(
DeviceName
,
GENERIC_WRITE
,
0
,
NULL
,
hServiceWriteDevice
=
CreateFile
(
DeviceName
,
GENERIC_WRITE
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
hServiceWriteDevice
==
INVALID_HANDLE_VALUE
)
{
if
(
hServiceWriteDevice
==
INVALID_HANDLE_VALUE
)
{
CloseHandle
(
hServiceReadDevice
);
CloseHandle
(
hServiceReadDevice
);
hServiceReadDevice
=
NULL
;
hServiceReadDevice
=
NULL
;
hServiceWriteDevice
=
NULL
;
hServiceWriteDevice
=
NULL
;
return
(
E_IF_OS_ERROR
);
return
(
E_IF_OS_ERROR
);
}
}
if
(
OperationMode
==
FMS_DPV1_MASTER_MODE
)
{
if
(
OperationMode
==
FMS_DPV1_MASTER_MODE
)
{
// --- get DP-Master's Data device name
// --- get DP-Master's Data device name
sprintf
(
sprintf
(
DeviceName
,
"
\\\\
.
\\
PROFIBUS
\\
Board%u
\\
Pb%u
\\
DpData"
,
Board
,
DeviceName
,
"
\\\\
.
\\
PROFIBUS
\\
Board%u
\\
Pb%u
\\
DpData"
,
Board
,
Channel
);
Channel
);
hDpDataDevice
=
CreateFile
(
DeviceName
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
hDpDataDevice
=
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
CreateFile
(
DeviceName
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
hDpDataDevice
==
INVALID_HANDLE_VALUE
)
{
if
(
hDpDataDevice
==
INVALID_HANDLE_VALUE
)
{
CloseHandle
(
hServiceReadDevice
);
CloseHandle
(
hServiceReadDevice
);
CloseHandle
(
hServiceWriteDevice
);
CloseHandle
(
hServiceWriteDevice
);
hServiceReadDevice
=
NULL
;
hServiceReadDevice
=
NULL
;
...
@@ -1238,15 +936,19 @@ version
...
@@ -1238,15 +936,19 @@ version
hDpDataDevice
=
NULL
;
hDpDataDevice
=
NULL
;
return
(
E_IF_OS_ERROR
);
return
(
E_IF_OS_ERROR
);
}
}
}
else
{
}
else
{
// get DP-Slave Input-Data device name
// get DP-Slave Input-Data device name
sprintf
(
DeviceName
,
"
\\\\
.
\\
PROFIBUS
\\
Board%u
\\
Pb%u
\\
DpSlaveInputData"
,
sprintf
(
DeviceName
,
"
\\\\
.
\\
PROFIBUS
\\
Board%u
\\
Pb%u
\\
DpSlaveInputData"
,
Board
,
Channel
);
Board
,
Channel
);
hDpsInputDataDevice
=
CreateFile
(
DeviceName
,
GENERIC_READ
|
GENERIC_WRITE
,
hDpsInputDataDevice
=
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
CreateFile
(
DeviceName
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
hDpsInputDataDevice
==
INVALID_HANDLE_VALUE
)
{
if
(
hDpsInputDataDevice
==
INVALID_HANDLE_VALUE
)
{
CloseHandle
(
hServiceReadDevice
);
CloseHandle
(
hServiceReadDevice
);
CloseHandle
(
hServiceWriteDevice
);
CloseHandle
(
hServiceWriteDevice
);
hServiceReadDevice
=
NULL
;
hServiceReadDevice
=
NULL
;
...
@@ -1257,12 +959,14 @@ version
...
@@ -1257,12 +959,14 @@ version
// get DP-Slave Output-Data device name
// get DP-Slave Output-Data device name
sprintf
(
DeviceName
,
"
\\\\
.
\\
PROFIBUS
\\
Board%u
\\
Pb%u
\\
DpSlaveOutputData"
,
sprintf
(
DeviceName
,
"
\\\\
.
\\
PROFIBUS
\\
Board%u
\\
Pb%u
\\
DpSlaveOutputData"
,
Board
,
Channel
);
Board
,
Channel
);
hDpsOutputDataDevice
=
CreateFile
(
DeviceName
,
GENERIC_READ
|
GENERIC_WRITE
,
hDpsOutputDataDevice
=
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
CreateFile
(
DeviceName
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
hDpsOutputDataDevice
==
INVALID_HANDLE_VALUE
)
{
if
(
hDpsOutputDataDevice
==
INVALID_HANDLE_VALUE
)
{
CloseHandle
(
hServiceReadDevice
);
CloseHandle
(
hServiceReadDevice
);
CloseHandle
(
hServiceWriteDevice
);
CloseHandle
(
hServiceWriteDevice
);
CloseHandle
(
hDpsInputDataDevice
);
CloseHandle
(
hDpsInputDataDevice
);
...
@@ -1278,9 +982,10 @@ version
...
@@ -1278,9 +982,10 @@ version
ReadWriteTimeout
[
1
]
=
WriteTimeout
;
ReadWriteTimeout
[
1
]
=
WriteTimeout
;
if
(
!
DeviceIoControl
((
HANDLE
)
hServiceReadDevice
,
if
(
!
DeviceIoControl
((
HANDLE
)
hServiceReadDevice
,
(
DWORD
)
IOCTL_PROFI_SET_TIMEOUT
,
(
LPVOID
)
ReadWriteTimeout
,
(
DWORD
)
IOCTL_PROFI_SET_TIMEOUT
,
(
LPVOID
)
ReadWriteTimeout
,
(
DWORD
)
2
*
sizeof
(
USIGN32
),
(
LPVOID
)
NULL
,
(
DWORD
)
0
,
(
DWORD
)
2
*
sizeof
(
USIGN32
),
(
LPVOID
)
NULL
,
(
DWORD
)
0
,
(
LPDWORD
)
&
BytesReturned
,
NULL
))
{
(
LPDWORD
)
&
BytesReturned
,
NULL
))
{
CloseHandle
(
hServiceReadDevice
);
CloseHandle
(
hServiceReadDevice
);
CloseHandle
(
hServiceWriteDevice
);
CloseHandle
(
hServiceWriteDevice
);
if
(
hDpDataDevice
)
if
(
hDpDataDevice
)
...
@@ -1310,56 +1015,59 @@ version
...
@@ -1310,56 +1015,59 @@ version
sprintf
(
DeviceName
,
"/dev/pbservice%u"
,
Board
+
Channel
);
sprintf
(
DeviceName
,
"/dev/pbservice%u"
,
Board
+
Channel
);
// Open service device for read access
// Open service device for read access
h
Device
->
h
ServiceReadDevice
=
open
(
DeviceName
,
O_RDWR
|
O_NONBLOCK
);
hServiceReadDevice
=
open
(
DeviceName
,
O_RDWR
|
O_NONBLOCK
);
if
(
hDevice
->
hServiceReadDevice
==
INVALID_HANDLE_VALUE
)
{
if
(
hServiceReadDevice
==
INVALID_HANDLE_VALUE
)
hDevice
->
hServiceReadDevice
=
(
HANDLE
)
NULL
;
{
hServiceReadDevice
=
(
HANDLE
)
0
;
return
(
E_IF_OS_ERROR
);
return
(
E_IF_OS_ERROR
);
}
}
// Open service device for write access
// Open service device for write access
h
Device
->
hServiceWriteDevice
=
hDevice
->
hServiceReadDevice
;
h
ServiceWriteDevice
=
hServiceReadDevice
;
// --- get DP-Master's Data device name
// --- get DP-Master's Data device name
sprintf
(
DeviceName
,
"/dev/pbdata%u"
,
Board
+
Channel
);
sprintf
(
DeviceName
,
"/dev/pbdata%u"
,
Board
+
Channel
);
hD
evice
->
hD
pDataDevice
=
open
(
DeviceName
,
O_RDWR
|
O_NONBLOCK
);
hDpDataDevice
=
open
(
DeviceName
,
O_RDWR
|
O_NONBLOCK
);
// get DP-Slave Input-Data device name
// get DP-Slave Input-Data device name
sprintf
(
DeviceName
,
"/dev/pbslin%u"
,
Board
+
Channel
);
sprintf
(
DeviceName
,
"/dev/pbslin%u"
,
Board
+
Channel
);
hD
evice
->
hD
psInputDataDevice
=
open
(
DeviceName
,
O_RDWR
|
O_NONBLOCK
);
hDpsInputDataDevice
=
open
(
DeviceName
,
O_RDWR
|
O_NONBLOCK
);
// get DP-Slave Output-Data device name
// get DP-Slave Output-Data device name
sprintf
(
DeviceName
,
"/dev/pbslout%u"
,
Board
+
Channel
);
sprintf
(
DeviceName
,
"/dev/pbslout%u"
,
Board
+
Channel
);
hDevice
->
hDpsOutputDataDevice
=
open
(
DeviceName
,
O_RDWR
|
O_NONBLOCK
);
hDpsOutputDataDevice
=
open
(
DeviceName
,
O_RDWR
|
O_NONBLOCK
);
if
((
hDevice
->
hDpDataDevice
==
INVALID_HANDLE_VALUE
)
if
((
hDpDataDevice
==
INVALID_HANDLE_VALUE
)
&&
&&
(
hDevice
->
hDpsInputDataDevice
==
INVALID_HANDLE_VALUE
)
(
hDpsInputDataDevice
==
INVALID_HANDLE_VALUE
)
&&
&&
(
hDevice
->
hDpsOutputDataDevice
==
INVALID_HANDLE_VALUE
))
{
(
hDpsOutputDataDevice
==
INVALID_HANDLE_VALUE
))
close
(
hDevice
->
hServiceReadDevice
);
{
close
(
hDevice
->
hServiceWriteDevice
);
close
(
hServiceReadDevice
);
close
(
hDevice
->
hDpDataDevice
);
close
(
hServiceWriteDevice
);
close
(
hDevice
->
hDpsInputDataDevice
);
close
(
hDpDataDevice
);
close
(
hDevice
->
hDpsOutputDataDevice
);
close
(
hDpsInputDataDevice
);
hDevice
->
hServiceReadDevice
=
(
HANDLE
)
NULL
;
close
(
hDpsOutputDataDevice
);
hDevice
->
hServiceWriteDevice
=
(
HANDLE
)
NULL
;
hServiceReadDevice
=
(
HANDLE
)
0
;
hDevice
->
hDpDataDevice
=
(
HANDLE
)
NULL
;
hServiceWriteDevice
=
(
HANDLE
)
0
;
hDevice
->
hDpsInputDataDevice
=
(
HANDLE
)
NULL
;
hDpDataDevice
=
(
HANDLE
)
0
;
hDevice
->
hDpsOutputDataDevice
=
(
HANDLE
)
NULL
;
hDpsInputDataDevice
=
(
HANDLE
)
0
;
hDpsOutputDataDevice
=
(
HANDLE
)
0
;
return
(
E_IF_OS_ERROR
);
return
(
E_IF_OS_ERROR
);
}
}
hDevice
->
CurrentBoardNumber
=
Board
+
Channel
;
CurrentBoardNumber
=
Board
+
Channel
;
#endif
#endif
return
(
E_OK
);
return
(
E_OK
);
}
}
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_init
(
OUT
T_PROFI_DEVICE_HANDLE
*
hDevice
,
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_init
(
IN
USIGN8
Board
,
IN
USIGN8
Board
,
IN
USIGN32
ReadTimeout
,
IN
USIGN32
WriteTimeout
)
IN
USIGN32
ReadTimeout
,
IN
USIGN32
WriteTimeout
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -1388,19 +1096,21 @@ version
...
@@ -1388,19 +1096,21 @@ version
FUNCTION_BODY
FUNCTION_BODY
if
((
hDevice
->
hServiceReadDevice
&&
hDevice
->
hServiceWriteDevice
)
if
((
hServiceReadDevice
&&
hServiceWriteDevice
)
&&
&&
(
hDevice
->
hDpDataDevice
(
hDpDataDevice
||
(
hDpsInputDataDevice
&&
hDpsOutputDataDevice
)))
||
(
hDevice
->
hDpsInputDataDevice
{
&&
hDevice
->
hDpsOutputDataDevice
)))
{
return
(
E_OK
);
// PAPI is already initialized
return
(
E_OK
);
// PAPI is already initialized
}
else
{
}
return
(
profi_set_default
(
else
hDevice
,
Board
,
0
,
ReadTimeout
,
WriteTimeout
));
// initalize PAPI
{
return
(
profi_set_default
(
Board
,
0
,
ReadTimeout
,
WriteTimeout
));
// initalize PAPI
}
}
}
}
FUNCTION
GLOBAL
INT16
CALL_CONV
init_profibus
(
FUNCTION
GLOBAL
INT16
CALL_CONV
init_profibus
(
IN
USIGN32
DprAdress
,
IN
USIGN32
DprAdress
,
IN
USIGN16
IoPortAdress
,
IN
PB_BOOL
Dummy
)
IN
USIGN16
IoPortAdress
,
IN
PB_BOOL
Dummy
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -1427,21 +1137,20 @@ version
...
@@ -1427,21 +1137,20 @@ version
{
{
LOCAL_VARIABLES
LOCAL_VARIABLES
T_PROFI_DEVICE_HANDLE
hDevice
;
FUNCTION_BODY
FUNCTION_BODY
if
((
hDevice
.
hServiceReadDevice
&&
hDevice
.
hServiceWriteDevice
)
if
((
hServiceReadDevice
&&
hServiceWriteDevice
)
&&
&&
(
hDevice
.
hDpDataDevice
(
hDpDataDevice
||
(
hDpsInputDataDevice
&&
hDpsOutputDataDevice
)))
||
(
hDevice
.
hDpsInputDataDevice
{
&&
hDevice
.
hDpsOutputDataDevice
)))
{
return
(
E_OK
);
// PAPI is already initialized
return
(
E_OK
);
// PAPI is already initialized
}
else
{
}
return
(
profi_set_default
(
&
hDevice
,
0
,
0
,
0
,
0
));
// initalize PAPI
else
{
return
(
profi_set_default
(
0
,
0
,
0
,
0
));
// initalize PAPI
}
}
}
}
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_end
(
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
)
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_end
(
VOID
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -1459,75 +1168,79 @@ Possible return values:
...
@@ -1459,75 +1168,79 @@ Possible return values:
FUNCTION_BODY
FUNCTION_BODY
// close service device
// close service device
if
(
hDevice
->
hServiceReadDevice
)
{
if
(
hServiceReadDevice
)
{
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
CloseHandle
(
hServiceReadDevice
);
CloseHandle
(
hServiceReadDevice
);
#endif
#endif
#ifdef _LINUX
#ifdef _LINUX
close
(
h
Device
->
h
ServiceReadDevice
);
close
(
hServiceReadDevice
);
#endif
#endif
h
Device
->
hServiceReadDevice
=
(
HANDLE
)
NULL
;
h
ServiceReadDevice
=
(
HANDLE
)
0
;
}
}
if
(
hDevice
->
hServiceWriteDevice
)
{
if
(
hServiceWriteDevice
)
{
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
CloseHandle
(
hServiceWriteDevice
);
CloseHandle
(
hServiceWriteDevice
);
#endif
#endif
#ifdef _LINUX
#ifdef _LINUX
close
(
h
Device
->
h
ServiceWriteDevice
);
close
(
hServiceWriteDevice
);
#endif
#endif
h
Device
->
hServiceWriteDevice
=
(
HANDLE
)
NULL
;
h
ServiceWriteDevice
=
(
HANDLE
)
0
;
}
}
// close DP-Data device
// close DP-Data device
if
(
hDevice
->
hDpDataDevice
)
{
if
(
hDpDataDevice
)
{
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
CloseHandle
(
hDpDataDevice
);
CloseHandle
(
hDpDataDevice
);
#endif
#endif
#ifdef _LINUX
#ifdef _LINUX
close
(
hD
evice
->
hD
pDataDevice
);
close
(
hDpDataDevice
);
#endif
#endif
hD
evice
->
hDpDataDevice
=
(
HANDLE
)
NULL
;
hD
pDataDevice
=
(
HANDLE
)
0
;
}
}
// close DP-Slave Input-Data device
// close DP-Slave Input-Data device
if
(
hDevice
->
hDpsInputDataDevice
)
{
if
(
hDpsInputDataDevice
)
{
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
CloseHandle
(
hDpsInputDataDevice
);
CloseHandle
(
hDpsInputDataDevice
);
#endif
#endif
#ifdef _LINUX
#ifdef _LINUX
close
(
hD
evice
->
hD
psInputDataDevice
);
close
(
hDpsInputDataDevice
);
#endif
#endif
hD
evice
->
hDpsInputDataDevice
=
(
HANDLE
)
NULL
;
hD
psInputDataDevice
=
(
HANDLE
)
0
;
}
}
// close DP-Slave Output-Data device
// close DP-Slave Output-Data device
if
(
hDevice
->
hDpsOutputDataDevice
)
{
if
(
hDpsOutputDataDevice
)
{
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
CloseHandle
(
hDpsOutputDataDevice
);
CloseHandle
(
hDpsOutputDataDevice
);
#endif
#endif
#ifdef _LINUX
#ifdef _LINUX
close
(
hD
evice
->
hD
psOutputDataDevice
);
close
(
hDpsOutputDataDevice
);
#endif
#endif
hD
evice
->
hDpsOutputDataDevice
=
(
HANDLE
)
NULL
;
hD
psOutputDataDevice
=
(
HANDLE
)
0
;
}
}
return
(
E_OK
);
return
(
E_OK
);
}
}
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_snd_req_res
(
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_snd_req_res
(
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
IN
T_PROFI_SERVICE_DESCR
*
pSdb
,
IN
T_PROFI_SERVICE_DESCR
*
pSdb
,
IN
VOID
*
pData
,
IN
PB_BOOL
dummy
)
IN
VOID
*
pData
,
IN
PB_BOOL
dummy
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -1566,15 +1279,15 @@ RES
...
@@ -1566,15 +1279,15 @@ RES
FUNCTION_BODY
FUNCTION_BODY
// --- check if service device is open
// --- check if service device is open
if
(
!
h
Device
||
!
hDevice
->
h
ServiceWriteDevice
)
if
(
!
hServiceWriteDevice
)
return
(
E_IF_PAPI_NOT_INITIALIZED
);
return
(
E_IF_PAPI_NOT_INITIALIZED
);
return
(
profi_write_service
(
h
Device
->
h
ServiceWriteDevice
,
pSdb
,
pData
));
return
(
profi_write_service
(
hServiceWriteDevice
,
pSdb
,
pData
));
}
}
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_rcv_con_ind
(
FUNCTION
GLOBAL
INT16
CALL_CONV
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
OUT
T_PROFI_SERVICE_DESCR
*
pSdb
,
profi_rcv_con_ind
(
OUT
T_PROFI_SERVICE_DESCR
*
pSdb
,
OUT
VOID
*
pData
,
OUT
VOID
*
pData
,
INOUT
USIGN16
*
pDataLength
)
INOUT
USIGN16
*
pDataLength
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -1602,16 +1315,16 @@ Possible return values:
...
@@ -1602,16 +1315,16 @@ Possible return values:
FUNCTION_BODY
FUNCTION_BODY
// --- check if service device is open
// --- check if service device is open
if
(
!
h
Device
||
!
hDevice
->
h
ServiceReadDevice
)
if
(
!
hServiceReadDevice
)
return
(
E_IF_PAPI_NOT_INITIALIZED
);
return
(
E_IF_PAPI_NOT_INITIALIZED
);
return
(
profi_read_service
(
return
(
profi_read_service
(
hServiceReadDevice
,
pSdb
,
pData
,
pDataLength
));
hDevice
->
hServiceReadDevice
,
pSdb
,
pData
,
pDataLength
));
}
}
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_set_data
(
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_set_data
(
IN
USIGN8
DataId
,
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
IN
USIGN8
DataId
,
IN
USIGN16
Offset
,
IN
USIGN16
Offset
,
IN
USIGN16
DataLength
,
IN
VOID
*
pData
)
IN
USIGN16
DataLength
,
IN
VOID
*
pData
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -1647,7 +1360,7 @@ possible return values:
...
@@ -1647,7 +1360,7 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
// --- check if DP-Data device is open
// --- check if DP-Data device is open
if
(
!
hD
evice
->
hD
pDataDevice
)
if
(
!
hDpDataDevice
)
return
(
E_IF_PAPI_NOT_INITIALIZED
);
return
(
E_IF_PAPI_NOT_INITIALIZED
);
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
...
@@ -1656,18 +1369,22 @@ possible return values:
...
@@ -1656,18 +1369,22 @@ possible return values:
overlapped
.
Offset
=
Offset
;
overlapped
.
Offset
=
Offset
;
// write data
// write data
if
(
!
WriteFile
(
if
(
!
WriteFile
(
hDpDataDevice
,
pData
,
DataLength
,
&
BytesWritten
,
&
overlapped
))
hDpDataDevice
,
pData
,
DataLength
,
&
BytesWritten
,
&
overlapped
))
{
{
return
(
papi_get_last_error
());
return
(
papi_get_last_error
());
}
}
#endif
#endif
#ifdef _LINUX
#ifdef _LINUX
if
(
lseek
(
hDevice
->
hDpDataDevice
,
Offset
,
SEEK_SET
)
<
0
)
{
if
(
lseek
(
hDpDataDevice
,
Offset
,
SEEK_SET
)
<
0
)
{
printf
(
"lseek error
\n
"
);
return
(
papi_get_last_error
());
return
(
papi_get_last_error
());
}
}
if
(
write
(
hDevice
->
hDpDataDevice
,
pData
,
DataLength
)
<
0
)
{
if
(
write
(
hDpDataDevice
,
pData
,
DataLength
)
<
0
)
{
printf
(
"write error
\n
"
);
return
(
papi_get_last_error
());
return
(
papi_get_last_error
());
}
}
#endif
#endif
...
@@ -1675,9 +1392,10 @@ possible return values:
...
@@ -1675,9 +1392,10 @@ possible return values:
return
(
E_OK
);
return
(
E_OK
);
}
}
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_get_data
(
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_get_data
(
IN
USIGN8
DataId
,
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
IN
USIGN8
DataId
,
IN
USIGN16
Offset
,
IN
USIGN16
Offset
,
INOUT
USIGN16
*
pDataLength
,
OUT
VOID
*
pData
)
INOUT
USIGN16
*
pDataLength
,
OUT
VOID
*
pData
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -1709,66 +1427,31 @@ possible return values:
...
@@ -1709,66 +1427,31 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
INT16
RetVal
=
E_OK
;
INT16
RetVal
=
E_OK
;
HANDLE
hBoard
=
(
HANDLE
)
NULL
;
HANDLE
hBoard
=
(
HANDLE
)
0
;
char
DeviceName
[
64
];
char
DeviceName
[
64
];
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
DWORD
BytesRead
=
0
;
T_PROFI_DATA_IMAGE_DESCR
DataImageDescr
;
OVERLAPPED
Overlapped
;
#endif
#ifdef _LINUX
#ifdef _LINUX
ssize_t
BytesRead
=
0
;
ssize_t
BytesRead
=
0
;
DataImage
DataImageDescr
;
DataImage
DataImageDescr
;
#endif
#endif
switch
(
DataId
)
{
switch
(
DataId
)
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
{
case
ID_SERIAL_DEVICE_NUMBER
:
case
ID_FW_VERS_IMAGE
:
case
ID_EXCEPTION_IMAGE
:
// --- open BOARD-Device
sprintfprofi_get_data
(
DeviceName
,
"
\\\\
.
\\
PROFIBUS
\\
Board%u
\\
Board"
,
CurrentBoardNumber
);
if
(
INVALID_HANDLE_VALUE
==
(
hBoard
=
CreateFile
(
DeviceName
,
0
,
0
,
NULL
,
OPEN_ALWAYS
,
profi_get_data
FILE_ATTRIBUTE_NORMAL
,
NULL
)))
{
BytesRead
return
(
E_IF_OS_ERROR
);
}
// --- set input IOCTL data structure
DataImageDescr
.
imageId
=
DataId
;
DataImageDescr
.
offset
=
Offset
;
DataImageDescr
.
bus
=
0
;
// --- read DATA-Image
if
(
DeviceIoprofi_get_dataControl
((
HANDLE
)
hBoard
,
(
DWORD
)
IOCTL_PROFI_GET_DATA_IMAGE
,
(
LPVOID
)
&
DataImageDescr
,
BytesRead
(
DWORD
)
sizeof
(
DataImageDescr
),
(
LPVOID
)
pData
,
(
DWORD
)
*
pDataLength
,
(
LPDWORD
)
&
BytesRead
,
NULL
))
{
profi_get_data
*
pDataLength
=
(
USIGN16
)
BytesRead
;
RetVal
=
E_OK
;
}
else
{
*
pDataLength
=
0
;
RetVal
=
papi_get_last_error
();
}
CloseHandle
(
hBoard
);
#endif // BytesRead
#ifdef _LINUX
#ifdef _LINUX
case
ID_SERIAL_DEVICE_NUMBER
:
case
ID_SERIAL_DEVICE_NUMBER
:
case
ID_FW_VERS_IMAGE
:
case
ID_FW_VERS_IMAGE
:
sprintf
(
DeviceName
,
"/dev/pbboard%u"
,
hDevice
->
CurrentBoardNumber
);
sprintf
(
DeviceName
,
"/dev/pbboard%u"
,
CurrentBoardNumber
);
if
((
hBoard
=
open
(
DeviceName
,
O_RDONLY
))
<
0
)
{
if
((
hBoard
=
open
(
DeviceName
,
O_RDONLY
))
<
0
)
{
return
(
papi_get_last_error
());
return
(
papi_get_last_error
());
}
}
if
(
DataId
==
ID_SERIAL_DEVICE_NUMBER
)
{
if
(
DataId
==
ID_SERIAL_DEVICE_NUMBER
)
if
(
lseek
(
hBoard
,
Offset
,
SEEK_SET
)
<
0
)
{
{
if
(
lseek
(
hBoard
,
Offset
,
SEEK_SET
)
<
0
)
{
return
(
papi_get_last_error
());
return
(
papi_get_last_error
());
}
}
...
@@ -1776,21 +1459,34 @@ possible return values:
...
@@ -1776,21 +1459,34 @@ possible return values:
DataImageDescr
.
Buf
=
pData
;
DataImageDescr
.
Buf
=
pData
;
DataImageDescr
.
Length
=
*
pDataLength
;
DataImageDescr
.
Length
=
*
pDataLength
;
if
(
ioctl
(
hBoard
,
IOCTL_PROFI_SERIAL_NUMBER
,
&
DataImageDescr
)
==
-
1
)
{
// printf("\nprofi_get_data: buf=%p, len=%u, size=%lu\n",
// DataImageDescr.Buf,
// DataImageDescr.Length,
// sizeof(DataImageDescr));
if
(
ioctl
(
hBoard
,
IOCTL_PROFI_SERIAL_NUMBER
,
&
DataImageDescr
)
==
-
1
)
{
*
pDataLength
=
0
;
*
pDataLength
=
0
;
RetVal
=
papi_get_last_error
();
RetVal
=
papi_get_last_error
();
}
else
{
}
else
{
*
pDataLength
=
(
USIGN16
)
4
;
*
pDataLength
=
(
USIGN16
)
4
;
*
(
USIGN32
*
)
pData
=
*
(
USIGN32
*
)
&
DataImageDescr
;
*
(
USIGN32
*
)
pData
=
*
(
USIGN32
*
)
&
DataImageDescr
;
RetVal
=
E_OK
;
RetVal
=
E_OK
;
// printf("papi: Serialnumber = %lu len = %hu\n",*(USIGN32*)pData,
// printf("papi: Serialnumber = %lu len = %hu\n",*(USIGN32*)pData,
// BytesRead);
// BytesRead);
}
}
}
else
{
}
if
((
BytesRead
=
read
(
hBoard
,
pData
,
*
pDataLength
))
<
0
)
{
else
{
if
((
BytesRead
=
read
(
hBoard
,
pData
,
*
pDataLength
))
<
0
)
{
*
pDataLength
=
0
;
*
pDataLength
=
0
;
RetVal
=
papi_get_last_error
();
RetVal
=
papi_get_last_error
();
}
else
{
}
else
{
*
pDataLength
=
(
USIGN16
)
BytesRead
;
*
pDataLength
=
(
USIGN16
)
BytesRead
;
RetVal
=
E_OK
;
RetVal
=
E_OK
;
}
}
...
@@ -1803,24 +1499,13 @@ possible return values:
...
@@ -1803,24 +1499,13 @@ possible return values:
case
ID_DP_SLAVE_IO_IMAGE
:
case
ID_DP_SLAVE_IO_IMAGE
:
// --- check if DP-Data device is open
// --- check if DP-Data device is open
if
(
!
hD
evice
->
hD
pDataDevice
)
if
(
!
hDpDataDevice
)
return
(
E_IF_PAPI_NOT_INITIALIZED
);
return
(
E_IF_PAPI_NOT_INITIALIZED
);
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
// --- init overlapped structure
memset
(
&
Overlapped
,
0
,
sizeof
(
OVERLAPPED
));
Overlapped
.
OfhBoardfset
=
Offset
;
if
(
!
ReadFile
(
hDpDataDevice
,
pData
,
*
pDataLength
,
&
BytesRead
,
&
Overlapped
))
{
return
(
papi_get_last_error
());
}
#endif
#ifdef _LINUX
#ifdef _LINUX
if
(
lseek
(
hDevice
->
hDpDataDevice
,
Offset
,
SEEK_SET
)
<
0
)
{
if
(
lseek
(
hDpDataDevice
,
Offset
,
SEEK_SET
)
<
0
)
{
return
(
papi_get_last_error
());
return
(
papi_get_last_error
());
}
}
...
@@ -1834,13 +1519,21 @@ possible return values:
...
@@ -1834,13 +1519,21 @@ possible return values:
&DataImageDescr,
&DataImageDescr,
CurrentBoardNumber);
CurrentBoardNumber);
*/
*/
// printf("\nprofi_get_data: buf=%p, IOCTL_PROFI_GET_DATA_IMAGE
if
(
ioctl
(
// len=%u, size=%lu\n",
hDevice
->
hDpDataDevice
,
IOCTL_PROFI_GET_DATA_IMAGE
,
&
DataImageDescr
)
// DataImageDescr.Buf,
==
-
1
)
{
// DataImageDescr.Length,
// sizeof(DataImageDescr));
if
(
ioctl
((
int
)
hDpDataDevice
,
(
int
)
IOCTL_PROFI_GET_DATA_IMAGE
,
&
DataImageDescr
)
==
-
1
)
{
BytesRead
=
0
;
BytesRead
=
0
;
RetVal
=
papi_get_last_error
();
RetVal
=
papi_get_last_error
();
}
else
{
}
else
{
BytesRead
=
(
USIGN16
)
DataImageDescr
.
Length
;
BytesRead
=
(
USIGN16
)
DataImageDescr
.
Length
;
// printf("papi data length = %u\n", BytesRead);
// printf("papi data length = %u\n", BytesRead);
RetVal
=
E_OK
;
RetVal
=
E_OK
;
...
@@ -1856,9 +1549,9 @@ possible return values:
...
@@ -1856,9 +1549,9 @@ possible return values:
}
}
}
}
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_set_dps_input_data
(
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_set_dps_input_data
(
IN
USIGN8
*
pData
,
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
IN
USIGN8
*
pData
,
IN
USIGN8
DataLength
,
IN
USIGN8
DataLength
,
OUT
USIGN8
*
pState
)
OUT
USIGN8
*
pState
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -1883,17 +1576,16 @@ data size
...
@@ -1883,17 +1576,16 @@ data size
FUNCTION_BODY
FUNCTION_BODY
if
(
hDevice
->
hDpsInputDataDevice
==
(
HANDLE
)
NULL
)
{
if
(
hDpsInputDataDevice
==
(
HANDLE
)
0
)
{
return
(
E_IF_PAPI_NOT_INITIALIZED
);
return
(
E_IF_PAPI_NOT_INITIALIZED
);
}
}
return
(
profi_write_dps_data
(
return
(
profi_write_dps_data
(
hDpsInputDataDevice
,
pData
,
DataLength
,
pState
));
hDevice
->
hDpsInputDataDevice
,
pData
,
DataLength
,
pState
));
}
}
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_get_dps_input_data
(
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_get_dps_input_data
(
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
OUT
USIGN8
*
pData
,
OUT
USIGN8
*
pData
,
INOUT
USIGN8
*
pDataLength
,
OUT
USIGN8
*
pState
)
INOUT
USIGN8
*
pDataLength
,
OUT
USIGN8
*
pState
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -1915,17 +1607,16 @@ possible return values:
...
@@ -1915,17 +1607,16 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
if
(
hDevice
->
hDpsInputDataDevice
==
(
HANDLE
)
NULL
)
{
if
(
hDpsInputDataDevice
==
(
HANDLE
)
0
)
{
return
(
E_IF_PAPI_NOT_INITIALIZED
);
return
(
E_IF_PAPI_NOT_INITIALIZED
);
}
}
return
(
profi_read_dps_data
(
return
(
profi_read_dps_data
(
hDpsInputDataDevice
,
pData
,
pDataLength
,
pState
));
hDevice
->
hDpsInputDataDevice
,
pData
,
pDataLength
,
pState
));
}
}
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_get_dps_output_data
(
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_get_dps_output_data
(
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
OUT
USIGN8
*
pData
,
OUT
USIGN8
*
pData
,
INOUT
USIGN8
*
pDataLength
,
OUT
USIGN8
*
pState
)
INOUT
USIGN8
*
pDataLength
,
OUT
USIGN8
*
pState
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -1949,17 +1640,17 @@ possible return values:
...
@@ -1949,17 +1640,17 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
if
(
hDevice
->
hDpsOutputDataDevice
==
(
HANDLE
)
NULL
)
{
if
(
hDpsOutputDataDevice
==
(
HANDLE
)
0
)
{
return
(
E_IF_PAPI_NOT_INITIALIZED
);
return
(
E_IF_PAPI_NOT_INITIALIZED
);
}
}
return
(
profi_read_dps_data
(
return
(
hDevice
->
hDpsOutputDataDevice
,
pData
,
pDataLength
,
pState
));
profi_read_dps_data
(
hDpsOutputDataDevice
,
pData
,
pDataLength
,
pState
));
}
}
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_get_versions
(
FUNCTION
GLOBAL
INT16
CALL_CONV
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
OUT
CSTRING
*
pPapiVersion
,
profi_get_versions
(
OUT
CSTRING
*
pPapiVersion
,
OUT
CSTRING
*
pFirmwareVersion
)
OUT
CSTRING
*
pFirmwareVersion
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -1997,14 +1688,15 @@ Possible return values:
...
@@ -1997,14 +1688,15 @@ Possible return values:
// --- get PROFIBUS firmware version
// --- get PROFIBUS firmware version
DataLength
=
(
USIGN16
)
VERSION_STRING_LENGTH
;
DataLength
=
(
USIGN16
)
VERSION_STRING_LENGTH
;
if
(
profi_get_data
(
if
(
profi_get_data
(
ID_FW_VERS_IMAGE
,
0
,
&
DataLength
,
pFirmwareVersion
)
!=
hDevice
,
ID_FW_VERS_IMAGE
,
0
,
&
DataLength
,
pFirmwareVersion
)
E_OK
)
!=
E_OK
)
{
{
strcpy
(
pFirmwareVersion
,
(
CSTRING
*
)
"controller not initialized"
);
strcpy
(
pFirmwareVersion
,
(
CSTRING
*
)
"controller not initialized"
);
}
}
// --- convert \n to ' '
// --- convert \n to ' '
for
(
i
=
0
;
i
<
VERSION_STRING_LENGTH
;
i
++
)
{
for
(
i
=
0
;
i
<
VERSION_STRING_LENGTH
;
i
++
)
{
if
(
pFirmwareVersion
[
i
]
==
'\n'
)
if
(
pFirmwareVersion
[
i
]
==
'\n'
)
pFirmwareVersion
[
i
]
=
' '
;
pFirmwareVersion
[
i
]
=
' '
;
else
if
(
pFirmwareVersion
[
i
]
==
'\0'
)
else
if
(
pFirmwareVersion
[
i
]
==
'\0'
)
...
@@ -2016,8 +1708,8 @@ Possible return values:
...
@@ -2016,8 +1708,8 @@ Possible return values:
return
(
E_OK
);
return
(
E_OK
);
}
}
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_get_serial_device_number
(
FUNCTION
GLOBAL
INT16
CALL_CONV
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
OUT
USIGN32
*
pSerialDeviceNumber
)
profi_get_serial_device_number
(
OUT
USIGN32
*
pSerialDeviceNumber
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -2041,8 +1733,8 @@ Possible return values:
...
@@ -2041,8 +1733,8 @@ Possible return values:
DataLength
=
(
USIGN16
)
sizeof
(
USIGN32
);
DataLength
=
(
USIGN16
)
sizeof
(
USIGN32
);
// --- get serial device number
// --- get serial device number
return
(
profi_get_data
(
return
(
profi_get_data
(
ID_SERIAL_DEVICE_NUMBER
,
0
,
&
DataLength
,
hDevice
,
ID_SERIAL_DEVICE_NUMBER
,
0
,
&
DataLength
,
pSerialDeviceNumber
));
pSerialDeviceNumber
));
}
}
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_get_last_error
(
VOID
)
FUNCTION
GLOBAL
INT16
CALL_CONV
profi_get_last_error
(
VOID
)
...
@@ -2080,55 +1772,6 @@ Possible return values:
...
@@ -2080,55 +1772,6 @@ Possible return values:
#endif
#endif
}
}
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
FUNCTION
BOOL
WINAPI
DllMain
(
IN
HINSTANCE
hInstDLL
,
IN
ULONG
Reason
,
IN
LPVOID
pReserved
)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
32Bit-DLL main function.
The function is called by MS-Windows during loading DLL.
Possible return values:
- TRUE
-----------------------------------------------------------------------------*/
{
LOCAL_VARIABLES
FUNCTION_BODY
switch
(
Reason
)
{
case
DLL_PROCESS_ATTACH
:
hServiceReadDevice
=
NULL
;
hServiceWriteDevice
=
NULL
;
hDpDataDevice
=
NULL
;
hDpsInputDataDevice
=
NULL
;
hDpsOutputDataDevice
=
NULL
;
CurrentBoardNumber
=
0
;
break
;
case
DLL_THREAD_ATTACH
:
break
;
case
DLL_THREAD_DETACH
:
break
;
case
DLL_PROCESS_DETACH
:
profi_end
();
break
;
default:
break
;
}
return
TRUE
;
}
#endif
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
#pragma check_stack
#pragma check_stack
#endif
#endif
profibus/lib/rt/src/buildnr.papi.h
View file @
ce758cd3
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#define BUILD_NUMBER 52
#define BUILD_NUMBER 52
#define BUILD_NUMBER_STR "52"
#define BUILD_NUMBER_STR "52"
...
...
profibus/lib/rt/src/busparam.c
View file @
ce758cd3
/*
/******************************************************************************
* ProviewR Open Source Process Control.
* *
* Copyright (C) 2005-2019 SSAB EMEA AB.
* SOFTING Industrial Automation GmbH *
*
* Richard-Reitzner-Allee 6 *
* This file is part of ProviewR.
* D-85540 Haar *
*
* Phone: (++49)-(0)89-45656-0 *
* This program is free software; you can redistribute it and/or
* Fax: (++49)-(0)89-45656-399 *
* modify it under the terms of the GNU General Public License as
* *
* published by the Free Software Foundation, either version 2 of
* Copyright (C) SOFTING Industrial Automation GmbH 1995-2012 *
* the License, or (at your option) any later version.
* All Rights Reserved *
*
* *
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************
* *
* SOFTING AG *
* Richard-Reitzner-Allee 6 *
* D-85540 Haar *
* Phone: ++49-89-4 56 56-0 *
* Fax: ++49-89-4 56 56-3 99 *
* *
* Copyright (C) SOFTING AG 1995-2003 *
* All Rights Reserved *
* *
******************************************************************************
FILE_NAME BUSPARAM.C
FILE_NAME BUSPARAM.C
...
@@ -55,25 +20,11 @@ MODULE BUSPARAM
...
@@ -55,25 +20,11 @@ MODULE BUSPARAM
COMPONENT_LIBRARY PBT LIBs and DLL (16-Bit)
COMPONENT_LIBRARY PBT LIBs and DLL (16-Bit)
PBTOOLS DLL (32-Bit)
PBTOOLS DLL (32-Bit)
AUTHOR SOFTING AG
AUTHOR SOFTING
VERSION 5.00
VERSION 5.21.0.00.release
5.01
5.02
DATE February-1998
5.10
5.11
5.20.0.00.alpha
5.20.0.00.release
5.21.0.00.release
DATE 24-November-1995
31-January-1996
14-July-1996
20-Febrary-1997
18-March-1997
30-July-1997
17-October-1997
27-February-1998
STATUS finished
STATUS finished
...
@@ -138,7 +89,8 @@ possible return values:
...
@@ -138,7 +89,8 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
switch
(
baud_rate
)
{
switch
(
baud_rate
)
{
case
0
:
/* 9,6 KBaud */
case
0
:
/* 9,6 KBaud */
case
1
:
/* 19,2 KBaud */
case
1
:
/* 19,2 KBaud */
case
2
:
/* 93,75 KBaud */
case
2
:
/* 93,75 KBaud */
...
@@ -242,7 +194,8 @@ possible return values:
...
@@ -242,7 +194,8 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
switch
(
baud_rate
)
{
switch
(
baud_rate
)
{
case
0
:
/* 9,6 KBaud */
case
0
:
/* 9,6 KBaud */
bus_param_ptr
->
tsl
=
100
;
bus_param_ptr
->
tsl
=
100
;
bus_param_ptr
->
min_tsdr
=
30
;
bus_param_ptr
->
min_tsdr
=
30
;
...
@@ -365,7 +318,8 @@ possible return values:
...
@@ -365,7 +318,8 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
switch
(
baud_rate
)
{
switch
(
baud_rate
)
{
case
0
:
/* 9,6 KBaud */
case
0
:
/* 9,6 KBaud */
bus_param_ptr
->
tsl
=
125
;
bus_param_ptr
->
tsl
=
125
;
bus_param_ptr
->
min_tsdr
=
30
;
bus_param_ptr
->
min_tsdr
=
30
;
...
@@ -481,8 +435,8 @@ possible return values:
...
@@ -481,8 +435,8 @@ possible return values:
}
}
}
}
FUNCTION
GLOBAL
PB_BOOL
CALL_CONV
pbt_get_dp_def_bus_param
(
IN
USIGN8
baud_rate
,
FUNCTION
GLOBAL
PB_BOOL
CALL_CONV
pbt_get_dp_def_bus_param
(
IN
USIGN8
station_addr
,
IN
USIGN16
mode
,
IN
USIGN8
baud_rate
,
IN
USIGN8
station_addr
,
IN
USIGN16
mode
,
OUT
T_DP_BUS_PARA_SET
FAR
*
bus_param_ptr
)
OUT
T_DP_BUS_PARA_SET
FAR
*
bus_param_ptr
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
...
@@ -510,7 +464,8 @@ possible return values:
...
@@ -510,7 +464,8 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
ret_val
=
PB_TRUE
;
ret_val
=
PB_TRUE
;
switch
(
mode
)
{
switch
(
mode
)
{
case
DP_MODE
:
/* only DP mode */
case
DP_MODE
:
/* only DP mode */
ret_val
=
pbt_get_bus_param_for_dp
(
baud_rate
,
&
bus_param
);
ret_val
=
pbt_get_bus_param_for_dp
(
baud_rate
,
&
bus_param
);
break
;
break
;
...
@@ -524,7 +479,8 @@ possible return values:
...
@@ -524,7 +479,8 @@ possible return values:
break
;
break
;
}
}
if
(
ret_val
==
PB_TRUE
)
{
if
(
ret_val
==
PB_TRUE
)
{
/* -- set variable busparametes ---------------------------------------- */
/* -- set variable busparametes ---------------------------------------- */
bus_param_ptr
->
tsl
=
bus_param
.
tsl
;
bus_param_ptr
->
tsl
=
bus_param
.
tsl
;
bus_param_ptr
->
min_tsdr
=
bus_param
.
min_tsdr
;
bus_param_ptr
->
min_tsdr
=
bus_param
.
min_tsdr
;
...
@@ -542,11 +498,11 @@ possible return values:
...
@@ -542,11 +498,11 @@ possible return values:
bus_param_ptr
->
hsa
=
HSA
;
bus_param_ptr
->
hsa
=
HSA
;
bus_param_ptr
->
bp_flag
=
0x00
;
bus_param_ptr
->
bp_flag
=
0x00
;
bus_param_ptr
->
min_slave_interval
=
200
;
/* [100us] */
bus_param_ptr
->
min_slave_interval
=
200
;
/* [100us] */
bus_param_ptr
->
poll_timeout
=
1000
;
/* [ 1ms] */
bus_param_ptr
->
poll_timeout
=
1000
;
/* [ 1ms] */
bus_param_ptr
->
data_control_time
=
100
;
/* [ 10ms] */
bus_param_ptr
->
data_control_time
=
100
;
/* [ 10ms] */
bus_param_ptr
->
master_user_data_len
=
34
;
bus_param_ptr
->
master_user_data_len
=
34
;
memcpy
((
USIGN8
FAR
*
)
bus_param_ptr
->
master_class2_name
,
memcpy
((
USIGN8
FAR
*
)
bus_param_ptr
->
master_class2_name
,
(
USIGN8
FAR
*
)
"SOFTING PROFIBUS DP MASTER "
,
32
);
(
USIGN8
FAR
*
)
"SOFTING PROFIBUS DP MASTER "
,
32
);
bus_param_ptr
->
bus_para_len
+=
bus_param_ptr
->
master_user_data_len
;
bus_param_ptr
->
bus_para_len
+=
bus_param_ptr
->
master_user_data_len
;
}
}
...
@@ -583,7 +539,8 @@ possible return values:
...
@@ -583,7 +539,8 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
if
(
pbt_get_bus_param_for_fms
(
baud_rate
,
&
bus_param
))
{
if
(
pbt_get_bus_param_for_fms
(
baud_rate
,
&
bus_param
))
{
/* -- set variable busparametes -------------------------------------- */
/* -- set variable busparametes -------------------------------------- */
bus_param_ptr
->
tsl
=
bus_param
.
tsl
;
bus_param_ptr
->
tsl
=
bus_param
.
tsl
;
bus_param_ptr
->
min_tsdr
=
bus_param
.
min_tsdr
;
bus_param_ptr
->
min_tsdr
=
bus_param
.
min_tsdr
;
...
@@ -607,7 +564,9 @@ possible return values:
...
@@ -607,7 +564,9 @@ possible return values:
bus_param_ptr
->
ident
[
3
]
=
0
;
bus_param_ptr
->
ident
[
3
]
=
0
;
return
(
PB_TRUE
);
return
(
PB_TRUE
);
}
else
{
}
else
{
return
(
PB_FALSE
);
return
(
PB_FALSE
);
}
}
}
}
...
@@ -644,7 +603,8 @@ possible return values:
...
@@ -644,7 +603,8 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
switch
(
mode
)
{
switch
(
mode
)
{
case
DP_MODE
:
/* only DP mode */
case
DP_MODE
:
/* only DP mode */
ret_val
=
pbt_get_bus_param_for_dp
(
baud_rate
,
&
bus_param
);
ret_val
=
pbt_get_bus_param_for_dp
(
baud_rate
,
&
bus_param
);
break
;
break
;
...
@@ -662,7 +622,8 @@ possible return values:
...
@@ -662,7 +622,8 @@ possible return values:
break
;
break
;
}
}
if
(
ret_val
==
PB_TRUE
)
{
if
(
ret_val
==
PB_TRUE
)
{
/* -- set variable busparametes ---------------------------------------- */
/* -- set variable busparametes ---------------------------------------- */
bus_param_ptr
->
tsl
=
bus_param
.
tsl
;
bus_param_ptr
->
tsl
=
bus_param
.
tsl
;
bus_param_ptr
->
min_tsdr
=
bus_param
.
min_tsdr
;
bus_param_ptr
->
min_tsdr
=
bus_param
.
min_tsdr
;
...
@@ -689,9 +650,9 @@ possible return values:
...
@@ -689,9 +650,9 @@ possible return values:
return
(
ret_val
);
return
(
ret_val
);
}
}
FUNCTION
GLOBAL
PB_BOOL
CALL_CONV
pbt_get_fmb_def_bus_param
(
IN
USIGN8
baud_rate
,
FUNCTION
GLOBAL
PB_BOOL
CALL_CONV
pbt_get_fmb_def_bus_param
(
IN
USIGN8
station_addr
,
IN
PB_BOOL
in_ring_desired
,
IN
USIGN16
mode
,
IN
USIGN8
baud_rate
,
IN
USIGN8
station_addr
,
IN
PB_BOOL
in_ring_desired
,
OUT
T_FMB_SET_BUSPARAMETER_REQ
FAR
*
bus_param_ptr
)
IN
USIGN16
mode
,
OUT
T_FMB_SET_BUSPARAMETER_REQ
FAR
*
bus_param_ptr
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -720,7 +681,8 @@ possible return values:
...
@@ -720,7 +681,8 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
switch
(
mode
)
{
switch
(
mode
)
{
case
DP_MODE
:
/* only DP mode */
case
DP_MODE
:
/* only DP mode */
ret_val
=
pbt_get_bus_param_for_dp
(
baud_rate
,
&
bus_param
);
ret_val
=
pbt_get_bus_param_for_dp
(
baud_rate
,
&
bus_param
);
break
;
break
;
...
@@ -738,7 +700,8 @@ possible return values:
...
@@ -738,7 +700,8 @@ possible return values:
break
;
break
;
}
}
if
(
ret_val
==
PB_TRUE
)
{
if
(
ret_val
==
PB_TRUE
)
{
/* -- set variable busparametes ---------------------------------------- */
/* -- set variable busparametes ---------------------------------------- */
bus_param_ptr
->
tsl
=
bus_param
.
tsl
;
bus_param_ptr
->
tsl
=
bus_param
.
tsl
;
bus_param_ptr
->
min_tsdr
=
bus_param
.
min_tsdr
;
bus_param_ptr
->
min_tsdr
=
bus_param
.
min_tsdr
;
...
...
profibus/lib/rt/src/ccrl.c
View file @
ce758cd3
/*
/******************************************************************************
* ProviewR Open Source Process Control.
* *
* Copyright (C) 2005-2019 SSAB EMEA AB.
* SOFTING Industrial Automation GmbH *
*
* Richard-Reitzner-Allee 6 *
* This file is part of ProviewR.
* D-85540 Haar *
*
* Phone: (++49)-(0)89-45656-0 *
* This program is free software; you can redistribute it and/or
* Fax: (++49)-(0)89-45656-399 *
* modify it under the terms of the GNU General Public License as
* *
* published by the Free Software Foundation, either version 2 of
* Copyright (C) SOFTING Industrial Automation GmbH 1995-2012 *
* the License, or (at your option) any later version.
* All Rights Reserved *
*
* *
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************
* *
* SOFTING AG *
* Richard-Reitzner-Allee 6 *
* D-85540 Haar *
* Phone: ++49-89-4 56 56-0 *
* Fax: ++49-89-4 56 56-3 99 *
* *
* Copyright (C) SOFTING AG 1995-2003 *
* All Rights Reserved *
* *
******************************************************************************
FILE_NAME CCRL.C
FILE_NAME CCRL.C
PROJECT_NAME PROFIBUS
PROJECT_NAME PROFIBUS
...
@@ -54,25 +20,11 @@ MODULE CCRL
...
@@ -54,25 +20,11 @@ MODULE CCRL
COMPONENT_LIBRARY PBT LIBs and DLL (16-Bit)
COMPONENT_LIBRARY PBT LIBs and DLL (16-Bit)
PBTOOLS.DLL (32-Bit)
PBTOOLS.DLL (32-Bit)
AUTHOR SOFTING AG
AUTHOR SOFTING
VERSION 5.00
VERSION 5.21.0.00.release
5.01
5.02
DATE February-1998
5.10
5.11
5.20.0.00.alpha
5.20.0.00.release
5.21.0.00.release
DATE 24-November-1995
31-January-1996
14-July-1996
20-Febrary-1997
18-March-1997
30-July-1997
17-October-1997
27-February-1998
STATUS finished
STATUS finished
...
@@ -133,14 +85,12 @@ INCLUDES
...
@@ -133,14 +85,12 @@ INCLUDES
#include <windows.h>
#include <windows.h>
#endif
#endif
#include "co_math.h"
#include <pb_type.h>
#include <pb_if.h>
#include "pb_type.h"
#include <pb_fmb.h>
#include "pb_if.h"
#include <pb_fm7.h>
#include "pb_fmb.h"
#include <pb_err.h>
#include "pb_fm7.h"
#include <pb_tools.h>
#include "pb_err.h"
#include "pb_tools.h"
LOCAL_DEFINES
LOCAL_DEFINES
...
@@ -156,17 +106,29 @@ LOCAL_DEFINES
...
@@ -156,17 +106,29 @@ LOCAL_DEFINES
#define _IS_I_CONN(x) ((x & 0x03) == I_CONN)
#define _IS_I_CONN(x) ((x & 0x03) == I_CONN)
#define _IS_CYCLIC(type) (type & 0x02)
#define _IS_CYCLIC(type) (type & 0x02)
#define _WITHOUT_SLAVE_INITIATIVE(type) (!(type & 0x04))
#define _WITHOUT_SLAVE_INITIATIVE(type) (!(type & 0x04))
#define _IS_CONN_LESS(x) ((x & 0x09) == BRCT)
#define _IS_CONN_ORIENTED(x) (!_IS_CONN_LESS(x))
#ifndef min
#define min(a, b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef max
#define max(a, b) (((a) > (b)) ? (a) : (b))
#endif
LOCAL_TYPEDEFS
LOCAL_TYPEDEFS
typedef
struct
_T_CCRL_CONN_RESRCES
{
typedef
struct
_T_CCRL_CONN_RESRCES
{
USIGN8
no_of_fal_sdbs
;
USIGN8
no_of_fal_sdbs
;
USIGN8
no_of_fdl_sdbs
;
USIGN8
no_of_fdl_sdbs
;
USIGN8
no_of_data_buffer
;
USIGN8
no_of_data_buffer
;
USIGN8
no_of_api_buffer
;
USIGN8
no_of_api_buffer
;
}
T_CCRL_CONN_RESRCES
;
}
T_CCRL_CONN_RESRCES
;
typedef
struct
_T_CCRL
{
typedef
struct
_T_CCRL
{
T_FMB_CONFIG_CRL
ccrl
;
T_FMB_CONFIG_CRL
ccrl
;
USIGN8
poll_sap
;
USIGN8
poll_sap
;
PB_BOOL
mms_exist
;
PB_BOOL
mms_exist
;
...
@@ -188,8 +150,8 @@ static T_CCRL ccrl_obj;
...
@@ -188,8 +150,8 @@ static T_CCRL ccrl_obj;
#pragma check_stack(off)
#pragma check_stack(off)
#endif
#endif
FUNCTION
LOCAL
USIGN16
ccrl_determine_role
(
FUNCTION
LOCAL
USIGN16
ccrl_determine_role
(
IN
T_CRL_STATIC
FAR
*
crl_ptr
,
IN
T_CRL_STATIC
FAR
*
crl_ptr
,
IN
USIGN8
*
role_ptr
)
IN
USIGN8
*
role_ptr
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -210,7 +172,8 @@ R_CL -> Receiver of multicast/broadcast messages
...
@@ -210,7 +172,8 @@ R_CL -> Receiver of multicast/broadcast messages
FUNCTION_BODY
FUNCTION_BODY
switch
((
USIGN8
)(
crl_ptr
->
conn_type
&
0x0F
))
{
switch
((
USIGN8
)(
crl_ptr
->
conn_type
&
0x0F
))
{
case
MMAC
:
case
MMAC
:
*
role_ptr
=
M_MM
;
*
role_ptr
=
M_MM
;
return
(
E_OK
);
return
(
E_OK
);
...
@@ -238,8 +201,8 @@ R_CL -> Receiver of multicast/broadcast messages
...
@@ -238,8 +201,8 @@ R_CL -> Receiver of multicast/broadcast messages
}
}
}
}
FUNCTION
LOCAL
VOID
ccrl_correct_crl_entry
(
FUNCTION
LOCAL
VOID
ccrl_correct_crl_entry
(
IN
USIGN16
cr
,
IN
USIGN8
role
,
IN
USIGN16
cr
,
IN
USIGN8
role
,
INOUT
T_CRL_STATIC
FAR
*
crl_ptr
)
INOUT
T_CRL_STATIC
FAR
*
crl_ptr
)
/*------------------------------------------------------------------------------
/*------------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -250,15 +213,18 @@ FUNCTIONAL_DESCRIPTION
...
@@ -250,15 +213,18 @@ FUNCTIONAL_DESCRIPTION
FUNCTION_BODY
FUNCTION_BODY
if
(
crl_ptr
->
lli_sap
==
1
)
{
if
(
crl_ptr
->
lli_sap
==
1
)
if
(
cr
>
1
)
{
{
if
(
cr
>
1
)
{
/* There is a management client -----------------------------------------
/* There is a management client -----------------------------------------
*/
*/
crl_ptr
->
max_scc
=
1
;
crl_ptr
->
max_scc
=
1
;
crl_ptr
->
max_sac
=
0
;
crl_ptr
->
max_sac
=
0
;
crl_ptr
->
max_rcc
=
0
;
crl_ptr
->
max_rcc
=
0
;
crl_ptr
->
max_rac
=
0
;
crl_ptr
->
max_rac
=
0
;
}
else
/* (cr == 1) */
}
else
/* (cr == 1) */
{
{
/* There is a management server -----------------------------------------
/* There is a management server -----------------------------------------
*/
*/
...
@@ -269,14 +235,17 @@ FUNCTIONAL_DESCRIPTION
...
@@ -269,14 +235,17 @@ FUNCTIONAL_DESCRIPTION
}
}
}
}
if
(
role
==
M_MS
)
{
if
(
role
==
M_MS
)
{
crl_ptr
->
max_rcc
=
0
;
crl_ptr
->
max_rcc
=
0
;
if
(
_IS_CYCLIC
(
crl_ptr
->
conn_type
))
if
(
_IS_CYCLIC
(
crl_ptr
->
conn_type
))
crl_ptr
->
max_scc
=
0
;
crl_ptr
->
max_scc
=
0
;
if
(
_WITHOUT_SLAVE_INITIATIVE
(
crl_ptr
->
conn_type
))
if
(
_WITHOUT_SLAVE_INITIATIVE
(
crl_ptr
->
conn_type
))
crl_ptr
->
max_rac
=
0
;
crl_ptr
->
max_rac
=
0
;
}
else
if
(
role
==
S_MS
)
{
}
else
if
(
role
==
S_MS
)
{
crl_ptr
->
max_scc
=
0
;
crl_ptr
->
max_scc
=
0
;
if
(
_IS_CYCLIC
(
crl_ptr
->
conn_type
))
if
(
_IS_CYCLIC
(
crl_ptr
->
conn_type
))
...
@@ -288,8 +257,8 @@ FUNCTIONAL_DESCRIPTION
...
@@ -288,8 +257,8 @@ FUNCTIONAL_DESCRIPTION
return
;
return
;
}
}
FUNCTION
LOCAL
VOID
ccrl_update_resrc_ctr
(
FUNCTION
LOCAL
VOID
ccrl_update_resrc_ctr
(
INOUT
USIGN8
*
stored_number_ptr
,
INOUT
USIGN8
*
stored_number_ptr
,
INOUT
USIGN8
*
current_number_ptr
)
INOUT
USIGN8
*
current_number_ptr
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -302,19 +271,23 @@ FUNCTIONAL_DESCRIPTION
...
@@ -302,19 +271,23 @@ FUNCTIONAL_DESCRIPTION
FUNCTION_BODY
FUNCTION_BODY
if
(
*
stored_number_ptr
<
*
current_number_ptr
)
{
if
(
*
stored_number_ptr
<
*
current_number_ptr
)
{
diff
=
(
USIGN8
)(
*
current_number_ptr
-
*
stored_number_ptr
);
diff
=
(
USIGN8
)(
*
current_number_ptr
-
*
stored_number_ptr
);
*
stored_number_ptr
=
*
current_number_ptr
;
*
stored_number_ptr
=
*
current_number_ptr
;
*
current_number_ptr
=
diff
;
*
current_number_ptr
=
diff
;
}
else
{
}
else
{
*
current_number_ptr
=
0
;
*
current_number_ptr
=
0
;
}
}
return
;
return
;
}
}
FUNCTION
LOCAL
VOID
ccrl_adapt_resrces
(
IN
T_CCRL_CONN_RESRCES
*
in_resrces_ptr
,
FUNCTION
LOCAL
VOID
INOUT
T_CCRL_CONN_RESRCES
*
out_resrces_ptr
)
ccrl_adapt_resrces
(
IN
T_CCRL_CONN_RESRCES
*
in_resrces_ptr
,
INOUT
T_CCRL_CONN_RESRCES
*
out_resrces_ptr
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -325,14 +298,14 @@ FUNCTIONAL_DESCRIPTION
...
@@ -325,14 +298,14 @@ FUNCTIONAL_DESCRIPTION
FUNCTION_BODY
FUNCTION_BODY
ccrl_update_resrc_ctr
(
ccrl_update_resrc_ctr
(
&
in_resrces_ptr
->
no_of_fal_sdbs
,
&
in_resrces_ptr
->
no_of_fal_sdbs
,
&
out_resrces_ptr
->
no_of_fal_sdbs
);
&
out_resrces_ptr
->
no_of_fal_sdbs
);
ccrl_update_resrc_ctr
(
ccrl_update_resrc_ctr
(
&
in_resrces_ptr
->
no_of_fdl_sdbs
,
&
in_resrces_ptr
->
no_of_fdl_sdbs
,
&
out_resrces_ptr
->
no_of_fdl_sdbs
);
&
out_resrces_ptr
->
no_of_fdl_sdbs
);
ccrl_update_resrc_ctr
(
ccrl_update_resrc_ctr
(
&
in_resrces_ptr
->
no_of_data_buffer
,
&
in_resrces_ptr
->
no_of_data_buffer
,
&
out_resrces_ptr
->
no_of_data_buffer
);
&
out_resrces_ptr
->
no_of_data_buffer
);
ccrl_update_resrc_ctr
(
ccrl_update_resrc_ctr
(
&
in_resrces_ptr
->
no_of_api_buffer
,
&
in_resrces_ptr
->
no_of_api_buffer
,
&
out_resrces_ptr
->
no_of_api_buffer
);
&
out_resrces_ptr
->
no_of_api_buffer
);
return
;
return
;
}
}
...
@@ -370,7 +343,8 @@ possible return values:
...
@@ -370,7 +343,8 @@ possible return values:
ccrl_obj
.
poll_sap
=
crl_hdr_ptr
->
poll_sap
;
ccrl_obj
.
poll_sap
=
crl_hdr_ptr
->
poll_sap
;
ccrl_obj
.
mms_exist
=
PB_FALSE
;
ccrl_obj
.
mms_exist
=
PB_FALSE
;
for
(
i
=
0
;
i
<
65
;
i
++
)
{
for
(
i
=
0
;
i
<
65
;
i
++
)
{
ccrl_obj
.
isap_resrces
[
i
].
no_of_fal_sdbs
=
0
;
ccrl_obj
.
isap_resrces
[
i
].
no_of_fal_sdbs
=
0
;
ccrl_obj
.
isap_resrces
[
i
].
no_of_fdl_sdbs
=
0
;
ccrl_obj
.
isap_resrces
[
i
].
no_of_fdl_sdbs
=
0
;
ccrl_obj
.
isap_resrces
[
i
].
no_of_data_buffer
=
0
;
ccrl_obj
.
isap_resrces
[
i
].
no_of_data_buffer
=
0
;
...
@@ -380,8 +354,9 @@ possible return values:
...
@@ -380,8 +354,9 @@ possible return values:
return
;
return
;
}
}
FUNCTION
GLOBAL
USIGN16
CALL_CONV
ccrl_resrces_add_entry
(
IN
USIGN16
cr
,
FUNCTION
GLOBAL
USIGN16
CALL_CONV
IN
T_CRL_STATIC
FAR
*
crl_ptr
,
OUT
T_FMB_CONFIG_CRL
FAR
*
config_ptr
)
ccrl_resrces_add_entry
(
IN
USIGN16
cr
,
IN
T_CRL_STATIC
FAR
*
crl_ptr
,
OUT
T_FMB_CONFIG_CRL
FAR
*
config_ptr
)
/*------------------------------------------------------------------------------
/*------------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -461,93 +436,97 @@ possible return values:
...
@@ -461,93 +436,97 @@ possible return values:
ci
=
crl_ptr
->
ci
;
ci
=
crl_ptr
->
ci
;
multiplier
=
crl_ptr
->
multiplier
;
multiplier
=
crl_ptr
->
multiplier
;
snd_req
=
0
;
/* (FAL + DATA) + FDL */
snd_req
=
0
;
/* (FAL + DATA) + FDL */
snd_req_csrd
=
0
;
/* (FAL + DATA) */
snd_req_csrd
=
0
;
/* (FAL + DATA) */
snd_req_srd
=
0
;
/* (FDL + DATA) */
snd_req_srd
=
0
;
/* (FDL + DATA) */
rcv_res
=
0
;
/* (FDL + DATA) */
rcv_res
=
0
;
/* (FDL + DATA) */
rcv_ind
=
0
;
/* (FDL + DATA) + FAL */
rcv_ind
=
0
;
/* (FDL + DATA) + FAL */
rcv_ind_csrd
=
0
;
/* (FAL + DATA) */
rcv_ind_csrd
=
0
;
/* (FAL + DATA) */
snd_res_srd
=
0
;
/* (FDL + API) */
snd_res_srd
=
0
;
/* (FDL + API) */
lli_api_resrc
=
0
;
/* (FAL + API) */
lli_api_resrc
=
0
;
/* (FAL + API) */
lli_api_snd_resrc
=
0
;
/* (FAL + API) + FDL */
lli_api_snd_resrc
=
0
;
/* (FAL + API) + FDL */
lli_sr_snd_resrc
=
0
;
/* (FAL + DATA) + FDL */
lli_sr_snd_resrc
=
0
;
/* (FAL + DATA) + FDL */
lli_rcv_ind
=
0
;
/* (FDL + DATA) */
lli_rcv_ind
=
0
;
/* (FDL + DATA) */
lli_poll_elem
=
0
;
/* (POLL + API) + (FDL + DATA) */
lli_poll_elem
=
0
;
/* (POLL + API) + (FDL + DATA) */
lli_idm
=
0
;
/* (DATA) */
lli_idm
=
0
;
/* (DATA) */
lli_evt_resrc
=
0
;
/* (FAL + DATA) */
lli_evt_resrc
=
0
;
/* (FAL + DATA) */
fdl_sap
=
0
;
/* (FDL) */
fdl_sap
=
0
;
/* (FDL) */
fdl_rsap
=
0
;
/* (DATA or FDL + DATA) */
fdl_rsap
=
0
;
/* (DATA or FDL + DATA) */
switch
(
role
)
{
switch
(
role
)
{
case
M_MM
:
case
M_MM
:
/* Master in Master/Master Connection ----------------------------- */
/* Master in Master/Master Connection ----------------------------- */
snd_req
=
(
USIGN8
)(
MAX
(
1
,
/* snd ASS.req */
snd_req
=
(
USIGN8
)(
max
(
1
,
/* snd ASS.req */
(
max_scc
/* snd DTC.req */
(
max_scc
/* snd DTC.req */
+
max_sac
))
/* snd DTA.req */
+
max_sac
))
/* snd DTA.req */
+
1
/* snd ABT.req */
+
1
/* snd ABT.req */
);
);
lli_api_snd_resrc
=
(
USIGN8
)(
MIN
(
ci
,
1
)
/* snd IDLE.req */
lli_api_snd_resrc
=
(
USIGN8
)(
min
(
ci
,
1
)
/* snd IDLE.req */
+
1
/* LLI abort resrc */
+
1
/* LLI abort resrc */
);
);
rcv_res
=
(
USIGN8
)(
MAX
(
1
,
/* rcv ASS_RES_PDU */
rcv_res
=
(
USIGN8
)(
max
(
1
,
/* rcv ASS_RES_PDU */
(
max_scc
/* rcv DTC_RES_PDU */
(
max_scc
/* rcv DTC_RES_PDU */
+
max_sac
))
/* rcv DTA_ACK_PDU */
+
max_sac
))
/* rcv DTA_ACK_PDU */
);
);
rcv_ind
=
(
USIGN8
)(
MAX
(
1
,
/* rcv ASS_REQ_PDU */
rcv_ind
=
(
USIGN8
)(
max
(
1
,
/* rcv ASS_REQ_PDU */
(
max_rcc
/* rcv DTC_REQ_PDU */
(
max_rcc
/* rcv DTC_REQ_PDU */
+
max_rac
))
/* rcv DTA_REQ_PDU */
+
max_rac
))
/* rcv DTA_REQ_PDU */
+
1
/* rcv ABT_REQ_PDU */
+
1
/* rcv ABT_REQ_PDU */
);
);
lli_rcv_ind
=
(
USIGN8
)
MIN
(
ci
,
1
);
/* rcv IDLE_REQ_PDU */
lli_rcv_ind
=
(
USIGN8
)
min
(
ci
,
1
);
/* rcv IDLE_REQ_PDU */
fdl_sap
=
1
;
/* act/deact LSAP */
fdl_sap
=
1
;
/* act/deact LSAP */
break
;
break
;
case
M_MS
:
case
M_MS
:
/* Master in a cyclic master/slave connection --------------------- */
/* Master in a cyclic master/slave connection --------------------- */
if
(
_IS_CYCLIC
(
crl_ptr
->
conn_type
))
{
if
(
_IS_CYCLIC
(
crl_ptr
->
conn_type
))
{
max_scc
=
1
;
max_scc
=
1
;
ci
=
0
;
ci
=
0
;
lli_idm
=
1
;
/* image data memory */
lli_idm
=
1
;
/* image data memory */
if
(
crl_ptr
->
conn_type
&
LLI_EVT_BIT
)
if
(
crl_ptr
->
conn_type
&
LLI_EVT_BIT
)
lli_evt_resrc
=
1
;
lli_evt_resrc
=
1
;
}
else
/* _IS_ACYCLIC (crl_ptr->conn_type) */
}
else
/* _IS_ACYCLIC (crl_ptr->conn_type) */
{
{
multiplier
=
1
;
multiplier
=
1
;
}
}
lli_poll_elem
=
(
USIGN8
)(
MAX
(
multiplier
,
1
));
/* poll_list_element */
lli_poll_elem
=
(
USIGN8
)(
max
(
multiplier
,
1
));
/* poll_list_element */
lli_api_resrc
=
(
USIGN8
)(
MIN
(
ci
,
1
)
/* snd IDLE_REQ_PDU */
lli_api_resrc
=
(
USIGN8
)(
min
(
ci
,
1
)
/* snd IDLE_REQ_PDU */
+
1
/* LLI abort resrc */
+
1
/* LLI abort resrc */
);
);
snd_req_csrd
=
(
USIGN8
)(
MAX
(
1
,
/* snd ASS.req */
snd_req_csrd
=
(
USIGN8
)(
max
(
1
,
/* snd ASS.req */
(
max_scc
/* snd DTC.req */
(
max_scc
/* snd DTC.req */
+
max_sac
))
/* snd DTA.req */
+
max_sac
))
/* snd DTA.req */
+
1
/* snd ABT.req */
+
1
/* snd ABT.req */
);
);
snd_req_srd
=
max_sac
;
/* snd DTA.req (high) */
snd_req_srd
=
max_sac
;
/* snd DTA.req (high) */
rcv_ind_csrd
=
(
USIGN8
)(
max_rac
/* rcv DTA_REQ_PDU */
rcv_ind_csrd
=
(
USIGN8
)(
max_rac
/* rcv DTA_REQ_PDU */
+
1
/* rcv ABT_REQ_PDU */
+
1
/* rcv ABT_REQ_PDU */
);
);
snd_res_srd
=
max_rac
;
/* snd DTA.ack (high)*/
snd_res_srd
=
max_rac
;
/* snd DTA.ack (high)*/
if
(
!
ccrl_obj
.
mms_exist
)
{
if
(
!
ccrl_obj
.
mms_exist
)
{
fdl_sap
=
1
;
fdl_sap
=
1
;
ccrl_obj
.
mms_exist
=
PB_TRUE
;
ccrl_obj
.
mms_exist
=
PB_TRUE
;
}
}
...
@@ -558,69 +537,74 @@ possible return values:
...
@@ -558,69 +537,74 @@ possible return values:
fdl_rsap
=
1
;
/* reply update buffer */
fdl_rsap
=
1
;
/* reply update buffer */
if
(
_IS_CYCLIC
(
crl_ptr
->
conn_type
))
{
if
(
_IS_CYCLIC
(
crl_ptr
->
conn_type
))
{
max_rcc
=
1
;
max_rcc
=
1
;
ci
=
0
;
ci
=
0
;
lli_idm
=
1
;
/* image data memory */
lli_idm
=
1
;
/* image data memory */
}
}
snd_req
=
(
USIGN8
)(
max_sac
/* snd DTA.req */
snd_req
=
(
USIGN8
)(
max_sac
/* snd DTA.req */
+
1
/* snd ABT.req */
+
1
/* snd ABT.req */
);
);
rcv_res
=
max_sac
;
/* rcv DTA_ACK_PDU */
rcv_res
=
max_sac
;
/* rcv DTA_ACK_PDU */
lli_sr_snd_resrc
=
(
USIGN8
)(
MIN
(
ci
,
1
)
/* snd IDLE.req */
lli_sr_snd_resrc
=
(
USIGN8
)(
min
(
ci
,
1
)
/* snd IDLE.req */
+
1
/* LLI abort resrc */
+
1
/* LLI abort resrc */
);
);
rcv_ind
=
(
USIGN8
)(
MAX
(
1
,
/* rcv ASS_REQ_PDU */
rcv_ind
=
(
USIGN8
)(
max
(
1
,
/* rcv ASS_REQ_PDU */
(
max_rcc
/* rcv DTC_REQ_PDU */
(
max_rcc
/* rcv DTC_REQ_PDU */
+
max_rac
))
/* rcv DTA_REQ_PDU */
+
max_rac
))
/* rcv DTA_REQ_PDU */
+
1
/* rcv ABT_REQ_PDU */
+
1
/* rcv ABT_REQ_PDU */
);
);
lli_rcv_ind
=
(
USIGN8
)(
MIN
(
ci
,
1
)
/* rcv IDLE_REQ_PDU */
lli_rcv_ind
=
(
USIGN8
)(
min
(
ci
,
1
)
/* rcv IDLE_REQ_PDU */
+
2
/* rcv poll telegrams */
+
2
/* rcv poll telegrams */
);
);
fdl_sap
=
1
;
/* act/deact LSAP */
fdl_sap
=
1
;
/* act/deact LSAP */
break
;
break
;
case
S_CL
:
case
S_CL
:
/* Broadcast/Multicast Sender ------------------------------------- */
/* Broadcast/Multicast Sender ------------------------------------- */
snd_req
=
(
USIGN8
)
MAX
(
1
,
max_sac
);
/* snd DTU.req */
snd_req
=
(
USIGN8
)
max
(
1
,
max_sac
);
/* snd DTU.req */
fdl_sap
=
1
;
/* act/deact LSAP */
fdl_sap
=
1
;
/* act/deact LSAP */
break
;
break
;
case
R_CL
:
case
R_CL
:
/* Broadcast/Multicast Receiver ----------------------------------- */
/* Broadcast/Multicast Receiver ----------------------------------- */
rcv_ind
=
(
USIGN8
)
MAX
(
1
,
max_rac
);
/* rcv DTU_REQ_PDU */
rcv_ind
=
(
USIGN8
)
max
(
1
,
max_rac
);
/* rcv DTU_REQ_PDU */
fdl_sap
=
1
;
/* act/deact LSAP */
fdl_sap
=
1
;
/* act/deact LSAP */
break
;
break
;
default:
default:
return
(
E_FM7_CRL_INVALID_ENTRY
);
return
(
E_FM7_CRL_INVALID_ENTRY
);
}
}
no_of_fal_sdbs
=
(
USIGN16
)(
snd_req
+
snd_req_csrd
+
rcv_ind
+
rcv_ind_csrd
no_of_fal_sdbs
=
(
USIGN16
)(
snd_req
+
snd_req_csrd
+
rcv_ind
+
rcv_ind_csrd
+
+
lli_api_resrc
+
lli_api_snd_resrc
+
lli_sr_snd_resrc
+
lli_evt_resrc
);
lli_api_resrc
+
lli_api_snd_resrc
+
lli_sr_snd_resrc
+
lli_evt_resrc
);
no_of_fdl_sdbs
=
(
USIGN16
)(
snd_req
+
snd_req_srd
+
rcv_res
+
rcv_ind
no_of_fdl_sdbs
=
+
snd_res_srd
+
lli_api_snd_resrc
+
lli_sr_snd_resrc
+
lli_rcv_ind
(
USIGN16
)(
snd_req
+
snd_req_srd
+
rcv_res
+
rcv_ind
+
snd_res_srd
+
+
fdl_sap
+
lli_poll_elem
);
lli_api_snd_resrc
+
lli_sr_snd_resrc
+
lli_rcv_ind
+
fdl_sap
+
lli_poll_elem
);
no_of_fdl_sdbs
=
(
USIGN16
)(
no_of_fdl_sdbs
+
fdl_rsap
);
no_of_fdl_sdbs
=
(
USIGN16
)(
no_of_fdl_sdbs
+
fdl_rsap
);
no_of_data_buffer
=
(
USIGN16
)(
snd_req
+
snd_req_csrd
+
snd_req_srd
+
rcv_res
no_of_data_buffer
=
+
rcv_ind
+
rcv_ind_csrd
+
lli_sr_snd_resrc
+
lli_poll_elem
+
lli_idm
(
USIGN16
)(
snd_req
+
snd_req_csrd
+
snd_req_srd
+
rcv_res
+
rcv_ind
+
+
lli_rcv_ind
+
fdl_rsap
+
lli_evt_resrc
);
rcv_ind_csrd
+
lli_sr_snd_resrc
+
lli_poll_elem
+
lli_idm
+
lli_rcv_ind
+
fdl_rsap
+
lli_evt_resrc
);
no_of_api_buffer
=
(
USIGN16
)(
no_of_api_buffer
=
(
USIGN16
)(
snd_res_srd
+
lli_api_resrc
+
lli_api_snd_resrc
+
snd_res_srd
+
lli_api_resrc
+
lli_api_snd_resrc
+
lli_poll_elem
);
lli_poll_elem
);
if
((
no_of_fal_sdbs
>
0xFF
)
||
(
no_of_fdl_sdbs
>
0xFF
)
if
((
no_of_fal_sdbs
>
0xFF
)
||
(
no_of_fdl_sdbs
>
0xFF
)
||
||
(
no_of_data_buffer
>
0xFF
)
||
(
no_of_api_buffer
>
0xFF
))
{
(
no_of_data_buffer
>
0xFF
)
||
(
no_of_api_buffer
>
0xFF
))
{
return
(
E_FM7_CRL_INVALID_ENTRY
);
return
(
E_FM7_CRL_INVALID_ENTRY
);
}
}
...
@@ -631,26 +615,27 @@ possible return values:
...
@@ -631,26 +615,27 @@ possible return values:
conn_resrc
.
no_of_data_buffer
=
(
USIGN8
)
no_of_data_buffer
;
conn_resrc
.
no_of_data_buffer
=
(
USIGN8
)
no_of_data_buffer
;
conn_resrc
.
no_of_api_buffer
=
(
USIGN8
)
no_of_api_buffer
;
conn_resrc
.
no_of_api_buffer
=
(
USIGN8
)
no_of_api_buffer
;
if
((
role
==
M_MM
)
&&
(
_IS_I_CONN
(
crl_ptr
->
conn_attr
)))
{
if
((
role
==
M_MM
)
&&
(
_IS_I_CONN
(
crl_ptr
->
conn_attr
)))
{
ccrl_adapt_resrces
(
ccrl_adapt_resrces
(
&
ccrl_obj
.
isap_resrces
[
_CCRL_MAP_SAP_NR
(
crl_ptr
->
loc_lsap
)],
&
ccrl_obj
.
isap_resrces
[
_CCRL_MAP_SAP_NR
(
crl_ptr
->
loc_lsap
)],
&
conn_resrc
);
&
conn_resrc
);
}
}
ccrl_obj
.
ccrl
.
max_no_fal_sdbs
ccrl_obj
.
ccrl
.
max_no_fal_sdbs
=
=
(
USIGN16
)(
ccrl_obj
.
ccrl
.
max_no_fal_sdbs
+
conn_resrc
.
no_of_fal_sdbs
);
(
USIGN16
)(
ccrl_obj
.
ccrl
.
max_no_fal_sdbs
+
conn_resrc
.
no_of_fal_sdbs
);
ccrl_obj
.
ccrl
.
max_no_fdl_sdbs
ccrl_obj
.
ccrl
.
max_no_fdl_sdbs
=
=
(
USIGN16
)(
ccrl_obj
.
ccrl
.
max_no_fdl_sdbs
+
conn_resrc
.
no_of_fdl_sdbs
);
(
USIGN16
)(
ccrl_obj
.
ccrl
.
max_no_fdl_sdbs
+
conn_resrc
.
no_of_fdl_sdbs
);
ccrl_obj
.
ccrl
.
max_no_data_buffer
=
(
USIGN16
)(
ccrl_obj
.
ccrl
.
max_no_data_buffer
=
(
USIGN16
)(
ccrl_obj
.
ccrl
.
max_no_data_buffer
+
conn_resrc
.
no_of_data_buffer
);
ccrl_obj
.
ccrl
.
max_no_data_buffer
+
conn_resrc
.
no_of_data_buffer
);
ccrl_obj
.
ccrl
.
max_no_api_buffer
=
(
USIGN16
)(
ccrl_obj
.
ccrl
.
max_no_api_buffer
=
ccrl_obj
.
ccrl
.
max_no_api_buffer
+
conn_resrc
.
no_of_api_buffer
);
(
USIGN16
)(
ccrl_obj
.
ccrl
.
max_no_api_buffer
+
conn_resrc
.
no_of_api_buffer
);
ccrl_obj
.
ccrl
.
max_no_poll_entries
ccrl_obj
.
ccrl
.
max_no_poll_entries
=
=
(
USIGN16
)(
ccrl_obj
.
ccrl
.
max_no_poll_entries
+
lli_poll_elem
);
(
USIGN16
)(
ccrl_obj
.
ccrl
.
max_no_poll_entries
+
lli_poll_elem
);
*
config_ptr
=
ccrl_obj
.
ccrl
;
*
config_ptr
=
ccrl_obj
.
ccrl
;
...
...
profibus/lib/rt/src/cif_api.c
View file @
ce758cd3
...
@@ -59,16 +59,17 @@ Discription
...
@@ -59,16 +59,17 @@ Discription
#include "rcsdef.h"
#include "rcsdef.h"
#define INVALID_HANDLE_VALUE -1
#define INVALID_HANDLE_VALUE -1
int
hDevDrv
=
INVALID_HANDLE_VALUE
;
// handle to cifDevDrv
int
hDevDrv
=
INVALID_HANDLE_VALUE
;
// handle to cifDevDrv
static
unsigned
short
DrvOpenCount
=
0
;
// no Application is logged in
static
unsigned
short
DrvOpenCount
=
0
;
// no Application is logged in
typedef
struct
DEV_DPM_SIZEtag
{
typedef
struct
DEV_DPM_SIZEtag
{
unsigned
int
ulDpmSize
;
unsigned
int
ulDpmSize
;
unsigned
int
ulDpmIOSize
;
unsigned
int
ulDpmIOSize
;
}
DEV_DPM_SIZE
;
}
DEV_DPM_SIZE
;
DEV_DPM_SIZE
tDevDPMSize
[
MAX_DEV_BOARDS
]
=
{
{
0L
,
0L
},
{
0L
,
0L
},
{
0L
,
0L
},
DEV_DPM_SIZE
tDevDPMSize
[
MAX_DEV_BOARDS
]
=
{
{
0L
,
0L
}
};
// DPM size of each board
{
0L
,
0L
},
{
0L
,
0L
},
{
0L
,
0L
},
{
0L
,
0L
}
};
// DPM size of each board
/* <ST>
/* <ST>
=================================================================================
=================================================================================
...
@@ -86,17 +87,22 @@ short DevOpenDriver()
...
@@ -86,17 +87,22 @@ short DevOpenDriver()
{
{
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
// first application, search CIF device driver
// first application, search CIF device driver
if
((
hDevDrv
=
open
(
"/dev/cif"
,
O_RDONLY
))
if
((
hDevDrv
=
open
(
"/dev/cif"
,
O_RDONLY
))
==
-
1
)
==
-
1
)
{
// handle of file with attributes to copy
{
// handle of file with attributes to copy
// error open CIF driver
// error open CIF driver
sRet
=
DRV_USR_OPEN_ERROR
;
sRet
=
DRV_USR_OPEN_ERROR
;
}
else
{
}
else
{
// driver is opend for the 1st. time, store application in DrvOpencount
// driver is opend for the 1st. time, store application in DrvOpencount
DrvOpenCount
=
1
;
DrvOpenCount
=
1
;
}
}
}
else
{
}
else
{
// driver is already opend, store application in DrvOpencount
// driver is already opend, store application in DrvOpencount
DrvOpenCount
++
;
DrvOpenCount
++
;
}
}
...
@@ -122,14 +128,20 @@ short DevCloseDriver()
...
@@ -122,14 +128,20 @@ short DevCloseDriver()
{
{
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
{
}
else
{
// test if other applications are logged in
// test if other applications are logged in
if
(
DrvOpenCount
>
1
)
{
if
(
DrvOpenCount
>
1
)
{
// there are more applications logged in, do not close the driver
// there are more applications logged in, do not close the driver
DrvOpenCount
--
;
DrvOpenCount
--
;
}
else
{
}
else
{
// no more application are logged in, close File Handle
// no more application are logged in, close File Handle
close
(
hDevDrv
);
// handle of object to close
close
(
hDevDrv
);
// handle of object to close
DrvOpenCount
=
0
;
DrvOpenCount
=
0
;
...
@@ -160,15 +172,18 @@ short DevGetBoardInfo(BOARD_INFO* pvData)
...
@@ -160,15 +172,18 @@ short DevGetBoardInfo(BOARD_INFO* pvData)
BOARD_INFO
*
ptBoardInfo
=
NULL
;
BOARD_INFO
*
ptBoardInfo
=
NULL
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
{
}
if
((
ptBuffer
else
=
(
DEVIO_GETBOARDINFOCMD
*
)
malloc
(
sizeof
(
DEVIO_GETBOARDINFOCMD
)))
{
==
NULL
)
if
((
ptBuffer
=
(
DEVIO_GETBOARDINFOCMD
*
)
malloc
(
sizeof
(
DEVIO_GETBOARDINFOCMD
)))
==
NULL
)
return
DRV_USR_SENDBUF_PTR_NULL
;
return
DRV_USR_SENDBUF_PTR_NULL
;
if
((
ptBuffer
->
ptBoardInfo
=
(
BOARD_INFO
*
)
malloc
(
sizeof
(
BOARD_INFO
)))
if
((
ptBuffer
->
ptBoardInfo
=
(
BOARD_INFO
*
)
malloc
(
sizeof
(
BOARD_INFO
)))
==
==
NULL
)
{
NULL
)
{
free
(
ptBuffer
);
free
(
ptBuffer
);
return
DRV_USR_SENDBUF_PTR_NULL
;
return
DRV_USR_SENDBUF_PTR_NULL
;
}
}
...
@@ -176,10 +191,13 @@ short DevGetBoardInfo(BOARD_INFO* pvData)
...
@@ -176,10 +191,13 @@ short DevGetBoardInfo(BOARD_INFO* pvData)
ptBuffer
->
usInfoLen
=
sizeof
(
BOARD_INFO
);
ptBuffer
->
usInfoLen
=
sizeof
(
BOARD_INFO
);
ptBoardInfo
=
ptBuffer
->
ptBoardInfo
;
ptBoardInfo
=
ptBuffer
->
ptBoardInfo
;
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLBOARDINFO
,
(
unsigned
long
)
ptBuffer
))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLBOARDINFO
,
(
unsigned
long
)
ptBuffer
))
{
// fprintf(stderr, "CIF_IOCTLBOARDINFO: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLBOARDINFO: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
{
}
else
{
ptBuffer
->
ptBoardInfo
=
ptBoardInfo
;
ptBuffer
->
ptBoardInfo
=
ptBoardInfo
;
// printf("sRet=%X, &tBuffer=%lX, ->ptBI=%lX\n",sRet,(unsigned
// printf("sRet=%X, &tBuffer=%lX, ->ptBI=%lX\n",sRet,(unsigned
// long)tBuffer,(unsigned long)ptBoardInfo);
// long)tBuffer,(unsigned long)ptBoardInfo);
...
@@ -217,16 +235,19 @@ short DevGetBoardInfoEx(BOARD_INFOEX* pvData)
...
@@ -217,16 +235,19 @@ short DevGetBoardInfoEx(BOARD_INFOEX* pvData)
BOARD_INFOEX
*
ptBoardInfoEx
=
NULL
;
BOARD_INFOEX
*
ptBoardInfoEx
=
NULL
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
{
}
if
((
ptBuffer
else
=
(
DEVIO_GETBOARDINFOEXCMD
*
)
malloc
(
sizeof
(
DEVIO_GETBOARDINFOEXCMD
)))
{
==
NULL
)
if
((
ptBuffer
=
(
DEVIO_GETBOARDINFOEXCMD
*
)
malloc
(
sizeof
(
DEVIO_GETBOARDINFOEXCMD
)))
==
NULL
)
return
DRV_USR_SENDBUF_PTR_NULL
;
return
DRV_USR_SENDBUF_PTR_NULL
;
ptBuffer
->
usInfoLen
=
sizeof
(
BOARD_INFOEX
);
ptBuffer
->
usInfoLen
=
sizeof
(
BOARD_INFOEX
);
if
((
ptBuffer
->
ptBoard
=
(
BOARD_INFOEX
*
)
malloc
(
sizeof
(
BOARD_INFOEX
)))
if
((
ptBuffer
->
ptBoard
=
(
BOARD_INFOEX
*
)
malloc
(
sizeof
(
BOARD_INFOEX
)))
==
==
NULL
)
{
NULL
)
{
free
(
ptBuffer
);
free
(
ptBuffer
);
return
DRV_USR_SENDBUF_PTR_NULL
;
return
DRV_USR_SENDBUF_PTR_NULL
;
}
}
...
@@ -234,10 +255,13 @@ short DevGetBoardInfoEx(BOARD_INFOEX* pvData)
...
@@ -234,10 +255,13 @@ short DevGetBoardInfoEx(BOARD_INFOEX* pvData)
ptBuffer
->
usInfoLen
=
sizeof
(
BOARD_INFOEX
);
ptBuffer
->
usInfoLen
=
sizeof
(
BOARD_INFOEX
);
ptBuffer
->
sError
=
sRet
;
ptBuffer
->
sError
=
sRet
;
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLBOARDINFOEX
,
(
unsigned
long
)
ptBuffer
))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLBOARDINFOEX
,
(
unsigned
long
)
ptBuffer
))
{
// fprintf(stderr, "CIF_IOCTLBOARDINFOEX: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLBOARDINFOEX: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
{
}
else
{
sRet
=
ptBuffer
->
sError
;
sRet
=
ptBuffer
->
sError
;
ptBuffer
->
ptBoard
=
ptBoardInfoEx
;
ptBuffer
->
ptBoard
=
ptBoardInfoEx
;
memcpy
(
pvData
,
ptBoardInfoEx
,
sizeof
(
BOARD_INFOEX
));
memcpy
(
pvData
,
ptBoardInfoEx
,
sizeof
(
BOARD_INFOEX
));
...
@@ -260,27 +284,35 @@ short DevGetBoardInfoEx(BOARD_INFOEX* pvData)
...
@@ -260,27 +284,35 @@ short DevGetBoardInfoEx(BOARD_INFOEX* pvData)
=================================================================================
=================================================================================
<En> */
<En> */
short
DevSetOpMode
(
short
DevSetOpMode
(
unsigned
short
usBoard
,
unsigned
short
usMode
,
unsigned
short
usBoard
,
unsigned
short
usMode
,
unsigned
short
*
usIrq
)
unsigned
short
*
usIrq
)
{
{
DEVIO_SETOPMODE
tBuffer
;
DEVIO_SETOPMODE
tBuffer
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usBoard
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usBoard
>=
MAX_DEV_BOARDS
)
{
// number is invalid
// number is invalid
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
{
}
else
{
// clear all data buffers
// clear all data buffers
tBuffer
.
usBoard
=
usBoard
;
tBuffer
.
usBoard
=
usBoard
;
tBuffer
.
usMode
=
usMode
;
tBuffer
.
usMode
=
usMode
;
tBuffer
.
sError
=
sRet
;
tBuffer
.
sError
=
sRet
;
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTL_IRQ_POLL
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTL_IRQ_POLL
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "CIFAPI (CIF_IOCTL_IRQ_POLL): %s\n", strerror(errno));
// fprintf(stderr, "CIFAPI (CIF_IOCTL_IRQ_POLL): %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
{
}
else
{
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
*
usIrq
=
tBuffer
.
usIrq
;
*
usIrq
=
tBuffer
.
usIrq
;
}
}
...
@@ -307,28 +339,37 @@ short DevInitBoard(unsigned short usDevNumber)
...
@@ -307,28 +339,37 @@ short DevInitBoard(unsigned short usDevNumber)
DEVIO_RESETCMD
tBuffer
;
DEVIO_RESETCMD
tBuffer
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
// number is invalid
// number is invalid
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
{
}
else
{
// clear all data buffers
// clear all data buffers
tBuffer
.
usBoard
=
usDevNumber
;
tBuffer
.
usBoard
=
usDevNumber
;
tBuffer
.
sError
=
sRet
;
tBuffer
.
sError
=
sRet
;
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLINITDRV
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLINITDRV
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "CIFAPI (CIF_IOCTLINITDRV): %s\n", strerror(errno));
// fprintf(stderr, "CIFAPI (CIF_IOCTLINITDRV): %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
{
}
else
{
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
// printf("CIFAPI (CIF_IOCTLINITDRV): sRet = %d\n", sRet);
// printf("CIFAPI (CIF_IOCTLINITDRV): sRet = %d\n", sRet);
if
(
sRet
==
DRV_NO_ERROR
)
{
if
(
sRet
==
DRV_NO_ERROR
)
{
// Save the DPM size for further function calls and calculate the length
// Save the DPM size for further function calls and calculate the length
// of the DPM-IO data area
// of the DPM-IO data area
tDevDPMSize
[
usDevNumber
].
ulDpmSize
=
tBuffer
.
ulDpmSize
;
tDevDPMSize
[
usDevNumber
].
ulDpmSize
=
tBuffer
.
ulDpmSize
;
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
=
=
((
tBuffer
.
ulDpmSize
*
1024
)
-
1024
)
/
2
;
((
tBuffer
.
ulDpmSize
*
1024
)
-
1024
)
/
2
;
}
}
}
}
}
}
...
@@ -350,22 +391,29 @@ short DevInitBoard(unsigned short usDevNumber)
...
@@ -350,22 +391,29 @@ short DevInitBoard(unsigned short usDevNumber)
=================================================================================
=================================================================================
<En> */
<En> */
short
DevReset
(
short
DevReset
(
unsigned
char
usDevNumber
,
unsigned
short
usMode
,
unsigned
char
usDevNumber
,
unsigned
short
usMode
,
unsigned
long
ulTimeout
)
unsigned
long
ulTimeout
)
{
{
DEVIO_RESETCMD
tBuffer
;
DEVIO_RESETCMD
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
((
usMode
!=
COLDSTART
)
&&
(
usMode
!=
WARMSTART
)
}
&&
(
usMode
!=
BOOTSTART
))
{
else
if
((
usMode
!=
COLDSTART
)
&&
(
usMode
!=
WARMSTART
)
&&
(
usMode
!=
BOOTSTART
))
{
sRet
=
DRV_USR_MODE_INVALID
;
sRet
=
DRV_USR_MODE_INVALID
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
// set output buffer
// set output buffer
...
@@ -376,10 +424,13 @@ short DevReset(
...
@@ -376,10 +424,13 @@ short DevReset(
// printf("CIF_IOCTLRESETDEV: BOARD = %d, mode = %d, tout = %ld\n",
// printf("CIF_IOCTLRESETDEV: BOARD = %d, mode = %d, tout = %ld\n",
// tBuffer.ucBoard, tBuffer.usMode, tBuffer.ulTimeout);
// tBuffer.ucBoard, tBuffer.usMode, tBuffer.ulTimeout);
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLRESETDEV
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLRESETDEV
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "CIF_IOCTLRESETDEV: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLRESETDEV: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
{
}
else
{
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
}
}
}
}
...
@@ -403,66 +454,83 @@ short DevReset(
...
@@ -403,66 +454,83 @@ short DevReset(
<En> */
<En> */
short
DevGetInfo
(
unsigned
short
usDevNumber
,
unsigned
short
usInfoArea
,
short
DevGetInfo
(
unsigned
short
usDevNumber
,
unsigned
short
usInfoArea
,
unsigned
short
usSize
,
void
*
pvData
)
unsigned
short
usSize
,
void
*
pvData
)
{
{
DEVIO_GETDEVINFOCMD
tBuffer
;
DEVIO_GETDEVINFOCMD
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
(
usSize
==
0
)
{
}
else
if
(
usSize
==
0
)
{
sRet
=
DRV_USR_SIZE_ZERO
;
sRet
=
DRV_USR_SIZE_ZERO
;
}
else
{
}
else
{
// test area spezific data
// test area spezific data
switch
(
usInfoArea
)
{
switch
(
usInfoArea
)
{
case
GET_VERSION_INFO
:
case
GET_VERSION_INFO
:
if
(
usSize
>
sizeof
(
VERSIONINFO
))
{
if
(
usSize
>
sizeof
(
VERSIONINFO
))
{
sRet
=
DRV_USR_SIZE_TOO_LONG
;
sRet
=
DRV_USR_SIZE_TOO_LONG
;
}
}
break
;
break
;
case
GET_DRIVER_INFO
:
case
GET_DRIVER_INFO
:
if
(
usSize
>
sizeof
(
DRIVERINFO
))
{
if
(
usSize
>
sizeof
(
DRIVERINFO
))
{
sRet
=
DRV_USR_SIZE_TOO_LONG
;
sRet
=
DRV_USR_SIZE_TOO_LONG
;
}
}
break
;
break
;
case
GET_FIRMWARE_INFO
:
case
GET_FIRMWARE_INFO
:
if
(
usSize
>
sizeof
(
FIRMWAREINFO
))
{
if
(
usSize
>
sizeof
(
FIRMWAREINFO
))
{
sRet
=
DRV_USR_SIZE_TOO_LONG
;
sRet
=
DRV_USR_SIZE_TOO_LONG
;
}
}
break
;
break
;
case
GET_RCS_INFO
:
case
GET_RCS_INFO
:
if
(
usSize
>
sizeof
(
RCSINFO
))
{
if
(
usSize
>
sizeof
(
RCSINFO
))
{
sRet
=
DRV_USR_SIZE_TOO_LONG
;
sRet
=
DRV_USR_SIZE_TOO_LONG
;
}
}
break
;
break
;
case
GET_DEV_INFO
:
case
GET_DEV_INFO
:
if
(
usSize
>
sizeof
(
DEVINFO
))
{
if
(
usSize
>
sizeof
(
DEVINFO
))
{
sRet
=
DRV_USR_SIZE_TOO_LONG
;
sRet
=
DRV_USR_SIZE_TOO_LONG
;
}
}
break
;
break
;
case
GET_TASK_INFO
:
case
GET_TASK_INFO
:
if
(
usSize
>
sizeof
(
TASKINFO
))
{
if
(
usSize
>
sizeof
(
TASKINFO
))
{
sRet
=
DRV_USR_SIZE_TOO_LONG
;
sRet
=
DRV_USR_SIZE_TOO_LONG
;
}
}
break
;
break
;
case
GET_IO_INFO
:
case
GET_IO_INFO
:
if
(
usSize
>
sizeof
(
IOINFO
))
{
if
(
usSize
>
sizeof
(
IOINFO
))
{
sRet
=
DRV_USR_SIZE_TOO_LONG
;
sRet
=
DRV_USR_SIZE_TOO_LONG
;
}
}
break
;
break
;
case
GET_IO_SEND_DATA
:
case
GET_IO_SEND_DATA
:
if
(
usSize
>
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
)
{
if
(
usSize
>
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
)
{
sRet
=
DRV_USR_SIZE_TOO_LONG
;
sRet
=
DRV_USR_SIZE_TOO_LONG
;
}
}
break
;
break
;
default:
default:
sRet
=
DRV_USR_INFO_AREA_INVALID
;
sRet
=
DRV_USR_INFO_AREA_INVALID
;
}
/* end switch */
}
/* end switch */
if
(
sRet
==
DRV_NO_ERROR
)
{
if
(
sRet
==
DRV_NO_ERROR
)
{
// complete buffer length with return data
// complete buffer length with return data
// usDataBufferLen = usSize;
// usDataBufferLen = usSize;
// fill in parameter data
// fill in parameter data
...
@@ -471,15 +539,18 @@ short DevGetInfo(unsigned short usDevNumber, unsigned short usInfoArea,
...
@@ -471,15 +539,18 @@ short DevGetInfo(unsigned short usDevNumber, unsigned short usInfoArea,
tBuffer
.
usBoard
=
usDevNumber
;
tBuffer
.
usBoard
=
usDevNumber
;
tBuffer
.
usInfoArea
=
usInfoArea
;
tBuffer
.
usInfoArea
=
usInfoArea
;
tBuffer
.
usInfoLen
=
usSize
;
tBuffer
.
usInfoLen
=
usSize
;
tBuffer
.
pabInfoData
tBuffer
.
pabInfoData
=
=
pvData
;
// needed in kernel-space to copy data back to it!
pvData
;
// needed in kernel-space to copy data back to it!
tBuffer
.
sError
=
sRet
;
tBuffer
.
sError
=
sRet
;
// activate function
// activate function
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLGETINFO
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLGETINFO
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "(CIFAPI: (CIF_IOCTLGETINFO): %s\n",
// fprintf(stderr, "(CIFAPI: (CIF_IOCTLGETINFO): %s\n",
// strerror(errno));
// strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
{
}
else
{
// memcpy(pvData, tBuffer.pabInfoData, usSize); already copied by
// memcpy(pvData, tBuffer.pabInfoData, usSize); already copied by
// driver direct !!!
// driver direct !!!
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
...
@@ -506,24 +577,34 @@ short DevGetInfo(unsigned short usDevNumber, unsigned short usInfoArea,
...
@@ -506,24 +577,34 @@ short DevGetInfo(unsigned short usDevNumber, unsigned short usInfoArea,
<En> */
<En> */
short
DevPutTaskParameter
(
unsigned
short
usDevNumber
,
unsigned
short
usNumber
,
short
DevPutTaskParameter
(
unsigned
short
usDevNumber
,
unsigned
short
usNumber
,
unsigned
short
usSize
,
void
*
pvData
)
unsigned
short
usSize
,
void
*
pvData
)
{
{
DEVIO_PUTPARAMETERCMD
tBuffer
;
DEVIO_PUTPARAMETERCMD
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
((
usNumber
<
1
)
}
||
(
usNumber
>
7
))
{
// 3...7 wird in MailBox memory area geschrieben
else
if
((
usNumber
<
1
)
||
(
usNumber
>
7
))
{
// 3...7 wird in MailBox memory area geschrieben
sRet
=
DRV_USR_NUMBER_INVALID
;
sRet
=
DRV_USR_NUMBER_INVALID
;
}
else
if
(
usSize
==
0
)
{
}
else
if
(
usSize
==
0
)
{
sRet
=
DRV_USR_SIZE_ZERO
;
sRet
=
DRV_USR_SIZE_ZERO
;
}
else
if
(
usSize
>
sizeof
(
TASKPARAM
))
{
}
else
if
(
usSize
>
sizeof
(
TASKPARAM
))
{
sRet
=
DRV_USR_SIZE_TOO_LONG
;
sRet
=
DRV_USR_SIZE_TOO_LONG
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
// set command buffer
// set command buffer
...
@@ -531,13 +612,15 @@ short DevPutTaskParameter(unsigned short usDevNumber, unsigned short usNumber,
...
@@ -531,13 +612,15 @@ short DevPutTaskParameter(unsigned short usDevNumber, unsigned short usNumber,
tBuffer
.
usTaskParamNum
=
usNumber
;
tBuffer
.
usTaskParamNum
=
usNumber
;
tBuffer
.
usTaskParamLen
=
usSize
;
tBuffer
.
usTaskParamLen
=
usSize
;
memcpy
((
unsigned
char
*
)
&
(
tBuffer
.
TaskParameter
),
(
unsigned
char
*
)
pvData
,
memcpy
((
unsigned
char
*
)
&
(
tBuffer
.
TaskParameter
),
(
unsigned
char
*
)
pvData
,
usSize
);
usSize
);
tBuffer
.
sError
=
sRet
;
tBuffer
.
sError
=
sRet
;
// activate function
// activate function
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLPARAMETER
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLPARAMETER
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "CIF_IOCTLRESETDEV: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLRESETDEV: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
}
else
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
}
}
return
sRet
;
return
sRet
;
...
@@ -560,24 +643,35 @@ short DevPutTaskParameter(unsigned short usDevNumber, unsigned short usNumber,
...
@@ -560,24 +643,35 @@ short DevPutTaskParameter(unsigned short usDevNumber, unsigned short usNumber,
<En> */
<En> */
short
DevGetTaskState
(
unsigned
short
usDevNumber
,
unsigned
short
usNumber
,
short
DevGetTaskState
(
unsigned
short
usDevNumber
,
unsigned
short
usNumber
,
unsigned
short
usSize
,
void
*
pvData
)
unsigned
short
usSize
,
void
*
pvData
)
{
{
DEVIO_GETTASKSTATECMD
tBuffer
;
DEVIO_GETTASKSTATECMD
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
(
usNumber
<
1
||
usNumber
>
2
)
{
}
else
if
(
usNumber
<
1
||
usNumber
>
2
)
{
sRet
=
DRV_USR_NUMBER_INVALID
;
sRet
=
DRV_USR_NUMBER_INVALID
;
}
else
if
(
usSize
==
0
)
{
}
else
if
(
usSize
==
0
)
{
sRet
=
DRV_USR_SIZE_ZERO
;
sRet
=
DRV_USR_SIZE_ZERO
;
}
else
if
(
usSize
>
sizeof
(
TASKSTATE
))
{
}
else
if
(
usSize
>
sizeof
(
TASKSTATE
))
{
sRet
=
DRV_USR_SIZE_TOO_LONG
;
sRet
=
DRV_USR_SIZE_TOO_LONG
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
...
@@ -588,10 +682,13 @@ short DevGetTaskState(unsigned short usDevNumber, unsigned short usNumber,
...
@@ -588,10 +682,13 @@ short DevGetTaskState(unsigned short usDevNumber, unsigned short usNumber,
// memcpy( tBuffer.TaskState, pvData, usSize);
// memcpy( tBuffer.TaskState, pvData, usSize);
tBuffer
.
sError
=
sRet
;
tBuffer
.
sError
=
sRet
;
// activate function
// activate function
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLTASKSTATE
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLTASKSTATE
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "CIF_IOCTLTASKSTATE: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLTASKSTATE: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
{
}
else
{
memcpy
(
pvData
,
tBuffer
.
TaskState
,
usSize
);
memcpy
(
pvData
,
tBuffer
.
TaskState
,
usSize
);
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
}
}
...
@@ -614,30 +711,38 @@ short DevGetTaskState(unsigned short usDevNumber, unsigned short usNumber,
...
@@ -614,30 +711,38 @@ short DevGetTaskState(unsigned short usDevNumber, unsigned short usNumber,
<En> */
<En> */
short
DevGetMBXState
(
unsigned
short
usDevNumber
,
unsigned
short
*
pusDevMbxState
,
short
DevGetMBXState
(
unsigned
short
usDevNumber
,
unsigned
short
*
pusDevMbxState
,
unsigned
short
*
pusHostMbxState
)
unsigned
short
*
pusHostMbxState
)
{
{
DEVIO_MBXINFOCMD
tBuffer
;
DEVIO_MBXINFOCMD
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
// set output buffer
// set output buffer
tBuffer
.
ucBoard
=
usDevNumber
;
tBuffer
.
ucBoard
=
usDevNumber
;
tBuffer
.
usDevMbxState
=
0x00
;
//*pusDevMbxState;
tBuffer
.
usDevMbxState
=
0x00
;
//*pusDevMbxState;
tBuffer
.
usHostMbxState
=
0x00
;
//*pusHostMbxState;
tBuffer
.
usHostMbxState
=
0x00
;
//*pusHostMbxState;
tBuffer
.
sError
=
sRet
;
tBuffer
.
sError
=
sRet
;
// activate function
// activate function
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLMBXINFO
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLMBXINFO
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "CIF_IOCTLMBXINFO: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLMBXINFO: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
{
}
else
{
*
pusDevMbxState
=
tBuffer
.
usDevMbxState
;
*
pusDevMbxState
=
tBuffer
.
usDevMbxState
;
*
pusHostMbxState
=
tBuffer
.
usHostMbxState
;
*
pusHostMbxState
=
tBuffer
.
usHostMbxState
;
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
...
@@ -662,23 +767,31 @@ short DevGetMBXState(unsigned short usDevNumber, unsigned short* pusDevMbxState,
...
@@ -662,23 +767,31 @@ short DevGetMBXState(unsigned short usDevNumber, unsigned short* pusDevMbxState,
=================================================================================
=================================================================================
<En> */
<En> */
short
DevGetMBXData
(
unsigned
short
usDevNumber
,
unsigned
short
usHostSize
,
short
DevGetMBXData
(
unsigned
short
usDevNumber
,
unsigned
short
usHostSize
,
void
*
pvHostData
,
unsigned
short
usDevSize
,
void
*
pvDevData
)
void
*
pvHostData
,
unsigned
short
usDevSize
,
void
*
pvDevData
)
{
{
DEVIO_GETMBXCMD
tBuffer
;
DEVIO_GETMBXCMD
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
((
usHostSize
==
0
)
||
(
usDevSize
==
0
))
{
}
else
if
((
usHostSize
==
0
)
||
(
usDevSize
==
0
))
{
sRet
=
DRV_USR_SIZE_ZERO
;
sRet
=
DRV_USR_SIZE_ZERO
;
}
else
if
((
usHostSize
>
sizeof
(
MSG_STRUC
))
}
||
(
usDevSize
>
sizeof
(
MSG_STRUC
)))
{
else
if
((
usHostSize
>
sizeof
(
MSG_STRUC
))
||
(
usDevSize
>
sizeof
(
MSG_STRUC
)))
{
sRet
=
DRV_USR_SIZE_TOO_LONG
;
sRet
=
DRV_USR_SIZE_TOO_LONG
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
...
@@ -687,9 +800,9 @@ short DevGetMBXData(unsigned short usDevNumber, unsigned short usHostSize,
...
@@ -687,9 +800,9 @@ short DevGetMBXData(unsigned short usDevNumber, unsigned short usHostSize,
tBuffer
.
usDevLen
=
usDevSize
;
tBuffer
.
usDevLen
=
usDevSize
;
tBuffer
.
sError
=
sRet
;
tBuffer
.
sError
=
sRet
;
// activate function
// activate function
if
(
!
ioctl
(
hDevDrv
,
// handle of the device
if
(
!
ioctl
(
hDevDrv
,
// handle of the device
CIF_IOCTLGETMBX
,
// control code of operation to perform
CIF_IOCTLGETMBX
,
// control code of operation to perform
(
unsigned
long
)(
&
tBuffer
)))
(
unsigned
long
)(
&
tBuffer
)))
/*, // address of buffer for input data
/*, // address of buffer for input data
sizeof(tBuffer),
sizeof(tBuffer),
// size of input buffer
// size of input buffer
...
@@ -705,7 +818,9 @@ short DevGetMBXData(unsigned short usDevNumber, unsigned short usHostSize,
...
@@ -705,7 +818,9 @@ short DevGetMBXData(unsigned short usDevNumber, unsigned short usHostSize,
// fprintf(stderr, "CIF_IOCTLGETMBX: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLGETMBX: %s\n", strerror(errno));
// function error
// function error
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
{
}
else
{
printf
(
"cif_api::DevGetMBXData: after CIF_IOCTLGETMBX ...
\n
"
);
printf
(
"cif_api::DevGetMBXData: after CIF_IOCTLGETMBX ...
\n
"
);
memcpy
(
pvDevData
,
tBuffer
.
abDevMbx
,
usDevSize
);
memcpy
(
pvDevData
,
tBuffer
.
abDevMbx
,
usDevSize
);
printf
(
"cif_api::DevGetMBXData: after memcpy ...
\n
"
);
printf
(
"cif_api::DevGetMBXData: after memcpy ...
\n
"
);
...
@@ -736,12 +851,17 @@ short DevExitBoard(unsigned short usDevNumber)
...
@@ -736,12 +851,17 @@ short DevExitBoard(unsigned short usDevNumber)
unsigned
short
usDrvOpenCount
=
0
;
unsigned
short
usDrvOpenCount
=
0
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
// number is invalid
// number is invalid
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
{
}
else
{
// valid handle available, driver is open
// valid handle available, driver is open
// clear all data buffers
// clear all data buffers
lBytesReturned
=
0
;
lBytesReturned
=
0
;
...
@@ -749,12 +869,15 @@ short DevExitBoard(unsigned short usDevNumber)
...
@@ -749,12 +869,15 @@ short DevExitBoard(unsigned short usDevNumber)
// tBuffer.usDrvOpenCount = usDrvOpenCount; // [out]
// tBuffer.usDrvOpenCount = usDrvOpenCount; // [out]
// tBuffer.sError = sRet; // [out]
// tBuffer.sError = sRet; // [out]
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLEXITDRV
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLEXITDRV
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "CIF_IOCTLEXITDRV: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLEXITDRV: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
{
}
else
{
tBuffer
.
usDrvOpenCount
=
usDrvOpenCount
;
// [out]
tBuffer
.
usDrvOpenCount
=
usDrvOpenCount
;
// [out]
sRet
=
tBuffer
.
sError
;
// [out]
sRet
=
tBuffer
.
sError
;
// [out]
}
}
}
}
...
@@ -777,22 +900,29 @@ short DevExitBoard(unsigned short usDevNumber)
...
@@ -777,22 +900,29 @@ short DevExitBoard(unsigned short usDevNumber)
<En> */
<En> */
short
DevReadSendData
(
unsigned
short
usDevNumber
,
unsigned
short
usOffset
,
short
DevReadSendData
(
unsigned
short
usDevNumber
,
unsigned
short
usOffset
,
unsigned
short
usSize
,
void
*
pvData
)
unsigned
short
usSize
,
void
*
pvData
)
{
{
DEVIO_READSENDCMD
tBuffer
;
DEVIO_READSENDCMD
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
((
usSize
!=
0
)
}
&&
((
usSize
+
usOffset
)
else
if
((
usSize
!=
0
)
&&
>
(
unsigned
short
)
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
))
{
((
usSize
+
usOffset
)
>
(
unsigned
short
)
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
))
{
sRet
=
DRV_USR_SIZE_TOO_LONG
;
sRet
=
DRV_USR_SIZE_TOO_LONG
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
// set output buffer
// set output buffer
...
@@ -803,10 +933,13 @@ short DevReadSendData(unsigned short usDevNumber, unsigned short usOffset,
...
@@ -803,10 +933,13 @@ short DevReadSendData(unsigned short usDevNumber, unsigned short usOffset,
tBuffer
.
sError
=
sRet
;
tBuffer
.
sError
=
sRet
;
// activate function
// activate function
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLREADSEND
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLREADSEND
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "CIF_IOCTLREADSEND: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLREADSEND: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
{
}
else
{
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
}
}
}
}
...
@@ -828,19 +961,26 @@ short DevReadSendData(unsigned short usDevNumber, unsigned short usOffset,
...
@@ -828,19 +961,26 @@ short DevReadSendData(unsigned short usDevNumber, unsigned short usOffset,
<En> */
<En> */
short
DevTriggerWatchDog
(
unsigned
short
usDevNumber
,
unsigned
short
usMode
,
short
DevTriggerWatchDog
(
unsigned
short
usDevNumber
,
unsigned
short
usMode
,
unsigned
short
*
pusDevWatchDog
)
unsigned
short
*
pusDevWatchDog
)
{
{
DEVIO_TRIGGERCMD
tBuffer
;
DEVIO_TRIGGERCMD
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
(
usMode
>
WATCHDOG_START
)
{
}
else
if
(
usMode
>
WATCHDOG_START
)
{
sRet
=
DRV_USR_MODE_INVALID
;
sRet
=
DRV_USR_MODE_INVALID
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
// set output buffer
// set output buffer
...
@@ -850,10 +990,13 @@ short DevTriggerWatchDog(unsigned short usDevNumber, unsigned short usMode,
...
@@ -850,10 +990,13 @@ short DevTriggerWatchDog(unsigned short usDevNumber, unsigned short usMode,
tBuffer
.
sError
=
sRet
;
tBuffer
.
sError
=
sRet
;
// activate function
// activate function
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLTRIGGERWD
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLTRIGGERWD
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "CIF_IOCTLREADSEND: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLREADSEND: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
{
}
else
{
*
pusDevWatchDog
=
tBuffer
.
usTriggerValue
;
*
pusDevWatchDog
=
tBuffer
.
usTriggerValue
;
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
}
}
...
@@ -877,19 +1020,26 @@ short DevTriggerWatchDog(unsigned short usDevNumber, unsigned short usMode,
...
@@ -877,19 +1020,26 @@ short DevTriggerWatchDog(unsigned short usDevNumber, unsigned short usMode,
<En> */
<En> */
short
DevSpecialControl
(
unsigned
short
usDevNumber
,
unsigned
short
usMode
,
short
DevSpecialControl
(
unsigned
short
usDevNumber
,
unsigned
short
usMode
,
unsigned
short
*
pusCtrlAck
)
unsigned
short
*
pusCtrlAck
)
{
{
DEVIO_TRIGGERCMD
tBuffer
;
DEVIO_TRIGGERCMD
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
(
pusCtrlAck
==
NULL
)
{
}
else
if
(
pusCtrlAck
==
NULL
)
{
sRet
=
DRV_USR_BUF_PTR_NULL
;
sRet
=
DRV_USR_BUF_PTR_NULL
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
// set output buffer
// set output buffer
...
@@ -898,10 +1048,13 @@ short DevSpecialControl(unsigned short usDevNumber, unsigned short usMode,
...
@@ -898,10 +1048,13 @@ short DevSpecialControl(unsigned short usDevNumber, unsigned short usMode,
tBuffer
.
sError
=
sRet
;
tBuffer
.
sError
=
sRet
;
// activate function
// activate function
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLSPCONTROL
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLSPCONTROL
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "CIF_IOCTLREADSEND: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLREADSEND: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
{
}
else
{
*
pusCtrlAck
=
tBuffer
.
usTriggerValue
;
*
pusCtrlAck
=
tBuffer
.
usTriggerValue
;
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
}
}
...
@@ -926,23 +1079,34 @@ short DevSpecialControl(unsigned short usDevNumber, unsigned short usMode,
...
@@ -926,23 +1079,34 @@ short DevSpecialControl(unsigned short usDevNumber, unsigned short usMode,
<En> */
<En> */
short
DevExtendedData
(
unsigned
short
usDevNumber
,
unsigned
short
usMode
,
short
DevExtendedData
(
unsigned
short
usDevNumber
,
unsigned
short
usMode
,
unsigned
short
usSize
,
void
*
pvData
)
unsigned
short
usSize
,
void
*
pvData
)
{
{
DEVIO_EXTDATACMD
tBuffer
;
DEVIO_EXTDATACMD
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
(
usSize
==
0
)
{
}
else
if
(
usSize
==
0
)
{
sRet
=
DRV_USR_SIZE_ZERO
;
sRet
=
DRV_USR_SIZE_ZERO
;
}
else
if
(
usSize
>
EXTDATASIZE
)
{
}
else
if
(
usSize
>
EXTDATASIZE
)
{
sRet
=
DRV_USR_SIZE_TOO_LONG
;
sRet
=
DRV_USR_SIZE_TOO_LONG
;
}
else
if
((
usMode
==
0
)
||
(
usMode
>
100
))
{
}
else
if
((
usMode
==
0
)
||
(
usMode
>
100
))
{
sRet
=
DRV_USR_MODE_INVALID
;
sRet
=
DRV_USR_MODE_INVALID
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
...
@@ -957,10 +1121,12 @@ short DevExtendedData(unsigned short usDevNumber, unsigned short usMode,
...
@@ -957,10 +1121,12 @@ short DevExtendedData(unsigned short usDevNumber, unsigned short usMode,
// error into the tDataBuffer.
// error into the tDataBuffer.
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
// activate function
// activate function
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLEXTDATA
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLEXTDATA
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "CIF_IOCTLEXTDATA: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLEXTDATA: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
}
else
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
}
}
return
sRet
;
return
sRet
;
...
@@ -983,24 +1149,35 @@ short DevExtendedData(unsigned short usDevNumber, unsigned short usMode,
...
@@ -983,24 +1149,35 @@ short DevExtendedData(unsigned short usDevNumber, unsigned short usMode,
<En> */
<En> */
short
DevGetTaskParameter
(
unsigned
short
usDevNumber
,
unsigned
short
usNumber
,
short
DevGetTaskParameter
(
unsigned
short
usDevNumber
,
unsigned
short
usNumber
,
unsigned
short
usSize
,
void
*
pvData
)
unsigned
short
usSize
,
void
*
pvData
)
{
{
DEVIO_GETPARAMETERCMD
tBuffer
;
DEVIO_GETPARAMETERCMD
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
((
usNumber
<
1
)
||
(
usNumber
>
2
))
{
}
else
if
((
usNumber
<
1
)
||
(
usNumber
>
2
))
{
sRet
=
DRV_USR_NUMBER_INVALID
;
sRet
=
DRV_USR_NUMBER_INVALID
;
}
else
if
(
usSize
==
0
)
{
}
else
if
(
usSize
==
0
)
{
sRet
=
DRV_USR_SIZE_ZERO
;
sRet
=
DRV_USR_SIZE_ZERO
;
}
else
if
(
usSize
>
sizeof
(
TASKPARAM
))
{
}
else
if
(
usSize
>
sizeof
(
TASKPARAM
))
{
sRet
=
DRV_USR_SIZE_TOO_LONG
;
sRet
=
DRV_USR_SIZE_TOO_LONG
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
// set command buffer
// set command buffer
...
@@ -1010,12 +1187,15 @@ short DevGetTaskParameter(unsigned short usDevNumber, unsigned short usNumber,
...
@@ -1010,12 +1187,15 @@ short DevGetTaskParameter(unsigned short usDevNumber, unsigned short usNumber,
// tBuffer.ptTaskParam = pvData;
// tBuffer.ptTaskParam = pvData;
tBuffer
.
sError
=
sRet
;
tBuffer
.
sError
=
sRet
;
// activate function
// activate function
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLGETPARAMETER
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLGETPARAMETER
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "CIF_IOCTLGETPARAMETER: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLGETPARAMETER: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
{
}
else
{
memcpy
((
unsigned
char
*
)
pvData
,
(
unsigned
char
*
)
&
(
tBuffer
.
TaskParameter
),
memcpy
((
unsigned
char
*
)
pvData
,
(
unsigned
char
*
)
&
(
tBuffer
.
TaskParameter
),
usSize
);
usSize
);
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
}
}
}
}
...
@@ -1036,25 +1216,35 @@ short DevGetTaskParameter(unsigned short usDevNumber, unsigned short usNumber,
...
@@ -1036,25 +1216,35 @@ short DevGetTaskParameter(unsigned short usDevNumber, unsigned short usNumber,
<En> */
<En> */
short
DevReadWriteDPMData
(
unsigned
short
usDevNumber
,
unsigned
short
usMode
,
short
DevReadWriteDPMData
(
unsigned
short
usDevNumber
,
unsigned
short
usMode
,
unsigned
short
usOffset
,
unsigned
short
usSize
,
void
*
pvData
)
unsigned
short
usOffset
,
unsigned
short
usSize
,
void
*
pvData
)
{
{
DEVIO_RWDPMDATACMD
tBuffer
;
DEVIO_RWDPMDATACMD
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
((
usMode
!=
PARAMETER_READ
)
&&
(
usMode
!=
PARAMETER_WRITE
))
{
}
else
if
((
usMode
!=
PARAMETER_READ
)
&&
(
usMode
!=
PARAMETER_WRITE
))
{
sRet
=
DRV_USR_MODE_INVALID
;
sRet
=
DRV_USR_MODE_INVALID
;
}
else
if
((
usSize
!=
0
)
}
&&
((
usSize
+
usOffset
)
else
if
((
usSize
!=
0
)
&&
>
(
unsigned
short
)(
tDevDPMSize
[
usDevNumber
].
ulDpmSize
*
1024
)))
{
((
usSize
+
usOffset
)
>
(
unsigned
short
)(
tDevDPMSize
[
usDevNumber
].
ulDpmSize
*
1024
)))
{
sRet
=
DRV_USR_SIZE_TOO_LONG
;
sRet
=
DRV_USR_SIZE_TOO_LONG
;
;
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
tBuffer
.
usBoard
=
usDevNumber
;
tBuffer
.
usBoard
=
usDevNumber
;
...
@@ -1065,10 +1255,12 @@ short DevReadWriteDPMData(unsigned short usDevNumber, unsigned short usMode,
...
@@ -1065,10 +1255,12 @@ short DevReadWriteDPMData(unsigned short usDevNumber, unsigned short usMode,
tBuffer
.
sError
=
sRet
;
tBuffer
.
sError
=
sRet
;
// activate function
// activate function
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLRWDPMDATA
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLRWDPMDATA
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "CIF_IOCTLRWDPMDATA: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLRWDPMDATA: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
}
else
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
}
/* endif */
}
/* endif */
return
sRet
;
return
sRet
;
...
@@ -1091,22 +1283,32 @@ short DevReadWriteDPMData(unsigned short usDevNumber, unsigned short usMode,
...
@@ -1091,22 +1283,32 @@ short DevReadWriteDPMData(unsigned short usDevNumber, unsigned short usMode,
<En> */
<En> */
short
DevReadWriteDPMRaw
(
unsigned
short
usDevNumber
,
unsigned
short
usMode
,
short
DevReadWriteDPMRaw
(
unsigned
short
usDevNumber
,
unsigned
short
usMode
,
unsigned
short
usOffset
,
unsigned
short
usSize
,
void
*
pvData
)
unsigned
short
usOffset
,
unsigned
short
usSize
,
void
*
pvData
)
{
{
DEVIO_RWRAWDATACMD
tBuffer
;
DEVIO_RWRAWDATACMD
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
((
usSize
+
usOffset
)
>
sizeof
(
RAWDATA
))
{
}
else
if
((
usSize
+
usOffset
)
>
sizeof
(
RAWDATA
))
{
sRet
=
DRV_USR_SIZE_TOO_LONG
;
sRet
=
DRV_USR_SIZE_TOO_LONG
;
}
else
if
((
usMode
!=
PARAMETER_READ
)
&&
(
usMode
!=
PARAMETER_WRITE
))
{
}
else
if
((
usMode
!=
PARAMETER_READ
)
&&
(
usMode
!=
PARAMETER_WRITE
))
{
sRet
=
DRV_USR_MODE_INVALID
;
sRet
=
DRV_USR_MODE_INVALID
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
tBuffer
.
usBoard
=
usDevNumber
;
tBuffer
.
usBoard
=
usDevNumber
;
...
@@ -1117,10 +1319,12 @@ short DevReadWriteDPMRaw(unsigned short usDevNumber, unsigned short usMode,
...
@@ -1117,10 +1319,12 @@ short DevReadWriteDPMRaw(unsigned short usDevNumber, unsigned short usMode,
tBuffer
.
sError
=
sRet
;
tBuffer
.
sError
=
sRet
;
// activate function
// activate function
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLRWRAW
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLRWRAW
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "CIF_IOCTLRWRAW: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLRWRAW: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
}
else
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
}
/* endif */
}
/* endif */
return
sRet
;
return
sRet
;
...
@@ -1142,27 +1346,38 @@ short DevReadWriteDPMRaw(unsigned short usDevNumber, unsigned short usMode,
...
@@ -1142,27 +1346,38 @@ short DevReadWriteDPMRaw(unsigned short usDevNumber, unsigned short usMode,
<En> */
<En> */
short
DevExchangeIO
(
unsigned
short
usDevNumber
,
unsigned
short
usSendOffset
,
short
DevExchangeIO
(
unsigned
short
usDevNumber
,
unsigned
short
usSendOffset
,
unsigned
short
usSendSize
,
void
*
pvSendData
,
unsigned
short
usReceiveOffset
,
unsigned
short
usSendSize
,
void
*
pvSendData
,
unsigned
short
usReceiveSize
,
void
*
pvReceiveData
,
unsigned
long
ulTimeout
)
unsigned
short
usReceiveOffset
,
unsigned
short
usReceiveSize
,
void
*
pvReceiveData
,
unsigned
long
ulTimeout
)
{
{
DEVIO_EXIOCMD
tBuffer
;
DEVIO_EXIOCMD
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
int
lRet
=
0
;
int
lRet
=
0
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
((
usSendSize
!=
0
)
}
&&
((
usSendSize
+
usSendOffset
)
else
if
((
usSendSize
!=
0
)
&&
>
(
unsigned
short
)
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
))
{
((
usSendSize
+
usSendOffset
)
>
(
unsigned
short
)
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
))
{
sRet
=
DRV_USR_SENDSIZE_TOO_LONG
;
sRet
=
DRV_USR_SENDSIZE_TOO_LONG
;
}
else
if
((
usReceiveSize
!=
0
)
}
&&
((
usReceiveSize
+
usReceiveOffset
)
else
if
((
usReceiveSize
!=
0
)
&&
>
(
unsigned
short
)
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
))
{
((
usReceiveSize
+
usReceiveOffset
)
>
(
unsigned
short
)
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
))
{
sRet
=
DRV_USR_RECVSIZE_TOO_LONG
;
sRet
=
DRV_USR_RECVSIZE_TOO_LONG
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
// set output buffer
// set output buffer
...
@@ -1178,10 +1393,12 @@ short DevExchangeIO(unsigned short usDevNumber, unsigned short usSendOffset,
...
@@ -1178,10 +1393,12 @@ short DevExchangeIO(unsigned short usDevNumber, unsigned short usSendOffset,
// activate function
// activate function
lRet
=
ioctl
(
hDevDrv
,
CIF_IOCTLEXIO
,
(
unsigned
long
)(
&
tBuffer
));
lRet
=
ioctl
(
hDevDrv
,
CIF_IOCTLEXIO
,
(
unsigned
long
)(
&
tBuffer
));
if
(
lRet
<=
0
)
{
if
(
lRet
<=
0
)
{
// fprintf(stderr, "CIF_IOCTLEXIO: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLEXIO: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
}
else
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
}
}
return
sRet
;
return
sRet
;
...
@@ -1204,9 +1421,10 @@ short DevExchangeIO(unsigned short usDevNumber, unsigned short usSendOffset,
...
@@ -1204,9 +1421,10 @@ short DevExchangeIO(unsigned short usDevNumber, unsigned short usSendOffset,
<En> */
<En> */
short
DevExchangeIOEx
(
unsigned
short
usDevNumber
,
unsigned
short
usMode
,
short
DevExchangeIOEx
(
unsigned
short
usDevNumber
,
unsigned
short
usMode
,
unsigned
short
usSendOffset
,
unsigned
short
usSendSize
,
void
*
pvSendData
,
unsigned
short
usSendOffset
,
unsigned
short
usSendSize
,
unsigned
short
usReceiveOffset
,
unsigned
short
usReceiveSize
,
void
*
pvSendData
,
unsigned
short
usReceiveOffset
,
void
*
pvReceiveData
,
unsigned
long
ulTimeout
)
unsigned
short
usReceiveSize
,
void
*
pvReceiveData
,
unsigned
long
ulTimeout
)
{
{
DEVIO_EXIOCMDEX
tBuffer
;
DEVIO_EXIOCMDEX
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
...
@@ -1214,21 +1432,32 @@ short DevExchangeIOEx(unsigned short usDevNumber, unsigned short usMode,
...
@@ -1214,21 +1432,32 @@ short DevExchangeIOEx(unsigned short usDevNumber, unsigned short usMode,
int
lRet
=
0
;
int
lRet
=
0
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
((
usSendSize
!=
0
)
}
&&
((
usSendSize
+
usSendOffset
)
else
if
((
usSendSize
!=
0
)
&&
>
(
unsigned
short
)
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
))
{
((
usSendSize
+
usSendOffset
)
>
(
unsigned
short
)
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
))
{
sRet
=
DRV_USR_SENDSIZE_TOO_LONG
;
sRet
=
DRV_USR_SENDSIZE_TOO_LONG
;
}
else
if
((
usReceiveSize
!=
0
)
}
&&
((
usReceiveSize
+
usReceiveOffset
)
else
if
((
usReceiveSize
!=
0
)
&&
>
(
unsigned
short
)
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
))
{
((
usReceiveSize
+
usReceiveOffset
)
>
(
unsigned
short
)
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
))
{
sRet
=
DRV_USR_RECVSIZE_TOO_LONG
;
sRet
=
DRV_USR_RECVSIZE_TOO_LONG
;
}
else
if
(
usMode
>
4
)
{
}
else
if
(
usMode
>
4
)
{
sRet
=
DRV_USR_MODE_INVALID
;
sRet
=
DRV_USR_MODE_INVALID
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
...
@@ -1246,10 +1475,12 @@ short DevExchangeIOEx(unsigned short usDevNumber, unsigned short usMode,
...
@@ -1246,10 +1475,12 @@ short DevExchangeIOEx(unsigned short usDevNumber, unsigned short usMode,
// activate function
// activate function
lRet
=
ioctl
(
hDevDrv
,
CIF_IOCTLEXIOEX
,
(
unsigned
long
)(
&
tBuffer
));
lRet
=
ioctl
(
hDevDrv
,
CIF_IOCTLEXIOEX
,
(
unsigned
long
)(
&
tBuffer
));
if
(
lRet
<=
0
)
{
if
(
lRet
<=
0
)
{
// fprintf(stderr, "CIF_IOCTLEXIO: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLEXIO: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
}
else
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
}
}
return
sRet
;
return
sRet
;
...
@@ -1272,9 +1503,10 @@ short DevExchangeIOEx(unsigned short usDevNumber, unsigned short usMode,
...
@@ -1272,9 +1503,10 @@ short DevExchangeIOEx(unsigned short usDevNumber, unsigned short usMode,
<En> */
<En> */
short
DevExchangeIOErr
(
unsigned
short
usDevNumber
,
unsigned
short
usSendOffset
,
short
DevExchangeIOErr
(
unsigned
short
usDevNumber
,
unsigned
short
usSendOffset
,
unsigned
short
usSendSize
,
void
*
pvSendData
,
unsigned
short
usReceiveOffset
,
unsigned
short
usSendSize
,
void
*
pvSendData
,
unsigned
short
usReceiveSize
,
void
*
pvReceiveData
,
COMSTATE
*
ptState
,
unsigned
short
usReceiveOffset
,
unsigned
long
ulTimeout
)
unsigned
short
usReceiveSize
,
void
*
pvReceiveData
,
COMSTATE
*
ptState
,
unsigned
long
ulTimeout
)
{
{
DEVIO_EXIOCMDERR
tBuffer
;
DEVIO_EXIOCMDERR
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
...
@@ -1282,19 +1514,28 @@ short DevExchangeIOErr(unsigned short usDevNumber, unsigned short usSendOffset,
...
@@ -1282,19 +1514,28 @@ short DevExchangeIOErr(unsigned short usDevNumber, unsigned short usSendOffset,
int
lRet
=
0
;
int
lRet
=
0
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
((
usSendSize
!=
0
)
}
&&
((
usSendSize
+
usSendOffset
)
else
if
((
usSendSize
!=
0
)
&&
>
(
unsigned
short
)
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
))
{
((
usSendSize
+
usSendOffset
)
>
(
unsigned
short
)
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
))
{
sRet
=
DRV_USR_SENDSIZE_TOO_LONG
;
sRet
=
DRV_USR_SENDSIZE_TOO_LONG
;
}
else
if
((
usReceiveSize
!=
0
)
}
&&
((
usReceiveSize
+
usReceiveOffset
)
else
if
((
usReceiveSize
!=
0
)
&&
>
(
unsigned
short
)
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
))
{
((
usReceiveSize
+
usReceiveOffset
)
>
(
unsigned
short
)
tDevDPMSize
[
usDevNumber
].
ulDpmIOSize
))
{
sRet
=
DRV_USR_RECVSIZE_TOO_LONG
;
sRet
=
DRV_USR_RECVSIZE_TOO_LONG
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
// set output buffer
// set output buffer
...
@@ -1311,10 +1552,12 @@ short DevExchangeIOErr(unsigned short usDevNumber, unsigned short usSendOffset,
...
@@ -1311,10 +1552,12 @@ short DevExchangeIOErr(unsigned short usDevNumber, unsigned short usSendOffset,
// activate function
// activate function
lRet
=
ioctl
(
hDevDrv
,
CIF_IOCTLEXIOERR
,
(
unsigned
long
)(
&
tBuffer
));
lRet
=
ioctl
(
hDevDrv
,
CIF_IOCTLEXIOERR
,
(
unsigned
long
)(
&
tBuffer
));
if
(
lRet
<=
0
)
{
if
(
lRet
<=
0
)
{
// fprintf(stderr, "CIF_IOCTLEXIO: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLEXIO: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
}
else
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
}
}
return
sRet
;
return
sRet
;
...
@@ -1334,21 +1577,28 @@ short DevExchangeIOErr(unsigned short usDevNumber, unsigned short usSendOffset,
...
@@ -1334,21 +1577,28 @@ short DevExchangeIOErr(unsigned short usDevNumber, unsigned short usSendOffset,
=================================================================================
=================================================================================
<En> */
<En> */
short
DevSetHostState
(
short
DevSetHostState
(
unsigned
short
usDevNumber
,
unsigned
short
usMode
,
unsigned
short
usDevNumber
,
unsigned
short
usMode
,
unsigned
long
ulTimeout
)
unsigned
long
ulTimeout
)
{
{
DEVIO_TRIGGERCMD
tBuffer
;
DEVIO_TRIGGERCMD
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
(
usMode
>
HOST_READY
)
{
}
else
if
(
usMode
>
HOST_READY
)
{
sRet
=
DRV_USR_MODE_INVALID
;
sRet
=
DRV_USR_MODE_INVALID
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
...
@@ -1358,10 +1608,12 @@ short DevSetHostState(
...
@@ -1358,10 +1608,12 @@ short DevSetHostState(
tBuffer
.
ulTimeout
=
ulTimeout
;
tBuffer
.
ulTimeout
=
ulTimeout
;
tBuffer
.
sError
=
sRet
;
tBuffer
.
sError
=
sRet
;
// activate function
// activate function
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLSETHOST
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLSETHOST
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "CIF_IOCTLSETHOST: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLSETHOST: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
}
else
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
}
}
return
sRet
;
return
sRet
;
...
@@ -1382,19 +1634,24 @@ short DevSetHostState(
...
@@ -1382,19 +1634,24 @@ short DevSetHostState(
=================================================================================
=================================================================================
<En> */
<En> */
short
DevPutMessage
(
short
DevPutMessage
(
unsigned
short
usDevNumber
,
MSG_STRUC
*
ptMessage
,
unsigned
short
usDevNumber
,
MSG_STRUC
*
ptMessage
,
unsigned
long
ulTimeout
)
unsigned
long
ulTimeout
)
{
{
DEVIO_PUTMESSAGECMD
tBuffer
;
DEVIO_PUTMESSAGECMD
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
// set output buffer
// set output buffer
...
@@ -1404,10 +1661,12 @@ short DevPutMessage(
...
@@ -1404,10 +1661,12 @@ short DevPutMessage(
tBuffer
.
sError
=
sRet
;
tBuffer
.
sError
=
sRet
;
// activate function
// activate function
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLPUTMSG
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLPUTMSG
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "CIF_IOCTLPUTMSG: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLPUTMSG: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
}
else
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
}
}
return
sRet
;
return
sRet
;
...
@@ -1431,20 +1690,27 @@ short DevPutMessage(
...
@@ -1431,20 +1690,27 @@ short DevPutMessage(
<En> */
<En> */
short
DevGetMessage
(
unsigned
short
usDevNumber
,
unsigned
short
usSize
,
short
DevGetMessage
(
unsigned
short
usDevNumber
,
unsigned
short
usSize
,
MSG_STRUC
*
ptMessage
,
unsigned
long
ulTimeout
)
MSG_STRUC
*
ptMessage
,
unsigned
long
ulTimeout
)
{
{
DEVIO_GETMESSAGECMD
tBuffer
;
DEVIO_GETMESSAGECMD
tBuffer
;
unsigned
int
lBytesReturned
;
unsigned
int
lBytesReturned
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
(
usSize
==
0
||
usSize
>
sizeof
(
MSG_STRUC
))
{
}
else
if
(
usSize
==
0
||
usSize
>
sizeof
(
MSG_STRUC
))
{
sRet
=
DRV_USR_SIZE_INVALID
;
sRet
=
DRV_USR_SIZE_INVALID
;
}
else
{
}
else
{
// fill in parameter data
// fill in parameter data
lBytesReturned
=
0
;
lBytesReturned
=
0
;
// set output buffer
// set output buffer
...
@@ -1452,10 +1718,13 @@ short DevGetMessage(unsigned short usDevNumber, unsigned short usSize,
...
@@ -1452,10 +1718,13 @@ short DevGetMessage(unsigned short usDevNumber, unsigned short usSize,
tBuffer
.
ulTimeout
=
ulTimeout
;
tBuffer
.
ulTimeout
=
ulTimeout
;
tBuffer
.
sError
=
sRet
;
tBuffer
.
sError
=
sRet
;
// activate function
// activate function
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLGETMSG
,
(
unsigned
long
)(
&
tBuffer
)))
{
if
(
!
ioctl
(
hDevDrv
,
CIF_IOCTLGETMSG
,
(
unsigned
long
)(
&
tBuffer
)))
{
// fprintf(stderr, "CIF_IOCTLGETMSG: %s\n", strerror(errno));
// fprintf(stderr, "CIF_IOCTLGETMSG: %s\n", strerror(errno));
sRet
=
DRV_USR_COMM_ERR
;
sRet
=
DRV_USR_COMM_ERR
;
}
else
{
}
else
{
memcpy
(
ptMessage
,
&
tBuffer
.
tMsg
,
sizeof
(
MSG_STRUC
));
memcpy
(
ptMessage
,
&
tBuffer
.
tMsg
,
sizeof
(
MSG_STRUC
));
sRet
=
tBuffer
.
sError
;
sRet
=
tBuffer
.
sError
;
}
}
...
@@ -1481,14 +1750,16 @@ short DevGetMessage(unsigned short usDevNumber, unsigned short usSize,
...
@@ -1481,14 +1750,16 @@ short DevGetMessage(unsigned short usDevNumber, unsigned short usSize,
#define TO_LAST_MSG 15000L
#define TO_LAST_MSG 15000L
// File data structure
// File data structure
typedef
struct
tagFILEDATA
{
typedef
struct
tagFILEDATA
{
int
fd
;
int
fd
;
// struct stat *Info;//struct _stat *Info;
// struct stat *Info;//struct _stat *Info;
char
*
pabBuffer
;
char
*
pabBuffer
;
int
lSize
;
int
lSize
;
}
FILEDATA
;
}
FILEDATA
;
typedef
struct
tagDEVICE_TYPE_INFO
{
typedef
struct
tagDEVICE_TYPE_INFO
{
unsigned
char
bHerstellerkennung
;
unsigned
char
bHerstellerkennung
;
unsigned
char
bDeviceType
;
unsigned
char
bDeviceType
;
unsigned
char
bDeviceModel
;
unsigned
char
bDeviceModel
;
...
@@ -1508,8 +1779,10 @@ typedef struct tagDEVICE_TYPE_INFO {
...
@@ -1508,8 +1779,10 @@ typedef struct tagDEVICE_TYPE_INFO {
<En> */
<En> */
void
closeFile
(
FILEDATA
*
ptFile
)
void
closeFile
(
FILEDATA
*
ptFile
)
{
{
if
(
ptFile
->
fd
>=
0
)
{
if
(
ptFile
->
fd
>=
0
)
if
(
ptFile
->
pabBuffer
!=
NULL
)
{
{
if
(
ptFile
->
pabBuffer
!=
NULL
)
{
free
(
ptFile
->
pabBuffer
);
free
(
ptFile
->
pabBuffer
);
}
}
close
(
ptFile
->
fd
);
close
(
ptFile
->
fd
);
...
@@ -1539,30 +1812,41 @@ short openFile(const char* fileName, FILEDATA* ptFile)
...
@@ -1539,30 +1812,41 @@ short openFile(const char* fileName, FILEDATA* ptFile)
// open the existing file
// open the existing file
ptFile
->
fd
=
open
(
fileName
,
O_RDONLY
);
ptFile
->
fd
=
open
(
fileName
,
O_RDONLY
);
if
(
ptFile
->
fd
<
0
)
{
if
(
ptFile
->
fd
<
0
)
{
// File not opend
// File not opend
sRet
=
DRV_USR_FILE_OPEN_FAILED
;
sRet
=
DRV_USR_FILE_OPEN_FAILED
;
}
else
{
}
else
{
// Get the file size
// Get the file size
ptFile
->
lSize
=
lseek
(
ptFile
->
fd
,
0
,
SEEK_END
);
ptFile
->
lSize
=
lseek
(
ptFile
->
fd
,
0
,
SEEK_END
);
if
(
ptFile
->
lSize
<=
0
)
{
if
(
ptFile
->
lSize
<=
0
)
{
// File size is zero
// File size is zero
sRet
=
DRV_USR_FILE_SIZE_ZERO
;
sRet
=
DRV_USR_FILE_SIZE_ZERO
;
}
else
{
}
else
{
if
(
lseek
(
ptFile
->
fd
,
0
,
SEEK_SET
)
<
0
)
if
(
lseek
(
ptFile
->
fd
,
0
,
SEEK_SET
)
<
0
)
sRet
=
DRV_USR_FILE_READ_FAILED
;
sRet
=
DRV_USR_FILE_READ_FAILED
;
else
{
else
{
// Allocate memory for file data
// Allocate memory for file data
if
((
ptFile
->
pabBuffer
=
(
char
*
)
malloc
(
ptFile
->
lSize
))
==
NULL
)
{
if
((
ptFile
->
pabBuffer
=
(
char
*
)
malloc
(
ptFile
->
lSize
))
==
NULL
)
{
// Error by memory allocation
// Error by memory allocation
sRet
=
DRV_USR_FILE_NO_MEMORY
;
sRet
=
DRV_USR_FILE_NO_MEMORY
;
closeFile
(
ptFile
);
closeFile
(
ptFile
);
}
else
{
}
else
{
// Read file data into memory
// Read file data into memory
if
((
lNumberOfBytesRead
=
read
(
ptFile
->
fd
,
// handle of file to read
if
((
lNumberOfBytesRead
=
read
(
ptFile
->
fd
,
// handle of file to read
ptFile
->
pabBuffer
,
// address of buffer that receives data
ptFile
->
pabBuffer
,
// address of buffer that receives data
ptFile
->
lSize
))
ptFile
->
lSize
))
<
0
)
<
0
)
{
// number of bytes to read
{
// number of bytes to read
// File read into memory failed
// File read into memory failed
sRet
=
DRV_USR_FILE_READ_FAILED
;
sRet
=
DRV_USR_FILE_READ_FAILED
;
closeFile
(
ptFile
);
closeFile
(
ptFile
);
...
@@ -1586,17 +1870,24 @@ short FreeRecvMailbox(unsigned short usDevNumber)
...
@@ -1586,17 +1870,24 @@ short FreeRecvMailbox(unsigned short usDevNumber)
// Read until no msg available
// Read until no msg available
usIdx
=
0
;
usIdx
=
0
;
do
{
do
if
((
sRet
=
DevGetMBXState
(
usDevNumber
,
&
usDevState
,
&
usHostState
))
{
!=
DRV_NO_ERROR
)
{
if
((
sRet
=
DevGetMBXState
(
usDevNumber
,
&
usDevState
,
&
usHostState
))
!=
DRV_NO_ERROR
)
{
// Something wrong, end function
// Something wrong, end function
break
;
break
;
}
else
{
}
else
{
// Check if message available
// Check if message available
if
(
usHostState
==
HOST_MBX_FULL
)
{
if
(
usHostState
==
HOST_MBX_FULL
)
{
// Read message and throw away
// Read message and throw away
DevGetMessage
(
usDevNumber
,
sizeof
(
MSG_STRUC
),
&
tRecvMsg
,
100L
);
DevGetMessage
(
usDevNumber
,
sizeof
(
MSG_STRUC
),
&
tRecvMsg
,
100L
);
}
else
{
}
else
{
break
;
break
;
}
}
}
}
...
@@ -1609,8 +1900,8 @@ short FreeRecvMailbox(unsigned short usDevNumber)
...
@@ -1609,8 +1900,8 @@ short FreeRecvMailbox(unsigned short usDevNumber)
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
// Create checksum
// Create checksum
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
unsigned
short
CreateChecksum
(
unsigned
short
CreateChecksum
(
unsigned
char
*
pabData
,
int
lDataLen
,
unsigned
char
*
pabData
,
int
lDataLen
,
MSG_STRUC
*
ptSendMsg
)
MSG_STRUC
*
ptSendMsg
)
{
{
int
lIdx
,
lTempLen
;
int
lIdx
,
lTempLen
;
unsigned
short
usCheckSum
,
usTemp
;
unsigned
short
usCheckSum
,
usTemp
;
...
@@ -1623,7 +1914,8 @@ unsigned short CreateChecksum(
...
@@ -1623,7 +1914,8 @@ unsigned short CreateChecksum(
pByte
=
&
ptSendMsg
->
data
[
3
];
pByte
=
&
ptSendMsg
->
data
[
3
];
// Calculate the Checksum, start with the first message Msg.d[3] up to
// Calculate the Checksum, start with the first message Msg.d[3] up to
// Msg.d[64]
// Msg.d[64]
for
(
lIdx
=
0
;
lIdx
<
31
;
lIdx
++
)
{
for
(
lIdx
=
0
;
lIdx
<
31
;
lIdx
++
)
{
usTemp
=
(
*
(
pByte
+
1
));
usTemp
=
(
*
(
pByte
+
1
));
usTemp
=
(
unsigned
short
)((
usTemp
<<
8
)
|
(
*
pByte
));
usTemp
=
(
unsigned
short
)((
usTemp
<<
8
)
|
(
*
pByte
));
usCheckSum
=
(
unsigned
short
)(
usCheckSum
+
usTemp
);
usCheckSum
=
(
unsigned
short
)(
usCheckSum
+
usTemp
);
...
@@ -1632,7 +1924,8 @@ unsigned short CreateChecksum(
...
@@ -1632,7 +1924,8 @@ unsigned short CreateChecksum(
pByte
=
&
pabData
[
64
];
pByte
=
&
pabData
[
64
];
// Create cheksum for the rest of the file
// Create cheksum for the rest of the file
do
{
do
{
usTemp
=
(
*
(
pByte
+
1
));
usTemp
=
(
*
(
pByte
+
1
));
usTemp
=
(
unsigned
short
)((
usTemp
<<
8
)
|
(
*
pByte
));
usTemp
=
(
unsigned
short
)((
usTemp
<<
8
)
|
(
*
pByte
));
usCheckSum
=
(
unsigned
short
)(
usCheckSum
+
usTemp
);
usCheckSum
=
(
unsigned
short
)(
usCheckSum
+
usTemp
);
...
@@ -1648,26 +1941,33 @@ unsigned short CreateChecksum(
...
@@ -1648,26 +1941,33 @@ unsigned short CreateChecksum(
// Transfer messages
// Transfer messages
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
short
TransferMessage
(
unsigned
short
usDevNumber
,
MSG_STRUC
*
ptSendMsg
,
short
TransferMessage
(
unsigned
short
usDevNumber
,
MSG_STRUC
*
ptSendMsg
,
MSG_STRUC
*
ptRecvMsg
,
long
lTimeout
)
MSG_STRUC
*
ptRecvMsg
,
long
lTimeout
)
{
{
int
lCount
=
0
;
int
lCount
=
0
;
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
if
((
sRet
=
DevPutMessage
(
usDevNumber
,
ptSendMsg
,
TO_SEND_MSG
))
if
((
sRet
=
DevPutMessage
(
usDevNumber
,
ptSendMsg
,
TO_SEND_MSG
))
==
==
DRV_NO_ERROR
)
{
DRV_NO_ERROR
)
do
{
{
if
((
sRet
=
DevGetMessage
(
do
usDevNumber
,
sizeof
(
MSG_STRUC
),
ptRecvMsg
,
lTimeout
))
{
==
DRV_NO_ERROR
)
{
if
((
sRet
=
DevGetMessage
(
usDevNumber
,
sizeof
(
MSG_STRUC
),
ptRecvMsg
,
lTimeout
))
==
DRV_NO_ERROR
)
{
// Check on message errors
// Check on message errors
if
((
ptRecvMsg
->
tx
==
ptSendMsg
->
rx
)
&&
(
ptRecvMsg
->
rx
==
ptSendMsg
->
tx
)
if
((
ptRecvMsg
->
tx
==
ptSendMsg
->
rx
)
&&
&&
(
ptRecvMsg
->
a
==
ptSendMsg
->
b
)
&&
(
ptRecvMsg
->
b
==
0
)
(
ptRecvMsg
->
rx
==
ptSendMsg
->
tx
)
&&
&&
(
ptRecvMsg
->
nr
==
ptSendMsg
->
nr
))
{
(
ptRecvMsg
->
a
==
ptSendMsg
->
b
)
&&
(
ptRecvMsg
->
b
==
0
)
&&
(
ptRecvMsg
->
nr
==
ptSendMsg
->
nr
))
{
// Check on message error
// Check on message error
if
(
ptRecvMsg
->
f
!=
0
)
{
if
(
ptRecvMsg
->
f
!=
0
)
{
sRet
=
(
short
)(
ptRecvMsg
->
f
+
DRV_RCS_ERROR_OFFSET
);
sRet
=
(
short
)(
ptRecvMsg
->
f
+
DRV_RCS_ERROR_OFFSET
);
break
;
break
;
}
else
{
}
else
{
break
;
break
;
}
}
}
}
...
@@ -1692,7 +1992,8 @@ short ReadDeviceInformation(unsigned short usDevNumber, const char* fileName)
...
@@ -1692,7 +1992,8 @@ short ReadDeviceInformation(unsigned short usDevNumber, const char* fileName)
memset
(
&
tSendMsg
,
0
,
sizeof
(
MSG_STRUC
));
memset
(
&
tSendMsg
,
0
,
sizeof
(
MSG_STRUC
));
memset
(
&
tRecvMsg
,
0
,
sizeof
(
MSG_STRUC
));
memset
(
&
tRecvMsg
,
0
,
sizeof
(
MSG_STRUC
));
if
((
sRet
=
FreeRecvMailbox
(
usDevNumber
))
==
DRV_NO_ERROR
)
{
if
((
sRet
=
FreeRecvMailbox
(
usDevNumber
))
==
DRV_NO_ERROR
)
{
// Insert data into message
// Insert data into message
tSendMsg
.
rx
=
RCS_TASK
;
tSendMsg
.
rx
=
RCS_TASK
;
tSendMsg
.
tx
=
MSG_SYSTEM_TX
;
tSendMsg
.
tx
=
MSG_SYSTEM_TX
;
...
@@ -1704,14 +2005,17 @@ short ReadDeviceInformation(unsigned short usDevNumber, const char* fileName)
...
@@ -1704,14 +2005,17 @@ short ReadDeviceInformation(unsigned short usDevNumber, const char* fileName)
tSendMsg
.
e
=
0
;
tSendMsg
.
e
=
0
;
// Insert data
// Insert data
tSendMsg
.
data
[
0
]
=
MODE_GET_PROJ_WERTE_HW
;
tSendMsg
.
data
[
0
]
=
MODE_GET_PROJ_WERTE_HW
;
if
((
sRet
=
TransferMessage
(
usDevNumber
,
&
tSendMsg
,
&
tRecvMsg
,
TO_SEND_MSG
))
if
((
sRet
=
TransferMessage
(
usDevNumber
,
&
tSendMsg
,
&
tRecvMsg
,
==
DRV_NO_ERROR
)
{
TO_SEND_MSG
))
==
DRV_NO_ERROR
)
{
// Check entry
// Check entry
dwStrLen
=
strlen
(
fileName
);
dwStrLen
=
strlen
(
fileName
);
pInfo
=
(
DEVICE_TYPE_INFO
*
)
&
tRecvMsg
.
data
[
0
];
pInfo
=
(
DEVICE_TYPE_INFO
*
)
&
tRecvMsg
.
data
[
0
];
if
((
pInfo
->
bHerstellerkennung
!=
(
char
)(
toupper
(
fileName
[
dwStrLen
-
3
])))
if
((
pInfo
->
bHerstellerkennung
!=
||
(
pInfo
->
bDeviceType
!=
(
char
)(
toupper
(
fileName
[
dwStrLen
-
2
])))
(
char
)(
toupper
(
fileName
[
dwStrLen
-
3
])))
||
||
(
pInfo
->
bDeviceModel
!=
(
char
)(
toupper
(
fileName
[
dwStrLen
-
1
]))))
{
(
pInfo
->
bDeviceType
!=
(
char
)(
toupper
(
fileName
[
dwStrLen
-
2
])))
||
(
pInfo
->
bDeviceModel
!=
(
char
)(
toupper
(
fileName
[
dwStrLen
-
1
]))))
{
sRet
=
DRV_USR_INVALID_FILETYPE
;
sRet
=
DRV_USR_INVALID_FILETYPE
;
}
}
}
}
...
@@ -1732,8 +2036,8 @@ short ReadDeviceInformation(unsigned short usDevNumber, const char* fileName)
...
@@ -1732,8 +2036,8 @@ short ReadDeviceInformation(unsigned short usDevNumber, const char* fileName)
Return : DRV_NO_ERROR - Download successfully
Return : DRV_NO_ERROR - Download successfully
=================================================================================
=================================================================================
<En> */
<En> */
short
RunFirmwareDownload
(
short
RunFirmwareDownload
(
unsigned
short
usDevNumber
,
FILEDATA
*
ptFile
,
unsigned
short
usDevNumber
,
FILEDATA
*
ptFile
,
unsigned
long
*
pdwByte
)
unsigned
long
*
pdwByte
)
{
{
int
lFileLength
,
lSendLen
,
lActIdx
;
int
lFileLength
,
lSendLen
,
lActIdx
;
unsigned
short
usCheckSum
,
usTemp
;
unsigned
short
usCheckSum
,
usTemp
;
...
@@ -1764,8 +2068,10 @@ short RunFirmwareDownload(
...
@@ -1764,8 +2068,10 @@ short RunFirmwareDownload(
dwState
=
RCS_FIRST_MSK
;
dwState
=
RCS_FIRST_MSK
;
fRet
=
TRUE
;
fRet
=
TRUE
;
// Run download
// Run download
do
{
do
switch
(
dwState
)
{
{
switch
(
dwState
)
{
//--------------------------
//--------------------------
// Send first message
// Send first message
//--------------------------
//--------------------------
...
@@ -1799,12 +2105,14 @@ short RunFirmwareDownload(
...
@@ -1799,12 +2105,14 @@ short RunFirmwareDownload(
tSendMsg
.
data
[
2
]
=
(
unsigned
char
)((
usCheckSum
>>
8
)
&
0x00FF
);
tSendMsg
.
data
[
2
]
=
(
unsigned
char
)((
usCheckSum
>>
8
)
&
0x00FF
);
// Process message
// Process message
if
((
sRet
if
((
sRet
=
TransferMessage
(
usDevNumber
,
&
tSendMsg
,
&
tRecvMsg
,
=
TransferMessage
(
usDevNumber
,
&
tSendMsg
,
&
tRecvMsg
,
TO_1ST_MSG
)
)
TO_1ST_MSG
))
!=
DRV_NO_ERROR
)
!=
DRV_NO_ERROR
)
{
{
// Could not process this message
// Could not process this message
fRet
=
FALSE
;
fRet
=
FALSE
;
}
else
{
}
else
{
// ----------------------------
// ----------------------------
// Message send second message
// Message send second message
// ----------------------------
// ----------------------------
...
@@ -1826,25 +2134,30 @@ short RunFirmwareDownload(
...
@@ -1826,25 +2134,30 @@ short RunFirmwareDownload(
memcpy
(
&
tSendMsg
.
data
[
0
],
&
tSendMsg
.
data
[
1
],
64
);
memcpy
(
&
tSendMsg
.
data
[
0
],
&
tSendMsg
.
data
[
1
],
64
);
// Insert byte 64 to 239 from the abData[64]
// Insert byte 64 to 239 from the abData[64]
memcpy
(
memcpy
(
&
tSendMsg
.
data
[
64
],
&
pabData
[
64
],
&
tSendMsg
.
data
[
64
],
&
pabData
[
64
],
(
unsigned
char
)(
lSendLen
-
64
));
(
unsigned
char
)(
lSendLen
-
64
));
// Process message
// Process message
if
((
sRet
=
TransferMessage
(
if
((
sRet
=
TransferMessage
(
usDevNumber
,
&
tSendMsg
,
&
tRecvMsg
,
usDevNumber
,
&
tSendMsg
,
&
tRecvMsg
,
TO_1ST_MSG
)
)
TO_1ST_MSG
))
!=
DRV_NO_ERROR
)
!=
DRV_NO_ERROR
)
{
{
// Could not process this message
// Could not process this message
fRet
=
FALSE
;
fRet
=
FALSE
;
}
else
{
}
else
{
// No error, send next message
// No error, send next message
lActIdx
+=
lSendLen
;
// Add send size to actual index
lActIdx
+=
lSendLen
;
// Add send size to actual index
*
pdwByte
=
lActIdx
;
*
pdwByte
=
lActIdx
;
// Calculate next message length
// Calculate next message length
if
(
lFileLength
<=
(
lSendLen
+
lActIdx
))
{
if
(
lFileLength
<=
(
lSendLen
+
lActIdx
))
{
lSendLen
=
lFileLength
-
lActIdx
;
// Set length to rest of data
lSendLen
=
lFileLength
-
lActIdx
;
// Set length to rest of data
dwState
=
RCS_LAST_MSK
;
dwState
=
RCS_LAST_MSK
;
}
else
{
}
else
{
dwState
=
RCS_CONT_MSK
;
dwState
=
RCS_CONT_MSK
;
}
}
}
}
...
@@ -1862,12 +2175,14 @@ short RunFirmwareDownload(
...
@@ -1862,12 +2175,14 @@ short RunFirmwareDownload(
memcpy
(
&
tSendMsg
.
data
[
0
],
&
pabData
[
lActIdx
],
lSendLen
);
memcpy
(
&
tSendMsg
.
data
[
0
],
&
pabData
[
lActIdx
],
lSendLen
);
// Process message
// Process message
if
((
sRet
if
((
sRet
=
TransferMessage
(
usDevNumber
,
&
tSendMsg
,
&
tRecvMsg
,
=
TransferMessage
(
usDevNumber
,
&
tSendMsg
,
&
tRecvMsg
,
TO_CONT_MSG
)
)
TO_CONT_MSG
))
!=
DRV_NO_ERROR
)
!=
DRV_NO_ERROR
)
{
{
// Could not process this message
// Could not process this message
fRet
=
FALSE
;
fRet
=
FALSE
;
}
else
{
}
else
{
// printf("(A)===========================flen = %ld, Sndlen = %ld,
// printf("(A)===========================flen = %ld, Sndlen = %ld,
// ActIdx = %ld\n", lFileLength, lSendLen, lActIdx);
// ActIdx = %ld\n", lFileLength, lSendLen, lActIdx);
// No error, send next message
// No error, send next message
...
@@ -1875,10 +2190,13 @@ short RunFirmwareDownload(
...
@@ -1875,10 +2190,13 @@ short RunFirmwareDownload(
*
pdwByte
=
lActIdx
;
*
pdwByte
=
lActIdx
;
// Calculate next message length
// Calculate next message length
if
(
lFileLength
<=
(
lSendLen
+
lActIdx
))
{
if
(
lFileLength
<=
(
lSendLen
+
lActIdx
))
{
lSendLen
=
lFileLength
-
lActIdx
;
// Set length to rest of data
lSendLen
=
lFileLength
-
lActIdx
;
// Set length to rest of data
dwState
=
RCS_LAST_MSK
;
dwState
=
RCS_LAST_MSK
;
}
else
{
}
else
{
dwState
=
RCS_CONT_MSK
;
dwState
=
RCS_CONT_MSK
;
}
}
}
}
...
@@ -1921,8 +2239,8 @@ short RunFirmwareDownload(
...
@@ -1921,8 +2239,8 @@ short RunFirmwareDownload(
Return : DRV_NO_ERROR - Download successfully
Return : DRV_NO_ERROR - Download successfully
=================================================================================
=================================================================================
<En> */
<En> */
short
RunConfigDownload
(
short
RunConfigDownload
(
unsigned
short
usDevNumber
,
FILEDATA
*
ptFile
,
unsigned
short
usDevNumber
,
FILEDATA
*
ptFile
,
unsigned
long
*
pdwByte
)
unsigned
long
*
pdwByte
)
{
{
unsigned
int
dwState
;
unsigned
int
dwState
;
int
lSendLen
,
lActIdx
,
lOffset
,
lFileLength
;
int
lSendLen
,
lActIdx
,
lOffset
,
lFileLength
;
...
@@ -1962,8 +2280,10 @@ short RunConfigDownload(
...
@@ -1962,8 +2280,10 @@ short RunConfigDownload(
// Set program state
// Set program state
dwState
=
RCS_FIRST_MSK
;
dwState
=
RCS_FIRST_MSK
;
fRet
=
TRUE
;
fRet
=
TRUE
;
do
{
do
switch
(
dwState
)
{
{
switch
(
dwState
)
{
//--------------------------
//--------------------------
// Send first message
// Send first message
//--------------------------
//--------------------------
...
@@ -1971,14 +2291,14 @@ short RunConfigDownload(
...
@@ -1971,14 +2291,14 @@ short RunConfigDownload(
// Set HOST_READY for download, maybe it is disabled
// Set HOST_READY for download, maybe it is disabled
sRet
=
DevSetHostState
(
usDevNumber
,
HOST_READY
,
0L
);
sRet
=
DevSetHostState
(
usDevNumber
,
HOST_READY
,
0L
);
// Insert data into message
// Insert data into message
tSendMsg
.
rx
=
RCS_TASK
;
// Receiver task number
tSendMsg
.
rx
=
RCS_TASK
;
// Receiver task number
tSendMsg
.
tx
=
MSG_SYSTEM_TX
;
// Transmitter task number
tSendMsg
.
tx
=
MSG_SYSTEM_TX
;
// Transmitter task number
tSendMsg
.
ln
=
51
;
// Message length first message
tSendMsg
.
ln
=
51
;
// Message length first message
tSendMsg
.
nr
=
1
;
// Message number
tSendMsg
.
nr
=
1
;
// Message number
tSendMsg
.
a
=
0
;
// Answer byte cleared
tSendMsg
.
a
=
0
;
// Answer byte cleared
tSendMsg
.
f
=
0
;
// Error byte cleared
tSendMsg
.
f
=
0
;
// Error byte cleared
tSendMsg
.
b
=
RCS_B_LOADFKT
;
// Function code
tSendMsg
.
b
=
RCS_B_LOADFKT
;
// Function code
tSendMsg
.
e
=
RCS_FIRST_MSK
;
// First message
tSendMsg
.
e
=
RCS_FIRST_MSK
;
// First message
tSendMsg
.
data
[
0
]
=
MODE_DOWNLOAD_DBM
;
// Download a configuration file
tSendMsg
.
data
[
0
]
=
MODE_DOWNLOAD_DBM
;
// Download a configuration file
// Copy buffer 1st to message
// Copy buffer 1st to message
...
@@ -1988,12 +2308,14 @@ short RunConfigDownload(
...
@@ -1988,12 +2308,14 @@ short RunConfigDownload(
// printf("cifAPI: %ld\n", dwState);
// printf("cifAPI: %ld\n", dwState);
// Process message
// Process message
if
((
sRet
if
((
sRet
=
TransferMessage
(
usDevNumber
,
&
tSendMsg
,
&
tRecvMsg
,
=
TransferMessage
(
usDevNumber
,
&
tSendMsg
,
&
tRecvMsg
,
TO_1ST_MSG
)
)
TO_1ST_MSG
))
!=
DRV_NO_ERROR
)
!=
DRV_NO_ERROR
)
{
{
// Could not process this message
// Could not process this message
fRet
=
FALSE
;
fRet
=
FALSE
;
}
else
{
}
else
{
// Set Index for next message, start at offset 44
// Set Index for next message, start at offset 44
lActIdx
=
44
;
lActIdx
=
44
;
*
pdwByte
=
lActIdx
;
*
pdwByte
=
lActIdx
;
...
@@ -2020,20 +2342,25 @@ short RunConfigDownload(
...
@@ -2020,20 +2342,25 @@ short RunConfigDownload(
memcpy
(
&
tSendMsg
.
data
[
0
],
&
pabData
[
lActIdx
],
lSendLen
);
memcpy
(
&
tSendMsg
.
data
[
0
],
&
pabData
[
lActIdx
],
lSendLen
);
// Process message
// Process message
if
((
sRet
if
((
sRet
=
TransferMessage
(
usDevNumber
,
&
tSendMsg
,
&
tRecvMsg
,
=
TransferMessage
(
usDevNumber
,
&
tSendMsg
,
&
tRecvMsg
,
TO_CONT_MSG
)
)
TO_CONT_MSG
))
!=
DRV_NO_ERROR
)
!=
DRV_NO_ERROR
)
{
{
// Could not process this message
// Could not process this message
fRet
=
FALSE
;
fRet
=
FALSE
;
}
else
{
}
else
{
// No error, send next message
// No error, send next message
lActIdx
+=
lSendLen
;
// Add send size to actual index
lActIdx
+=
lSendLen
;
// Add send size to actual index
*
pdwByte
=
lActIdx
;
*
pdwByte
=
lActIdx
;
// Calculate next message length
// Calculate next message length
if
(
lFileLength
<=
(
lSendLen
+
lActIdx
))
{
if
(
lFileLength
<=
(
lSendLen
+
lActIdx
))
{
lSendLen
=
lFileLength
-
lActIdx
;
// Set length to rest of data
lSendLen
=
lFileLength
-
lActIdx
;
// Set length to rest of data
dwState
=
RCS_LAST_MSK
;
// Set to last mask
dwState
=
RCS_LAST_MSK
;
// Set to last mask
}
else
{
}
else
{
// Continue message
// Continue message
dwState
=
RCS_CONT_MSK
;
dwState
=
RCS_CONT_MSK
;
}
}
...
@@ -2082,16 +2409,18 @@ short RunConfigDownload(
...
@@ -2082,16 +2409,18 @@ short RunConfigDownload(
Return : DRV_NO_ERROR - Download successfully
Return : DRV_NO_ERROR - Download successfully
=================================================================================
=================================================================================
<En> */
<En> */
short
FirmwareDownload
(
short
FirmwareDownload
(
unsigned
short
usDevNumber
,
const
char
*
fileName
,
unsigned
short
usDevNumber
,
const
char
*
fileName
,
unsigned
long
*
pdwByte
)
unsigned
long
*
pdwByte
)
{
{
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
FILEDATA
tFileData
;
FILEDATA
tFileData
;
// Read Device Information
// Read Device Information
if
((
sRet
=
ReadDeviceInformation
(
usDevNumber
,
fileName
))
==
DRV_NO_ERROR
)
{
if
((
sRet
=
ReadDeviceInformation
(
usDevNumber
,
fileName
))
==
DRV_NO_ERROR
)
{
// Firmware name is OK
// Firmware name is OK
if
((
sRet
=
openFile
(
fileName
,
&
tFileData
))
==
DRV_NO_ERROR
)
{
if
((
sRet
=
openFile
(
fileName
,
&
tFileData
))
==
DRV_NO_ERROR
)
{
// Firmware file opened and loaded into RAM
// Firmware file opened and loaded into RAM
sRet
=
RunFirmwareDownload
(
usDevNumber
,
&
tFileData
,
pdwByte
);
sRet
=
RunFirmwareDownload
(
usDevNumber
,
&
tFileData
,
pdwByte
);
closeFile
(
&
tFileData
);
closeFile
(
&
tFileData
);
...
@@ -2112,13 +2441,14 @@ short FirmwareDownload(
...
@@ -2112,13 +2441,14 @@ short FirmwareDownload(
Return : DRV_NO_ERROR - Download successfully
Return : DRV_NO_ERROR - Download successfully
=================================================================================
=================================================================================
<En> */
<En> */
short
ConfigDownload
(
short
ConfigDownload
(
unsigned
short
usDevNumber
,
const
char
*
fileName
,
unsigned
short
usDevNumber
,
const
char
*
fileName
,
unsigned
long
*
pdwByte
)
unsigned
long
*
pdwByte
)
{
{
unsigned
short
sRet
=
DRV_NO_ERROR
;
unsigned
short
sRet
=
DRV_NO_ERROR
;
FILEDATA
tFileData
;
FILEDATA
tFileData
;
if
((
sRet
=
openFile
(
fileName
,
&
tFileData
))
==
DRV_NO_ERROR
)
{
if
((
sRet
=
openFile
(
fileName
,
&
tFileData
))
==
DRV_NO_ERROR
)
{
// Configuration file opened and loaded into RAM
// Configuration file opened and loaded into RAM
sRet
=
RunConfigDownload
(
usDevNumber
,
&
tFileData
,
pdwByte
);
sRet
=
RunConfigDownload
(
usDevNumber
,
&
tFileData
,
pdwByte
);
closeFile
(
&
tFileData
);
closeFile
(
&
tFileData
);
...
@@ -2141,22 +2471,31 @@ short ConfigDownload(
...
@@ -2141,22 +2471,31 @@ short ConfigDownload(
<En> */
<En> */
short
DevDownload
(
unsigned
short
usDevNumber
,
unsigned
short
usMode
,
short
DevDownload
(
unsigned
short
usDevNumber
,
unsigned
short
usMode
,
unsigned
char
*
pszFileName
,
unsigned
long
*
pdwBytes
)
unsigned
char
*
pszFileName
,
unsigned
long
*
pdwBytes
)
{
{
short
sRet
=
DRV_NO_ERROR
;
short
sRet
=
DRV_NO_ERROR
;
// valid handle available, driver is open
// valid handle available, driver is open
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
if
(
hDevDrv
==
INVALID_HANDLE_VALUE
)
{
sRet
=
DRV_USR_NOT_INITIALIZED
;
sRet
=
DRV_USR_NOT_INITIALIZED
;
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
}
else
if
(
usDevNumber
>=
MAX_DEV_BOARDS
)
{
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
sRet
=
DRV_USR_DEV_NUMBER_INVALID
;
}
else
if
((
pdwBytes
==
NULL
)
||
(
pszFileName
==
NULL
)
}
||
(
pdwBytes
==
NULL
))
{
else
if
((
pdwBytes
==
NULL
)
||
(
pszFileName
==
NULL
)
||
(
pdwBytes
==
NULL
))
{
sRet
=
DRV_USR_BUF_PTR_NULL
;
sRet
=
DRV_USR_BUF_PTR_NULL
;
}
else
if
(
strlen
((
const
char
*
)
pszFileName
)
==
0
)
{
}
else
if
(
strlen
((
const
char
*
)
pszFileName
)
==
0
)
{
sRet
=
DRV_USR_FILENAME_INVALID
;
sRet
=
DRV_USR_FILENAME_INVALID
;
}
else
{
}
switch
(
usMode
)
{
else
{
switch
(
usMode
)
{
case
FIRMWARE_DOWNLOAD
:
case
FIRMWARE_DOWNLOAD
:
sRet
=
FirmwareDownload
(
usDevNumber
,
(
const
char
*
)
pszFileName
,
pdwBytes
);
sRet
=
FirmwareDownload
(
usDevNumber
,
(
const
char
*
)
pszFileName
,
pdwBytes
);
break
;
break
;
...
...
profibus/lib/rt/src/dpgdl.c
View file @
ce758cd3
/*
/******************************************************************************
* ProviewR Open Source Process Control.
* *
* Copyright (C) 2005-2019 SSAB EMEA AB.
* SOFTING Industrial Automation GmbH *
*
* Richard-Reitzner-Allee 6 *
* This file is part of ProviewR.
* D-85540 Haar *
*
* Phone: (++49)-(0)89-45656-0 *
* This program is free software; you can redistribute it and/or
* Fax: (++49)-(0)89-45656-399 *
* modify it under the terms of the GNU General Public License as
* *
* published by the Free Software Foundation, either version 2 of
* Copyright (C) SOFTING Industrial Automation GmbH 1995-2012 *
* the License, or (at your option) any later version.
* All Rights Reserved *
*
* *
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************
* *
* SOFTING AG *
* Richard-Reitzner-Allee 6 *
* D-85540 Haar *
* Phone: ++49-89-4 56 56-0 *
* Fax: ++49-89-4 56 56-3 99 *
* *
* Copyright (C) SOFTING AG 1995-2003 *
* All Rights Reserved *
* *
******************************************************************************
FILE_NAME DPGDL.C
FILE_NAME DPGDL.C
PROJECT_NAME PROFIBUS
PROJECT_NAME PROFIBUS
...
@@ -54,11 +20,11 @@ MODULE DPGDL
...
@@ -54,11 +20,11 @@ MODULE DPGDL
COMPONENT_LIBRARY PAPI Lib
COMPONENT_LIBRARY PAPI Lib
PAPI DLL
PAPI DLL
AUTHOR SOFTING
AG
AUTHOR SOFTING
VERSION 5.
22
.0.00.release
VERSION 5.
45
.0.00.release
DATE
26-February-199
9
DATE
Dezember-200
9
STATUS finished
STATUS finished
...
@@ -103,7 +69,9 @@ LOCAL_DATA
...
@@ -103,7 +69,9 @@ LOCAL_DATA
#endif
#endif
FUNCTION
PUBLIC
INT16
dpgdl_get_data_len
(
IN
INT16
result
,
IN
USIGN8
service
,
FUNCTION
PUBLIC
INT16
dpgdl_get_data_len
(
IN
INT16
result
,
IN
USIGN8
service
,
IN
USIGN8
primitive
,
IN
USIGN8
FAR
*
data_ptr
,
OUT
INT16
FAR
*
data_len_ptr
)
IN
USIGN8
primitive
,
IN
USIGN8
FAR
*
data_ptr
,
OUT
INT16
FAR
*
data_len_ptr
)
/*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*/
/* FUNCTIONAL_DESCRIPTION */
/* FUNCTIONAL_DESCRIPTION */
/*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*/
...
@@ -116,11 +84,14 @@ FUNCTION PUBLIC INT16 dpgdl_get_data_len(IN INT16 result, IN USIGN8 service,
...
@@ -116,11 +84,14 @@ FUNCTION PUBLIC INT16 dpgdl_get_data_len(IN INT16 result, IN USIGN8 service,
FUNCTION_BODY
FUNCTION_BODY
switch
(
primitive
)
{
switch
(
primitive
)
/*--- USER REQUESTS ----------------------------------------------------*/
{
/*--- USER REQUESTS ----------------------------------------------------*/
case
REQ
:
{
case
REQ
:
switch
(
service
)
{
{
switch
(
service
)
{
case
DP_DATA_TRANSFER
:
case
DP_DATA_TRANSFER
:
*
data_len_ptr
=
0
;
*
data_len_ptr
=
0
;
break
;
break
;
...
@@ -144,15 +115,16 @@ FUNCTION PUBLIC INT16 dpgdl_get_data_len(IN INT16 result, IN USIGN8 service,
...
@@ -144,15 +115,16 @@ FUNCTION PUBLIC INT16 dpgdl_get_data_len(IN INT16 result, IN USIGN8 service,
break
;
break
;
case
DP_DOWNLOAD_LOC
:
case
DP_DOWNLOAD_LOC
:
case
DP_DOWNLOAD
:
{
case
DP_DOWNLOAD
:
if
(((
T_DP_DOWNLOAD_REQ
FAR
*
)(
data_ptr
))
->
data_len
{
>
DP_MAX_DOWNLOAD_DATA_LEN
)
{
if
(((
T_DP_DOWNLOAD_REQ
FAR
*
)(
data_ptr
))
->
data_len
>
result
=
E_IF_INVALID_DATA_SIZE
;
DP_MAX_DOWNLOAD_DATA_LEN
)
{
return
(
E_IF_INVALID_DATA_SIZE
);
return
(
E_IF_INVALID_DATA_SIZE
);
}
}
*
data_len_ptr
=
sizeof
(
T_DP_DOWNLOAD_REQ
)
*
data_len_ptr
=
sizeof
(
T_DP_DOWNLOAD_REQ
)
+
+
((
T_DP_DOWNLOAD_REQ
FAR
*
)(
data_ptr
))
->
data_len
;
((
T_DP_DOWNLOAD_REQ
FAR
*
)(
data_ptr
))
->
data_len
;
break
;
break
;
}
}
...
@@ -171,31 +143,33 @@ FUNCTION PUBLIC INT16 dpgdl_get_data_len(IN INT16 result, IN USIGN8 service,
...
@@ -171,31 +143,33 @@ FUNCTION PUBLIC INT16 dpgdl_get_data_len(IN INT16 result, IN USIGN8 service,
break
;
break
;
case
DP_SET_PRM
:
case
DP_SET_PRM
:
case
DP_SET_PRM_LOC
:
{
case
DP_SET_PRM_LOC
:
{
service_data_len
=
swap_16_intel_motorola
(
service_data_len
=
swap_16_intel_motorola
(
((
T_DP_SET_PRM_REQ
FAR
*
)(
data_ptr
))
->
prm_data
.
prm_data_len
);
((
T_DP_SET_PRM_REQ
FAR
*
)(
data_ptr
))
->
prm_data
.
prm_data_len
);
if
(
service_data_len
>
DP_MAX_PRM_DATA_LEN
)
{
if
(
service_data_len
>
DP_MAX_PRM_DATA_LEN
)
result
=
E_IF_INVALID_DATA_SIZE
;
{
return
(
E_IF_INVALID_DATA_SIZE
);
return
(
E_IF_INVALID_DATA_SIZE
);
}
}
*
data_len_ptr
*
data_len_ptr
=
=
sizeof
(
T_DP_SET_PRM_REQ
)
-
sizeof
(
T_DP_PRM_DATA
)
+
service_data_len
;
sizeof
(
T_DP_SET_PRM_REQ
)
-
sizeof
(
T_DP_PRM_DATA
)
+
service_data_len
;
break
;
break
;
}
}
case
DP_CHK_CFG
:
{
case
DP_CHK_CFG
:
{
service_data_len
=
swap_16_intel_motorola
(
service_data_len
=
swap_16_intel_motorola
(
((
T_DP_CHK_CFG_REQ
FAR
*
)(
data_ptr
))
->
cfg_data
.
cfg_data_len
);
((
T_DP_CHK_CFG_REQ
FAR
*
)(
data_ptr
))
->
cfg_data
.
cfg_data_len
);
if
(
service_data_len
>
DP_MAX_CFG_DATA_LEN
)
{
if
(
service_data_len
>
DP_MAX_CFG_DATA_LEN
)
result
=
E_IF_INVALID_DATA_SIZE
;
{
return
(
E_IF_INVALID_DATA_SIZE
);
return
(
E_IF_INVALID_DATA_SIZE
);
}
}
*
data_len_ptr
*
data_len_ptr
=
=
sizeof
(
T_DP_CHK_CFG_REQ
)
-
sizeof
(
T_DP_CFG_DATA
)
+
service_data_len
;
sizeof
(
T_DP_CHK_CFG_REQ
)
-
sizeof
(
T_DP_CFG_DATA
)
+
service_data_len
;
break
;
break
;
}
}
...
@@ -212,27 +186,30 @@ FUNCTION PUBLIC INT16 dpgdl_get_data_len(IN INT16 result, IN USIGN8 service,
...
@@ -212,27 +186,30 @@ FUNCTION PUBLIC INT16 dpgdl_get_data_len(IN INT16 result, IN USIGN8 service,
*
data_len_ptr
=
sizeof
(
T_DP_RD_OUTP_REQ
);
*
data_len_ptr
=
sizeof
(
T_DP_RD_OUTP_REQ
);
break
;
break
;
case
DP_DATA_EXCHANGE
:
{
case
DP_DATA_EXCHANGE
:
if
(((
T_DP_DATA_EXCHANGE_REQ
FAR
*
)(
data_ptr
))
->
outp_data_len
{
>
DP_MAX_OUTPUT_DATA_LEN
)
{
if
(((
T_DP_DATA_EXCHANGE_REQ
FAR
*
)(
data_ptr
))
->
outp_data_len
>
result
=
E_IF_INVALID_DATA_SIZE
;
DP_MAX_OUTPUT_DATA_LEN
)
{
return
(
E_IF_INVALID_DATA_SIZE
);
return
(
E_IF_INVALID_DATA_SIZE
);
}
}
*
data_len_ptr
=
sizeof
(
T_DP_DATA_EXCHANGE_REQ
)
*
data_len_ptr
=
sizeof
(
T_DP_DATA_EXCHANGE_REQ
)
+
+
((
T_DP_DATA_EXCHANGE_REQ
FAR
*
)(
data_ptr
))
->
outp_data_len
;
((
T_DP_DATA_EXCHANGE_REQ
FAR
*
)(
data_ptr
))
->
outp_data_len
;
break
;
break
;
}
}
case
DP_SET_SLAVE_ADD
:
{
case
DP_SET_SLAVE_ADD
:
if
(((
T_DP_SET_SLAVE_ADD_REQ
FAR
*
)(
data_ptr
))
->
rem_slave_data_len
{
>
DP_MAX_REM_SLAVE_DATA_LEN
)
{
if
(((
T_DP_SET_SLAVE_ADD_REQ
FAR
*
)(
data_ptr
))
->
rem_slave_data_len
>
result
=
E_IF_INVALID_DATA_SIZE
;
DP_MAX_REM_SLAVE_DATA_LEN
)
{
return
(
E_IF_INVALID_DATA_SIZE
);
return
(
E_IF_INVALID_DATA_SIZE
);
}
}
*
data_len_ptr
=
sizeof
(
T_DP_SET_SLAVE_ADD_REQ
)
*
data_len_ptr
=
+
((
T_DP_SET_SLAVE_ADD_REQ
FAR
*
)(
data_ptr
))
->
rem_slave_data_len
;
sizeof
(
T_DP_SET_SLAVE_ADD_REQ
)
+
((
T_DP_SET_SLAVE_ADD_REQ
FAR
*
)(
data_ptr
))
->
rem_slave_data_len
;
break
;
break
;
}
}
...
@@ -249,37 +226,41 @@ FUNCTION PUBLIC INT16 dpgdl_get_data_len(IN INT16 result, IN USIGN8 service,
...
@@ -249,37 +226,41 @@ FUNCTION PUBLIC INT16 dpgdl_get_data_len(IN INT16 result, IN USIGN8 service,
*
data_len_ptr
=
0
;
*
data_len_ptr
=
0
;
break
;
break
;
case
DP_SET_BUSPARAMETER
:
{
case
DP_SET_BUSPARAMETER
:
if
((((
T_DP_SET_BUSPARAMETER_REQ
FAR
*
)(
data_ptr
))
->
master_user_data_len
{
>
DP_MAX_SET_BUSPARAMETER_LEN
)
if
((((
T_DP_SET_BUSPARAMETER_REQ
FAR
*
)(
data_ptr
))
->
master_user_data_len
>
||
(((
T_DP_SET_BUSPARAMETER_REQ
FAR
*
)(
data_ptr
))
->
master_user_data_len
DP_MAX_SET_BUSPARAMETER_LEN
)
||
<
DP_MASTER_USER_DATA_LEN
))
{
(((
T_DP_SET_BUSPARAMETER_REQ
FAR
*
)(
data_ptr
))
->
master_user_data_len
<
result
=
E_IF_INVALID_DATA_SIZE
;
DP_MASTER_USER_DATA_LEN
))
{
return
(
E_IF_INVALID_DATA_SIZE
);
return
(
E_IF_INVALID_DATA_SIZE
);
}
}
*
data_len_ptr
=
sizeof
(
T_DP_SET_BUSPARAMETER_REQ
)
*
data_len_ptr
=
+
((
T_DP_SET_BUSPARAMETER_REQ
FAR
*
)(
data_ptr
))
->
master_user_data_len
sizeof
(
T_DP_SET_BUSPARAMETER_REQ
)
+
-
DP_MASTER_USER_DATA_LEN
;
((
T_DP_SET_BUSPARAMETER_REQ
FAR
*
)(
data_ptr
))
->
master_user_data_len
-
DP_MASTER_USER_DATA_LEN
;
break
;
break
;
}
}
case
DP_SET_MASTER_PARAM
:
{
case
DP_SET_MASTER_PARAM
:
if
(((
T_DP_SET_MASTER_PARAM_REQ
FAR
*
)(
data_ptr
))
->
data_len
{
>
DP_MAX_TELEGRAM_LEN
)
{
if
(((
T_DP_SET_MASTER_PARAM_REQ
FAR
*
)(
data_ptr
))
->
data_len
>
result
=
E_IF_INVALID_DATA_SIZE
;
DP_MAX_TELEGRAM_LEN
)
{
return
(
E_IF_INVALID_DATA_SIZE
);
return
(
E_IF_INVALID_DATA_SIZE
);
}
}
*
data_len_ptr
=
sizeof
(
T_DP_SET_MASTER_PARAM_REQ
)
*
data_len_ptr
=
sizeof
(
T_DP_SET_MASTER_PARAM_REQ
)
+
+
((
T_DP_SET_MASTER_PARAM_REQ
FAR
*
)(
data_ptr
))
->
data_len
;
((
T_DP_SET_MASTER_PARAM_REQ
FAR
*
)(
data_ptr
))
->
data_len
;
break
;
break
;
}
}
case
DP_INITIATE
:
case
DP_INITIATE
:
*
data_len_ptr
=
sizeof
(
T_DP_INITIATE_REQ
)
*
data_len_ptr
=
+
((
T_DP_INITIATE_REQ
FAR
*
)(
data_ptr
))
->
add_addr_param
.
s_len
sizeof
(
T_DP_INITIATE_REQ
)
+
+
((
T_DP_INITIATE_REQ
FAR
*
)(
data_ptr
))
->
add_addr_param
.
d_len
;
((
T_DP_INITIATE_REQ
FAR
*
)(
data_ptr
))
->
add_addr_param
.
s_len
+
((
T_DP_INITIATE_REQ
FAR
*
)(
data_ptr
))
->
add_addr_param
.
d_len
;
break
;
break
;
case
DP_ABORT
:
case
DP_ABORT
:
...
@@ -291,27 +272,28 @@ FUNCTION PUBLIC INT16 dpgdl_get_data_len(IN INT16 result, IN USIGN8 service,
...
@@ -291,27 +272,28 @@ FUNCTION PUBLIC INT16 dpgdl_get_data_len(IN INT16 result, IN USIGN8 service,
break
;
break
;
case
DP_WRITE
:
case
DP_WRITE
:
*
data_len_ptr
*
data_len_ptr
=
=
sizeof
(
T_DP_WRITE_REQ
)
+
((
T_DP_WRITE_REQ
FAR
*
)(
data_ptr
))
->
length
;
sizeof
(
T_DP_WRITE_REQ
)
+
((
T_DP_WRITE_REQ
FAR
*
)(
data_ptr
))
->
length
;
break
;
break
;
case
DP_DATA_TRANSPORT
:
case
DP_DATA_TRANSPORT
:
*
data_len_ptr
=
sizeof
(
T_DP_DATA_TRANSPORT_REQ
)
*
data_len_ptr
=
sizeof
(
T_DP_DATA_TRANSPORT_REQ
)
+
+
((
T_DP_DATA_TRANSPORT_REQ
FAR
*
)(
data_ptr
))
->
length
;
((
T_DP_DATA_TRANSPORT_REQ
FAR
*
)(
data_ptr
))
->
length
;
break
;
break
;
default:
default:
result
=
E_IF_INVALID_SERVICE
;
return
(
E_IF_INVALID_SERVICE
);
return
(
E_IF_INVALID_SERVICE
);
}
/* switch serivce */
}
/* switch serivce */
break
;
break
;
}
/* case REQ */
}
/* case REQ */
/*---- USER RESPONSES --------------------------------------------------*/
/*---- USER RESPONSES --------------------------------------------------*/
case
RES
:
{
case
RES
:
switch
(
service
)
{
{
switch
(
service
)
{
case
DP_ACT_PARAM
:
case
DP_ACT_PARAM
:
*
data_len_ptr
=
sizeof
(
T_DP_ACT_PARAM_RES_CON
);
*
data_len_ptr
=
sizeof
(
T_DP_ACT_PARAM_RES_CON
);
break
;
break
;
...
@@ -325,47 +307,45 @@ FUNCTION PUBLIC INT16 dpgdl_get_data_len(IN INT16 result, IN USIGN8 service,
...
@@ -325,47 +307,45 @@ FUNCTION PUBLIC INT16 dpgdl_get_data_len(IN INT16 result, IN USIGN8 service,
*
data_len_ptr
=
sizeof
(
T_DP_END_SEQ_RES_CON
);
*
data_len_ptr
=
sizeof
(
T_DP_END_SEQ_RES_CON
);
break
;
break
;
case
DP_UPLOAD
:
{
case
DP_UPLOAD
:
if
(((
T_DP_UPLOAD_RES_CON
FAR
*
)(
data_ptr
))
->
data_len
{
>
DP_MAX_UPLOAD_DATA_LEN
)
{
if
(((
T_DP_UPLOAD_RES_CON
FAR
*
)(
data_ptr
))
->
data_len
>
result
=
E_IF_INVALID_DATA_SIZE
;
DP_MAX_UPLOAD_DATA_LEN
)
{
return
(
E_IF_INVALID_DATA_SIZE
);
return
(
E_IF_INVALID_DATA_SIZE
);
}
}
*
data_len_ptr
=
sizeof
(
T_DP_UPLOAD_RES_CON
)
*
data_len_ptr
=
sizeof
(
T_DP_UPLOAD_RES_CON
)
+
+
((
T_DP_UPLOAD_RES_CON
FAR
*
)(
data_ptr
))
->
data_len
;
((
T_DP_UPLOAD_RES_CON
FAR
*
)(
data_ptr
))
->
data_len
;
break
;
break
;
}
}
case
DP_GET_MASTER_DIAG
:
{
case
DP_GET_MASTER_DIAG
:
if
(((
T_DP_GET_MASTER_DIAG_RES_CON
FAR
*
)(
data_ptr
))
->
data_len
{
>
DP_MAX_TELEGRAM_LEN
)
{
if
(((
T_DP_GET_MASTER_DIAG_RES_CON
FAR
*
)(
data_ptr
))
->
data_len
>
result
=
E_IF_INVALID_DATA_SIZE
;
DP_MAX_TELEGRAM_LEN
)
{
return
(
E_IF_INVALID_DATA_SIZE
);
return
(
E_IF_INVALID_DATA_SIZE
);
}
}
*
data_len_ptr
=
sizeof
(
T_DP_GET_MASTER_DIAG_RES_CON
)
*
data_len_ptr
=
sizeof
(
T_DP_GET_MASTER_DIAG_RES_CON
)
+
+
((
T_DP_GET_MASTER_DIAG_RES_CON
FAR
*
)(
data_ptr
))
->
data_len
;
((
T_DP_GET_MASTER_DIAG_RES_CON
FAR
*
)(
data_ptr
))
->
data_len
;
break
;
break
;
}
}
default:
default:
result
=
E_IF_INVALID_SERVICE
;
return
(
E_IF_INVALID_SERVICE
);
return
(
E_IF_INVALID_SERVICE
);
}
/* switch serivce */
}
/* switch serivce */
break
;
break
;
}
/* case RES */
}
/* case RES */
/*---- WRONG PRIMITIVE -------------------------------------------------*/
/*---- WRONG PRIMITIVE -------------------------------------------------*/
default:
default:
result
=
E_IF_INVALID_PRIMITIVE
;
return
(
E_IF_INVALID_PRIMITIVE
);
return
(
E_IF_INVALID_PRIMITIVE
);
}
/* switch primitive */
}
/* switch primitive */
result
=
E_OK
;
return
(
E_OK
);
return
(
E_OK
);
}
/* dp_get_data_len */
}
/* dp_get_data_len */
...
...
profibus/lib/rt/src/dpm_user.h
View file @
ce758cd3
...
@@ -113,7 +113,7 @@ extern "C" {
...
@@ -113,7 +113,7 @@ extern "C" {
#endif
#endif
#if defined(_MSC_VER)
/* Microsoft C */
#if defined(_MSC_VER)
/* Microsoft C */
#pragma pack(1)
/* Byte Alignment */
#pragma pack(1)
/* Byte Alignment */
#endif
#endif
/* ------------------------------------------------------------------------------------
/* ------------------------------------------------------------------------------------
...
@@ -139,7 +139,8 @@ extern "C" {
...
@@ -139,7 +139,8 @@ extern "C" {
/* device warm start parameter */
/* device warm start parameter */
/* --------------------------- */
/* --------------------------- */
typedef
struct
DPM_PLC_PARAMETERtag
{
typedef
struct
DPM_PLC_PARAMETERtag
{
unsigned
char
bMode
;
/* handshake of process data */
unsigned
char
bMode
;
/* handshake of process data */
#define DPM_SET_MODE_BUSSYNC_DEVICE_CONTROLLED 0
#define DPM_SET_MODE_BUSSYNC_DEVICE_CONTROLLED 0
#define DPM_SET_MODE_BUFFERED_DEVICE_CONTROLLED 1
#define DPM_SET_MODE_BUFFERED_DEVICE_CONTROLLED 1
...
@@ -147,17 +148,18 @@ typedef struct DPM_PLC_PARAMETERtag {
...
@@ -147,17 +148,18 @@ typedef struct DPM_PLC_PARAMETERtag {
#define DPM_SET_MODE_BUFFERED_HOST_CONTROLLED 3
#define DPM_SET_MODE_BUFFERED_HOST_CONTROLLED 3
#define DPM_SET_MODE_BUSSYNC_HOST_CONTROLLED 4
#define DPM_SET_MODE_BUSSYNC_HOST_CONTROLLED 4
unsigned
char
bCycleTime
;
/* replace the min_slave_intervall */
unsigned
char
bCycleTime
;
/* replace the min_slave_intervall */
unsigned
char
bFormat
;
/* storage format of word data */
unsigned
char
bFormat
;
/* storage format of word data */
#define DPM_FORMAT_NO_SWAP 0
#define DPM_FORMAT_NO_SWAP 0
#define DPM_FORMAT_SWAP 1
#define DPM_FORMAT_SWAP 1
unsigned
short
unsigned
short
usWatchDogTime
;
/* watchdog time in msec. for HOST-supervision */
usWatchDogTime
;
/* watchdog time in msec. for HOST-supervision */
unsigned
char
bRedundancy
;
/* enables or disables the redundancy logic */
unsigned
char
bRedundancy
;
/* enables or disables the redundancy logic */
unsigned
char
unsigned
char
bSlStateMethod
;
/* defines the update method od Sl_State field */
bSlStateMethod
;
/* defines the update method od Sl_State field */
#define DPM_SL_STATE_NOT_SYCHRONOUS 0
#define DPM_SL_STATE_NOT_SYCHRONOUS 0
#define DPM_SL_STATE_SYCHRONOUS 1
#define DPM_SL_STATE_SYCHRONOUS 1
struct
{
struct
{
unsigned
char
biIdentNumberActive
:
1
;
unsigned
char
biIdentNumberActive
:
1
;
unsigned
char
biHighPriorHandshake
:
1
;
unsigned
char
biHighPriorHandshake
:
1
;
unsigned
char
biReserved
:
6
;
unsigned
char
biReserved
:
6
;
...
@@ -173,9 +175,11 @@ typedef struct DPM_PLC_PARAMETERtag {
...
@@ -173,9 +175,11 @@ typedef struct DPM_PLC_PARAMETERtag {
/* parameter data header structure of a slave station,
/* parameter data header structure of a slave station,
described in norm EN 50170 page 101 */
described in norm EN 50170 page 101 */
typedef
struct
DPM_SL_PRM_HEADERtag
{
typedef
struct
DPM_SL_PRM_HEADERtag
{
unsigned
short
usSlaveParaLen
;
/* length of whole parameter data set */
unsigned
short
usSlaveParaLen
;
/* length of whole parameter data set */
struct
{
struct
{
unsigned
char
biReserved1
:
1
;
unsigned
char
biReserved1
:
1
;
unsigned
char
biExtra_Alarm_SAP
:
1
;
unsigned
char
biExtra_Alarm_SAP
:
1
;
unsigned
char
biDPV1_Data_Types
:
1
;
unsigned
char
biDPV1_Data_Types
:
1
;
...
@@ -184,7 +188,7 @@ typedef struct DPM_SL_PRM_HEADERtag {
...
@@ -184,7 +188,7 @@ typedef struct DPM_SL_PRM_HEADERtag {
unsigned
char
biFail_Safe
:
1
;
unsigned
char
biFail_Safe
:
1
;
unsigned
char
biNew_Prm
:
1
;
unsigned
char
biNew_Prm
:
1
;
unsigned
char
biActive
:
1
;
unsigned
char
biActive
:
1
;
}
GNUC_PACKED
Sl_Flag
;
/* slave related flags */
}
GNUC_PACKED
Sl_Flag
;
/* slave related flags */
unsigned
char
bSlave_Typ
;
/* type of slave */
unsigned
char
bSlave_Typ
;
/* type of slave */
unsigned
char
bMax_Diag_Data_Len
;
unsigned
char
bMax_Diag_Data_Len
;
...
@@ -193,7 +197,8 @@ typedef struct DPM_SL_PRM_HEADERtag {
...
@@ -193,7 +197,8 @@ typedef struct DPM_SL_PRM_HEADERtag {
unsigned
char
bDiag_Upd_Delay
;
unsigned
char
bDiag_Upd_Delay
;
unsigned
char
bAlarm_Mode
;
unsigned
char
bAlarm_Mode
;
struct
{
struct
{
unsigned
char
biNA_to_Abort
:
1
;
unsigned
char
biNA_to_Abort
:
1
;
unsigned
char
biIgnore_Aclr
:
1
;
unsigned
char
biIgnore_Aclr
:
1
;
unsigned
char
abiReserved
:
6
;
unsigned
char
abiReserved
:
6
;
...
@@ -207,13 +212,16 @@ typedef struct DPM_SL_PRM_HEADERtag {
...
@@ -207,13 +212,16 @@ typedef struct DPM_SL_PRM_HEADERtag {
described in norm EN 50170 page 51 */
described in norm EN 50170 page 51 */
#define MAX_USR_PRM_LEN 237
#define MAX_USR_PRM_LEN 237
typedef
struct
DPV0_PRMtag
{
typedef
struct
DPV0_PRMtag
{
unsigned
char
abUsr_Prm_Data
[
MAX_USR_PRM_LEN
];
/* user parameter data without
unsigned
char
abUsr_Prm_Data
[
MAX_USR_PRM_LEN
];
/* user parameter data without
DPV1-bytes */
DPV1-bytes */
}
GNUC_PACKED
DPV0_PRM
;
}
GNUC_PACKED
DPV0_PRM
;
typedef
struct
DPV1_USR_PRMtag
{
typedef
struct
DPV1_USR_PRMtag
struct
{
{
struct
{
unsigned
char
bReserved1
:
2
;
unsigned
char
bReserved1
:
2
;
unsigned
char
bWD_Base_1ms
:
1
;
unsigned
char
bWD_Base_1ms
:
1
;
unsigned
char
bReserved2
:
2
;
unsigned
char
bReserved2
:
2
;
...
@@ -222,7 +230,8 @@ typedef struct DPV1_USR_PRMtag {
...
@@ -222,7 +230,8 @@ typedef struct DPV1_USR_PRMtag {
unsigned
char
bDPV1_Enable
:
1
;
unsigned
char
bDPV1_Enable
:
1
;
}
GNUC_PACKED
DPV1_Status_1
;
}
GNUC_PACKED
DPV1_Status_1
;
struct
{
struct
{
unsigned
char
bRun_On_Cfg_Fault
:
1
;
unsigned
char
bRun_On_Cfg_Fault
:
1
;
unsigned
char
bReserved1
:
1
;
unsigned
char
bReserved1
:
1
;
unsigned
char
bEnable_Update_Alarm
:
1
;
unsigned
char
bEnable_Update_Alarm
:
1
;
...
@@ -233,26 +242,30 @@ typedef struct DPV1_USR_PRMtag {
...
@@ -233,26 +242,30 @@ typedef struct DPV1_USR_PRMtag {
unsigned
char
bEnable_Pull_plug_Alarm
:
1
;
unsigned
char
bEnable_Pull_plug_Alarm
:
1
;
}
GNUC_PACKED
DPV1_Status_2
;
}
GNUC_PACKED
DPV1_Status_2
;
struct
{
struct
{
unsigned
char
bAlarm_Mode
:
3
;
unsigned
char
bAlarm_Mode
:
3
;
unsigned
char
bIsoM_Req
:
1
;
unsigned
char
bIsoM_Req
:
1
;
unsigned
char
bReserved1
:
4
;
unsigned
char
bReserved1
:
4
;
}
GNUC_PACKED
DPV1_Status_3
;
}
GNUC_PACKED
DPV1_Status_3
;
}
GNUC_PACKED
DPV1_USR_PRM
;
}
GNUC_PACKED
DPV1_USR_PRM
;
typedef
struct
DPV1_PRMtag
{
typedef
struct
DPV1_PRMtag
{
DPV1_USR_PRM
tDpv1
;
DPV1_USR_PRM
tDpv1
;
unsigned
char
abUsr_Prm_Data
[
MAX_USR_PRM_LEN
-
sizeof
(
DPV1_USR_PRM
)];
unsigned
char
abUsr_Prm_Data
[
MAX_USR_PRM_LEN
-
sizeof
(
DPV1_USR_PRM
)];
}
GNUC_PACKED
DPV1_PRM
;
}
GNUC_PACKED
DPV1_PRM
;
typedef
struct
DPV2_HEADERtag
{
typedef
struct
DPV2_HEADERtag
{
unsigned
char
bStructure_Length
;
unsigned
char
bStructure_Length
;
unsigned
char
bStructure_Type
;
unsigned
char
bStructure_Type
;
unsigned
char
bSlot_Number
;
unsigned
char
bSlot_Number
;
unsigned
char
bReserved
;
unsigned
char
bReserved
;
}
GNUC_PACKED
DPV2_HEADER
;
}
GNUC_PACKED
DPV2_HEADER
;
typedef
struct
DPV2_ISOM_PRMtag
{
typedef
struct
DPV2_ISOM_PRMtag
{
DPV2_HEADER
tDpv2Header
;
DPV2_HEADER
tDpv2Header
;
unsigned
char
bVersion
;
unsigned
char
bVersion
;
unsigned
long
bTBase_Dp
;
unsigned
long
bTBase_Dp
;
...
@@ -266,29 +279,34 @@ typedef struct DPV2_ISOM_PRMtag {
...
@@ -266,29 +279,34 @@ typedef struct DPV2_ISOM_PRMtag {
unsigned
short
bTPll_D
;
unsigned
short
bTPll_D
;
}
GNUC_PACKED
DPV2_ISOM_PRM
;
}
GNUC_PACKED
DPV2_ISOM_PRM
;
typedef
struct
DPV2_DBX_LINK_FILTERtag
{
typedef
struct
DPV2_DBX_LINK_FILTERtag
{
unsigned
char
bPublisher_Addr
;
unsigned
char
bPublisher_Addr
;
unsigned
char
bPublisher_Length
;
unsigned
char
bPublisher_Length
;
unsigned
char
bSample_Offset
;
unsigned
char
bSample_Offset
;
unsigned
char
bSample_Length
;
unsigned
char
bSample_Length
;
}
GNUC_PACKED
DPV2_DBX_LINK_FILTER
;
}
GNUC_PACKED
DPV2_DBX_LINK_FILTER
;
typedef
struct
DPV2_DBX_LINKtag
{
typedef
struct
DPV2_DBX_LINKtag
{
DPV2_HEADER
tDpv2Header
;
DPV2_HEADER
tDpv2Header
;
unsigned
char
bVersion
;
unsigned
char
bVersion
;
DPV2_DBX_LINK_FILTER
tDbxLinkFilter
;
DPV2_DBX_LINK_FILTER
tDbxLinkFilter
;
}
GNUC_PACKED
DPV2_DBX_LINK
;
}
GNUC_PACKED
DPV2_DBX_LINK
;
typedef
struct
DPV2_PRMtag
{
typedef
struct
DPV2_PRMtag
{
DPV1_USR_PRM
tDpv1
;
DPV1_USR_PRM
tDpv1
;
DPV2_ISOM_PRM
tDpv2Iso
;
DPV2_ISOM_PRM
tDpv2Iso
;
unsigned
char
abUsr_Prm_Data
[
MAX_USR_PRM_LEN
-
sizeof
(
DPV1_USR_PRM
)
unsigned
char
abUsr_Prm_Data
[
MAX_USR_PRM_LEN
-
sizeof
(
DPV1_USR_PRM
)
-
-
sizeof
(
DPV2_ISOM_PRM
)];
sizeof
(
DPV2_ISOM_PRM
)];
}
GNUC_PACKED
DPV2_PRM
;
}
GNUC_PACKED
DPV2_PRM
;
typedef
struct
DPM_SL_PRM_PRM_DATAtag
{
typedef
struct
DPM_SL_PRM_PRM_DATAtag
{
unsigned
short
usPrmDataLen
;
/* length of PRM_PRM_DATA */
unsigned
short
usPrmDataLen
;
/* length of PRM_PRM_DATA */
struct
{
struct
{
unsigned
char
bReserved
:
3
;
unsigned
char
bReserved
:
3
;
unsigned
char
bWD_On
:
1
;
unsigned
char
bWD_On
:
1
;
unsigned
char
bFreeze_Req
:
1
;
unsigned
char
bFreeze_Req
:
1
;
...
@@ -299,13 +317,13 @@ typedef struct DPM_SL_PRM_PRM_DATAtag {
...
@@ -299,13 +317,13 @@ typedef struct DPM_SL_PRM_PRM_DATAtag {
unsigned
char
bWD_Fact_1
;
/* watchdog factor 1 */
unsigned
char
bWD_Fact_1
;
/* watchdog factor 1 */
unsigned
char
bWD_Fact_2
;
/* watchdog factor 2 */
unsigned
char
bWD_Fact_2
;
/* watchdog factor 2 */
unsigned
char
bMin_Tsdr
;
/* min. station delay reponder */
unsigned
char
bMin_Tsdr
;
/* min. station delay reponder */
unsigned
short
unsigned
short
usIdent_Number
;
/* ident number of the station, motorola format */
usIdent_Number
;
/* ident number of the station, motorola format */
unsigned
char
bGroup_Ident
;
/* configures group number */
unsigned
char
bGroup_Ident
;
/* configures group number */
union
{
union
{
DPV0_PRM
tDpv0
;
/* standard parameter , or */
DPV0_PRM
tDpv0
;
/* standard parameter , or */
DPV1_PRM
tDpv1Only
;
/* parameter data with DPV1 */
DPV1_PRM
tDpv1Only
;
/* parameter data with DPV1 */
DPV2_PRM
tDpv1Dpv2
;
/* parameter data with DPV1,DPV2 */
DPV2_PRM
tDpv1Dpv2
;
/* parameter data with DPV1,DPV2 */
}
GNUC_PACKED
u
;
}
GNUC_PACKED
u
;
...
@@ -315,8 +333,9 @@ typedef struct DPM_SL_PRM_PRM_DATAtag {
...
@@ -315,8 +333,9 @@ typedef struct DPM_SL_PRM_PRM_DATAtag {
described in norm EN 50170 page 55 */
described in norm EN 50170 page 55 */
#define MAX_CFG_DATA_LEN 244
#define MAX_CFG_DATA_LEN 244
typedef
struct
DPM_SL_PRM_CFG_DATAtag
{
typedef
struct
DPM_SL_PRM_CFG_DATAtag
unsigned
short
usCfg_Data_Len
;
/* length of CFG_DATA */
{
unsigned
short
usCfg_Data_Len
;
/* length of CFG_DATA */
unsigned
char
abCfg_Data
[
MAX_CFG_DATA_LEN
];
/* configuration data of the
unsigned
char
abCfg_Data
[
MAX_CFG_DATA_LEN
];
/* configuration data of the
slave station */
slave station */
}
GNUC_PACKED
DPM_SL_PRM_CFG_DATA
;
}
GNUC_PACKED
DPM_SL_PRM_CFG_DATA
;
...
@@ -325,10 +344,11 @@ typedef struct DPM_SL_PRM_CFG_DATAtag {
...
@@ -325,10 +344,11 @@ typedef struct DPM_SL_PRM_CFG_DATAtag {
described in norm EN 50170 page 103 */
described in norm EN 50170 page 103 */
#define MAX_EA_OFFSET_LEN 244
#define MAX_EA_OFFSET_LEN 244
typedef
struct
DPM_SL_PRM_ADD_TABtag
{
typedef
struct
DPM_SL_PRM_ADD_TABtag
{
unsigned
short
usAdd_Tab_Len
;
/* length of ADD_TAB */
unsigned
short
usAdd_Tab_Len
;
/* length of ADD_TAB */
unsigned
char
bInput_Count
;
/* counter of following input offsets */
unsigned
char
bInput_Count
;
/* counter of following input offsets */
unsigned
char
bOutput_Count
;
/* counter of following ouput offsets */
unsigned
char
bOutput_Count
;
/* counter of following ouput offsets */
#define EA_OFFSET_BYTE 0x8000
#define EA_OFFSET_BYTE 0x8000
unsigned
short
ausEA_Offset
[
MAX_EA_OFFSET_LEN
];
/* user defined offsets */
unsigned
short
ausEA_Offset
[
MAX_EA_OFFSET_LEN
];
/* user defined offsets */
}
GNUC_PACKED
DPM_SL_PRM_ADD_TAB
;
}
GNUC_PACKED
DPM_SL_PRM_ADD_TAB
;
...
@@ -337,8 +357,9 @@ typedef struct DPM_SL_PRM_ADD_TABtag {
...
@@ -337,8 +357,9 @@ typedef struct DPM_SL_PRM_ADD_TABtag {
described in norm EN 50170 page 103 */
described in norm EN 50170 page 103 */
#define MAX_SL_PRM_LEN 100
#define MAX_SL_PRM_LEN 100
typedef
struct
DPM_SL_PRM_USR_DATAtag
{
typedef
struct
DPM_SL_PRM_USR_DATAtag
unsigned
short
usSlave_Usr_Data_Len
;
/* length of USR_DATA */
{
unsigned
short
usSlave_Usr_Data_Len
;
/* length of USR_DATA */
unsigned
char
abSlave_Usr_Data
[
MAX_SL_PRM_LEN
];
/* user paramteres */
unsigned
char
abSlave_Usr_Data
[
MAX_SL_PRM_LEN
];
/* user paramteres */
}
GNUC_PACKED
DPM_SL_PRM_USR_DATA
;
}
GNUC_PACKED
DPM_SL_PRM_USR_DATA
;
...
@@ -348,10 +369,11 @@ typedef struct DPM_SL_PRM_USR_DATAtag {
...
@@ -348,10 +369,11 @@ typedef struct DPM_SL_PRM_USR_DATAtag {
/* master parameter 'DPM_Bus_Dp' data set
/* master parameter 'DPM_Bus_Dp' data set
described in norm DIN 19245-T3 page 98 */
described in norm DIN 19245-T3 page 98 */
typedef
struct
DPM_BUS_DPtag
{
typedef
struct
DPM_BUS_DPtag
{
unsigned
short
usBus_Para_Len
;
/* length of BUS_DP */
unsigned
short
usBus_Para_Len
;
/* length of BUS_DP */
unsigned
char
bFDL_Add
;
/* master address */
unsigned
char
bFDL_Add
;
/* master address */
unsigned
char
bBaudrate
;
/* baudrate, see. #defines */
unsigned
char
bBaudrate
;
/* baudrate, see. #defines */
#define DP_BAUD_96 0
#define DP_BAUD_96 0
#define DP_BAUD_19_2 1
#define DP_BAUD_19_2 1
#define DP_BAUD_93_75 2
#define DP_BAUD_93_75 2
...
@@ -364,22 +386,23 @@ typedef struct DPM_BUS_DPtag {
...
@@ -364,22 +386,23 @@ typedef struct DPM_BUS_DPtag {
#define DP_BAUD_31_25 10
#define DP_BAUD_31_25 10
#define DP_BAUD_45_45 11
#define DP_BAUD_45_45 11
unsigned
short
usTSL
;
/* slot-time */
unsigned
short
usTSL
;
/* slot-time */
unsigned
short
usMin_TSDR
;
/* min. station delay responder */
unsigned
short
usMin_TSDR
;
/* min. station delay responder */
unsigned
short
usMax_TSDR
;
/* max. station delay responder */
unsigned
short
usMax_TSDR
;
/* max. station delay responder */
unsigned
char
bTQUI
;
/* quite time */
unsigned
char
bTQUI
;
/* quite time */
unsigned
char
bTSET
;
/* setup time */
unsigned
char
bTSET
;
/* setup time */
unsigned
long
ulTTR
;
/* target rotation time */
unsigned
long
ulTTR
;
/* target rotation time */
unsigned
char
bG
;
/* gap update */
unsigned
char
bG
;
/* gap update */
unsigned
char
bHSA
;
/* highest active station address */
unsigned
char
bHSA
;
/* highest active station address */
unsigned
char
bMax_Retry_Limit
;
/* retries if error occurs */
unsigned
char
bMax_Retry_Limit
;
/* retries if error occurs */
struct
{
struct
{
unsigned
char
bReserved
:
7
;
unsigned
char
bReserved
:
7
;
unsigned
char
bError_Action_Flag
:
1
;
unsigned
char
bError_Action_Flag
:
1
;
}
GNUC_PACKED
Bp_Flag
;
/* auto_clear on/off */
}
GNUC_PACKED
Bp_Flag
;
/* auto_clear on/off */
unsigned
short
usMin_Slave_Intervall
;
/* min. slave intervall time */
unsigned
short
usMin_Slave_Intervall
;
/* min. slave intervall time */
unsigned
short
usPoll_Timeout
;
/* poll timeout */
unsigned
short
usPoll_Timeout
;
/* poll timeout */
unsigned
short
usData_Control_Time
;
/* data control time */
unsigned
short
usData_Control_Time
;
/* data control time */
unsigned
char
bAlarm_Max
;
/* maximum alarms the master supports = 32 */
unsigned
char
bAlarm_Max
;
/* maximum alarms the master supports = 32 */
unsigned
char
bMax_User_Global_Control
;
/* maximum parallel Global-
unsigned
char
bMax_User_Global_Control
;
/* maximum parallel Global-
Controls the master supports = 1*/
Controls the master supports = 1*/
...
@@ -392,37 +415,41 @@ typedef struct DPM_BUS_DPtag {
...
@@ -392,37 +415,41 @@ typedef struct DPM_BUS_DPtag {
#define MAX_EXT_DIAG_LEN 100
#define MAX_EXT_DIAG_LEN 100
/* slave specific diagnostic structure
/* slave specific diagnostic structure
described in norm DIN 19245-T3 page 41 */
described in norm DIN 19245-T3 page 41 */
typedef
struct
DPM_SLAVE_SINGLE_DIAGNOTICStag
{
typedef
struct
DPM_SLAVE_SINGLE_DIAGNOTICStag
struct
{
{
struct
{
unsigned
char
bStation_Non_Existent
:
1
;
/* no response */
unsigned
char
bStation_Non_Existent
:
1
;
/* no response */
unsigned
char
bStation_Not_Ready
:
1
;
/* station not ready */
unsigned
char
bStation_Not_Ready
:
1
;
/* station not ready */
unsigned
char
bCfg_Fault
:
1
;
/* configuration fault */
unsigned
char
bCfg_Fault
:
1
;
/* configuration fault */
unsigned
char
bExt_Diag
:
1
;
/* extended diagnostic */
unsigned
char
bExt_Diag
:
1
;
/* extended diagnostic */
unsigned
char
bNot_Supported
:
1
;
/* sync, freeze not supported */
unsigned
char
bNot_Supported
:
1
;
/* sync, freeze not supported */
unsigned
char
bInvalid_Response
:
1
;
/* response faulty */
unsigned
char
bInvalid_Response
:
1
;
/* response faulty */
unsigned
char
bPrm_Fault
:
1
;
/* parameters faulty */
unsigned
char
bPrm_Fault
:
1
;
/* parameters faulty */
unsigned
char
bMaster_Lock
:
1
;
/* locked by a master */
unsigned
char
bMaster_Lock
:
1
;
/* locked by a master */
}
GNUC_PACKED
Stationstatus_1
;
}
GNUC_PACKED
Stationstatus_1
;
struct
{
struct
unsigned
char
bPrm_Req
:
1
;
/* request new parameters */
{
unsigned
char
bPrm_Req
:
1
;
/* request new parameters */
unsigned
char
bStat_Diag
:
1
;
/* static diagnostic */
unsigned
char
bStat_Diag
:
1
;
/* static diagnostic */
unsigned
char
bTrue
:
1
;
/* set to 1 by a slave */
unsigned
char
bTrue
:
1
;
/* set to 1 by a slave */
unsigned
char
bWd_On
:
1
;
/* watchdog function on/off */
unsigned
char
bWd_On
:
1
;
/* watchdog function on/off */
unsigned
char
bFreeze_Mode
:
1
;
/* freeze mode active */
unsigned
char
bFreeze_Mode
:
1
;
/* freeze mode active */
unsigned
char
bSync_Mode
:
1
;
/* sync mode active */
unsigned
char
bSync_Mode
:
1
;
/* sync mode active */
unsigned
char
bReserved
:
1
;
/* reserved */
unsigned
char
bReserved
:
1
;
/* reserved */
unsigned
char
bDeactivated
:
1
;
/* slave deactivated */
unsigned
char
bDeactivated
:
1
;
/* slave deactivated */
}
GNUC_PACKED
Stationstatus_2
;
}
GNUC_PACKED
Stationstatus_2
;
struct
{
struct
{
unsigned
char
bReserved
:
7
;
unsigned
char
bReserved
:
7
;
unsigned
char
bExt_Diag_Overflow
:
1
;
/* ext. diagnostic overflow */
unsigned
char
bExt_Diag_Overflow
:
1
;
/* ext. diagnostic overflow */
}
GNUC_PACKED
Stationstatus_3
;
}
GNUC_PACKED
Stationstatus_3
;
unsigned
char
bMaster_Add
;
/* corresponding master address */
unsigned
char
bMaster_Add
;
/* corresponding master address */
unsigned
short
usIdent_Number
;
/* ident number, motorola format */
unsigned
short
usIdent_Number
;
/* ident number, motorola format */
unsigned
char
abExt_Diag_Data
[
MAX_EXT_DIAG_LEN
];
unsigned
char
abExt_Diag_Data
[
MAX_EXT_DIAG_LEN
];
...
@@ -434,16 +461,18 @@ typedef struct DPM_SLAVE_SINGLE_DIAGNOTICStag {
...
@@ -434,16 +461,18 @@ typedef struct DPM_SLAVE_SINGLE_DIAGNOTICStag {
/* Protocol master state structure */
/* Protocol master state structure */
/* ======================================================================== */
/* ======================================================================== */
typedef
struct
DPM_DIAGNOSTICStag
{
typedef
struct
DPM_DIAGNOSTICStag
{
/* unsigned char field to show bus and master main errors */
/* unsigned char field to show bus and master main errors */
struct
{
struct
unsigned
char
bCtrl
:
1
;
/* wrong parameterization */
{
unsigned
char
bAClr
:
1
;
/* auto_clear activated */
unsigned
char
bCtrl
:
1
;
/* wrong parameterization */
unsigned
char
bAClr
:
1
;
/* auto_clear activated */
unsigned
char
bNonExch
:
1
;
/* no data exchange to at least on station */
unsigned
char
bNonExch
:
1
;
/* no data exchange to at least on station */
unsigned
char
bFatal
:
1
;
/* fatal error occured */
unsigned
char
bFatal
:
1
;
/* fatal error occured */
unsigned
char
bEvent
:
1
;
/* bus error events occured */
unsigned
char
bEvent
:
1
;
/* bus error events occured */
unsigned
char
bNRdy
:
1
;
/* host program not ready */
unsigned
char
bNRdy
:
1
;
/* host program not ready */
unsigned
char
bTout
:
1
;
/* PROFIBUS timeout event detected */
unsigned
char
bTout
:
1
;
/* PROFIBUS timeout event detected */
unsigned
char
bReserved
:
1
;
unsigned
char
bReserved
:
1
;
}
GNUC_PACKED
bGlobalBits
;
}
GNUC_PACKED
bGlobalBits
;
...
@@ -455,33 +484,34 @@ typedef struct DPM_DIAGNOSTICStag {
...
@@ -455,33 +484,34 @@ typedef struct DPM_DIAGNOSTICStag {
#define OPERATE 0xC0
#define OPERATE 0xC0
/* location of error and error code */
/* location of error and error code */
struct
{
struct
{
unsigned
char
bErr_Rem_Adr
;
/* 0-125, 255 */
unsigned
char
bErr_Rem_Adr
;
/* 0-125, 255 */
#define MST_ERR 0xFF
#define MST_ERR 0xFF
unsigned
char
bErr_Event
;
/* see #defines */
unsigned
char
bErr_Event
;
/* see #defines */
#define TASK_F_NO_USR_TASK 50
/* usr task not found */
#define TASK_F_NO_USR_TASK 50
/* usr task not found */
#define TASK_F_NO_GLOBAL_DATA 51
/* no global entry in data base */
#define TASK_F_NO_GLOBAL_DATA 51
/* no global entry in data base */
#define TASK_F_NO_FDL 52
/* fdl task not found */
#define TASK_F_NO_FDL 52
/* fdl task not found */
#define TASK_F_NO_PLC 53
/* plc task not found */
#define TASK_F_NO_PLC 53
/* plc task not found */
#define TASK_F_NO_BUS_DP 54
/* no bus parameters */
#define TASK_F_NO_BUS_DP 54
/* no bus parameters */
#define TASK_F_INVALID_BUS_DP 55
/* bus parameters faulty */
#define TASK_F_INVALID_BUS_DP 55
/* bus parameters faulty */
#define TASK_F_NO_SL_TAB 56
/* no slave data sets */
#define TASK_F_NO_SL_TAB 56
/* no slave data sets */
#define TASK_F_INVALID_SL_TAB 57
/* slave data set faulty */
#define TASK_F_INVALID_SL_TAB 57
/* slave data set faulty */
#define TASK_F_REM_ADR_DOUBLE 58
/* double station adress detected */
#define TASK_F_REM_ADR_DOUBLE 58
/* double station adress detected */
#define TASK_F_A_OFFSET_MAX 59
/* maximum output offset reached */
#define TASK_F_A_OFFSET_MAX 59
/* maximum output offset reached */
#define TASK_F_E_OFFSET_MAX 60
/* maximum input offset reached */
#define TASK_F_E_OFFSET_MAX 60
/* maximum input offset reached */
#define TASK_F_A_OVERLAP 61
/* overlap in output area */
#define TASK_F_A_OVERLAP 61
/* overlap in output area */
#define TASK_F_E_OVERLAP 62
/* overlap in input area */
#define TASK_F_E_OVERLAP 62
/* overlap in input area */
#define TASK_F_DPM_UNKNOWN_MODE 63
/* warm start with unknown mode */
#define TASK_F_DPM_UNKNOWN_MODE 63
/* warm start with unknown mode */
#define TASK_F_RAM_OVERRUN 64
/* extended ram exeeded */
#define TASK_F_RAM_OVERRUN 64
/* extended ram exeeded */
#define TASK_F_SL_PRM_FAULT 65
/* slave data set faulty */
#define TASK_F_SL_PRM_FAULT 65
/* slave data set faulty */
#define TASK_F_WATCHDOG 220
/* user watchdog failure */
#define TASK_F_WATCHDOG 220
/* user watchdog failure */
#define TASK_F_NO_DATA_ACK 221
/* mode0 no acknowledge */
#define TASK_F_NO_DATA_ACK 221
/* mode0 no acknowledge */
#define TASK_F_AUTO_CLEAR 222
/* auto clear activated */
#define TASK_F_AUTO_CLEAR 222
/* auto clear activated */
#define TASK_F_FATAL_ASIC_ERROR 223
/* fatal error occured */
#define TASK_F_FATAL_ASIC_ERROR 223
/* fatal error occured */
#define TASK_F_UNKNOWN_EVENT 224
/* unknown event detected */
#define TASK_F_UNKNOWN_EVENT 224
/* unknown event detected */
#define TASK_F_SEGMENT_CNT 225
/* no segments to communicate */
#define TASK_F_SEGMENT_CNT 225
/* no segments to communicate */
#define CON_NA 0x11
/* no reaction of the remote station */
#define CON_NA 0x11
/* no reaction of the remote station */
#define CON_DS 0x12
/* cocal-FDL/PHY not in logical token ring */
#define CON_DS 0x12
/* cocal-FDL/PHY not in logical token ring */
#define CON_RS 0x03
/* master request not supported by the slave */
#define CON_RS 0x03
/* master request not supported by the slave */
...
@@ -500,9 +530,9 @@ typedef struct DPM_DIAGNOSTICStag {
...
@@ -500,9 +530,9 @@ typedef struct DPM_DIAGNOSTICStag {
unsigned
char
abReserved
[
8
];
unsigned
char
abReserved
[
8
];
/* Bit-Ready, Cfg-Ready and diagnostic display of slave devices */
/* Bit-Ready, Cfg-Ready and diagnostic display of slave devices */
unsigned
char
abSl_cfg
[
16
];
/* Slave configuration area */
unsigned
char
abSl_cfg
[
16
];
/* Slave configuration area */
unsigned
char
abSl_state
[
16
];
/* Slave state information area */
unsigned
char
abSl_state
[
16
];
/* Slave state information area */
unsigned
char
abSl_diag
[
16
];
/* Slave diagnostic area */
unsigned
char
abSl_diag
[
16
];
/* Slave diagnostic area */
}
GNUC_PACKED
DPM_DIAGNOSTICS
;
}
GNUC_PACKED
DPM_DIAGNOSTICS
;
/* ======================================================================== */
/* ======================================================================== */
...
@@ -511,21 +541,24 @@ typedef struct DPM_DIAGNOSTICStag {
...
@@ -511,21 +541,24 @@ typedef struct DPM_DIAGNOSTICStag {
#define UNDEFINED 1
#define UNDEFINED 1
typedef
struct
{
typedef
struct
{
unsigned
char
abNetwork_Address
[
6
];
/* network address according ISO/OSI */
unsigned
char
abNetwork_Address
[
6
];
/* network address according ISO/OSI */
unsigned
char
abMAC_Address
[
UNDEFINED
];
/* MAC_Address */
unsigned
char
abMAC_Address
[
UNDEFINED
];
/* MAC_Address */
}
GNUC_PACKED
ADDR_EXTENTION
;
}
GNUC_PACKED
ADDR_EXTENTION
;
typedef
struct
{
typedef
struct
{
unsigned
char
bAPI
;
/* application process instance */
unsigned
char
bAPI
;
/* application process instance */
unsigned
char
bSCL
;
/* access level */
unsigned
char
bSCL
;
/* access level */
}
GNUC_PACKED
ADDR
;
}
GNUC_PACKED
ADDR
;
#define MAX_ADD_TABLE_LEN 235
#define MAX_ADD_TABLE_LEN 235
typedef
struct
{
typedef
struct
{
#define TYPE_EXT_OFF 0
/* no optional Network/MAC address */
#define TYPE_EXT_OFF 0
/* no optional Network/MAC address */
#define TYPE_EXT_ON 1
/* optional Network/MAC address available */
#define TYPE_EXT_ON 1
/* optional Network/MAC address available */
unsigned
char
bS_Type
;
unsigned
char
bS_Type
;
unsigned
char
bS_Len
;
/* length of S_Addr subparameter */
unsigned
char
bS_Len
;
/* length of S_Addr subparameter */
...
@@ -536,15 +569,18 @@ typedef struct {
...
@@ -536,15 +569,18 @@ typedef struct {
}
GNUC_PACKED
ADD_ADDR_PARAM
;
}
GNUC_PACKED
ADD_ADDR_PARAM
;
typedef
struct
{
typedef
struct
{
unsigned
short
usSend_Timeout
;
/* control time for supervision */
unsigned
short
usSend_Timeout
;
/* control time for supervision */
struct
{
struct
{
unsigned
char
biDPV1_RW
:
1
;
/* support of MSAC2_READ and WRITE */
unsigned
char
biDPV1_RW
:
1
;
/* support of MSAC2_READ and WRITE */
unsigned
char
abiReserved
:
7
;
unsigned
char
abiReserved
:
7
;
}
GNUC_PACKED
bFeatures_Supported_1
;
}
GNUC_PACKED
bFeatures_Supported_1
;
struct
{
struct
{
unsigned
char
abiReserved
:
8
;
unsigned
char
abiReserved
:
8
;
}
GNUC_PACKED
bFeatures_Supported_2
;
}
GNUC_PACKED
bFeatures_Supported_2
;
...
@@ -556,13 +592,16 @@ typedef struct {
...
@@ -556,13 +592,16 @@ typedef struct {
ADD_ADDR_PARAM
tAdd_Addr_Param
;
ADD_ADDR_PARAM
tAdd_Addr_Param
;
}
GNUC_PACKED
DPM_MSAC2M_INITIATE_REQ
;
}
GNUC_PACKED
DPM_MSAC2M_INITIATE_REQ
;
typedef
struct
{
typedef
struct
struct
{
{
struct
{
unsigned
char
biDPV1_RW
:
1
;
/* support of MSAC2_READ and WRITE */
unsigned
char
biDPV1_RW
:
1
;
/* support of MSAC2_READ and WRITE */
unsigned
char
abiReserved
:
7
;
unsigned
char
abiReserved
:
7
;
}
GNUC_PACKED
bFeatures_Supported_1
;
}
GNUC_PACKED
bFeatures_Supported_1
;
struct
{
struct
{
unsigned
char
abiReserved
:
8
;
unsigned
char
abiReserved
:
8
;
}
GNUC_PACKED
bFeatures_Supported_2
;
}
GNUC_PACKED
bFeatures_Supported_2
;
...
@@ -627,7 +666,8 @@ typedef struct {
...
@@ -627,7 +666,8 @@ typedef struct {
/* message command msg.b msg.a */
/* message command msg.b msg.a */
#define DDLM_Slave_Diag 0x42
#define DDLM_Slave_Diag 0x42
typedef
struct
DDLM_SLAVE_DIAG_CONFIRMtag
{
typedef
struct
DDLM_SLAVE_DIAG_CONFIRMtag
{
DPM_SLAVE_SINGLE_DIAGNOSTICS
tDiagData
;
DPM_SLAVE_SINGLE_DIAGNOSTICS
tDiagData
;
}
GNUC_PACKED
DDLM_SLAVE_DIAG_CONFIRM
;
}
GNUC_PACKED
DDLM_SLAVE_DIAG_CONFIRM
;
...
@@ -638,12 +678,14 @@ typedef struct DDLM_SLAVE_DIAG_CONFIRMtag {
...
@@ -638,12 +678,14 @@ typedef struct DDLM_SLAVE_DIAG_CONFIRMtag {
/* message command msg.b msg.a */
/* message command msg.b msg.a */
#define DDLM_Set_Prm 0x4a
#define DDLM_Set_Prm 0x4a
typedef
struct
DDLM_SET_PRM_REQUESTtag
{
typedef
struct
DDLM_SET_PRM_REQUESTtag
{
unsigned
char
bRem_Add
;
unsigned
char
bRem_Add
;
unsigned
char
abUsr_Prm_Data
[
DPM_MAX_LEN_DATA_UNIT
];
unsigned
char
abUsr_Prm_Data
[
DPM_MAX_LEN_DATA_UNIT
];
}
GNUC_PACKED
DDLM_SET_PRM_REQUEST
;
}
GNUC_PACKED
DDLM_SET_PRM_REQUEST
;
typedef
struct
DDLM_SET_PRM_CONFIRMtag
{
typedef
struct
DDLM_SET_PRM_CONFIRMtag
{
unsigned
char
bRem_Add
;
unsigned
char
bRem_Add
;
}
GNUC_PACKED
DDLM_SET_PRM_CONFIRM
;
}
GNUC_PACKED
DDLM_SET_PRM_CONFIRM
;
...
@@ -661,13 +703,15 @@ typedef struct DDLM_SET_PRM_CONFIRMtag {
...
@@ -661,13 +703,15 @@ typedef struct DDLM_SET_PRM_CONFIRMtag {
/* message command msg.b msg.a */
/* message command msg.b msg.a */
#define DDLM_Start_Seq 0x43
#define DDLM_Start_Seq 0x43
typedef
struct
DDLM_START_SEQ_REQUESTtag
{
typedef
struct
DDLM_START_SEQ_REQUESTtag
unsigned
char
bReq_Add
;
/* 0 */
{
unsigned
char
bReq_Add
;
/* 0 */
unsigned
char
bArea_Code
;
/* 0 - 125 */
unsigned
char
bArea_Code
;
/* 0 - 125 */
unsigned
short
usTimeout
;
/* 0 - 65535 */
unsigned
short
usTimeout
;
/* 0 - 65535 */
}
GNUC_PACKED
DDLM_START_SEQ_REQUEST
;
}
GNUC_PACKED
DDLM_START_SEQ_REQUEST
;
typedef
struct
DDLM_START_SEQ_CONFIRMtag
{
typedef
struct
DDLM_START_SEQ_CONFIRMtag
{
unsigned
char
bMax_Len_Data_Unit
;
/* 240 */
unsigned
char
bMax_Len_Data_Unit
;
/* 240 */
}
GNUC_PACKED
DDLM_START_SEQ_CONFIRM
;
}
GNUC_PACKED
DDLM_START_SEQ_CONFIRM
;
...
@@ -680,9 +724,10 @@ typedef struct DDLM_START_SEQ_CONFIRMtag {
...
@@ -680,9 +724,10 @@ typedef struct DDLM_START_SEQ_CONFIRMtag {
#define DPM_DEVICE_PRM 127
#define DPM_DEVICE_PRM 127
/* message data structure */
/* message data structure */
typedef
struct
DDLM_DOWNLOAD_REQUESTtag
{
typedef
struct
DDLM_DOWNLOAD_REQUESTtag
unsigned
char
bReq_Add
;
/* 0 */
{
unsigned
char
bArea_Code
;
/* 0 - 125, 127 */
unsigned
char
bReq_Add
;
/* 0 */
unsigned
char
bArea_Code
;
/* 0 - 125, 127 */
unsigned
short
usAdd_Offset
;
/* 0 - 760 */
unsigned
short
usAdd_Offset
;
/* 0 - 760 */
unsigned
char
abData
[
DPM_MAX_LEN_DATA_UNIT
];
unsigned
char
abData
[
DPM_MAX_LEN_DATA_UNIT
];
}
GNUC_PACKED
DDLM_DOWNLOAD_REQUEST
;
}
GNUC_PACKED
DDLM_DOWNLOAD_REQUEST
;
...
@@ -695,11 +740,12 @@ typedef struct DDLM_DOWNLOAD_REQUESTtag {
...
@@ -695,11 +740,12 @@ typedef struct DDLM_DOWNLOAD_REQUESTtag {
#define DDLM_Upload 0x50
#define DDLM_Upload 0x50
/* message data structure */
/* message data structure */
typedef
struct
DDLM_UPLOAD_REQUESTtag
{
typedef
struct
DDLM_UPLOAD_REQUESTtag
unsigned
char
bReq_Add
;
/* 0 */
{
unsigned
char
bArea_Code
;
/* 0 - 125, 127 */
unsigned
char
bReq_Add
;
/* 0 */
unsigned
char
bArea_Code
;
/* 0 - 125, 127 */
unsigned
short
usAdd_Offset
;
/* 0 - 760 */
unsigned
short
usAdd_Offset
;
/* 0 - 760 */
unsigned
char
bData_Len
;
/* 1-240 */
unsigned
char
bData_Len
;
/* 1-240 */
}
GNUC_PACKED
DDLM_UPLOAD_REQUEST
;
}
GNUC_PACKED
DDLM_UPLOAD_REQUEST
;
/* ------------------------------- */
/* ------------------------------- */
...
@@ -710,7 +756,8 @@ typedef struct DDLM_UPLOAD_REQUESTtag {
...
@@ -710,7 +756,8 @@ typedef struct DDLM_UPLOAD_REQUESTtag {
#define DDLM_End_Seq 0x45
#define DDLM_End_Seq 0x45
/* message data structure */
/* message data structure */
typedef
struct
DDLM_END_SEQ_REQUESTtag
{
typedef
struct
DDLM_END_SEQ_REQUESTtag
{
unsigned
char
bReq_Add
;
/* 0 */
unsigned
char
bReq_Add
;
/* 0 */
}
GNUC_PACKED
DDLM_END_SEQ_REQUEST
;
}
GNUC_PACKED
DDLM_END_SEQ_REQUEST
;
...
@@ -722,7 +769,8 @@ typedef struct DDLM_END_SEQ_REQUESTtag {
...
@@ -722,7 +769,8 @@ typedef struct DDLM_END_SEQ_REQUESTtag {
#define DDLM_Global_Control 0x46
#define DDLM_Global_Control 0x46
/* message data structure */
/* message data structure */
typedef
struct
DDLM_GLOBAL_CONTROL_REQUESTtag
{
typedef
struct
DDLM_GLOBAL_CONTROL_REQUESTtag
{
unsigned
char
bRem_Add
;
/* 0 - 127 */
unsigned
char
bRem_Add
;
/* 0 - 127 */
unsigned
char
bControl_Command
;
unsigned
char
bControl_Command
;
#define CLEAR_DATA 0x02
#define CLEAR_DATA 0x02
...
@@ -734,7 +782,8 @@ typedef struct DDLM_GLOBAL_CONTROL_REQUESTtag {
...
@@ -734,7 +782,8 @@ typedef struct DDLM_GLOBAL_CONTROL_REQUESTtag {
unsigned
char
bGroup_Select
;
unsigned
char
bGroup_Select
;
}
GNUC_PACKED
DDLM_GLOBAL_CONTROL_REQUEST
;
}
GNUC_PACKED
DDLM_GLOBAL_CONTROL_REQUEST
;
typedef
struct
DDLM_GLOBAL_CONTROL_CONFIRMtag
{
typedef
struct
DDLM_GLOBAL_CONTROL_CONFIRMtag
{
unsigned
char
bRem_Add
;
/* 0 - 127 */
unsigned
char
bRem_Add
;
/* 0 - 127 */
}
GNUC_PACKED
DDLM_GLOBAL_CONTROL_CONFIRM
;
}
GNUC_PACKED
DDLM_GLOBAL_CONTROL_CONFIRM
;
...
@@ -773,26 +822,29 @@ typedef struct DDLM_GLOBAL_CONTROL_CONFIRMtag {
...
@@ -773,26 +822,29 @@ typedef struct DDLM_GLOBAL_CONTROL_CONFIRMtag {
#define DATA_STU_SIZE 244
#define DATA_STU_SIZE 244
typedef
struct
octet_strtag
{
typedef
struct
octet_strtag
unsigned
char
bLen
;
/* length of data field 0 to 244 */
{
unsigned
char
bLen
;
/* length of data field 0 to 244 */
unsigned
char
bValue
[
DATA_STU_SIZE
];
/* data field */
unsigned
char
bValue
[
DATA_STU_SIZE
];
/* data field */
}
GNUC_PACKED
octet_str
;
}
GNUC_PACKED
octet_str
;
typedef
struct
FDL_DATA_ACK_REQ_STUtag
{
typedef
struct
FDL_DATA_ACK_REQ_STUtag
unsigned
char
bSsap
;
/* Src.Serv.Acc.Point0-62,255 */
{
unsigned
char
bDsap
;
/* Dest.Serv.Acc.Point0-63,255 */
unsigned
char
bSsap
;
/* Src.Serv.Acc.Point0-62,255 */
unsigned
char
bDsap
;
/* Dest.Serv.Acc.Point0-63,255 */
unsigned
char
bRem_add_da
;
/* Remote Address 0-126 */
unsigned
char
bRem_add_da
;
/* Remote Address 0-126 */
unsigned
char
bServ_class
;
/* Prio Low=0,high=1*/
unsigned
char
bServ_class
;
/* Prio Low=0,high=1*/
octet_str
tL_sdu
;
/* data field structure */
octet_str
tL_sdu
;
/* data field structure */
}
GNUC_PACKED
FDL_DATA_ACK_REQ_STU
;
}
GNUC_PACKED
FDL_DATA_ACK_REQ_STU
;
typedef
struct
FDL_DATA_ACK_IND_STUtag
{
typedef
struct
FDL_DATA_ACK_IND_STUtag
unsigned
char
bDsap
;
/* Dest.Serv.Acc.Point0-63,255 */
{
unsigned
char
bSsap
;
/* Src.Serv.Acc.Point0-62,255 */
unsigned
char
bDsap
;
/* Dest.Serv.Acc.Point0-63,255 */
unsigned
char
bSsap
;
/* Src.Serv.Acc.Point0-62,255 */
unsigned
char
bRem_add_da
;
/* Remote Address 0-126 */
unsigned
char
bRem_add_da
;
/* Remote Address 0-126 */
unsigned
char
bLoc_add_da
;
/* local Address in PROFIBUS 0 to 127 */
unsigned
char
bLoc_add_da
;
/* local Address in PROFIBUS 0 to 127 */
unsigned
char
bServ_class
;
/* Prio Low=0,high=1*/
unsigned
char
bServ_class
;
/* Prio Low=0,high=1*/
octet_str
tL_sdu
;
/* data field structure */
octet_str
tL_sdu
;
/* data field structure */
}
GNUC_PACKED
FDL_DATA_ACK_IND_STU
;
}
GNUC_PACKED
FDL_DATA_ACK_IND_STU
;
/* --------------------------------- */
/* --------------------------------- */
...
@@ -810,36 +862,39 @@ typedef struct FDL_DATA_ACK_IND_STUtag {
...
@@ -810,36 +862,39 @@ typedef struct FDL_DATA_ACK_IND_STUtag {
#define FDL_Send_Data_Reply_Con 0x82
#define FDL_Send_Data_Reply_Con 0x82
#define FDL_Send_Data_Reply_Ind 0xC2
#define FDL_Send_Data_Reply_Ind 0xC2
typedef
struct
FDL_DATA_REPLY_REQ_STUtag
{
typedef
struct
FDL_DATA_REPLY_REQ_STUtag
unsigned
char
bSsap
;
/* Source Service Access Point 0 to 126 */
{
unsigned
char
bDsap
;
/* Destination Service Access Point 0 to 127 */
unsigned
char
bSsap
;
/* Source Service Access Point 0 to 126 */
unsigned
char
bDsap
;
/* Destination Service Access Point 0 to 127 */
unsigned
char
bRem_add_da
;
/* Remote Address in PROFIBUS 0 to 127 */
unsigned
char
bRem_add_da
;
/* Remote Address in PROFIBUS 0 to 127 */
unsigned
char
bServ_class
;
/* Priority of service = 0 Low */
unsigned
char
bServ_class
;
/* Priority of service = 0 Low */
octet_str
tL_sdu
;
/* data field structure */
octet_str
tL_sdu
;
/* data field structure */
}
GNUC_PACKED
FDL_DATA_REPLY_REQ_STU
;
}
GNUC_PACKED
FDL_DATA_REPLY_REQ_STU
;
typedef
struct
FDL_DATA_REPLY_CON_STUtag
{
typedef
struct
FDL_DATA_REPLY_CON_STUtag
unsigned
char
bSsap
;
/* Source Service Access Point 0 to 126 */
{
unsigned
char
bDsap
;
/* Destination Service Access Point 0 to 127 */
unsigned
char
bSsap
;
/* Source Service Access Point 0 to 126 */
unsigned
char
bDsap
;
/* Destination Service Access Point 0 to 127 */
unsigned
char
bRem_add_da
;
/* Remote Address in PROFIBUS 0 to 127 */
unsigned
char
bRem_add_da
;
/* Remote Address in PROFIBUS 0 to 127 */
unsigned
char
bServ_class
;
/* Priority of service = 0 Low */
unsigned
char
bServ_class
;
/* Priority of service = 0 Low */
unsigned
char
bL_status
;
/* Error code */
unsigned
char
bL_status
;
/* Error code */
octet_str
tL_sdu
;
/* data field structure */
octet_str
tL_sdu
;
/* data field structure */
}
GNUC_PACKED
FDL_DATA_REPLY_CON_STU
;
}
GNUC_PACKED
FDL_DATA_REPLY_CON_STU
;
typedef
struct
FDL_DATA_REPLY_IND_STUtag
{
typedef
struct
FDL_DATA_REPLY_IND_STUtag
unsigned
char
bDsap
;
/* Destination Service Access Point 0 to 127 */
{
unsigned
char
bSsap
;
/* Source Service Access Point 0 to 126 */
unsigned
char
bDsap
;
/* Destination Service Access Point 0 to 127 */
unsigned
char
bRem_add_da
;
/* Remote Address in PROFIBUS 0 to 127 */
unsigned
char
bSsap
;
/* Source Service Access Point 0 to 126 */
unsigned
char
bLoc_add_da
;
/* local Address in PROFIBUS 0 to 127 */
unsigned
char
bRem_add_da
;
/* Remote Address in PROFIBUS 0 to 127 */
unsigned
char
bServ_class
;
/* Priority of service = 0 Low */
unsigned
char
bLoc_add_da
;
/* local Address in PROFIBUS 0 to 127 */
unsigned
char
bServ_class
;
/* Priority of service = 0 Low */
unsigned
char
bUpdate_status
;
/* reply data sent, or not */
unsigned
char
bUpdate_status
;
/* reply data sent, or not */
octet_str
tL_sdu
;
/* data field structure */
octet_str
tL_sdu
;
/* data field structure */
}
GNUC_PACKED
FDL_DATA_REPLY_IND_STU
;
}
GNUC_PACKED
FDL_DATA_REPLY_IND_STU
;
/* definition for bUpdate_status */
/* definition for bUpdate_status */
#define CON_LO 0x20
/* low priority data transmitted in response */
#define CON_LO 0x20
/* low priority data transmitted in response */
#define CON_HI 0x21
/* high priority data transmitted in response */
#define CON_HI 0x21
/* high priority data transmitted in response */
#define CON_NO_DATA 0x22
/* no data transmitted in response */
#define CON_NO_DATA 0x22
/* no data transmitted in response */
/* --------------------------------- */
/* --------------------------------- */
...
@@ -848,21 +903,23 @@ typedef struct FDL_DATA_REPLY_IND_STUtag {
...
@@ -848,21 +903,23 @@ typedef struct FDL_DATA_REPLY_IND_STUtag {
#define FDL_Reply_Update_Req 0x83
#define FDL_Reply_Update_Req 0x83
typedef
struct
FDL_REPLY_UPDATE_REQ_STUtag
{
typedef
struct
FDL_REPLY_UPDATE_REQ_STUtag
unsigned
char
bSsap
;
/* Src.Serv.Acc.Point 0-62 */
{
unsigned
char
bDsap
;
/* not used */
unsigned
char
bSsap
;
/* Src.Serv.Acc.Point 0-62 */
unsigned
char
bDsap
;
/* not used */
unsigned
char
bRem_add_da
;
/* not used */
unsigned
char
bRem_add_da
;
/* not used */
unsigned
char
bServ_class
;
/* Prio Low=0,high=1*/
unsigned
char
bServ_class
;
/* Prio Low=0,high=1*/
unsigned
char
bTransmit
;
/* Single=1/Multiple=2*/
unsigned
char
bTransmit
;
/* Single=1/Multiple=2*/
octet_str
tL_sdu
;
/* data field structure */
octet_str
tL_sdu
;
/* data field structure */
}
GNUC_PACKED
FDL_REPLY_UPDATE_REQ_STU
;
}
GNUC_PACKED
FDL_REPLY_UPDATE_REQ_STU
;
typedef
struct
FDL_REPLY_UPDATE_CON_STUtag
{
typedef
struct
FDL_REPLY_UPDATE_CON_STUtag
unsigned
char
bSsap
;
/* Src.Serv.Acc.Point 0-62 */
{
unsigned
char
bDsap
;
/* Dest.Serv.Acc.Point 0-63 */
unsigned
char
bSsap
;
/* Src.Serv.Acc.Point 0-62 */
unsigned
char
bDsap
;
/* Dest.Serv.Acc.Point 0-63 */
unsigned
char
bRem_add_da
;
/* Remote Address 0-126 */
unsigned
char
bRem_add_da
;
/* Remote Address 0-126 */
unsigned
char
bServ_class
;
/* Prio Low=0,high=1*/
unsigned
char
bServ_class
;
/* Prio Low=0,high=1*/
unsigned
char
bL_status
;
/* error code */
unsigned
char
bL_status
;
/* error code */
}
GNUC_PACKED
FDL_REPLY_UPDATE_CON_STU
;
}
GNUC_PACKED
FDL_REPLY_UPDATE_CON_STU
;
/* --------------------------------- */
/* --------------------------------- */
...
@@ -872,9 +929,10 @@ typedef struct FDL_REPLY_UPDATE_CON_STUtag {
...
@@ -872,9 +929,10 @@ typedef struct FDL_REPLY_UPDATE_CON_STUtag {
#define FDL_SSap_Activate_req 0x97
#define FDL_SSap_Activate_req 0x97
#define FDL_SSap_Activate_con 0x97
#define FDL_SSap_Activate_con 0x97
typedef
struct
FDL_SAP_ACTIVATE_REQ_STUtag
{
typedef
struct
FDL_SAP_ACTIVATE_REQ_STUtag
unsigned
char
bSsap
;
/* Source Service Access Point 0-63,65 */
{
unsigned
char
bAccess
;
/* Accessright = 255 */
unsigned
char
bSsap
;
/* Source Service Access Point 0-63,65 */
unsigned
char
bAccess
;
/* Accessright = 255 */
unsigned
char
bService_list_length
;
/* Length of followed list = 4 */
unsigned
char
bService_list_length
;
/* Length of followed list = 4 */
#define SERVICE_SDA 0
#define SERVICE_SDA 0
...
@@ -889,16 +947,18 @@ typedef struct FDL_SAP_ACTIVATE_REQ_STUtag {
...
@@ -889,16 +947,18 @@ typedef struct FDL_SAP_ACTIVATE_REQ_STUtag {
unsigned
char
abRole_in_service
[
4
];
/* Configuration for the service */
unsigned
char
abRole_in_service
[
4
];
/* Configuration for the service */
struct
{
struct
unsigned
char
bReq_low
;
/* Maximum length of buffer = 240 */
{
unsigned
char
bReq_low
;
/* Maximum length of buffer = 240 */
unsigned
char
bReq_high
;
/* Maximum length of buffer = 240 */
unsigned
char
bReq_high
;
/* Maximum length of buffer = 240 */
unsigned
char
bInd_low
;
/* Maximum length of buffer = 240 */
unsigned
char
bInd_low
;
/* Maximum length of buffer = 240 */
unsigned
char
bInd_high
;
/* Maximum length of buffer = 240 */
unsigned
char
bInd_high
;
/* Maximum length of buffer = 240 */
}
GNUC_PACKED
tNon_cyclic_L_sdu_length_list
[
3
];
}
GNUC_PACKED
tNon_cyclic_L_sdu_length_list
[
3
];
}
GNUC_PACKED
FDL_SAP_ACTIVATE_REQ_STU
;
}
GNUC_PACKED
FDL_SAP_ACTIVATE_REQ_STU
;
typedef
struct
FDL_SAP_ACTIVATE_CON_STUtag
{
typedef
struct
FDL_SAP_ACTIVATE_CON_STUtag
{
unsigned
char
bSsap
;
/* Src. Service Access Pnt */
unsigned
char
bSsap
;
/* Src. Service Access Pnt */
unsigned
char
bM_status
;
unsigned
char
bM_status
;
}
GNUC_PACKED
FDL_SAP_ACTIVATE_CON_STU
;
}
GNUC_PACKED
FDL_SAP_ACTIVATE_CON_STU
;
...
@@ -910,19 +970,21 @@ typedef struct FDL_SAP_ACTIVATE_CON_STUtag {
...
@@ -910,19 +970,21 @@ typedef struct FDL_SAP_ACTIVATE_CON_STUtag {
#define FDL_RSap_Activate_Req 0x98
#define FDL_RSap_Activate_Req 0x98
#define FDL_RSap_Activate_Con 0x98
#define FDL_RSap_Activate_Con 0x98
typedef
struct
FDL_RSAP_ACTIVATE_REQ_STUtag
{
typedef
struct
FDL_RSAP_ACTIVATE_REQ_STUtag
unsigned
char
bSsap
;
/* Source Service Access Point 0-63,65 */
{
unsigned
char
bSsap
;
/* Source Service Access Point 0-63,65 */
unsigned
char
bAccess
;
/* Accessright = 255 */
unsigned
char
bAccess
;
/* Accessright = 255 */
unsigned
char
bIndication_mode
;
unsigned
char
bIndication_mode
;
unsigned
char
bReq_low
;
/* Maximum length of buffer = 240 */
unsigned
char
bReq_low
;
/* Maximum length of buffer = 240 */
unsigned
char
bReq_high
;
/* Maximum length of buffer = 240 */
unsigned
char
bReq_high
;
/* Maximum length of buffer = 240 */
unsigned
char
bInd_low
;
/* Maximum length of buffer = 240 */
unsigned
char
bInd_low
;
/* Maximum length of buffer = 240 */
unsigned
char
bInd_high
;
/* Maximum length of buffer = 240 */
unsigned
char
bInd_high
;
/* Maximum length of buffer = 240 */
}
GNUC_PACKED
FDL_RSAP_ACTIVATE_REQ_STU
;
}
GNUC_PACKED
FDL_RSAP_ACTIVATE_REQ_STU
;
typedef
struct
FDL_RSAP_ACTIVATE_CON_STUtag
{
typedef
struct
FDL_RSAP_ACTIVATE_CON_STUtag
{
unsigned
char
bSsap
;
/* Src. Service Access Pnt */
unsigned
char
bSsap
;
/* Src. Service Access Pnt */
unsigned
char
bM_status
;
unsigned
char
bM_status
;
}
GNUC_PACKED
FDL_RSAP_ACTIVATE_CON_STU
;
}
GNUC_PACKED
FDL_RSAP_ACTIVATE_CON_STU
;
...
@@ -934,11 +996,13 @@ typedef struct FDL_RSAP_ACTIVATE_CON_STUtag {
...
@@ -934,11 +996,13 @@ typedef struct FDL_RSAP_ACTIVATE_CON_STUtag {
#define FDL_Sap_Deactivate_Req 0x9A
#define FDL_Sap_Deactivate_Req 0x9A
#define FDL_Sap_Deactivate_Con 0x9A
#define FDL_Sap_Deactivate_Con 0x9A
typedef
struct
{
typedef
struct
{
unsigned
char
bSsap
;
/* Source Serv. Access Pnt 0-63,255 */
unsigned
char
bSsap
;
/* Source Serv. Access Pnt 0-63,255 */
}
GNUC_PACKED
FDL_SAP_DEACTIVATE_REQ_STU
;
}
GNUC_PACKED
FDL_SAP_DEACTIVATE_REQ_STU
;
typedef
struct
{
typedef
struct
{
unsigned
char
bSsap
;
/* Src. Service Access Pnt 0-63,255 */
unsigned
char
bSsap
;
/* Src. Service Access Pnt 0-63,255 */
unsigned
char
bM_status
;
unsigned
char
bM_status
;
}
GNUC_PACKED
FDL_SAP_DEACTIVATE_CON_STU
;
}
GNUC_PACKED
FDL_SAP_DEACTIVATE_CON_STU
;
...
@@ -963,7 +1027,7 @@ typedef struct {
...
@@ -963,7 +1027,7 @@ typedef struct {
#define CON_DI 0x3B
/* data fault or not complete */
#define CON_DI 0x3B
/* data fault or not complete */
#if defined(_MSC_VER)
/* Microsoft C */
#if defined(_MSC_VER)
/* Microsoft C */
#pragma pack()
/* Byte Alignment */
#pragma pack()
/* Byte Alignment */
#endif
#endif
#ifdef __cplusplus
#ifdef __cplusplus
...
...
profibus/lib/rt/src/dpsgdl.c
View file @
ce758cd3
/*
/******************************************************************************
* ProviewR Open Source Process Control.
* *
* Copyright (C) 2005-2019 SSAB EMEA AB.
* SOFTING Industrial Automation GmbH *
*
* Richard-Reitzner-Allee 6 *
* This file is part of ProviewR.
* D-85540 Haar *
*
* Phone: (++49)-(0)89-45656-0 *
* This program is free software; you can redistribute it and/or
* Fax: (++49)-(0)89-45656-399 *
* modify it under the terms of the GNU General Public License as
* *
* published by the Free Software Foundation, either version 2 of
* Copyright (C) SOFTING Industrial Automation GmbH 1995-2012 *
* the License, or (at your option) any later version.
* All Rights Reserved *
*
* *
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************
* *
* SOFTING AG *
* Richard-Reitzner-Allee 6 *
* D-85540 Haar *
* Phone: ++49-89-4 56 56-0 *
* Fax: ++49-89-4 56 56-3 99 *
* *
* Copyright (C) SOFTING AG 1998-2003 *
* All Rights Reserved *
* *
******************************************************************************
FILE_NAME DPSGDL.C
FILE_NAME DPSGDL.C
...
@@ -55,12 +20,12 @@ MODULE DPSGDL
...
@@ -55,12 +20,12 @@ MODULE DPSGDL
COMPONENT_LIBRARY PAPI Lib
COMPONENT_LIBRARY PAPI Lib
PAPI DLL
PAPI DLL
AUTHOR SOFTING
AG
AUTHOR SOFTING
VERSION 1.
2
0.0.00.release (DP-Slave Stand-Alone for DOS)
VERSION 1.
3
0.0.00.release (DP-Slave Stand-Alone for DOS)
5.22.0.00.release (WIN95/WIN98 and WinNT)
5.22.0.00.release (WIN95/WIN98 and WinNT)
DATE
26-
February-1999
DATE February-1999
STATUS finished
STATUS finished
...
@@ -107,7 +72,9 @@ LOCAL_DATA
...
@@ -107,7 +72,9 @@ LOCAL_DATA
#pragma check_stack(off)
#pragma check_stack(off)
#endif
#endif
FUNCTION
PUBLIC
INT16
dpsgdl_get_data_len
(
IN
INT16
result
,
IN
USIGN8
service
,
FUNCTION
PUBLIC
INT16
dpsgdl_get_data_len
(
IN
INT16
result
,
IN
USIGN8
service
,
IN
USIGN8
primitive
,
IN
USIGN8
FAR
*
data_ptr
,
OUT
INT16
FAR
*
data_len_ptr
)
IN
USIGN8
primitive
,
IN
USIGN8
FAR
*
data_ptr
,
OUT
INT16
FAR
*
data_len_ptr
)
/*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*/
/* FUNCTIONAL_DESCRIPTION */
/* FUNCTIONAL_DESCRIPTION */
/*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*/
...
@@ -121,29 +88,33 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
...
@@ -121,29 +88,33 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
FUNCTION_BODY
FUNCTION_BODY
switch
(
primitive
)
{
switch
(
primitive
)
/*--- USER REQUESTS ----------------------------------------------------*/
{
/*--- USER REQUESTS ----------------------------------------------------*/
case
REQ
:
{
case
REQ
:
switch
(
service
)
{
{
case
DPS_INIT_SLAVE
:
{
switch
(
service
)
{
case
DPS_INIT_SLAVE
:
{
init_slave_req_ptr
=
(
T_DPS_INIT_SLAVE_REQ
FAR
*
)
data_ptr
;
init_slave_req_ptr
=
(
T_DPS_INIT_SLAVE_REQ
FAR
*
)
data_ptr
;
if
((
init_slave_req_ptr
->
cfg_data_len
==
0
)
if
((
init_slave_req_ptr
->
cfg_data_len
==
0
)
||
||
(
init_slave_req_ptr
->
cfg_data_len
>
DP_MAX_CFG_DATA_LEN
))
{
(
init_slave_req_ptr
->
cfg_data_len
>
DP_MAX_CFG_DATA_LEN
))
result
=
E_IF_INVALID_DATA_SIZE
;
{
return
(
E_IF_INVALID_DATA_SIZE
);
return
(
E_IF_INVALID_DATA_SIZE
);
}
}
if
(
init_slave_req_ptr
->
enhanced_init_data_len
if
(
init_slave_req_ptr
->
enhanced_init_data_len
>
>
sizeof
(
init_slave_req_ptr
->
enhanced_init_data
))
{
sizeof
(
init_slave_req_ptr
->
enhanced_init_data
))
result
=
E_IF_INVALID_DATA_SIZE
;
{
return
(
E_IF_INVALID_DATA_SIZE
);
return
(
E_IF_INVALID_DATA_SIZE
);
}
}
*
data_len_ptr
=
sizeof
(
T_DPS_INIT_SLAVE_REQ
)
*
data_len_ptr
=
sizeof
(
T_DPS_INIT_SLAVE_REQ
)
-
-
(
sizeof
(
init_slave_req_ptr
->
enhanced_init_data
)
(
sizeof
(
init_slave_req_ptr
->
enhanced_init_data
)
-
-
init_slave_req_ptr
->
enhanced_init_data_len
);
init_slave_req_ptr
->
enhanced_init_data_len
);
break
;
break
;
}
/* case DPS_INIT_SLAVE */
}
/* case DPS_INIT_SLAVE */
...
@@ -151,16 +122,18 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
...
@@ -151,16 +122,18 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
*
data_len_ptr
=
0
;
*
data_len_ptr
=
0
;
break
;
break
;
case
DPS_SLAVE_DIAG
:
{
case
DPS_SLAVE_DIAG
:
{
slave_diag_req_ptr
=
(
T_DPS_SLAVE_DIAG_REQ
FAR
*
)
data_ptr
;
slave_diag_req_ptr
=
(
T_DPS_SLAVE_DIAG_REQ
FAR
*
)
data_ptr
;
if
(
slave_diag_req_ptr
->
ext_diag_data_len
>
DP_MAX_EXT_DIAG_DATA_LEN
)
{
if
(
slave_diag_req_ptr
->
ext_diag_data_len
>
DP_MAX_EXT_DIAG_DATA_LEN
)
result
=
E_IF_INVALID_DATA_SIZE
;
{
return
(
E_IF_INVALID_DATA_SIZE
);
return
(
E_IF_INVALID_DATA_SIZE
);
}
}
*
data_len_ptr
=
sizeof
(
T_DPS_SLAVE_DIAG_REQ
)
*
data_len_ptr
=
-
(
DP_MAX_EXT_DIAG_DATA_LEN
-
slave_diag_req_ptr
->
ext_diag_data_len
);
sizeof
(
T_DPS_SLAVE_DIAG_REQ
)
-
(
DP_MAX_EXT_DIAG_DATA_LEN
-
slave_diag_req_ptr
->
ext_diag_data_len
);
break
;
break
;
}
}
...
@@ -171,11 +144,9 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
...
@@ -171,11 +144,9 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
case
DPS_CHK_CFG
:
case
DPS_CHK_CFG
:
case
DPS_SET_PRM
:
case
DPS_SET_PRM
:
case
DPS_SET_SLAVE_ADD
:
case
DPS_SET_SLAVE_ADD
:
result
=
E_IF_INVALID_PRIMITIVE
;
return
(
E_IF_INVALID_PRIMITIVE
);
return
(
E_IF_INVALID_PRIMITIVE
);
default:
default:
result
=
E_IF_INVALID_SERVICE
;
return
(
E_IF_INVALID_SERVICE
);
return
(
E_IF_INVALID_SERVICE
);
}
/* switch serivce */
}
/* switch serivce */
...
@@ -183,10 +154,12 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
...
@@ -183,10 +154,12 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
break
;
break
;
}
/* case REQ */
}
/* case REQ */
/*---- USER RESPONSES --------------------------------------------------*/
/*---- USER RESPONSES --------------------------------------------------*/
case
RES
:
{
case
RES
:
switch
(
service
)
{
{
switch
(
service
)
{
case
DPS_CHK_CFG
:
case
DPS_CHK_CFG
:
*
data_len_ptr
=
sizeof
(
T_DPS_CHK_CFG_RES
);
*
data_len_ptr
=
sizeof
(
T_DPS_CHK_CFG_RES
);
break
;
break
;
...
@@ -195,7 +168,6 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
...
@@ -195,7 +168,6 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
break
;
break
;
default:
default:
result
=
E_IF_INVALID_SERVICE
;
return
(
E_IF_INVALID_SERVICE
);
return
(
E_IF_INVALID_SERVICE
);
}
/* switch serivce */
}
/* switch serivce */
...
@@ -203,15 +175,13 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
...
@@ -203,15 +175,13 @@ FUNCTION PUBLIC INT16 dpsgdl_get_data_len(IN INT16 result, IN USIGN8 service,
break
;
break
;
}
/* case RES */
}
/* case RES */
/*---- WRONG PRIMITIVE -------------------------------------------------*/
/*---- WRONG PRIMITIVE -------------------------------------------------*/
default:
default:
result
=
E_IF_INVALID_PRIMITIVE
;
return
(
E_IF_INVALID_PRIMITIVE
);
return
(
E_IF_INVALID_PRIMITIVE
);
}
/* switch primitive */
}
/* switch primitive */
result
=
E_OK
;
return
(
E_OK
);
return
(
E_OK
);
}
/* dpsgdl_get_data_len */
}
/* dpsgdl_get_data_len */
...
...
profibus/lib/rt/src/fdlgdl.c
View file @
ce758cd3
/*
/******************************************************************************
* ProviewR Open Source Process Control.
* *
* Copyright (C) 2005-2019 SSAB EMEA AB.
* SOFTING Industrial Automation GmbH *
*
* Richard-Reitzner-Allee 6 *
* This file is part of ProviewR.
* D-85540 Haar *
*
* Phone: (++49)-(0)89-45656-0 *
* This program is free software; you can redistribute it and/or
* Fax: (++49)-(0)89-45656-399 *
* modify it under the terms of the GNU General Public License as
* *
* published by the Free Software Foundation, either version 2 of
* Copyright (C) SOFTING Industrial Automation GmbH 1995-2012 *
* the License, or (at your option) any later version.
* All Rights Reserved *
*
* *
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************
* *
* SOFTING AG *
* Richard-Reitzner-Allee 6 *
* D-85540 Haar *
* Phone: ++49-89-4 56 56-0 *
* Fax: ++49-89-4 56 56-3 99 *
* *
* Copyright (C) SOFTING AG 1995-2003 *
* All Rights Reserved *
* *
******************************************************************************
FILE_NAME FDLGDL.C
FILE_NAME FDLGDL.C
...
@@ -55,11 +20,11 @@ MODULE FDLGDL
...
@@ -55,11 +20,11 @@ MODULE FDLGDL
COMPONENT_LIBRARY PAPI Lib
COMPONENT_LIBRARY PAPI Lib
PAPI DLL
PAPI DLL
AUTHOR SOFTING
AG
AUTHOR SOFTING
VERSION 5.23.0.00.release
VERSION 5.23.0.00.release
DATE
30-
October-2000
DATE October-2000
STATUS finished
STATUS finished
...
@@ -105,12 +70,13 @@ LOCAL_DATA
...
@@ -105,12 +70,13 @@ LOCAL_DATA
#pragma check_stack(off)
#pragma check_stack(off)
#endif
#endif
FUNCTION
PUBLIC
INT16
fdlgdl_get_data_len
(
IN
INT16
result
,
/* Service-Result */
FUNCTION
PUBLIC
INT16
fdlgdl_get_data_len
(
IN
USIGN8
service
,
/* Service */
IN
INT16
result
,
/* Service-Result */
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
service
,
/* Service */
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
FAR
*
data_ptr
,
/* pointer to data */
IN
USIGN8
FAR
*
data_ptr
,
/* pointer to data */
OUT
INT16
*
data_len_ptr
/* length of data */
OUT
INT16
*
data_len_ptr
/* length of data */
)
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -129,20 +95,26 @@ possible return values:
...
@@ -129,20 +95,26 @@ possible return values:
*
data_len_ptr
=
0
;
*
data_len_ptr
=
0
;
result
=
E_OK
;
result
=
E_OK
;
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
switch
(
service
)
{
{
switch
(
service
)
{
case
FDLIF_SDA
:
case
FDLIF_SDA
:
case
FDLIF_SDN
:
case
FDLIF_SDN
:
case
FDLIF_SRD
:
{
case
FDLIF_SRD
:
{
T_FDLIF_SDN_SDA_SRD_REQ
FAR
*
req
=
(
T_FDLIF_SDN_SDA_SRD_REQ
FAR
*
)
data_ptr
;
T_FDLIF_SDN_SDA_SRD_REQ
FAR
*
req
=
(
T_FDLIF_SDN_SDA_SRD_REQ
FAR
*
)
data_ptr
;
*
data_len_ptr
=
sizeof
(
T_FDLIF_SDN_SDA_SRD_REQ
)
+
req
->
length
;
*
data_len_ptr
=
sizeof
(
T_FDLIF_SDN_SDA_SRD_REQ
)
+
req
->
length
;
}
break
;
}
break
;
case
FDLIF_REPLY_UPDATE
:
case
FDLIF_REPLY_UPDATE
:
case
FDLIF_REPLY_UPDATE_MULTIPLE
:
{
case
FDLIF_REPLY_UPDATE_MULTIPLE
:
{
T_FDLIF_RUP_REQ
FAR
*
req
=
(
T_FDLIF_RUP_REQ
FAR
*
)
data_ptr
;
T_FDLIF_RUP_REQ
FAR
*
req
=
(
T_FDLIF_RUP_REQ
FAR
*
)
data_ptr
;
*
data_len_ptr
=
sizeof
(
T_FDLIF_RUP_REQ
)
+
req
->
length
;
*
data_len_ptr
=
sizeof
(
T_FDLIF_RUP_REQ
)
+
req
->
length
;
}
break
;
}
break
;
case
FDLIF_SET_BUSPARAMETER
:
case
FDLIF_SET_BUSPARAMETER
:
*
data_len_ptr
=
sizeof
(
T_FDLIF_SET_BUSPARAMETER_REQ
);
*
data_len_ptr
=
sizeof
(
T_FDLIF_SET_BUSPARAMETER_REQ
);
...
@@ -177,7 +149,9 @@ possible return values:
...
@@ -177,7 +149,9 @@ possible return values:
result
=
E_IF_INVALID_SERVICE
;
result
=
E_IF_INVALID_SERVICE
;
break
;
break
;
}
}
}
else
{
}
else
{
result
=
E_IF_INVALID_PRIMITIVE
;
result
=
E_IF_INVALID_PRIMITIVE
;
}
}
...
...
profibus/lib/rt/src/fm7gdl.c
View file @
ce758cd3
/*
/******************************************************************************
* ProviewR Open Source Process Control.
* *
* Copyright (C) 2005-2019 SSAB EMEA AB.
* SOFTING Industrial Automation GmbH *
*
* Richard-Reitzner-Allee 6 *
* This file is part of ProviewR.
* D-85540 Haar *
*
* Phone: (++49)-(0)89-45656-0 *
* This program is free software; you can redistribute it and/or
* Fax: (++49)-(0)89-45656-399 *
* modify it under the terms of the GNU General Public License as
* *
* published by the Free Software Foundation, either version 2 of
* Copyright (C) SOFTING Industrial Automation GmbH 1995-2012 *
* the License, or (at your option) any later version.
* All Rights Reserved *
*
* *
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************
* *
* SOFTING AG *
* Richard-Reitzner-Allee 6 *
* D-85540 Haar *
* Phone: ++49-89-4 56 56-0 *
* Fax: ++49-89-4 56 56-3 99 *
* *
* Copyright (C) SOFTING AG 1995-2003 *
* All Rights Reserved *
* *
******************************************************************************
FILE_NAME FM7GDL.C
FILE_NAME FM7GDL.C
...
@@ -55,11 +20,11 @@ MODULE FM7GDL
...
@@ -55,11 +20,11 @@ MODULE FM7GDL
COMPONENT_LIBRARY PAPI Lib
COMPONENT_LIBRARY PAPI Lib
PAPI DLL
PAPI DLL
AUTHOR SOFTING
AG
AUTHOR SOFTING
VERSION 5.21.0.00.release
VERSION 5.21.0.00.release
DATE
27-
February-1998
DATE February-1998
STATUS finished
STATUS finished
...
@@ -111,9 +76,10 @@ LOCAL_DATA
...
@@ -111,9 +76,10 @@ LOCAL_DATA
#pragma check_stack(off)
#pragma check_stack(off)
#endif
#endif
FUNCTION
LOCAL
INT16
fm7gdl_get_ctxt_data_len
(
IN
USIGN8
service
,
/* Service */
FUNCTION
LOCAL
INT16
fm7gdl_get_ctxt_data_len
(
IN
USIGN8
service
,
/* Service */
IN
USIGN8
primitive
/* Service-Primitive */
IN
USIGN8
primitive
/* Service-Primitive */
)
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -131,17 +97,21 @@ possible return values:
...
@@ -131,17 +97,21 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
if
(
service
==
FM7_ABORT
&&
primitive
==
REQ
)
{
if
(
service
==
FM7_ABORT
&&
primitive
==
REQ
)
{
return
(
sizeof
(
T_FM7_ABORT_REQ
));
return
(
sizeof
(
T_FM7_ABORT_REQ
));
}
else
{
}
else
{
return
(
0
);
return
(
0
);
}
}
}
}
FUNCTION
LOCAL
INT16
fm7gdl_get_crl_data_len
(
IN
USIGN8
service
,
/* Service */
FUNCTION
LOCAL
INT16
fm7gdl_get_crl_data_len
(
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
service
,
/* Service */
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
FAR
*
data_ptr
/* pointer to data */
IN
USIGN8
FAR
*
data_ptr
/* pointer to data */
)
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -169,7 +139,8 @@ possible return values:
...
@@ -169,7 +139,8 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
switch
(
service
)
{
switch
(
service
)
{
case
FM7_LOAD_CRL_LOC
:
case
FM7_LOAD_CRL_LOC
:
case
FM7_LOAD_CRL_REM
:
case
FM7_LOAD_CRL_REM
:
if
(
primitive
==
REQ
)
if
(
primitive
==
REQ
)
...
@@ -179,9 +150,12 @@ possible return values:
...
@@ -179,9 +150,12 @@ possible return values:
case
FM7_READ_CRL_LOC
:
case
FM7_READ_CRL_LOC
:
case
FM7_READ_CRL_REM
:
case
FM7_READ_CRL_REM
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
{
return
(
sizeof
(
T_READ_CRL_REQ
));
return
(
sizeof
(
T_READ_CRL_REQ
));
}
else
{
}
else
{
T_READ_CRL_CNF
FAR
*
rsp
=
(
T_READ_CRL_CNF
FAR
*
)
data_ptr
;
T_READ_CRL_CNF
FAR
*
rsp
=
(
T_READ_CRL_CNF
FAR
*
)
data_ptr
;
if
(
rsp
->
desired_cr
==
0
)
if
(
rsp
->
desired_cr
==
0
)
...
@@ -196,10 +170,10 @@ possible return values:
...
@@ -196,10 +170,10 @@ possible return values:
}
}
FUNCTION
LOCAL
INT16
fm7gdl_get_s_r_value_data_len
(
FUNCTION
LOCAL
INT16
fm7gdl_get_s_r_value_data_len
(
IN
USIGN8
service
,
/* Service */
IN
USIGN8
service
,
/* Service */
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
FAR
*
data_ptr
/* pointer to data */
IN
USIGN8
FAR
*
data_ptr
/* pointer to data */
)
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -224,13 +198,16 @@ possible return values:
...
@@ -224,13 +198,16 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
switch
(
service
)
{
switch
(
service
)
{
case
FM7_SET_VALUE_LOC
:
case
FM7_SET_VALUE_LOC
:
case
FM7_SET_VALUE_REM
:
case
FM7_SET_VALUE_REM
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
{
T_SET_VALUE_REQ
FAR
*
req
=
(
T_SET_VALUE_REQ
FAR
*
)
data_ptr
;
T_SET_VALUE_REQ
FAR
*
req
=
(
T_SET_VALUE_REQ
FAR
*
)
data_ptr
;
return
(
sizeof
(
T_SET_VALUE_REQ
)
+
req
->
length
);
return
(
sizeof
(
T_SET_VALUE_REQ
)
+
req
->
length
);
}
else
}
else
return
(
0
);
return
(
0
);
case
FM7_SET_BUSPARAMETER
:
case
FM7_SET_BUSPARAMETER
:
...
@@ -241,9 +218,12 @@ possible return values:
...
@@ -241,9 +218,12 @@ possible return values:
case
FM7_READ_VALUE_LOC
:
case
FM7_READ_VALUE_LOC
:
case
FM7_READ_VALUE_REM
:
case
FM7_READ_VALUE_REM
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
{
return
(
sizeof
(
T_READ_VALUE_REQ
));
return
(
sizeof
(
T_READ_VALUE_REQ
));
}
else
{
}
else
{
T_READ_VALUE_CNF
FAR
*
rsp
=
(
T_READ_VALUE_CNF
FAR
*
)
data_ptr
;
T_READ_VALUE_CNF
FAR
*
rsp
=
(
T_READ_VALUE_CNF
FAR
*
)
data_ptr
;
return
(
sizeof
(
T_READ_VALUE_CNF
)
+
rsp
->
length
);
return
(
sizeof
(
T_READ_VALUE_CNF
)
+
rsp
->
length
);
}
}
...
@@ -255,7 +235,7 @@ possible return values:
...
@@ -255,7 +235,7 @@ possible return values:
FUNCTION
LOCAL
INT16
fm7gdl_get_ident_data_len
(
FUNCTION
LOCAL
INT16
fm7gdl_get_ident_data_len
(
IN
USIGN8
primitive
/* Service-Primitive */
IN
USIGN8
primitive
/* Service-Primitive */
)
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -349,7 +329,7 @@ possible return values:
...
@@ -349,7 +329,7 @@ possible return values:
}
}
FUNCTION
LOCAL
INT16
fm7gdl_get_error_data_len
(
IN
USIGN8
service
/* Service */
FUNCTION
LOCAL
INT16
fm7gdl_get_error_data_len
(
IN
USIGN8
service
/* Service */
)
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -389,7 +369,8 @@ possible return values:
...
@@ -389,7 +369,8 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
switch
(
service
)
{
switch
(
service
)
{
case
FM7_INITIATE
:
case
FM7_INITIATE
:
return
(
sizeof
(
T_FM7_INIT_ERR_CNF
));
return
(
sizeof
(
T_FM7_INIT_ERR_CNF
));
...
@@ -425,12 +406,13 @@ possible return values:
...
@@ -425,12 +406,13 @@ possible return values:
}
}
}
}
FUNCTION
PUBLIC
INT16
fm7gdl_get_data_len
(
IN
INT16
result
,
/* Service-Result */
FUNCTION
PUBLIC
INT16
fm7gdl_get_data_len
(
IN
USIGN8
service
,
/* Service */
IN
INT16
result
,
/* Service-Result */
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
service
,
/* Service */
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
FAR
*
data_ptr
,
/* pointer to data */
IN
USIGN8
FAR
*
data_ptr
,
/* pointer to data */
OUT
INT16
*
data_len_ptr
/* length of data */
OUT
INT16
*
data_len_ptr
/* length of data */
)
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -448,7 +430,8 @@ possible return values:
...
@@ -448,7 +430,8 @@ possible return values:
*
data_len_ptr
=
0
;
*
data_len_ptr
=
0
;
switch
(
service
)
{
switch
(
service
)
{
case
FM7_READ_CRL_LOC
:
case
FM7_READ_CRL_LOC
:
case
FM7_INIT_LOAD_CRL_LOC
:
case
FM7_INIT_LOAD_CRL_LOC
:
case
FM7_LOAD_CRL_LOC
:
case
FM7_LOAD_CRL_LOC
:
...
@@ -470,8 +453,8 @@ possible return values:
...
@@ -470,8 +453,8 @@ possible return values:
case
FM7_SET_VALUE_REM
:
case
FM7_SET_VALUE_REM
:
case
FM7_READ_VALUE_REM
:
case
FM7_READ_VALUE_REM
:
if
(
result
==
POS
)
if
(
result
==
POS
)
*
data_len_ptr
*
data_len_ptr
=
=
fm7gdl_get_s_r_value_data_len
(
service
,
primitive
,
data_ptr
);
fm7gdl_get_s_r_value_data_len
(
service
,
primitive
,
data_ptr
);
else
else
*
data_len_ptr
=
fm7gdl_get_error_data_len
(
service
);
*
data_len_ptr
=
fm7gdl_get_error_data_len
(
service
);
break
;
break
;
...
@@ -518,6 +501,7 @@ possible return values:
...
@@ -518,6 +501,7 @@ possible return values:
default:
default:
return
(
E_IF_INVALID_SERVICE
);
return
(
E_IF_INVALID_SERVICE
);
break
;
}
}
return
(
E_OK
);
return
(
E_OK
);
...
...
profibus/lib/rt/src/fmbgdl.c
View file @
ce758cd3
/*
/******************************************************************************
* ProviewR Open Source Process Control.
* *
* Copyright (C) 2005-2019 SSAB EMEA AB.
* SOFTING Industrial Automation GmbH *
*
* Richard-Reitzner-Allee 6 *
* This file is part of ProviewR.
* D-85540 Haar *
*
* Phone: (++49)-(0)89-45656-0 *
* This program is free software; you can redistribute it and/or
* Fax: (++49)-(0)89-45656-399 *
* modify it under the terms of the GNU General Public License as
* *
* published by the Free Software Foundation, either version 2 of
* Copyright (C) SOFTING Industrial Automation GmbH 1995-2012 *
* the License, or (at your option) any later version.
* All Rights Reserved *
*
* *
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************
* *
* SOFTING AG *
* Richard-Reitzner-Allee 6 *
* D-85540 Haar *
* Phone: ++49-89-4 56 56-0 *
* Fax: ++49-89-4 56 56-3 99 *
* *
* Copyright (C) SOFTING AG 1995-2003 *
* All Rights Reserved *
* *
******************************************************************************
FILE_NAME FMBGDL.C
FILE_NAME FMBGDL.C
...
@@ -55,11 +20,11 @@ MODULE FMBGDL
...
@@ -55,11 +20,11 @@ MODULE FMBGDL
COMPONENT_LIBRARY PAPI Lib
COMPONENT_LIBRARY PAPI Lib
PAPI DLL
PAPI DLL
AUTHOR SOFTING
AG
AUTHOR SOFTING
VERSION 5.
21
.0.00.release
VERSION 5.
45
.0.00.release
DATE
27-February-1998
DATE
October-2009
STATUS finished
STATUS finished
...
@@ -105,12 +70,13 @@ LOCAL_DATA
...
@@ -105,12 +70,13 @@ LOCAL_DATA
#pragma check_stack(off)
#pragma check_stack(off)
#endif
#endif
FUNCTION
PUBLIC
INT16
fmbgdl_get_data_len
(
IN
INT16
result
,
/* Service-Result */
FUNCTION
PUBLIC
INT16
fmbgdl_get_data_len
(
IN
USIGN8
service
,
/* Service */
IN
INT16
result
,
/* Service-Result */
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
service
,
/* Service */
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
FAR
*
data_ptr
,
/* pointer to data */
IN
USIGN8
FAR
*
data_ptr
,
/* pointer to data */
OUT
INT16
*
data_len_ptr
/* length of data */
OUT
INT16
*
data_len_ptr
/* length of data */
)
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -129,24 +95,29 @@ possible return values:
...
@@ -129,24 +95,29 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
switch
(
service
)
{
{
case
FMB_SET_CONFIGURATION
:
{
switch
(
service
)
T_FMB_SET_CONFIGURATION_REQ
FAR
*
req_ptr
{
=
(
T_FMB_SET_CONFIGURATION_REQ
FAR
*
)
data_ptr
;
case
FMB_SET_CONFIGURATION
:
{
T_FMB_SET_CONFIGURATION_REQ
FAR
*
req_ptr
=
(
T_FMB_SET_CONFIGURATION_REQ
FAR
*
)
data_ptr
;
#ifdef WIN32
#ifdef WIN32
req_ptr
->
sm7_active
&=
0xFE
;
req_ptr
->
sm7_active
&=
0xFE
;
#else
#else
req_ptr
->
sm7_active
=
PB_FALSE
;
req_ptr
->
sm7_active
=
PB_FALSE
;
#endif
#endif
*
data_len_ptr
=
sizeof
(
T_FMB_SET_CONFIGURATION_REQ
);
*
data_len_ptr
=
sizeof
(
T_FMB_SET_CONFIGURATION_REQ
);
}
break
;
}
break
;
case
FMB_SET_BUSPARAMETER
:
case
FMB_SET_BUSPARAMETER
:
*
data_len_ptr
=
sizeof
(
T_FMB_SET_BUSPARAMETER_REQ
);
*
data_len_ptr
=
sizeof
(
T_FMB_SET_BUSPARAMETER_REQ
);
break
;
break
;
case
FMB_SET_VALUE
:
{
case
FMB_SET_VALUE
:
{
T_FMB_SET_VALUE_REQ
FAR
*
req
=
(
T_FMB_SET_VALUE_REQ
FAR
*
)
data_ptr
;
T_FMB_SET_VALUE_REQ
FAR
*
req
=
(
T_FMB_SET_VALUE_REQ
FAR
*
)
data_ptr
;
*
data_len_ptr
=
(
sizeof
(
T_FMB_SET_VALUE_REQ
)
+
req
->
length
);
*
data_len_ptr
=
(
sizeof
(
T_FMB_SET_VALUE_REQ
)
+
req
->
length
);
break
;
break
;
...
@@ -160,6 +131,10 @@ possible return values:
...
@@ -160,6 +131,10 @@ possible return values:
*
data_len_ptr
=
sizeof
(
T_FMB_LSAP_STATUS_REQ
);
*
data_len_ptr
=
sizeof
(
T_FMB_LSAP_STATUS_REQ
);
break
;
break
;
case
FMB_VALIDATE_MASTER
:
*
data_len_ptr
=
sizeof
(
T_FMB_VALIDATE_MASTER_REQ
);
break
;
case
FMB_GET_LIVE_LIST
:
case
FMB_GET_LIVE_LIST
:
case
FMB_READ_BUSPARAMETER
:
case
FMB_READ_BUSPARAMETER
:
case
FMB_EXIT
:
case
FMB_EXIT
:
...
@@ -172,7 +147,9 @@ possible return values:
...
@@ -172,7 +147,9 @@ possible return values:
ret_val
=
E_IF_INVALID_SERVICE
;
ret_val
=
E_IF_INVALID_SERVICE
;
break
;
break
;
}
}
}
else
{
}
else
{
ret_val
=
E_IF_INVALID_PRIMITIVE
;
ret_val
=
E_IF_INVALID_PRIMITIVE
;
}
}
...
...
profibus/lib/rt/src/fmsgdl.c
View file @
ce758cd3
/*
/******************************************************************************
* ProviewR Open Source Process Control.
* *
* Copyright (C) 2005-2019 SSAB EMEA AB.
* SOFTING Industrial Automation GmbH *
*
* Richard-Reitzner-Allee 6 *
* This file is part of ProviewR.
* D-85540 Haar *
*
* Phone: (++49)-(0)89-45656-0 *
* This program is free software; you can redistribute it and/or
* Fax: (++49)-(0)89-45656-399 *
* modify it under the terms of the GNU General Public License as
* *
* published by the Free Software Foundation, either version 2 of
* Copyright (C) SOFTING Industrial Automation GmbH 1995-2012 *
* the License, or (at your option) any later version.
* All Rights Reserved *
*
* *
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************
* *
* SOFTING AG *
* Richard-Reitzner-Allee 6 *
* D-85540 Haar *
* Phone: ++49-89-4 56 56-0 *
* Fax: ++49-89-4 56 56-3 99 *
* *
* Copyright (C) SOFTING AG 1995-2003 *
* All Rights Reserved *
* *
******************************************************************************
FILE_NAME FMSGDL.C
FILE_NAME FMSGDL.C
...
@@ -55,11 +20,11 @@ MODULE FMSGDL
...
@@ -55,11 +20,11 @@ MODULE FMSGDL
COMPONENT_LIBRARY PAPI Lib
COMPONENT_LIBRARY PAPI Lib
PAPI DLL
PAPI DLL
AUTHOR SOFTING
AG
AUTHOR SOFTING
VERSION 5.21.0.00.release
VERSION 5.21.0.00.release
DATE
27-
February-1998
DATE February-1998
STATUS finished
STATUS finished
...
@@ -105,9 +70,10 @@ LOCAL_DATA
...
@@ -105,9 +70,10 @@ LOCAL_DATA
#pragma check_stack(off)
#pragma check_stack(off)
#endif
#endif
FUNCTION
LOCAL
INT16
fmsgdl_get_ctxt_data_len
(
IN
USIGN8
service
,
/* Service */
FUNCTION
LOCAL
INT16
fmsgdl_get_ctxt_data_len
(
IN
USIGN8
service
,
/* Service */
IN
USIGN8
primitive
/* Service-Primitive */
IN
USIGN8
primitive
/* Service-Primitive */
)
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -126,7 +92,8 @@ possible return values:
...
@@ -126,7 +92,8 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
switch
(
service
)
{
switch
(
service
)
{
case
FMS_INITIATE
:
case
FMS_INITIATE
:
if
(
primitive
==
REQ
)
if
(
primitive
==
REQ
)
return
(
sizeof
(
T_CTXT_INIT_REQ
));
return
(
sizeof
(
T_CTXT_INIT_REQ
));
...
@@ -144,9 +111,10 @@ possible return values:
...
@@ -144,9 +111,10 @@ possible return values:
}
}
}
}
FUNCTION
LOCAL
INT16
fmsgdl_get_vfd_data_len
(
IN
USIGN8
service
,
/* Service */
FUNCTION
LOCAL
INT16
fmsgdl_get_vfd_data_len
(
IN
USIGN8
service
,
/* Service */
IN
USIGN8
primitive
/* Service-Primitive */
IN
USIGN8
primitive
/* Service-Primitive */
)
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -168,7 +136,8 @@ possible return values:
...
@@ -168,7 +136,8 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
switch
(
service
)
{
switch
(
service
)
{
case
FMS_STATUS
:
case
FMS_STATUS
:
if
(
primitive
==
RES
)
if
(
primitive
==
RES
)
return
(
sizeof
(
T_VFD_STATUS_CNF
));
return
(
sizeof
(
T_VFD_STATUS_CNF
));
...
@@ -204,10 +173,11 @@ possible return values:
...
@@ -204,10 +173,11 @@ possible return values:
}
}
}
}
FUNCTION
LOCAL
INT16
fmsgdl_get_od_data_len
(
IN
USIGN8
service
,
/* Service */
FUNCTION
LOCAL
INT16
fmsgdl_get_od_data_len
(
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
service
,
/* Service */
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
FAR
*
data_ptr
/* pointer to data */
IN
USIGN8
FAR
*
data_ptr
/* pointer to data */
)
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -233,24 +203,32 @@ possible return values:
...
@@ -233,24 +203,32 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
switch
(
service
)
{
switch
(
service
)
{
case
FMS_GET_OD
:
case
FMS_GET_OD
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
{
return
(
sizeof
(
T_GET_OD_REQ
));
return
(
sizeof
(
T_GET_OD_REQ
));
}
else
{
}
else
{
T_GET_OD_CNF
FAR
*
rsp
=
(
T_GET_OD_CNF
FAR
*
)
data_ptr
;
T_GET_OD_CNF
FAR
*
rsp
=
(
T_GET_OD_CNF
FAR
*
)
data_ptr
;
USIGN8
FAR
*
obj_descr_ptr
=
(
USIGN8
FAR
*
)(
rsp
+
1
);
USIGN8
FAR
*
obj_descr_ptr
=
(
USIGN8
FAR
*
)(
rsp
+
1
);
USIGN16
offset
=
0
;
USIGN16
offset
=
0
;
USIGN16
size
=
0
;
USIGN16
size
=
0
;
USIGN8
i
;
USIGN8
i
;
if
(
rsp
->
no_of_od_descr
!=
0
)
{
if
(
rsp
->
no_of_od_descr
!=
0
)
for
(
i
=
0
;
i
<
rsp
->
no_of_od_descr
;
i
++
)
{
{
for
(
i
=
0
;
i
<
rsp
->
no_of_od_descr
;
i
++
)
{
size
+=
(
obj_descr_ptr
[
offset
]
+
1
);
size
+=
(
obj_descr_ptr
[
offset
]
+
1
);
offset
=
size
;
offset
=
size
;
}
}
return
(
sizeof
(
T_GET_OD_CNF
)
+
size
);
return
(
sizeof
(
T_GET_OD_CNF
)
+
size
);
}
else
{
}
else
{
return
(
0
);
return
(
0
);
}
}
}
}
...
@@ -262,19 +240,22 @@ possible return values:
...
@@ -262,19 +240,22 @@ possible return values:
return
(
0
);
return
(
0
);
case
FMS_PUT_OD
:
case
FMS_PUT_OD
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
{
T_PUT_OD_REQ
FAR
*
req
=
(
T_PUT_OD_REQ
FAR
*
)
data_ptr
;
T_PUT_OD_REQ
FAR
*
req
=
(
T_PUT_OD_REQ
FAR
*
)
data_ptr
;
USIGN8
FAR
*
obj_descr_ptr
=
(
USIGN8
FAR
*
)(
req
+
1
);
USIGN8
FAR
*
obj_descr_ptr
=
(
USIGN8
FAR
*
)(
req
+
1
);
USIGN16
offset
=
0
;
USIGN16
offset
=
0
;
USIGN16
size
=
0
;
USIGN16
size
=
0
;
USIGN8
i
;
USIGN8
i
;
for
(
i
=
0
;
i
<
req
->
no_of_od_descr
;
i
++
)
{
for
(
i
=
0
;
i
<
req
->
no_of_od_descr
;
i
++
)
{
size
+=
(
obj_descr_ptr
[
offset
]
+
1
);
size
+=
(
obj_descr_ptr
[
offset
]
+
1
);
offset
=
size
;
offset
=
size
;
}
}
return
(
sizeof
(
T_PUT_OD_REQ
)
+
size
);
return
(
sizeof
(
T_PUT_OD_REQ
)
+
size
);
}
else
}
else
return
(
0
);
return
(
0
);
case
FMS_INIT_LOAD_OD_LOC
:
case
FMS_INIT_LOAD_OD_LOC
:
...
@@ -290,33 +271,37 @@ possible return values:
...
@@ -290,33 +271,37 @@ possible return values:
return
(
0
);
return
(
0
);
case
FMS_LOAD_OD_LOC
:
case
FMS_LOAD_OD_LOC
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
{
T_LOAD_OD_REQ
FAR
*
req
=
(
T_LOAD_OD_REQ
FAR
*
)
data_ptr
;
T_LOAD_OD_REQ
FAR
*
req
=
(
T_LOAD_OD_REQ
FAR
*
)
data_ptr
;
T_OD_NULL_OBJECT
FAR
*
object
T_OD_NULL_OBJECT
FAR
*
object
=
=
(
T_OD_NULL_OBJECT
FAR
*
)
&
req
->
obj_descr
.
id
.
null_obj_descr
;
(
T_OD_NULL_OBJECT
FAR
*
)
&
req
->
obj_descr
.
id
.
null_obj_descr
;
switch
(
object
->
obj_code
)
{
switch
(
object
->
obj_code
)
{
case
TYPE_STRUCT_OBJECT
:
case
TYPE_STRUCT_OBJECT
:
return
(
sizeof
(
T_LOAD_OD_REQ
)
return
(
sizeof
(
T_LOAD_OD_REQ
)
+
+
(
req
->
obj_descr
.
id
.
ds_obj_descr
.
no_of_elements
(
req
->
obj_descr
.
id
.
ds_obj_descr
.
no_of_elements
*
*
sizeof
(
T_OD_DT_LIST
)));
sizeof
(
T_OD_DT_LIST
)));
case
RECORD_OBJECT
:
case
RECORD_OBJECT
:
return
(
sizeof
(
T_LOAD_OD_REQ
)
return
(
sizeof
(
T_LOAD_OD_REQ
)
+
+
(
req
->
obj_descr
.
id
.
r_var_obj_descr
.
no_of_address
(
req
->
obj_descr
.
id
.
r_var_obj_descr
.
no_of_address
*
*
sizeof
(
USIGN32
)));
sizeof
(
USIGN32
)));
case
VAR_LIST_OBJECT
:
case
VAR_LIST_OBJECT
:
return
(
sizeof
(
T_LOAD_OD_REQ
)
return
(
+
(
req
->
obj_descr
.
id
.
vlist_obj_descr
.
no_of_var
*
sizeof
(
USIGN16
)));
sizeof
(
T_LOAD_OD_REQ
)
+
(
req
->
obj_descr
.
id
.
vlist_obj_descr
.
no_of_var
*
sizeof
(
USIGN16
)));
case
INVOCATION_OBJECT
:
case
INVOCATION_OBJECT
:
return
(
sizeof
(
T_LOAD_OD_REQ
)
return
(
sizeof
(
T_LOAD_OD_REQ
)
+
+
(
req
->
obj_descr
.
id
.
pi_obj_descr
.
cnt_dom
*
sizeof
(
USIGN16
)));
(
req
->
obj_descr
.
id
.
pi_obj_descr
.
cnt_dom
*
sizeof
(
USIGN16
)));
default:
default:
return
(
sizeof
(
T_LOAD_OD_REQ
));
return
(
sizeof
(
T_LOAD_OD_REQ
));
}
}
}
else
}
else
return
(
0
);
return
(
0
);
case
FMS_OD_READ_LOC
:
case
FMS_OD_READ_LOC
:
...
@@ -330,10 +315,11 @@ possible return values:
...
@@ -330,10 +315,11 @@ possible return values:
}
}
}
}
FUNCTION
LOCAL
INT16
fmsgdl_get_var_data_len
(
IN
USIGN8
service
,
/* Service */
FUNCTION
LOCAL
INT16
fmsgdl_get_var_data_len
(
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
service
,
/* Service */
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
FAR
*
data_ptr
/* pointer to data */
IN
USIGN8
FAR
*
data_ptr
/* pointer to data */
)
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -360,89 +346,113 @@ possible return values:
...
@@ -360,89 +346,113 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
switch
(
service
)
{
switch
(
service
)
{
case
FMS_READ
:
case
FMS_READ
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
{
return
(
sizeof
(
T_VAR_READ_REQ
));
return
(
sizeof
(
T_VAR_READ_REQ
));
}
else
{
}
else
{
T_VAR_READ_CNF
FAR
*
rsp
=
(
T_VAR_READ_CNF
FAR
*
)
data_ptr
;
T_VAR_READ_CNF
FAR
*
rsp
=
(
T_VAR_READ_CNF
FAR
*
)
data_ptr
;
return
(
sizeof
(
T_VAR_READ_CNF
)
+
rsp
->
length
);
return
(
sizeof
(
T_VAR_READ_CNF
)
+
rsp
->
length
);
}
}
case
FMS_READ_WITH_TYPE
:
case
FMS_READ_WITH_TYPE
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
{
return
(
sizeof
(
T_VAR_READ_WITH_TYPE_REQ
));
return
(
sizeof
(
T_VAR_READ_WITH_TYPE_REQ
));
}
else
{
}
T_VAR_READ_WITH_TYPE_CNF
FAR
*
rsp
else
=
(
T_VAR_READ_WITH_TYPE_CNF
FAR
*
)
data_ptr
;
{
return
(
sizeof
(
T_VAR_READ_WITH_TYPE_CNF
)
T_VAR_READ_WITH_TYPE_CNF
FAR
*
rsp
=
+
(
sizeof
(
T_TYPE_DESCR
)
*
rsp
->
no_of_type_descr
)
+
rsp
->
length
);
(
T_VAR_READ_WITH_TYPE_CNF
FAR
*
)
data_ptr
;
return
(
sizeof
(
T_VAR_READ_WITH_TYPE_CNF
)
+
(
sizeof
(
T_TYPE_DESCR
)
*
rsp
->
no_of_type_descr
)
+
rsp
->
length
);
}
}
case
FMS_WRITE
:
case
FMS_WRITE
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
{
T_VAR_WRITE_REQ
FAR
*
req
=
(
T_VAR_WRITE_REQ
FAR
*
)
data_ptr
;
T_VAR_WRITE_REQ
FAR
*
req
=
(
T_VAR_WRITE_REQ
FAR
*
)
data_ptr
;
return
(
sizeof
(
T_VAR_WRITE_REQ
)
+
req
->
length
);
return
(
sizeof
(
T_VAR_WRITE_REQ
)
+
req
->
length
);
}
else
}
else
return
(
0
);
return
(
0
);
case
FMS_WRITE_WITH_TYPE
:
case
FMS_WRITE_WITH_TYPE
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
T_VAR_WRITE_WITH_TYPE_REQ
FAR
*
req
{
=
(
T_VAR_WRITE_WITH_TYPE_REQ
FAR
*
)
data_ptr
;
T_VAR_WRITE_WITH_TYPE_REQ
FAR
*
req
=
return
(
sizeof
(
T_VAR_WRITE_WITH_TYPE_REQ
)
(
T_VAR_WRITE_WITH_TYPE_REQ
FAR
*
)
data_ptr
;
+
(
sizeof
(
T_TYPE_DESCR
)
*
req
->
no_of_type_descr
)
+
req
->
length
);
return
(
sizeof
(
T_VAR_WRITE_WITH_TYPE_REQ
)
+
}
else
(
sizeof
(
T_TYPE_DESCR
)
*
req
->
no_of_type_descr
)
+
req
->
length
);
}
else
return
(
0
);
return
(
0
);
case
FMS_INFO_RPT
:
case
FMS_INFO_RPT
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
{
T_VAR_INFO_RPT_REQ
FAR
*
req
=
(
T_VAR_INFO_RPT_REQ
FAR
*
)
data_ptr
;
T_VAR_INFO_RPT_REQ
FAR
*
req
=
(
T_VAR_INFO_RPT_REQ
FAR
*
)
data_ptr
;
return
(
sizeof
(
T_VAR_INFO_RPT_REQ
)
+
req
->
length
);
return
(
sizeof
(
T_VAR_INFO_RPT_REQ
)
+
req
->
length
);
}
else
}
else
return
(
0
);
return
(
0
);
case
FMS_INFO_RPT_WITH_TYPE
:
case
FMS_INFO_RPT_WITH_TYPE
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
T_VAR_INFO_RPT_WITH_TYPE_REQ
FAR
*
req
{
=
(
T_VAR_INFO_RPT_WITH_TYPE_REQ
FAR
*
)
data_ptr
;
T_VAR_INFO_RPT_WITH_TYPE_REQ
FAR
*
req
=
return
(
sizeof
(
T_VAR_INFO_RPT_WITH_TYPE_REQ
)
(
T_VAR_INFO_RPT_WITH_TYPE_REQ
FAR
*
)
data_ptr
;
+
(
sizeof
(
T_TYPE_DESCR
)
*
req
->
no_of_type_descr
)
+
req
->
length
);
return
(
sizeof
(
T_VAR_INFO_RPT_WITH_TYPE_REQ
)
+
}
else
(
sizeof
(
T_TYPE_DESCR
)
*
req
->
no_of_type_descr
)
+
req
->
length
);
}
else
return
(
0
);
return
(
0
);
case
FMS_PHYS_READ
:
case
FMS_PHYS_READ
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
{
return
(
sizeof
(
T_VAR_PHYS_READ_REQ
));
return
(
sizeof
(
T_VAR_PHYS_READ_REQ
));
}
else
{
}
else
{
T_VAR_PHYS_READ_CNF
FAR
*
rsp
=
(
T_VAR_PHYS_READ_CNF
FAR
*
)
data_ptr
;
T_VAR_PHYS_READ_CNF
FAR
*
rsp
=
(
T_VAR_PHYS_READ_CNF
FAR
*
)
data_ptr
;
return
(
sizeof
(
T_VAR_PHYS_READ_CNF
)
+
rsp
->
length
);
return
(
sizeof
(
T_VAR_PHYS_READ_CNF
)
+
rsp
->
length
);
}
}
case
FMS_PHYS_WRITE
:
case
FMS_PHYS_WRITE
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
{
T_VAR_PHYS_WRITE_REQ
FAR
*
req
=
(
T_VAR_PHYS_WRITE_REQ
FAR
*
)
data_ptr
;
T_VAR_PHYS_WRITE_REQ
FAR
*
req
=
(
T_VAR_PHYS_WRITE_REQ
FAR
*
)
data_ptr
;
return
(
sizeof
(
T_VAR_PHYS_WRITE_REQ
)
+
req
->
length
);
return
(
sizeof
(
T_VAR_PHYS_WRITE_REQ
)
+
req
->
length
);
}
else
}
else
return
(
0
);
return
(
0
);
case
FMS_DEF_VAR_LIST
:
case
FMS_DEF_VAR_LIST
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
T_VAR_DEFINE_VAR_LIST_REQ
FAR
*
req
{
=
(
T_VAR_DEFINE_VAR_LIST_REQ
FAR
*
)
data_ptr
;
T_VAR_DEFINE_VAR_LIST_REQ
FAR
*
req
=
(
T_VAR_DEFINE_VAR_LIST_REQ
FAR
*
)
data_ptr
;
USIGN8
FAR
*
d_acc_spec_list
=
(
USIGN8
FAR
*
)(
req
+
1
);
USIGN8
FAR
*
d_acc_spec_list
=
(
USIGN8
FAR
*
)(
req
+
1
);
USIGN16
offset
=
0
;
USIGN16
offset
=
0
;
USIGN16
acc_spec_list_size
=
0
;
USIGN16
acc_spec_list_size
=
0
;
USIGN8
i
=
0
;
USIGN8
i
=
0
;
for
(
i
=
0
;
i
<
req
->
no_of_var
;
i
++
)
{
for
(
i
=
0
;
i
<
req
->
no_of_var
;
i
++
)
{
offset
++
;
/* offset to length of acc_spec */
offset
++
;
/* offset to length of acc_spec */
acc_spec_list_size
+=
sizeof
(
T_DYN_ACC_SPEC
)
+
d_acc_spec_list
[
offset
];
acc_spec_list_size
+=
sizeof
(
T_DYN_ACC_SPEC
)
+
d_acc_spec_list
[
offset
];
offset
=
acc_spec_list_size
;
offset
=
acc_spec_list_size
;
}
}
return
(
sizeof
(
T_VAR_DEFINE_VAR_LIST_REQ
)
+
acc_spec_list_size
);
return
(
sizeof
(
T_VAR_DEFINE_VAR_LIST_REQ
)
+
acc_spec_list_size
);
}
else
{
}
else
{
return
(
sizeof
(
T_VAR_DEFINE_VAR_LIST_CNF
));
return
(
sizeof
(
T_VAR_DEFINE_VAR_LIST_CNF
));
}
}
...
@@ -457,10 +467,11 @@ possible return values:
...
@@ -457,10 +467,11 @@ possible return values:
}
}
}
}
FUNCTION
LOCAL
INT16
fmsgdl_get_evn_data_len
(
IN
USIGN8
service
,
/* Service */
FUNCTION
LOCAL
INT16
fmsgdl_get_evn_data_len
(
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
service
,
/* Service */
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
FAR
*
data_ptr
/* pointer to data */
IN
USIGN8
FAR
*
data_ptr
/* pointer to data */
)
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -481,20 +492,25 @@ possible return values:
...
@@ -481,20 +492,25 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
switch
(
service
)
{
switch
(
service
)
{
case
FMS_EVN_NOTIFY
:
case
FMS_EVN_NOTIFY
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
{
T_EVENT_NOTIFY_REQ
FAR
*
req
=
(
T_EVENT_NOTIFY_REQ
FAR
*
)
data_ptr
;
T_EVENT_NOTIFY_REQ
FAR
*
req
=
(
T_EVENT_NOTIFY_REQ
FAR
*
)
data_ptr
;
return
(
sizeof
(
T_EVENT_NOTIFY_REQ
)
+
req
->
data_length
);
return
(
sizeof
(
T_EVENT_NOTIFY_REQ
)
+
req
->
data_length
);
}
else
}
else
return
(
0
);
return
(
0
);
case
FMS_EVN_NOTIFY_WITH_TYPE
:
case
FMS_EVN_NOTIFY_WITH_TYPE
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
T_EVENT_NOTIFY_WITH_TYPE_REQ
FAR
*
req
{
=
(
T_EVENT_NOTIFY_WITH_TYPE_REQ
FAR
*
)
data_ptr
;
T_EVENT_NOTIFY_WITH_TYPE_REQ
FAR
*
req
=
(
T_EVENT_NOTIFY_WITH_TYPE_REQ
FAR
*
)
data_ptr
;
return
(
sizeof
(
T_EVENT_NOTIFY_WITH_TYPE_REQ
)
+
req
->
data_length
);
return
(
sizeof
(
T_EVENT_NOTIFY_WITH_TYPE_REQ
)
+
req
->
data_length
);
}
else
}
else
return
(
0
);
return
(
0
);
case
FMS_ALT_EVN_CND_MNT
:
case
FMS_ALT_EVN_CND_MNT
:
...
@@ -514,10 +530,11 @@ possible return values:
...
@@ -514,10 +530,11 @@ possible return values:
}
}
}
}
FUNCTION
LOCAL
INT16
fmsgdl_get_dom_data_len
(
IN
USIGN8
service
,
/* Service */
FUNCTION
LOCAL
INT16
fmsgdl_get_dom_data_len
(
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
service
,
/* Service */
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
FAR
*
data_ptr
/* pointer to data */
IN
USIGN8
FAR
*
data_ptr
/* pointer to data */
)
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -548,7 +565,8 @@ possible return values:
...
@@ -548,7 +565,8 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
switch
(
service
)
{
switch
(
service
)
{
case
FMS_INIT_DOWNL_SEQ
:
case
FMS_INIT_DOWNL_SEQ
:
case
FMS_GEN_INIT_DOWNL_SEQ
:
case
FMS_GEN_INIT_DOWNL_SEQ
:
case
FMS_INIT_UPL_SEQ
:
case
FMS_INIT_UPL_SEQ
:
...
@@ -560,9 +578,12 @@ possible return values:
...
@@ -560,9 +578,12 @@ possible return values:
case
FMS_DOWNL_SEG
:
case
FMS_DOWNL_SEG
:
case
FMS_UPL_SEG
:
case
FMS_UPL_SEG
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
{
return
(
sizeof
(
T_DOM_REQ
));
return
(
sizeof
(
T_DOM_REQ
));
}
else
{
}
else
{
T_DNL_UPL_SEG_CNF
FAR
*
rsp
=
(
T_DNL_UPL_SEG_CNF
FAR
*
)
data_ptr
;
T_DNL_UPL_SEG_CNF
FAR
*
rsp
=
(
T_DNL_UPL_SEG_CNF
FAR
*
)
data_ptr
;
return
(
sizeof
(
T_DNL_UPL_SEG_CNF
)
+
rsp
->
data_len
);
return
(
sizeof
(
T_DNL_UPL_SEG_CNF
)
+
rsp
->
data_len
);
}
}
...
@@ -574,10 +595,12 @@ possible return values:
...
@@ -574,10 +595,12 @@ possible return values:
return
(
0
);
return
(
0
);
case
FMS_GEN_DOWNL_SEG
:
case
FMS_GEN_DOWNL_SEG
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
{
T_GEN_DNL_SEG_REQ
FAR
*
req
=
(
T_GEN_DNL_SEG_REQ
FAR
*
)
data_ptr
;
T_GEN_DNL_SEG_REQ
FAR
*
req
=
(
T_GEN_DNL_SEG_REQ
FAR
*
)
data_ptr
;
return
(
sizeof
(
T_GEN_DNL_SEG_REQ
)
+
req
->
data_len
);
return
(
sizeof
(
T_GEN_DNL_SEG_REQ
)
+
req
->
data_len
);
}
else
}
else
return
(
0
);
return
(
0
);
case
FMS_GEN_TERM_DOWNL_SEQ
:
case
FMS_GEN_TERM_DOWNL_SEQ
:
...
@@ -588,10 +611,12 @@ possible return values:
...
@@ -588,10 +611,12 @@ possible return values:
case
FMS_REQ_DOM_DOWNL
:
case
FMS_REQ_DOM_DOWNL
:
case
FMS_REQ_DOM_UPL
:
case
FMS_REQ_DOM_UPL
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
{
T_REQUEST_DOM_REQ
FAR
*
req
=
(
T_REQUEST_DOM_REQ
FAR
*
)
data_ptr
;
T_REQUEST_DOM_REQ
FAR
*
req
=
(
T_REQUEST_DOM_REQ
FAR
*
)
data_ptr
;
return
(
sizeof
(
T_REQUEST_DOM_REQ
)
+
req
->
add_info_length
);
return
(
sizeof
(
T_REQUEST_DOM_REQ
)
+
req
->
add_info_length
);
}
else
}
else
return
(
0
);
return
(
0
);
default:
default:
...
@@ -599,10 +624,11 @@ possible return values:
...
@@ -599,10 +624,11 @@ possible return values:
}
}
}
}
FUNCTION
LOCAL
INT16
fmsgdl_get_pi_data_len
(
IN
USIGN8
service
,
/* Service */
FUNCTION
LOCAL
INT16
fmsgdl_get_pi_data_len
(
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
service
,
/* Service */
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
FAR
*
data_ptr
/* pointer to data */
IN
USIGN8
FAR
*
data_ptr
/* pointer to data */
)
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -627,9 +653,11 @@ possible return values:
...
@@ -627,9 +653,11 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
switch
(
service
)
{
switch
(
service
)
{
case
FMS_PI_CREATE
:
case
FMS_PI_CREATE
:
if
(
primitive
==
REQ
)
{
if
(
primitive
==
REQ
)
{
T_PI_CR8_REQ
FAR
*
req
=
(
T_PI_CR8_REQ
FAR
*
)
data_ptr
;
T_PI_CR8_REQ
FAR
*
req
=
(
T_PI_CR8_REQ
FAR
*
)
data_ptr
;
USIGN8
FAR
*
d_acc_spec_list
=
(
USIGN8
FAR
*
)(
req
+
1
);
USIGN8
FAR
*
d_acc_spec_list
=
(
USIGN8
FAR
*
)(
req
+
1
);
USIGN16
offset
=
0
;
USIGN16
offset
=
0
;
...
@@ -637,13 +665,16 @@ possible return values:
...
@@ -637,13 +665,16 @@ possible return values:
USIGN8
i
=
0
;
USIGN8
i
=
0
;
/* - dynamic access specification list --------------------------*/
/* - dynamic access specification list --------------------------*/
for
(
i
=
0
;
i
<
req
->
cnt_dom
;
i
++
)
{
for
(
i
=
0
;
i
<
req
->
cnt_dom
;
i
++
)
{
offset
++
;
/* offset to length of acc_spec */
offset
++
;
/* offset to length of acc_spec */
acc_spec_list_size
+=
sizeof
(
T_DYN_ACC_SPEC
)
+
d_acc_spec_list
[
offset
];
acc_spec_list_size
+=
sizeof
(
T_DYN_ACC_SPEC
)
+
d_acc_spec_list
[
offset
];
offset
=
acc_spec_list_size
;
offset
=
acc_spec_list_size
;
}
}
return
(
sizeof
(
T_PI_CR8_REQ
)
+
acc_spec_list_size
);
return
(
sizeof
(
T_PI_CR8_REQ
)
+
acc_spec_list_size
);
}
else
{
}
else
{
return
(
sizeof
(
T_PI_CR8_CNF
));
return
(
sizeof
(
T_PI_CR8_CNF
));
}
}
...
@@ -695,7 +726,7 @@ possible return values:
...
@@ -695,7 +726,7 @@ possible return values:
}
}
FUNCTION
LOCAL
INT16
fmsgdl_get_error_data_len
(
IN
USIGN8
service
/* Service */
FUNCTION
LOCAL
INT16
fmsgdl_get_error_data_len
(
IN
USIGN8
service
/* Service */
)
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -748,7 +779,8 @@ possible return values:
...
@@ -748,7 +779,8 @@ possible return values:
FUNCTION_BODY
FUNCTION_BODY
switch
(
service
)
{
switch
(
service
)
{
case
FMS_INITIATE
:
case
FMS_INITIATE
:
return
(
sizeof
(
T_CTXT_INIT_ERR_CNF
));
return
(
sizeof
(
T_CTXT_INIT_ERR_CNF
));
...
@@ -797,12 +829,13 @@ possible return values:
...
@@ -797,12 +829,13 @@ possible return values:
}
}
}
}
FUNCTION
PUBLIC
INT16
fmsgdl_get_data_len
(
IN
INT16
result
,
/* Service-Result */
FUNCTION
PUBLIC
INT16
fmsgdl_get_data_len
(
IN
USIGN8
service
,
/* Service */
IN
INT16
result
,
/* Service-Result */
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
service
,
/* Service */
IN
USIGN8
primitive
,
/* Service-Primitive */
IN
USIGN8
FAR
*
data_ptr
,
/* pointer to data */
IN
USIGN8
FAR
*
data_ptr
,
/* pointer to data */
OUT
INT16
*
data_len_ptr
/* length of data */
OUT
INT16
*
data_len_ptr
/* length of data */
)
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -820,7 +853,8 @@ possible return values:
...
@@ -820,7 +853,8 @@ possible return values:
*
data_len_ptr
=
0
;
*
data_len_ptr
=
0
;
switch
(
service
)
{
switch
(
service
)
{
case
FMS_INITIATE
:
case
FMS_INITIATE
:
case
FMS_ABORT
:
case
FMS_ABORT
:
if
(
result
==
POS
)
if
(
result
==
POS
)
...
...
profibus/lib/rt/src/keywords.h
View file @
ce758cd3
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************/
/*****************************************************************************/
/* */
/* */
/*
SOFTING AG
*/
/*
SOFTING Industrial Automation GmbH
*/
/* Richard-Reitzner-Allee 6 */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* */
/*
Copyright (C) SOFTING AG 1995-2003
*/
/*
Copyright (C) SOFTING Industrial Automation GmbH 1995-2012
*/
/* All Rights Reserved */
/* All Rights Reserved */
/* */
/* */
/*****************************************************************************/
/*****************************************************************************/
...
@@ -50,8 +15,8 @@
...
@@ -50,8 +15,8 @@
/* */
/* */
/* Filename : KEYWORDS.H */
/* Filename : KEYWORDS.H */
/* Version : 5.21.0.00.release */
/* Version : 5.21.0.00.release */
/* Date :
27-February-1998
*/
/* Date :
February-1998
*/
/* Author : SOFTING
AG
*/
/* Author : SOFTING
*/
/* */
/* */
/* Description : This include file defines some keywords which are used */
/* Description : This include file defines some keywords which are used */
/* for structuring and formatting the PROFIBUS source files. These */
/* for structuring and formatting the PROFIBUS source files. These */
...
...
profibus/lib/rt/src/papiaux.c
View file @
ce758cd3
/*
/******************************************************************************
* ProviewR Open Source Process Control.
* *
* Copyright (C) 2005-2019 SSAB EMEA AB.
* SOFTING Industrial Automation GmbH *
*
* Richard-Reitzner-Allee 6 *
* This file is part of ProviewR.
* D-85540 Haar *
*
* Phone: (++49)-(0)89-45656-0 *
* This program is free software; you can redistribute it and/or
* Fax: (++49)-(0)89-45656-399 *
* modify it under the terms of the GNU General Public License as
* *
* published by the Free Software Foundation, either version 2 of
* Copyright (C) SOFTING Industrial Automation GmbH 1995-2012 *
* the License, or (at your option) any later version.
* All Rights Reserved *
*
* *
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************
* *
* SOFTING AG *
* Richard-Reitzner-Allee 6 *
* D-85540 Haar *
* Phone: ++49-89-4 56 56-0 *
* Fax: ++49-89-4 56 56-3 99 *
* *
* Copyright (C) SOFTING AG 1999-2003 *
* All Rights Reserved *
* *
******************************************************************************
FILE_NAME PAPIAUX.C
FILE_NAME PAPIAUX.C
...
@@ -55,11 +20,11 @@ MODULE PAPIAUX
...
@@ -55,11 +20,11 @@ MODULE PAPIAUX
COMPONENT_LIBRARY PAPI Lib
COMPONENT_LIBRARY PAPI Lib
PAPI DLL
PAPI DLL
AUTHOR SOFTING
GmbH
AUTHOR SOFTING
VERSION 5.22.0.00.release
VERSION 5.22.0.00.release
DATE
26-
February-1999
DATE February-1999
STATUS finished
STATUS finished
...
@@ -109,8 +74,8 @@ LOCAL_DATA
...
@@ -109,8 +74,8 @@ LOCAL_DATA
// ***************************************************************************
// ***************************************************************************
#if defined(WIN32) || defined(_WIN32)
#if defined(WIN32) || defined(_WIN32)
FUNCTION
PUBLIC
BOOL
ReadBoardRegistryEntries
(
FUNCTION
PUBLIC
BOOL
ReadBoardRegistryEntries
(
IN
USIGN8
BoardNumber
,
IN
USIGN8
BoardNumber
,
OUT
USIGN32
*
OperationMode
)
OUT
USIGN32
*
OperationMode
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -134,21 +99,23 @@ return value:
...
@@ -134,21 +99,23 @@ return value:
FUNCTION_BODY
FUNCTION_BODY
if
(
ERROR_SUCCESS
if
(
ERROR_SUCCESS
==
RegOpenKeyEx
(
HKEY_LOCAL_MACHINE
,
==
RegOpenKeyEx
(
HKEY_LOCAL_MACHINE
,
REGPATH_PARAMETER_FROM_HLM
,
0
,
REGPATH_PARAMETER_FROM_HLM
,
0
,
KEY_READ
,
KEY_READ
,
&
keyParameters
))
{
&
keyParameters
))
{
sprintf
(
szKeyBoard
,
"%s
\\
%d"
,
REGPATH_PARAMETER_FROM_HLM
,
BoardNumber
);
sprintf
(
szKeyBoard
,
"%s
\\
%d"
,
REGPATH_PARAMETER_FROM_HLM
,
BoardNumber
);
if
(
ERROR_SUCCESS
if
(
ERROR_SUCCESS
==
==
RegOpenKeyEx
(
RegOpenKeyEx
(
HKEY_LOCAL_MACHINE
,
szKeyBoard
,
0
,
KEY_READ
,
&
keyBoard
))
HKEY_LOCAL_MACHINE
,
szKeyBoard
,
0
,
KEY_READ
,
&
keyBoard
))
{
{
SizeofBoardType
=
sizeof
(
szBoardType
);
SizeofBoardType
=
sizeof
(
szBoardType
);
szBoardType
[
0
]
=
'\0'
;
szBoardType
[
0
]
=
'\0'
;
if
((
RetVal
=
RegQueryValueEx
(
keyBoard
,
"Type"
,
NULL
,
NULL
,
if
((
RetVal
=
RegQueryValueEx
(
keyBoard
,
"Type"
,
NULL
,
NULL
,
(
LPBYTE
)
szBoardType
,
&
SizeofBoardType
))
(
LPBYTE
)
szBoardType
,
&
SizeofBoardType
))
==
==
ERROR_SUCCESS
)
{
ERROR_SUCCESS
)
{
RetVal
|=
RegQueryValueEx
(
keyBoard
,
"OperationMode"
,
NULL
,
NULL
,
RetVal
|=
RegQueryValueEx
(
keyBoard
,
"OperationMode"
,
NULL
,
NULL
,
(
LPBYTE
)
OperationMode
,
&
sizeULONG
);
(
LPBYTE
)
OperationMode
,
&
sizeULONG
);
if
(
!
RetVal
)
if
(
!
RetVal
)
return
(
TRUE
);
return
(
TRUE
);
...
@@ -184,7 +151,8 @@ FUNCTION PUBLIC int kbhit(VOID)
...
@@ -184,7 +151,8 @@ FUNCTION PUBLIC int kbhit(VOID)
timeout
.
tv_sec
=
0L
;
timeout
.
tv_sec
=
0L
;
timeout
.
tv_usec
=
1000L
;
/* wait 1 ms */
timeout
.
tv_usec
=
1000L
;
/* wait 1 ms */
if
(
select
(
1
,
&
rd_fds
,
NULL
,
NULL
,
&
timeout
)
>
0
)
{
if
(
select
(
1
,
&
rd_fds
,
NULL
,
NULL
,
&
timeout
)
>
0
)
{
return
(
1
);
return
(
1
);
}
}
...
@@ -199,7 +167,7 @@ FUNCTION PUBLIC int kbhit(VOID)
...
@@ -199,7 +167,7 @@ FUNCTION PUBLIC int kbhit(VOID)
FUNCTION
PUBLIC
USIGN16
swap_16_intel_motorola
(
FUNCTION
PUBLIC
USIGN16
swap_16_intel_motorola
(
IN
USIGN16
input16
/* value to swap */
IN
USIGN16
input16
/* value to swap */
)
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -220,8 +188,7 @@ return value:
...
@@ -220,8 +188,7 @@ return value:
FUNCTION_BODY
FUNCTION_BODY
((
USIGN8
*
)
&
inp16
)
((
USIGN8
*
)
&
inp16
)
[
0
]
[
0
]
=
((
USIGN8
*
)
&
input16
)[
1
];
=
((
USIGN8
*
)
&
input16
)[
1
];
((
USIGN8
*
)
&
inp16
)[
1
]
=
((
USIGN8
*
)
&
input16
)[
0
];
((
USIGN8
*
)
&
inp16
)[
1
]
=
((
USIGN8
*
)
&
input16
)[
0
];
return
(
inp16
);
return
(
inp16
);
...
@@ -229,7 +196,7 @@ return value:
...
@@ -229,7 +196,7 @@ return value:
FUNCTION
PUBLIC
USIGN32
swap_32_intel_motorola
(
FUNCTION
PUBLIC
USIGN32
swap_32_intel_motorola
(
IN
USIGN32
input32
/* value to swap */
IN
USIGN32
input32
/* value to swap */
)
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -250,8 +217,7 @@ return value:
...
@@ -250,8 +217,7 @@ return value:
FUNCTION_BODY
FUNCTION_BODY
((
USIGN8
*
)
&
inp32
)
((
USIGN8
*
)
&
inp32
)
[
0
]
[
0
]
=
((
USIGN8
*
)
&
input32
)[
3
];
=
((
USIGN8
*
)
&
input32
)[
3
];
((
USIGN8
*
)
&
inp32
)[
1
]
=
((
USIGN8
*
)
&
input32
)[
2
];
((
USIGN8
*
)
&
inp32
)[
1
]
=
((
USIGN8
*
)
&
input32
)[
2
];
((
USIGN8
*
)
&
inp32
)[
2
]
=
((
USIGN8
*
)
&
input32
)[
1
];
((
USIGN8
*
)
&
inp32
)[
2
]
=
((
USIGN8
*
)
&
input32
)[
1
];
((
USIGN8
*
)
&
inp32
)[
3
]
=
((
USIGN8
*
)
&
input32
)[
0
];
((
USIGN8
*
)
&
inp32
)[
3
]
=
((
USIGN8
*
)
&
input32
)[
0
];
...
...
profibus/lib/rt/src/pb_conf.h
View file @
ce758cd3
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************/
/*****************************************************************************/
/* */
/* */
/*
SOFTING AG
*/
/*
SOFTING Industrial Automation GmbH
*/
/* Richard-Reitzner-Allee 6 */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* */
/*
Copyright (C) SOFTING AG 1995-2003
*/
/*
Copyright (C) SOFTING Industrial Automation GmbH 1995-2012
*/
/* All Rights Reserved */
/* All Rights Reserved */
/* */
/* */
/*****************************************************************************/
/*****************************************************************************/
...
@@ -49,13 +14,12 @@
...
@@ -49,13 +14,12 @@
/* PROFIBUS CONFIGURATION AND IMPLEMENTATION DEFINITIONS */
/* PROFIBUS CONFIGURATION AND IMPLEMENTATION DEFINITIONS */
/* */
/* */
/* Filename : PB_CONF.H */
/* Filename : PB_CONF.H */
/* Version : 5.
26
.0.00.release */
/* Version : 5.
45
.0.00.release */
/* Date :
14-February-2002
*/
/* Date :
December-2009
*/
/* Author : SOFTING
AG
*/
/* Author : SOFTING
*/
/* */
/* */
/* Description : This file contains the PROFIBUS configuration and */
/* Description : This file contains the PROFIBUS configuration and */
/* implementation definitions using Windows ME/98/95 or */
/* implementation definitions using Linux operating system */
/* Windows XP / 2000 / NT operating system */
/* */
/* */
/*****************************************************************************/
/*****************************************************************************/
...
@@ -67,7 +31,7 @@
...
@@ -67,7 +31,7 @@
/*****************************************************************************/
/*****************************************************************************/
#ifndef PB_VER
#ifndef PB_VER
#define PB_VER 5
26
#define PB_VER 5
45
#endif
#endif
/*****************************************************************************/
/*****************************************************************************/
...
@@ -99,9 +63,9 @@
...
@@ -99,9 +63,9 @@
#define HUGE
#define HUGE
#define CALL_CONV
#define CALL_CONV
#define CALLBACK
#define CALLBACK
#define INVALID_HANDLE_VALUE
((HANDLE)NULL)
#define INVALID_HANDLE_VALUE
0
#define getch() getchar()
#define getch() getchar()
typedef
long
int
HANDLE
;
typedef
int
HANDLE
;
typedef
unsigned
long
DWORD
;
typedef
unsigned
long
DWORD
;
#ifdef PB_API_FUNC_NOT_USED
#ifdef PB_API_FUNC_NOT_USED
#undef CALL_CONV
#undef CALL_CONV
...
@@ -152,32 +116,32 @@ typedef unsigned long DWORD;
...
@@ -152,32 +116,32 @@ typedef unsigned long DWORD;
/* -- constants of internal sizes of byte arrays --------------------------- */
/* -- constants of internal sizes of byte arrays --------------------------- */
#define VFD_STRING_LENGTH 32
/* max length of the VFD string */
#define VFD_STRING_LENGTH 32
/* max length of the VFD string */
#define IDENT_STRING_LENGTH 32
/* max length of the Ident string */
#define IDENT_STRING_LENGTH 32
/* max length of the Ident string */
#define ACCESS_NAME_LENGTH 32
/* max length for name adressing */
#define ACCESS_NAME_LENGTH 32
/* max length for name adressing */
#define OBJECT_NAME_LENGTH 32
/* max length of object name */
#define OBJECT_NAME_LENGTH 32
/* max length of object name */
#define EXTENSION_LENGTH 32
/* max length of object extension */
#define EXTENSION_LENGTH 32
/* max length of object extension */
#define EXECUTION_ARGUMENT_LENGTH 32
/* max length of exec. argument */
#define EXECUTION_ARGUMENT_LENGTH 32
/* max length of exec. argument */
#define ERROR_DESCR_LENGTH 32
/* max length of error descript.*/
#define ERROR_DESCR_LENGTH 32
/* max length of error descript.*/
#define CRL_SYMBOL_LENGTH 32
/* max length of crl symbol name */
#define CRL_SYMBOL_LENGTH 32
/* max length of crl symbol name */
#define CRL_EXTENSION_LENGTH 2
/* max length of crl extension */
#define CRL_EXTENSION_LENGTH 2
/* max length of crl extension */
#if (PB_VER < 500)
#if (PB_VER < 500)
#define KBL_SYMBOL_LENGTH CRL_SYMBOL_LENGTH
#define KBL_SYMBOL_LENGTH CRL_SYMBOL_LENGTH
#define KBL_EXTENSION_LENGTH CRL_EXTENSION_LENGTH
#define KBL_EXTENSION_LENGTH CRL_EXTENSION_LENGTH
#endif
#endif
#define MAX_FMS_PDU_LENGTH 241
/* max size of the FMS/FM7-PDU-Buffer */
#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_VAR_LIST_ELEMENTS 50
/* max count of variable list elements */
#define MAX_DOM_LIST_ELEMENTS 50
/* max count of domain 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_VAR_RECORD_ELEMENTS 10
/* max count of record elements */
#define MAX_COMREF 64
/* max supported communication references */
#define MAX_COMREF 64
/* max supported communication references */
#define MAX_VFD 5
/* max supported VFDs */
#define MAX_VFD 5
/* max supported VFDs */
#if (PB_VER < 500)
#if (PB_VER < 500)
#define MAX_KBL_LEN MAX_COMREF
/* max entries in CRL */
#define MAX_KBL_LEN MAX_COMREF
/* max entries in CRL */
#define MAX_PARA_LOC_SERVICES 5
/* max parallel local FMS-Services*/
#define MAX_PARA_LOC_SERVICES 5
/* max parallel local FMS-Services*/
#endif
#endif
...
...
profibus/lib/rt/src/pb_dp.h
View file @
ce758cd3
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************/
/*****************************************************************************/
/* */
/* */
/*
SOFTING AG
*/
/*
SOFTING Industrial Automation GmbH
*/
/* Richard-Reitzner-Allee 6 */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* */
/*
Copyright (C) SOFTING AG 1995-2003
*/
/*
Copyright (C) SOFTING Industrial Automation GmbH 1995-2012
*/
/* All Rights Reserved */
/* All Rights Reserved */
/* */
/* */
/*****************************************************************************/
/*****************************************************************************/
...
@@ -50,8 +15,8 @@
...
@@ -50,8 +15,8 @@
/* */
/* */
/* Filename : PB_DP.H */
/* Filename : PB_DP.H */
/* Version : 5.22.0.00.release */
/* Version : 5.22.0.00.release */
/* Date :
26-February-1999
*/
/* Date :
February-1999
*/
/* Author : SOFTING
AG
*/
/* Author : SOFTING
*/
/* */
/* */
/* Description : This file contains the global defines and types of */
/* Description : This file contains the global defines and types of */
/* component DP */
/* component DP */
...
@@ -171,7 +136,7 @@
...
@@ -171,7 +136,7 @@
#define DP_GET_MASTER_DIAG (DP_SERVICE_MM | 0x0D)
#define DP_GET_MASTER_DIAG (DP_SERVICE_MM | 0x0D)
#define DP_GLOBAL_CONTROL (DP_SERVICE_DDLM | 0x0E)
/* SDN: M/S */
#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_ACT_PARA_BRCT (DP_SERVICE_MM | 0x0F)
/* SDN: M/M */
#define DP_FAULT (DP_SERVICE_DDLM | 0x10)
/* local */
#define DP_FAULT (DP_SERVICE_DDLM | 0x10)
/* local */
...
@@ -232,8 +197,8 @@
...
@@ -232,8 +197,8 @@
#define DP_PRM_WD_ON 0x08
#define DP_PRM_WD_ON 0x08
#define DP_PRM_STATION_STATUS \
#define DP_PRM_STATION_STATUS \
(DP_PRM_LOCK_REQ | DP_PRM_UNLOCK_REQ | DP_PRM_SYNC_REQ | DP_PRM_FREEZE_REQ
\
(DP_PRM_LOCK_REQ | DP_PRM_UNLOCK_REQ | DP_PRM_SYNC_REQ | DP_PRM_FREEZE_REQ
|
\
|
DP_PRM_WD_ON)
DP_PRM_WD_ON)
/*--- DP SLAVE GLOBAL CONTROL BITS -----------------------------------------*/
/*--- DP SLAVE GLOBAL CONTROL BITS -----------------------------------------*/
...
@@ -244,8 +209,8 @@
...
@@ -244,8 +209,8 @@
#define DP_CONTROL_CLEAR_DATA 0x02
#define DP_CONTROL_CLEAR_DATA 0x02
#define DP_CONTROL_COMMAND \
#define DP_CONTROL_COMMAND \
(DP_CONTROL_SYNC | DP_CONTROL_UNSYNC | DP_CONTROL_FREEZE
\
(DP_CONTROL_SYNC | DP_CONTROL_UNSYNC | DP_CONTROL_FREEZE
|
\
|
DP_CONTROL_UNFREEZE | DP_CONTROL_CLEAR_DATA)
DP_CONTROL_UNFREEZE | DP_CONTROL_CLEAR_DATA)
/*--- DP AREA CODES --------------------------------------------------------*/
/*--- DP AREA CODES --------------------------------------------------------*/
...
@@ -313,8 +278,8 @@
...
@@ -313,8 +278,8 @@
#define DP_DIAG_2_PRM_REQ 0x01
#define DP_DIAG_2_PRM_REQ 0x01
#define DP_DIAG_2_STATUS \
#define DP_DIAG_2_STATUS \
(DP_DIAG_2_DEACTIVATED | DP_DIAG_2_SYNC_MODE | DP_DIAG_2_FREEZE_MODE
\
(DP_DIAG_2_DEACTIVATED | DP_DIAG_2_SYNC_MODE | DP_DIAG_2_FREEZE_MODE
|
\
|
DP_DIAG_2_WD_ON | DP_DIAG_2_PRM_REQ)
DP_DIAG_2_WD_ON | DP_DIAG_2_PRM_REQ)
#define DP_DIAG_3_EXT_DIAG_OVERFLOW 0x80
#define DP_DIAG_3_EXT_DIAG_OVERFLOW 0x80
...
@@ -367,21 +332,23 @@
...
@@ -367,21 +332,23 @@
/*--- DP SLAVE PARAMETERIZATION DATA ---------------------------------------*/
/*--- DP SLAVE PARAMETERIZATION DATA ---------------------------------------*/
typedef
struct
_T_DP_PRM_DATA
{
typedef
struct
_T_DP_PRM_DATA
{
USIGN16
prm_data_len
;
/* 9..DP_MAX_PRM_DATA_LEN */
USIGN16
prm_data_len
;
/* 9..DP_MAX_PRM_DATA_LEN */
OCTET
station_status
;
/* DP_PRM_xxx */
OCTET
station_status
;
/* DP_PRM_xxx */
OCTET
wd_fact_1
;
/* watch dog time factors */
OCTET
wd_fact_1
;
/* watch dog time factors */
OCTET
wd_fact_2
;
OCTET
wd_fact_2
;
OCTET
min_tsdr
;
/* delay of DP-Slaves before response */
OCTET
min_tsdr
;
/* delay of DP-Slaves before response */
USIGN16
ident_number
;
/* PNO ident number */
USIGN16
ident_number
;
/* PNO ident number */
OCTET
group_ident
;
/* groups for GLOBAL_CONTROL */
OCTET
group_ident
;
/* groups for GLOBAL_CONTROL */
/* OCTET user_prm_data [DP_MAX_USER_PRM_DATA_LEN]; */
/* OCTET user_prm_data [DP_MAX_USER_PRM_DATA_LEN]; */
}
T_DP_PRM_DATA
;
}
T_DP_PRM_DATA
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_CFG_DATA
{
typedef
struct
_T_DP_CFG_DATA
{
USIGN16
cfg_data_len
;
/* 2..244 */
USIGN16
cfg_data_len
;
/* 2..244 */
/* OCTET cfg_data [cfg_data_len - 2]; */
/* OCTET cfg_data [cfg_data_len - 2]; */
...
@@ -389,9 +356,10 @@ typedef struct _T_DP_CFG_DATA {
...
@@ -389,9 +356,10 @@ typedef struct _T_DP_CFG_DATA {
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_AAT_DATA
{
typedef
struct
_T_DP_AAT_DATA
USIGN16
aat_data_len
;
/* 2..2^16-31 */
{
USIGN8
number_inputs
;
/* 0..244 */
USIGN16
aat_data_len
;
/* 2..2^16-31 */
USIGN8
number_inputs
;
/* 0..244 */
USIGN8
number_outputs
;
/* 0..244 */
USIGN8
number_outputs
;
/* 0..244 */
/* USIGN16 offset_input [0..244]; */
/* USIGN16 offset_input [0..244]; */
/* USIGN16 offset_output [0..244]; */
/* USIGN16 offset_output [0..244]; */
...
@@ -400,7 +368,8 @@ typedef struct _T_DP_AAT_DATA {
...
@@ -400,7 +368,8 @@ typedef struct _T_DP_AAT_DATA {
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SLAVE_USER_DATA
{
typedef
struct
_T_DP_SLAVE_USER_DATA
{
USIGN16
slave_user_data_len
;
/* 2..2^16-31 */
USIGN16
slave_user_data_len
;
/* 2..2^16-31 */
/* OCTET slave_user_data [slave_user_data_len - 2]; */
/* OCTET slave_user_data [slave_user_data_len - 2]; */
...
@@ -408,10 +377,11 @@ typedef struct _T_DP_SLAVE_USER_DATA {
...
@@ -408,10 +377,11 @@ typedef struct _T_DP_SLAVE_USER_DATA {
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SLAVE_PARA_SET
{
typedef
struct
_T_DP_SLAVE_PARA_SET
{
USIGN16
slave_para_len
;
/* 0..MAX_SLAVE_PARA_LEN */
USIGN16
slave_para_len
;
/* 0..MAX_SLAVE_PARA_LEN */
USIGN8
sl_flag
;
/* DP_SL_ACTIVE, DP_SL_FLAG_NEW_PRM */
USIGN8
sl_flag
;
/* DP_SL_ACTIVE, DP_SL_FLAG_NEW_PRM */
USIGN8
slave_type
;
/* DP_SLAVE_TYPE_DP */
USIGN8
slave_type
;
/* DP_SLAVE_TYPE_DP */
OCTET
reserved
[
12
];
OCTET
reserved
[
12
];
/* T_DP_PRM_DATA prm_data; */
/* T_DP_PRM_DATA prm_data; */
/* T_DP_CFG_DATA cfg_data; */
/* T_DP_CFG_DATA cfg_data; */
...
@@ -422,11 +392,12 @@ typedef struct _T_DP_SLAVE_PARA_SET {
...
@@ -422,11 +392,12 @@ typedef struct _T_DP_SLAVE_PARA_SET {
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DP_BUS_PARA_SET
{
typedef
struct
_T_DP_BUS_PARA_SET
{
USIGN16
bus_para_len
;
/* 66..2^16-1 */
USIGN16
bus_para_len
;
/* 66..2^16-1 */
USIGN8
fdl_add
;
/* 0..125 */
USIGN8
fdl_add
;
/* 0..125 */
USIGN8
baud_rate
;
/* DP_xBAUD_xxx */
USIGN8
baud_rate
;
/* DP_xBAUD_xxx */
USIGN16
tsl
;
/* see DIN 19245-1 for details */
USIGN16
tsl
;
/* see DIN 19245-1 for details */
USIGN16
min_tsdr
;
USIGN16
min_tsdr
;
USIGN16
max_tsdr
;
USIGN16
max_tsdr
;
USIGN8
tqui
;
USIGN8
tqui
;
...
@@ -435,12 +406,12 @@ typedef struct _T_DP_BUS_PARA_SET {
...
@@ -435,12 +406,12 @@ typedef struct _T_DP_BUS_PARA_SET {
USIGN8
g
;
USIGN8
g
;
USIGN8
hsa
;
USIGN8
hsa
;
USIGN8
max_retry_limit
;
USIGN8
max_retry_limit
;
USIGN8
bp_flag
;
/* DP_BP_ERROR_ACTION */
USIGN8
bp_flag
;
/* DP_BP_ERROR_ACTION */
USIGN16
min_slave_interval
;
/* 1..2^16-1 [100 micros] */
USIGN16
min_slave_interval
;
/* 1..2^16-1 [100 micros] */
USIGN16
poll_timeout
;
/* 1..2^16-1 [1 ms] */
USIGN16
poll_timeout
;
/* 1..2^16-1 [1 ms] */
USIGN16
data_control_time
;
/* 1..2^16-1 [10 ms] */
USIGN16
data_control_time
;
/* 1..2^16-1 [10 ms] */
OCTET
reserved
[
6
];
OCTET
reserved
[
6
];
USIGN16
master_user_data_len
;
/* 34..2^16-33 */
USIGN16
master_user_data_len
;
/* 34..2^16-33 */
STRINGV
master_class2_name
[
32
];
/* DP Master (class 2) vendor name */
STRINGV
master_class2_name
[
32
];
/* DP Master (class 2) vendor name */
/* OCTET master_user_data [DP_MASTER_USER_DATA_LEN - 34]; */
/* OCTET master_user_data [DP_MASTER_USER_DATA_LEN - 34]; */
...
@@ -448,22 +419,24 @@ typedef struct _T_DP_BUS_PARA_SET {
...
@@ -448,22 +419,24 @@ typedef struct _T_DP_BUS_PARA_SET {
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DP_DIAG_DATA
{
typedef
struct
_T_DP_DIAG_DATA
{
OCTET
station_status_1
;
/* DP_DIAG_1_xxx */
OCTET
station_status_1
;
/* DP_DIAG_1_xxx */
OCTET
station_status_2
;
/* DP_DIAG_2_xxx */
OCTET
station_status_2
;
/* DP_DIAG_2_xxx */
OCTET
station_status_3
;
/* DP_DIAG_3_xxx */
OCTET
station_status_3
;
/* DP_DIAG_3_xxx */
USIGN8
master_add
;
/* DP Master which parameterized the DP Slave */
USIGN8
master_add
;
/* DP Master which parameterized the DP Slave */
USIGN16
ident_number
;
/* PNO ident number of the DP Slave */
USIGN16
ident_number
;
/* PNO ident number of the DP Slave */
/* OCTET ext_diag_data [DP_MAX_EXT_DIAG_DATA_LEN]; */
/* OCTET ext_diag_data [DP_MAX_EXT_DIAG_DATA_LEN]; */
}
T_DP_DIAG_DATA
;
}
T_DP_DIAG_DATA
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_MASTER_STATUS
{
typedef
struct
_T_DP_MASTER_STATUS
OCTET
usif_state
;
/* DP_OP_MODE_xxx */
{
USIGN8
ident_number_high
;
/* alignment problem in DIN 19245-3 !!! */
OCTET
usif_state
;
/* DP_OP_MODE_xxx */
USIGN8
ident_number_low
;
/* USIGN16 ident_number at odd address !!! */
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_hardware_version
;
/* DDLM/USIF release information */
OCTET
dp_firmware_version
;
OCTET
dp_firmware_version
;
OCTET
user_hardware_version
;
/* USER release information */
OCTET
user_hardware_version
;
/* USER release information */
...
@@ -474,31 +447,34 @@ typedef struct _T_DP_MASTER_STATUS {
...
@@ -474,31 +447,34 @@ typedef struct _T_DP_MASTER_STATUS {
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SLAVE_PARAM_SLAVE_INFO
{
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
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 */
USIGN16
offset_outputs
;
/* offset of output area within I/O memory */
USIGN8
number_inputs
;
/* inputs of I/O memory */
USIGN8
number_inputs
;
/* inputs of I/O memory */
USIGN8
number_outputs
;
/* outputs of I/O memory */
USIGN8
number_outputs
;
/* outputs of I/O memory */
USIGN8
sl_flag
;
/* DP_SL_ACTIVE, DP_SL_FLAG_NEW_PRM */
USIGN8
sl_flag
;
/* DP_SL_ACTIVE, DP_SL_FLAG_NEW_PRM */
USIGN8
slave_type
;
/* DP_SLAVE_TYPE_DP */
USIGN8
slave_type
;
/* DP_SLAVE_TYPE_DP */
}
T_DP_SLAVE_PARAM_SLAVE_INFO
;
}
T_DP_SLAVE_PARAM_SLAVE_INFO
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SLAVE_PARAM_SYS_INFO
{
typedef
struct
_T_DP_SLAVE_PARAM_SYS_INFO
USIGN8
loaded_slaves
;
/* number downloaded slaves */
{
USIGN8
active_slaves
;
/* number active slaves */
USIGN8
loaded_slaves
;
/* number downloaded slaves */
INT16
diag_entries
;
/* number available DIAG messages */
USIGN8
active_slaves
;
/* number active slaves */
INT16
diag_entries
;
/* number available DIAG messages */
USIGN16
slave_io_image_len
;
/* length of slave I/O memory */
USIGN16
slave_io_image_len
;
/* length of slave I/O memory */
}
T_DP_SLAVE_PARAM_SYS_INFO
;
}
T_DP_SLAVE_PARAM_SYS_INFO
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SET_IDENT_NUMBER
{
typedef
struct
_T_DP_SET_IDENT_NUMBER
USIGN16
ident_number
;
/* new master ident_number */
{
USIGN16
ident_number
;
/* new master ident_number */
OCTET
dp_hardware_version
;
/* vendor specific release information */
OCTET
dp_hardware_version
;
/* vendor specific release information */
OCTET
dp_firmware_version
;
OCTET
dp_firmware_version
;
OCTET
user_hardware_version
;
OCTET
user_hardware_version
;
...
@@ -510,17 +486,18 @@ typedef struct _T_DP_SET_IDENT_NUMBER {
...
@@ -510,17 +486,18 @@ typedef struct _T_DP_SET_IDENT_NUMBER {
/*--- DP USIF SERVICE STRUCTURES -------------------------------------------*/
/*--- DP USIF SERVICE STRUCTURES -------------------------------------------*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_INIT_MASTER_REQ
{
typedef
struct
_T_DP_INIT_MASTER_REQ
USIGN8
master_default_address
;
/* station address for default BP */
{
PB_BOOL
master_class2
;
/* use M2 requester functionality ? */
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 */
STRINGV
master_class2_name
[
32
];
/* vendor name of M2 */
USIGN8
lowest_slave_address
;
/* station address of first DP Slave */
USIGN8
lowest_slave_address
;
/* station address of first DP Slave */
USIGN8
slave_io_address_mode
;
/* Address Assignment Mode of slave I/O */
USIGN8
slave_io_address_mode
;
/* Address Assignment Mode of slave I/O */
PB_BOOL
clear_outputs
;
/* clear output areas in DP_OP_MODE_CLEAR ? */
PB_BOOL
clear_outputs
;
/* clear output areas in DP_OP_MODE_CLEAR ? */
USIGN8
auto_remote_services
;
/* DP_AUTO_xxx */
USIGN8
auto_remote_services
;
/* DP_AUTO_xxx */
PB_BOOL
cyclic_data_transfer
;
/* no DATA_TRANSFER service requests ? */
PB_BOOL
cyclic_data_transfer
;
/* no DATA_TRANSFER service requests ? */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
...
@@ -529,14 +506,16 @@ typedef struct _T_DP_INIT_MASTER_REQ {
...
@@ -529,14 +506,16 @@ typedef struct _T_DP_INIT_MASTER_REQ {
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_INIT_MASTER_CON
{
typedef
struct
_T_DP_INIT_MASTER_CON
{
USIGN16
status
;
/* OK, IV, NO */
USIGN16
status
;
/* OK, IV, NO */
}
T_DP_INIT_MASTER_CON
;
}
T_DP_INIT_MASTER_CON
;
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DP_EXIT_MASTER_CON
{
typedef
struct
_T_DP_EXIT_MASTER_CON
{
USIGN16
status
;
/* OK, NO */
USIGN16
status
;
/* OK, NO */
}
T_DP_EXIT_MASTER_CON
;
}
T_DP_EXIT_MASTER_CON
;
...
@@ -545,9 +524,9 @@ typedef struct _T_DP_EXIT_MASTER_CON {
...
@@ -545,9 +524,9 @@ typedef struct _T_DP_EXIT_MASTER_CON {
typedef
struct
_T_DP_START_SEQ_REQ
/* MM: function_num --> rem_add */
typedef
struct
_T_DP_START_SEQ_REQ
/* MM: function_num --> rem_add */
{
{
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
area_code
;
/* DP_AREA_xxx */
USIGN8
area_code
;
/* DP_AREA_xxx */
USIGN16
timeout
;
/* download timeout [1ms] */
USIGN16
timeout
;
/* download timeout [1ms] */
}
T_DP_START_SEQ_REQ
;
}
T_DP_START_SEQ_REQ
;
...
@@ -555,18 +534,19 @@ typedef struct _T_DP_START_SEQ_REQ /* MM: function_num --> rem_add */
...
@@ -555,18 +534,19 @@ typedef struct _T_DP_START_SEQ_REQ /* MM: function_num --> rem_add */
typedef
struct
_T_DP_START_SEQ_IND
/* MM: req_add --> function_num */
typedef
struct
_T_DP_START_SEQ_IND
/* MM: req_add --> function_num */
{
{
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
area_code
;
/* DP_AREA_xxx */
USIGN8
area_code
;
/* DP_AREA_xxx */
USIGN16
timeout
;
/* download timeout [1ms] */
USIGN16
timeout
;
/* download timeout [1ms] */
}
T_DP_START_SEQ_IND
;
}
T_DP_START_SEQ_IND
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_START_SEQ_RES_CON
{
typedef
struct
_T_DP_START_SEQ_RES_CON
USIGN16
status
;
/* status of start sequence service */
{
USIGN16
status
;
/* status of start sequence service */
USIGN8
max_len_data_unit
;
/* 1..240 */
USIGN8
max_len_data_unit
;
/* 1..240 */
USIGN8
dummy
;
/* SDU alignment byte */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_START_SEQ_RES_CON
;
}
T_DP_START_SEQ_RES_CON
;
...
@@ -575,7 +555,7 @@ typedef struct _T_DP_START_SEQ_RES_CON {
...
@@ -575,7 +555,7 @@ typedef struct _T_DP_START_SEQ_RES_CON {
typedef
struct
_T_DP_END_SEQ_REQ
/* MM: function_num --> rem_add */
typedef
struct
_T_DP_END_SEQ_REQ
/* MM: function_num --> rem_add */
{
{
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
dummy
;
/* SDU alignment byte */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_END_SEQ_REQ
;
}
T_DP_END_SEQ_REQ
;
...
@@ -584,21 +564,23 @@ typedef struct _T_DP_END_SEQ_REQ /* MM: function_num --> rem_add */
...
@@ -584,21 +564,23 @@ typedef struct _T_DP_END_SEQ_REQ /* MM: function_num --> rem_add */
typedef
struct
_T_DP_END_SEQ_IND
/* MM: req_add --> function_num */
typedef
struct
_T_DP_END_SEQ_IND
/* MM: req_add --> function_num */
{
{
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
dummy
;
/* SDU alignment byte */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_END_SEQ_IND
;
}
T_DP_END_SEQ_IND
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_END_SEQ_RES_CON
{
typedef
struct
_T_DP_END_SEQ_RES_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, TO, FE, RE, */
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, TO, FE, RE, */
/* NE, AD, IP, NI, SE, SC, EA, LE */
/* NE, AD, IP, NI, SE, SC, EA, LE */
}
T_DP_END_SEQ_RES_CON
;
}
T_DP_END_SEQ_RES_CON
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_END_SEQ_LOC_IND
{
typedef
struct
_T_DP_END_SEQ_LOC_IND
{
USIGN16
status
;
/* TO */
USIGN16
status
;
/* TO */
}
T_DP_END_SEQ_LOC_IND
;
}
T_DP_END_SEQ_LOC_IND
;
...
@@ -607,9 +589,9 @@ typedef struct _T_DP_END_SEQ_LOC_IND {
...
@@ -607,9 +589,9 @@ typedef struct _T_DP_END_SEQ_LOC_IND {
typedef
struct
_T_DP_DOWNLOAD_REQ
/* MM: function_num --> rem_add */
typedef
struct
_T_DP_DOWNLOAD_REQ
/* MM: function_num --> rem_add */
{
{
USIGN16
data_len
;
/* 0..DP_MAX_DOWNLOAD_DATA_LEN */
USIGN16
data_len
;
/* 0..DP_MAX_DOWNLOAD_DATA_LEN */
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
area_code
;
/* destination area of download service */
USIGN8
area_code
;
/* destination area of download service */
USIGN16
add_offset
;
/* starting offset within this area */
USIGN16
add_offset
;
/* starting offset within this area */
/* OCTET data [data_len]; download data */
/* OCTET data [data_len]; download data */
...
@@ -619,9 +601,9 @@ typedef struct _T_DP_DOWNLOAD_REQ /* MM: function_num --> rem_add */
...
@@ -619,9 +601,9 @@ typedef struct _T_DP_DOWNLOAD_REQ /* MM: function_num --> rem_add */
typedef
struct
_T_DP_DOWNLOAD_IND
/* MM: req_add --> function_num */
typedef
struct
_T_DP_DOWNLOAD_IND
/* MM: req_add --> function_num */
{
{
USIGN16
data_len
;
/* 0..DP_MAX_DOWNLOAD_DATA_LEN */
USIGN16
data_len
;
/* 0..DP_MAX_DOWNLOAD_DATA_LEN */
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
area_code
;
/* destination area of download service */
USIGN8
area_code
;
/* destination area of download service */
USIGN16
add_offset
;
/* starting offset within this area */
USIGN16
add_offset
;
/* starting offset within this area */
/* OCTET data [data_len]; download data */
/* OCTET data [data_len]; download data */
...
@@ -629,9 +611,10 @@ typedef struct _T_DP_DOWNLOAD_IND /* MM: req_add --> function_num */
...
@@ -629,9 +611,10 @@ typedef struct _T_DP_DOWNLOAD_IND /* MM: req_add --> function_num */
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_DOWNLOAD_RES_CON
{
typedef
struct
_T_DP_DOWNLOAD_RES_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, TO, FE, */
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, TO, FE, */
/* RE, NE, AD, EA, SC, NI, LE */
/* RE, NE, AD, EA, SC, NI, LE */
}
T_DP_DOWNLOAD_RES_CON
;
}
T_DP_DOWNLOAD_RES_CON
;
...
@@ -639,11 +622,11 @@ typedef struct _T_DP_DOWNLOAD_RES_CON {
...
@@ -639,11 +622,11 @@ typedef struct _T_DP_DOWNLOAD_RES_CON {
typedef
struct
_T_DP_UPLOAD_REQ
/* MM: function_num --> rem_add */
typedef
struct
_T_DP_UPLOAD_REQ
/* MM: function_num --> rem_add */
{
{
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
area_code
;
/* destination area of download service */
USIGN8
area_code
;
/* destination area of download service */
USIGN16
add_offset
;
/* starting offset within this area */
USIGN16
add_offset
;
/* starting offset within this area */
USIGN8
data_len
;
/* 1..240 */
USIGN8
data_len
;
/* 1..240 */
USIGN8
dummy
;
/* SDU alignment byte */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_UPLOAD_REQ
;
}
T_DP_UPLOAD_REQ
;
...
@@ -651,19 +634,20 @@ typedef struct _T_DP_UPLOAD_REQ /* MM: function_num --> rem_add */
...
@@ -651,19 +634,20 @@ typedef struct _T_DP_UPLOAD_REQ /* MM: function_num --> rem_add */
typedef
struct
_T_DP_UPLOAD_IND
/* MM: req_add --> function_num */
typedef
struct
_T_DP_UPLOAD_IND
/* MM: req_add --> function_num */
{
{
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
area_code
;
/* destination area of download service */
USIGN8
area_code
;
/* destination area of download service */
USIGN16
add_offset
;
/* starting offset within this area */
USIGN16
add_offset
;
/* starting offset within this area */
USIGN8
data_len
;
/* 1..240 */
USIGN8
data_len
;
/* 1..240 */
USIGN8
dummy
;
/* SDU alignment byte */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_UPLOAD_IND
;
}
T_DP_UPLOAD_IND
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_UPLOAD_RES_CON
{
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
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 */
USIGN16
data_len
;
/* 1..DP_MAX_UPLOAD_DATA_LEN */
/* OCTET data [data_len]; upload data */
/* OCTET data [data_len]; upload data */
...
@@ -673,10 +657,10 @@ typedef struct _T_DP_UPLOAD_RES_CON {
...
@@ -673,10 +657,10 @@ typedef struct _T_DP_UPLOAD_RES_CON {
typedef
struct
_T_DP_ACT_PARAM_REQ
/* MM: function_num --> rem_add */
typedef
struct
_T_DP_ACT_PARAM_REQ
/* MM: function_num --> rem_add */
{
{
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
area_code
;
/* DP_AREA_xxx */
USIGN8
area_code
;
/* DP_AREA_xxx */
USIGN8
activate
;
/* DP_SLAVE_xxx, DP_BUS_PAR_ACTIVATE, DP_OP_MODE_xxx */
USIGN8
activate
;
/* DP_SLAVE_xxx, DP_BUS_PAR_ACTIVATE, DP_OP_MODE_xxx */
USIGN8
dummy
;
/* SDU alignment byte */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_ACT_PARAM_REQ
;
}
T_DP_ACT_PARAM_REQ
;
...
@@ -684,18 +668,19 @@ typedef struct _T_DP_ACT_PARAM_REQ /* MM: function_num --> rem_add */
...
@@ -684,18 +668,19 @@ typedef struct _T_DP_ACT_PARAM_REQ /* MM: function_num --> rem_add */
typedef
struct
_T_DP_ACT_PARAM_IND
/* MM: req_add --> function_num */
typedef
struct
_T_DP_ACT_PARAM_IND
/* MM: req_add --> function_num */
{
{
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
area_code
;
/* DP_AREA_xxx */
USIGN8
area_code
;
/* DP_AREA_xxx */
USIGN8
activate
;
/* DP_SLAVE_xxx, DP_BUS_PAR_ACTIVATE, DP_OP_MODE_xxx */
USIGN8
activate
;
/* DP_SLAVE_xxx, DP_BUS_PAR_ACTIVATE, DP_OP_MODE_xxx */
USIGN8
dummy
;
/* SDU alignment byte */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_ACT_PARAM_IND
;
}
T_DP_ACT_PARAM_IND
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_ACT_PARAM_RES_CON
{
typedef
struct
_T_DP_ACT_PARAM_RES_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, TO, FE, RE, */
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, TO, FE, RE, */
/* NE, AD, IP, SC, NI, DI, EA, LE */
/* NE, AD, IP, SC, NI, DI, EA, LE */
}
T_DP_ACT_PARAM_RES_CON
;
}
T_DP_ACT_PARAM_RES_CON
;
...
@@ -703,7 +688,7 @@ typedef struct _T_DP_ACT_PARAM_RES_CON {
...
@@ -703,7 +688,7 @@ typedef struct _T_DP_ACT_PARAM_RES_CON {
typedef
struct
_T_DP_GET_MASTER_DIAG_REQ
/* MM: function_num --> rem_add */
typedef
struct
_T_DP_GET_MASTER_DIAG_REQ
/* MM: function_num --> rem_add */
{
{
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
rem_add
;
/* station address DP Master (class 1) */
USIGN8
identifier
;
/* DP_DIAG_xxx */
USIGN8
identifier
;
/* DP_DIAG_xxx */
}
T_DP_GET_MASTER_DIAG_REQ
;
}
T_DP_GET_MASTER_DIAG_REQ
;
...
@@ -712,16 +697,17 @@ typedef struct _T_DP_GET_MASTER_DIAG_REQ /* MM: function_num --> rem_add */
...
@@ -712,16 +697,17 @@ typedef struct _T_DP_GET_MASTER_DIAG_REQ /* MM: function_num --> rem_add */
typedef
struct
_T_DP_GET_MASTER_DIAG_IND
/* MM: req_add --> function_num */
typedef
struct
_T_DP_GET_MASTER_DIAG_IND
/* MM: req_add --> function_num */
{
{
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
req_add
;
/* station address DP Master (class 2) */
USIGN8
identifier
;
/* DP_DIAG_xxx */
USIGN8
identifier
;
/* DP_DIAG_xxx */
}
T_DP_GET_MASTER_DIAG_IND
;
}
T_DP_GET_MASTER_DIAG_IND
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_GET_MASTER_DIAG_RES_CON
{
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
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 */
USIGN16
data_len
;
/* 1..DP_MAX_MASTER_DIAG_DATA_LEN */
/* OCTET diagnostic_data [data_len]; */
/* OCTET diagnostic_data [data_len]; */
...
@@ -733,11 +719,12 @@ typedef VOID T_DP_GET_SLAVE_DIAG_REQ;
...
@@ -733,11 +719,12 @@ typedef VOID T_DP_GET_SLAVE_DIAG_REQ;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_GET_SLAVE_DIAG_CON
{
typedef
struct
_T_DP_GET_SLAVE_DIAG_CON
USIGN16
status
;
/* OK, NO */
{
USIGN8
rem_add
;
/* 0..126 */
USIGN16
status
;
/* OK, NO */
USIGN8
dummy
;
/* SDU alignment byte */
USIGN8
rem_add
;
/* 0..126 */
INT16
diag_entries
;
/* -1..DP_MAX_SLAVE_DIAG_ENTRIES */
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 */
USIGN16
diag_data_len
;
/* 0..DP_MAX_SLAVE_DIAG_DATA_LEN */
/* T_DP_DIAG_DATA diag_data; diag_data_len */
/* T_DP_DIAG_DATA diag_data; diag_data_len */
...
@@ -753,24 +740,27 @@ typedef VOID T_DP_DATA_TRANSFER_REQ; /* no SDU */
...
@@ -753,24 +740,27 @@ typedef VOID T_DP_DATA_TRANSFER_REQ; /* no SDU */
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_DATA_TRANSFER_CON
{
typedef
struct
_T_DP_DATA_TRANSFER_CON
USIGN16
status
;
/* OK, NO */
{
USIGN16
status
;
/* OK, NO */
INT16
diag_entries
;
/* -1..DP_MAX_SLAVE_DIAG_ENTRIES */
INT16
diag_entries
;
/* -1..DP_MAX_SLAVE_DIAG_ENTRIES */
}
T_DP_DATA_TRANSFER_CON
;
}
T_DP_DATA_TRANSFER_CON
;
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DP_GET_SLAVE_PARAM_REQ
{
typedef
struct
_T_DP_GET_SLAVE_PARAM_REQ
{
USIGN8
identifier
;
/* DP_SLAVE_PARAM_xxx */
USIGN8
identifier
;
/* DP_SLAVE_PARAM_xxx */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
rem_add
;
/* 0..126 */
}
T_DP_GET_SLAVE_PARAM_REQ
;
}
T_DP_GET_SLAVE_PARAM_REQ
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_GET_SLAVE_PARAM_CON
{
typedef
struct
_T_DP_GET_SLAVE_PARAM_CON
USIGN16
status
;
/* OK, NO, IV, NE */
{
USIGN16
status
;
/* OK, NO, IV, NE */
USIGN16
data_len
;
/* 0..244 */
USIGN16
data_len
;
/* 0..244 */
/* OCTET slave_param_data [data_len]; data_len */
/* OCTET slave_param_data [data_len]; data_len */
...
@@ -778,13 +768,14 @@ typedef struct _T_DP_GET_SLAVE_PARAM_CON {
...
@@ -778,13 +768,14 @@ typedef struct _T_DP_GET_SLAVE_PARAM_CON {
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DP_SET_BUSPARAMETER_REQ
{
typedef
struct
_T_DP_SET_BUSPARAMETER_REQ
USIGN8
bp_flag
;
/* DP_BP_ERROR_ACTION */
{
USIGN8
dummy
;
/* alignment byte */
USIGN8
bp_flag
;
/* DP_BP_ERROR_ACTION */
USIGN16
min_slave_interval
;
/* 1..2^16-1 [100 micros] */
USIGN8
dummy
;
/* alignment byte */
USIGN16
poll_timeout
;
/* 1..2^16-1 [1 ms] */
USIGN16
min_slave_interval
;
/* 1..2^16-1 [100 micros] */
USIGN16
data_control_time
;
/* 1..2^16-1 [10 ms] */
USIGN16
poll_timeout
;
/* 1..2^16-1 [1 ms] */
USIGN16
master_user_data_len
;
/* 34..DP_MAX_SET_BUSPARAMETER_LEN */
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 */
STRINGV
master_class2_name
[
32
];
/* DP Master (class 2) vendor name */
/* OCTET master_user_data [0..DP_MAX_SET_BUSPARAMETER_LEN - 34]; */
/* OCTET master_user_data [0..DP_MAX_SET_BUSPARAMETER_LEN - 34]; */
...
@@ -792,23 +783,26 @@ typedef struct _T_DP_SET_BUSPARAMETER_REQ {
...
@@ -792,23 +783,26 @@ typedef struct _T_DP_SET_BUSPARAMETER_REQ {
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SET_BUSPARAMETER_CON
{
typedef
struct
_T_DP_SET_BUSPARAMETER_CON
{
USIGN16
status
;
/* OK, IV, NO */
USIGN16
status
;
/* OK, IV, NO */
}
T_DP_SET_BUSPARAMETER_CON
;
}
T_DP_SET_BUSPARAMETER_CON
;
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DP_SET_MASTER_PARAM_REQ
{
typedef
struct
_T_DP_SET_MASTER_PARAM_REQ
{
USIGN8
identifier
;
/* DP_SET_xxx */
USIGN8
identifier
;
/* DP_SET_xxx */
USIGN8
data_len
;
/* 0..DP_MAX_TELEGRAM_LEN */
USIGN8
data_len
;
/* 0..DP_MAX_TELEGRAM_LEN */
/* OCTET data [data_len]; data dependent on identifier */
/* OCTET data [data_len]; data dependent on identifier */
}
T_DP_SET_MASTER_PARAM_REQ
;
}
T_DP_SET_MASTER_PARAM_REQ
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SET_MASTER_PARAM_CON
{
typedef
struct
_T_DP_SET_MASTER_PARAM_CON
{
USIGN16
status
;
/* OK, IV, NO */
USIGN16
status
;
/* OK, IV, NO */
}
T_DP_SET_MASTER_PARAM_CON
;
}
T_DP_SET_MASTER_PARAM_CON
;
...
@@ -817,18 +811,20 @@ typedef struct _T_DP_SET_MASTER_PARAM_CON {
...
@@ -817,18 +811,20 @@ typedef struct _T_DP_SET_MASTER_PARAM_CON {
/*--- DP DDLM SERVICE STRUCTURES -------------------------------------------*/
/*--- DP DDLM SERVICE STRUCTURES -------------------------------------------*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SLAVE_DIAG_REQ
{
typedef
struct
_T_DP_SLAVE_DIAG_REQ
{
USIGN8
rem_add
;
/* 0..126 */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* SDU alignment byte */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_SLAVE_DIAG_REQ
;
}
T_DP_SLAVE_DIAG_REQ
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SLAVE_DIAG_CON
{
typedef
struct
_T_DP_SLAVE_DIAG_CON
USIGN16
status
;
/* OK, DS, NA, RS, UE, NR, RE */
{
USIGN8
rem_add
;
/* 0..126 */
USIGN16
status
;
/* OK, DS, NA, RS, UE, NR, RE */
USIGN8
dummy
;
/* PCI alignment byte */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* PCI alignment byte */
USIGN16
diag_data_len
;
/* 0..DP_MAX_SLAVE_DIAG_DATA_LEN */
USIGN16
diag_data_len
;
/* 0..DP_MAX_SLAVE_DIAG_DATA_LEN */
/* OCTET diag_data [diag_data_len]; */
/* OCTET diag_data [diag_data_len]; */
...
@@ -836,9 +832,10 @@ typedef struct _T_DP_SLAVE_DIAG_CON {
...
@@ -836,9 +832,10 @@ typedef struct _T_DP_SLAVE_DIAG_CON {
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DP_DATA_EXCHANGE_REQ
{
typedef
struct
_T_DP_DATA_EXCHANGE_REQ
USIGN8
rem_add
;
/* 0..126 */
{
USIGN8
dummy
;
/* PCI alignment byte */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* PCI alignment byte */
USIGN16
outp_data_len
;
/* 0..DP_MAX_OUTPUT_DATA_LEN */
USIGN16
outp_data_len
;
/* 0..DP_MAX_OUTPUT_DATA_LEN */
/* OCTET outp_data [outp_data_len]; */
/* OCTET outp_data [outp_data_len]; */
...
@@ -846,10 +843,11 @@ typedef struct _T_DP_DATA_EXCHANGE_REQ {
...
@@ -846,10 +843,11 @@ typedef struct _T_DP_DATA_EXCHANGE_REQ {
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_DATA_EXCHANGE_CON
{
typedef
struct
_T_DP_DATA_EXCHANGE_CON
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, RE */
{
USIGN8
rem_add
;
/* 0..126 */
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, RE */
PB_BOOL
diag_flag
;
/* DP_TRUE: DP Slave diagnostic data available */
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 */
USIGN16
inp_data_len
;
/* 0..DP_MAX_INPUT_DATA_LEN */
/* OCTET inp_data [inp_data_len]; */
/* OCTET inp_data [inp_data_len]; */
...
@@ -857,18 +855,20 @@ typedef struct _T_DP_DATA_EXCHANGE_CON {
...
@@ -857,18 +855,20 @@ typedef struct _T_DP_DATA_EXCHANGE_CON {
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DP_RD_INP_REQ
{
typedef
struct
_T_DP_RD_INP_REQ
{
USIGN8
rem_add
;
/* 0..126 */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* SDU alignment byte */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_RD_INP_REQ
;
}
T_DP_RD_INP_REQ
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_RD_INP_CON
{
typedef
struct
_T_DP_RD_INP_CON
USIGN16
status
;
/* OK, DS, NA, RS, UE, NR, RE */
{
USIGN8
rem_add
;
/* 0..126 */
USIGN16
status
;
/* OK, DS, NA, RS, UE, NR, RE */
USIGN8
dummy
;
/* PCI alignment byte */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* PCI alignment byte */
USIGN16
inp_data_len
;
/* 0..DP_MAX_INPUT_DATA_LEN */
USIGN16
inp_data_len
;
/* 0..DP_MAX_INPUT_DATA_LEN */
/* OCTET inp_data [inp_data_len]; */
/* OCTET inp_data [inp_data_len]; */
...
@@ -876,18 +876,20 @@ typedef struct _T_DP_RD_INP_CON {
...
@@ -876,18 +876,20 @@ typedef struct _T_DP_RD_INP_CON {
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DP_RD_OUTP_REQ
{
typedef
struct
_T_DP_RD_OUTP_REQ
{
USIGN8
rem_add
;
/* 0..126 */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* SDU alignment byte */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_RD_OUTP_REQ
;
}
T_DP_RD_OUTP_REQ
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_RD_OUTP_CON
{
typedef
struct
_T_DP_RD_OUTP_CON
USIGN16
status
;
/* OK, DS, NA, RS, UE, NR, RE */
{
USIGN8
rem_add
;
/* 0..126 */
USIGN16
status
;
/* OK, DS, NA, RS, UE, NR, RE */
USIGN8
dummy
;
/* PCI alignment byte */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* PCI alignment byte */
USIGN16
outp_data_len
;
/* 0..DP_MAX_OUTPUT_DATA_LEN */
USIGN16
outp_data_len
;
/* 0..DP_MAX_OUTPUT_DATA_LEN */
/* OCTET outp_data [outp_data_len]; */
/* OCTET outp_data [outp_data_len]; */
...
@@ -895,93 +897,103 @@ typedef struct _T_DP_RD_OUTP_CON {
...
@@ -895,93 +897,103 @@ typedef struct _T_DP_RD_OUTP_CON {
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DP_SET_PRM_REQ
{
typedef
struct
_T_DP_SET_PRM_REQ
USIGN8
rem_add
;
/* 0..126 */
{
USIGN8
dummy
;
/* PCI alignment byte */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* PCI alignment byte */
T_DP_PRM_DATA
prm_data
;
/* 9..DP_MAX_PRM_DATA_LEN */
T_DP_PRM_DATA
prm_data
;
/* 9..DP_MAX_PRM_DATA_LEN */
}
T_DP_SET_PRM_REQ
;
}
T_DP_SET_PRM_REQ
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SET_PRM_CON
{
typedef
struct
_T_DP_SET_PRM_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, RE */
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, RE */
}
T_DP_SET_PRM_CON
;
}
T_DP_SET_PRM_CON
;
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DP_CHK_CFG_REQ
{
typedef
struct
_T_DP_CHK_CFG_REQ
USIGN8
rem_add
;
/* 0..126 */
{
USIGN8
dummy
;
/* PCI alignment byte */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* PCI alignment byte */
T_DP_CFG_DATA
cfg_data
;
/* 3..DP_MAX_CFG_DATA_LEN */
T_DP_CFG_DATA
cfg_data
;
/* 3..DP_MAX_CFG_DATA_LEN */
}
T_DP_CHK_CFG_REQ
;
}
T_DP_CHK_CFG_REQ
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_CHK_CFG_CON
{
typedef
struct
_T_DP_CHK_CFG_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, RE */
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, RE */
}
T_DP_CHK_CFG_CON
;
}
T_DP_CHK_CFG_CON
;
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DP_GET_CFG_REQ
{
typedef
struct
_T_DP_GET_CFG_REQ
{
USIGN8
rem_add
;
/* 0..126 */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
dummy
;
/* SDU alignment byte */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_GET_CFG_REQ
;
}
T_DP_GET_CFG_REQ
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_GET_CFG_CON
{
typedef
struct
_T_DP_GET_CFG_CON
USIGN16
status
;
/* OK, DS, NA, RS, UE, NR, RE */
{
USIGN8
rem_add
;
/* 0..126 */
USIGN16
status
;
/* OK, DS, NA, RS, UE, NR, RE */
USIGN8
dummy
;
/* PCI alignment byte */
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_CFG_DATA
real_cfg_data
;
/* 3..DP_MAX_CFG_DATA_LEN */
}
T_DP_GET_CFG_CON
;
}
T_DP_GET_CFG_CON
;
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DP_GLOBAL_CONTROL_REQ
{
typedef
struct
_T_DP_GLOBAL_CONTROL_REQ
USIGN8
rem_add
;
/* 0..126, 127 DP_GLOBAL_STATION_ADDRESS */
{
USIGN8
dummy
;
/* PCI alignment byte */
USIGN8
rem_add
;
/* 0..126, 127 DP_GLOBAL_STATION_ADDRESS */
USIGN8
dummy
;
/* PCI alignment byte */
USIGN8
control_command
;
/* DP_CONTROL_xxx */
USIGN8
control_command
;
/* DP_CONTROL_xxx */
USIGN8
group_select
;
/* group_ident see T_DP_PRM_DATA */
USIGN8
group_select
;
/* group_ident see T_DP_PRM_DATA */
}
T_DP_GLOBAL_CONTROL_REQ
;
}
T_DP_GLOBAL_CONTROL_REQ
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_GLOBAL_CONTROL_CON
{
typedef
struct
_T_DP_GLOBAL_CONTROL_CON
{
USIGN16
status
;
/* OK, DS, NO, IV */
USIGN16
status
;
/* OK, DS, NO, IV */
USIGN8
rem_add
;
/* 0..126, 127 DP_GLOBAL_STATION_ADDRESS */
USIGN8
rem_add
;
/* 0..126, 127 DP_GLOBAL_STATION_ADDRESS */
USIGN8
dummy
;
/* SDU alignment byte */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_GLOBAL_CONTROL_CON
;
}
T_DP_GLOBAL_CONTROL_CON
;
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DP_SET_SLAVE_ADD_REQ
{
typedef
struct
_T_DP_SET_SLAVE_ADD_REQ
USIGN8
rem_add
;
/* 0..125, 126 DP_DEFAULT_SLAVE_ADDRESS */
{
USIGN8
dummy
;
/* PCI alignment byte */
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 */
USIGN16
rem_slave_data_len
;
/* 0..DP_MAX_REM_SLAVE_DATA_LEN */
USIGN8
new_slave_add
;
/* 0..125 */
USIGN8
new_slave_add
;
/* 0..125 */
USIGN8
ident_number_high
;
/* alignment problem in DIN 19245-3 !!! */
USIGN8
ident_number_high
;
/* alignment problem in DIN 19245-3 !!! */
USIGN8
ident_number_low
;
/* USIGN16 ident_number at odd address !!! */
USIGN8
ident_number_low
;
/* USIGN16 ident_number at odd address !!! */
PB_BOOL
no_add_chg
;
/* DP_TRUE: address change after reset only */
PB_BOOL
no_add_chg
;
/* DP_TRUE: address change after reset only */
/* OCTET rem_slave_data [rem_slave_data_len]; */
/* OCTET rem_slave_data [rem_slave_data_len]; */
}
T_DP_SET_SLAVE_ADD_REQ
;
}
T_DP_SET_SLAVE_ADD_REQ
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_SET_SLAVE_ADD_CON
{
typedef
struct
_T_DP_SET_SLAVE_ADD_CON
{
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, RE */
USIGN16
status
;
/* OK, DS, NA, RS, RR, UE, RE */
USIGN8
rem_add
;
/* 0..125, 126 DP_DEFAULT_SLAVE_ADDRESS */
USIGN8
rem_add
;
/* 0..125, 126 DP_DEFAULT_SLAVE_ADDRESS */
USIGN8
dummy
;
/* SDU alignment byte */
USIGN8
dummy
;
/* SDU alignment byte */
}
T_DP_SET_SLAVE_ADD_CON
;
}
T_DP_SET_SLAVE_ADD_CON
;
...
@@ -989,21 +1001,23 @@ typedef struct _T_DP_SET_SLAVE_ADD_CON {
...
@@ -989,21 +1001,23 @@ typedef struct _T_DP_SET_SLAVE_ADD_CON {
typedef
struct
_T_DP_ACT_PARA_BRCT_REQ
/* MM: function_num --> rem_add */
typedef
struct
_T_DP_ACT_PARA_BRCT_REQ
/* MM: function_num --> rem_add */
{
{
USIGN8
rem_add
;
/* 0..125, 127 DP_GLOBAL_STATION_ADDRESS */
USIGN8
rem_add
;
/* 0..125, 127 DP_GLOBAL_STATION_ADDRESS */
USIGN8
area_code
;
/* DP_AREA_BUS_PARAM */
USIGN8
area_code
;
/* DP_AREA_BUS_PARAM */
}
T_DP_ACT_PARA_BRCT_REQ
;
}
T_DP_ACT_PARA_BRCT_REQ
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_ACT_PARA_BRCT_CON
{
typedef
struct
_T_DP_ACT_PARA_BRCT_CON
{
USIGN16
status
;
/* OK, DS */
USIGN16
status
;
/* OK, DS */
}
T_DP_ACT_PARA_BRCT_CON
;
}
T_DP_ACT_PARA_BRCT_CON
;
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DP_FM2_EVENT_IND
{
typedef
struct
_T_DP_FM2_EVENT_IND
{
USIGN16
reason
;
/* FM2 event message */
USIGN16
reason
;
/* FM2 event message */
}
T_DP_FM2_EVENT_IND
;
}
T_DP_FM2_EVENT_IND
;
...
@@ -1012,22 +1026,24 @@ typedef struct _T_DP_FM2_EVENT_IND {
...
@@ -1012,22 +1026,24 @@ typedef struct _T_DP_FM2_EVENT_IND {
/*--- DPV1 DATA STRUCTURES -------------------------------------------------*/
/*--- DPV1 DATA STRUCTURES -------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_ADDR
{
typedef
struct
_T_ADDR
USIGN8
api
;
/* default: set to 0 */
{
USIGN8
scl
;
/* default: set to 0 */
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
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
/* OCTET mac_address[x_len-8]; */
/* use only when [d|s]_type is set to 1
*/
*/
}
T_ADDR
;
}
T_ADDR
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_ADD_ADDR
{
typedef
struct
_T_ADD_ADDR
{
USIGN8
s_type
;
/* default: set to 0 */
USIGN8
s_type
;
/* default: set to 0 */
USIGN8
s_len
;
/* default: set to 2 */
USIGN8
s_len
;
/* default: set to 2 */
USIGN8
d_type
;
/* default: set to 0 */
USIGN8
d_type
;
/* default: set to 0 */
USIGN8
d_len
;
/* default: set to 2 */
USIGN8
d_len
;
/* default: set to 2 */
/* USIGN8 s_addr[s_len]; */
/* USIGN8 s_addr[s_len]; */
/* USIGN8 d_addr[d_len]; */
/* USIGN8 d_addr[d_len]; */
...
@@ -1035,14 +1051,15 @@ typedef struct _T_ADD_ADDR {
...
@@ -1035,14 +1051,15 @@ typedef struct _T_ADD_ADDR {
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_INITIATE_REQ
{
typedef
struct
_T_DP_INITIATE_REQ
{
USIGN8
rem_add
;
/* 0..126 */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
reserved
[
3
];
USIGN8
reserved
[
3
];
USIGN16
send_timeout
;
/* 1..2^16-1 [10 ms] */
USIGN16
send_timeout
;
/* 1..2^16-1 [10 ms] */
OCTET
features_supported
[
2
];
/* 0x01, 0x00 */
OCTET
features_supported
[
2
];
/* 0x01, 0x00 */
OCTET
profile_features_supported
[
2
];
/* profile specific */
OCTET
profile_features_supported
[
2
];
/* profile specific */
USIGN16
profile_ident_number
;
/* profile specific */
USIGN16
profile_ident_number
;
/* profile specific */
T_ADD_ADDR
add_addr_param
;
/* additional address information */
T_ADD_ADDR
add_addr_param
;
/* additional address information */
}
T_DP_INITIATE_REQ
;
}
T_DP_INITIATE_REQ
;
...
@@ -1051,91 +1068,99 @@ typedef struct _T_DP_INITIATE_REQ {
...
@@ -1051,91 +1068,99 @@ typedef struct _T_DP_INITIATE_REQ {
#define DP_INITIATE_S_ADDR(x) \
#define DP_INITIATE_S_ADDR(x) \
((T_ADDR FAR*)(((USIGN8 FAR*)&((x)->add_addr_param)) + sizeof(T_ADD_ADDR)))
((T_ADDR FAR*)(((USIGN8 FAR*)&((x)->add_addr_param)) + sizeof(T_ADD_ADDR)))
#define DP_INITIATE_D_ADDR(x) \
#define DP_INITIATE_D_ADDR(x) \
((T_ADDR FAR*)(((USIGN8 FAR*)&((x)->add_addr_param)) + sizeof(T_ADD_ADDR)
\
((T_ADDR FAR*)(((USIGN8 FAR*)&((x)->add_addr_param)) + sizeof(T_ADD_ADDR)
+
\
+
(x)->add_addr_param.s_len))
(x)->add_addr_param.s_len))
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_INITIATE_CON
{
typedef
struct
_T_DP_INITIATE_CON
{
USIGN16
status
;
USIGN16
status
;
USIGN8
rem_add
;
/* 0..126 */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
max_len_data_unit
;
/* 0..DP_MSAC2_DATA_LEN */
USIGN8
max_len_data_unit
;
/* 0..DP_MSAC2_DATA_LEN */
OCTET
features_supported
[
2
];
/* 0x01, 0x00 */
OCTET
features_supported
[
2
];
/* 0x01, 0x00 */
OCTET
profile_features_supported
[
2
];
/* profile specific */
OCTET
profile_features_supported
[
2
];
/* profile specific */
USIGN16
profile_ident_number
;
/* profile specific */
USIGN16
profile_ident_number
;
/* profile specific */
T_ADD_ADDR
add_addr_param
;
/* additional address information */
T_ADD_ADDR
add_addr_param
;
/* additional address information */
}
T_DP_INITIATE_CON
;
}
T_DP_INITIATE_CON
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_READ_REQ
{
typedef
struct
_T_DP_READ_REQ
USIGN8
rem_add
;
/* 0..126, interpreted only when MSAC_C1 */
{
USIGN8
rem_add
;
/* 0..126, interpreted only when MSAC_C1 */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
}
T_DP_READ_REQ
;
}
T_DP_READ_REQ
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_READ_CON
{
typedef
struct
_T_DP_READ_CON
{
USIGN16
status
;
USIGN16
status
;
USIGN8
rem_add
;
/* 0..126 */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
/* OCTET data [length] */
/* OCTET data [length] */
}
T_DP_READ_CON
;
}
T_DP_READ_CON
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_WRITE_REQ
{
typedef
struct
_T_DP_WRITE_REQ
USIGN8
rem_add
;
/* 0..126, interpreted only when MSAC_C1 */
{
USIGN8
rem_add
;
/* 0..126, interpreted only when MSAC_C1 */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
/* OCTET data [length] */
/* OCTET data [length] */
}
T_DP_WRITE_REQ
;
}
T_DP_WRITE_REQ
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_WRITE_CON
{
typedef
struct
_T_DP_WRITE_CON
{
USIGN16
status
;
USIGN16
status
;
USIGN8
rem_add
;
/* 0..126 */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
}
T_DP_WRITE_CON
;
}
T_DP_WRITE_CON
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_DATA_TRANSPORT_REQ
{
typedef
struct
_T_DP_DATA_TRANSPORT_REQ
USIGN8
rem_add
;
/* 0..126 */
{
USIGN8
rem_add
;
/* 0..126 */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
/* OCTET data [length] */
/* OCTET data [length] */
}
T_DP_DATA_TRANSPORT_REQ
;
}
T_DP_DATA_TRANSPORT_REQ
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_DATA_TRANSPORT_CON
{
typedef
struct
_T_DP_DATA_TRANSPORT_CON
{
USIGN16
status
;
USIGN16
status
;
USIGN8
rem_add
;
/* 0..126 */
USIGN8
rem_add
;
/* 0..126 */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
slot_number
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
index
;
/* 0..254, 255 is reserved */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
USIGN8
length
;
/* 0..DP_MSAC2_DATA_LEN */
/* OCTET data [length] */
/* OCTET data [length] */
}
T_DP_DATA_TRANSPORT_CON
;
}
T_DP_DATA_TRANSPORT_CON
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_ABORT_REQ
{
typedef
struct
_T_DP_ABORT_REQ
{
USIGN8
subnet
;
/* 0, 1, 2, others reserved */
USIGN8
subnet
;
/* 0, 1, 2, others reserved */
USIGN8
reason
;
/* user reason code: 0..0x3F */
USIGN8
reason
;
/* user reason code: 0..0x3F */
...
@@ -1143,18 +1168,20 @@ typedef struct _T_DP_ABORT_REQ {
...
@@ -1143,18 +1168,20 @@ typedef struct _T_DP_ABORT_REQ {
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_ABORT_IND
{
typedef
struct
_T_DP_ABORT_IND
{
PB_BOOL
locally_generated
;
PB_BOOL
locally_generated
;
USIGN8
subnet
;
/* 0, 1, 2, others reserved */
USIGN8
subnet
;
/* 0, 1, 2, others reserved */
USIGN8
reason
;
/* reason codes: see DPV1 specification */
USIGN8
reason
;
/* reason codes: see DPV1 specification */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
USIGN16
additional_detail
;
/* received timeout with RM-REQ */
USIGN16
additional_detail
;
/* received timeout with RM-REQ */
}
T_DP_ABORT_IND
;
}
T_DP_ABORT_IND
;
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DP_ERROR_CON
{
typedef
struct
_T_DP_ERROR_CON
{
USIGN16
status
;
USIGN16
status
;
USIGN8
rem_add
;
USIGN8
rem_add
;
USIGN8
error_decode
;
USIGN8
error_decode
;
...
...
profibus/lib/rt/src/pb_dps.h
View file @
ce758cd3
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************/
/*****************************************************************************/
/* */
/* */
/*
SOFTING AG
*/
/*
SOFTING Industrial Automation GmbH
*/
/* Richard-Reitzner-Allee 6 */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* */
/*
Copyright (C) SOFTING AG 1995-2003
*/
/*
Copyright (C) SOFTING Industrial Automation GmbH 1995-2012
*/
/* All Rights Reserved */
/* All Rights Reserved */
/* */
/* */
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
/* */
/* */
/* Filename : PB_DPS.H */
/* Filename : PB_DPS.H */
/* Version : 5.22.0.00.release */
/* Version : 1.30.0.00.release SPC3 based */
/* Date : 26-February-1999 */
/* : 2.06.0.00.release ASPC2 based */
/* Author : SOFTING AG */
/* Date : July-2009 */
/* Author : SOFTING */
/* */
/* */
/* Description : This file contains the global defines and types of DPS */
/* Description : This file contains the global defines and types of DPS */
/* */
/* */
...
@@ -111,6 +77,9 @@
...
@@ -111,6 +77,9 @@
#define DPS_MAX_CFG_DATA_LEN DP_MAX_CFG_DATA_LEN
#define DPS_MAX_CFG_DATA_LEN DP_MAX_CFG_DATA_LEN
#define DPS_MIN_SSA_DATA_LEN 4
#define DPS_MIN_SSA_DATA_LEN 4
#define DPS_MAX_OUTPUT_DATA_LEN 244
#define DPS_MAX_INPUT_DATA_LEN 244
/****************************************************************************/
/****************************************************************************/
/*** DPS SERVICE CODES ******************************************************/
/*** DPS SERVICE CODES ******************************************************/
/****************************************************************************/
/****************************************************************************/
...
@@ -179,12 +148,12 @@
...
@@ -179,12 +148,12 @@
#define DPS_DIAG_BIT_WAIT_UNTIL_FETCHED 0x80
#define DPS_DIAG_BIT_WAIT_UNTIL_FETCHED 0x80
#define DPS_DIAG_BIT_STATUS_MASK \
#define DPS_DIAG_BIT_STATUS_MASK \
(DPS_DIAG_BIT_EXT_DIAG | DPS_DIAG_BIT_STAT_DIAG
\
(DPS_DIAG_BIT_EXT_DIAG | DPS_DIAG_BIT_STAT_DIAG
|
\
|
DPS_DIAG_BIT_EXT_DIAG_OVERFLOW)
DPS_DIAG_BIT_EXT_DIAG_OVERFLOW)
#define DPS_DIAG_BIT_MASK \
#define DPS_DIAG_BIT_MASK \
(DPS_DIAG_BIT_EXT_DIAG | DPS_DIAG_BIT_STAT_DIAG
\
(DPS_DIAG_BIT_EXT_DIAG | DPS_DIAG_BIT_STAT_DIAG
|
\
|
DPS_DIAG_BIT_EXT_DIAG_OVERFLOW | DPS_DIAG_BIT_WAIT_UNTIL_FETCHED)
DPS_DIAG_BIT_EXT_DIAG_OVERFLOW | DPS_DIAG_BIT_WAIT_UNTIL_FETCHED)
/*--- DPS SPC3 SPECIAL USR_PRM_BYTE ----------------------------------------*/
/*--- DPS SPC3 SPECIAL USR_PRM_BYTE ----------------------------------------*/
...
@@ -193,8 +162,8 @@
...
@@ -193,8 +162,8 @@
#define DPS_SPC3_USR_PRM_WD_BASE_1MS 0x04
#define DPS_SPC3_USR_PRM_WD_BASE_1MS 0x04
#define DPS_SPC3_USR_PRM_MASK \
#define DPS_SPC3_USR_PRM_MASK \
(DPS_SPC3_USR_PRM_DISABLE_STARTBIT | DPS_SPC3_USR_PRM_DISABLE_STOPBIT
\
(DPS_SPC3_USR_PRM_DISABLE_STARTBIT | DPS_SPC3_USR_PRM_DISABLE_STOPBIT
|
\
|
DPS_SPC3_USR_PRM_WD_BASE_1MS)
DPS_SPC3_USR_PRM_WD_BASE_1MS)
/*--- DPS INPUT / OUTPUT STATUS --------------------------------------------*/
/*--- DPS INPUT / OUTPUT STATUS --------------------------------------------*/
...
@@ -216,9 +185,10 @@
...
@@ -216,9 +185,10 @@
/*--- DPS USER INTERFACE STRUCTURES ----------------------------------------*/
/*--- DPS USER INTERFACE STRUCTURES ----------------------------------------*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DPS_INPUT_DATA_HEADER
{
typedef
struct
_T_DPS_INPUT_DATA_HEADER
{
USIGN8
input_data_len
;
/* length of DPS_USR input data, 0..244 */
USIGN8
input_data_len
;
/* length of DPS_USR input data, 0..244 */
USIGN8
input_state
;
/* status of input image: DPS_INPUT_STATE_xxx */
USIGN8
input_state
;
/* status of input image: DPS_INPUT_STATE_xxx */
USIGN8
input_data
[
DP_MAX_INPUT_DATA_LEN
];
USIGN8
input_data
[
DP_MAX_INPUT_DATA_LEN
];
...
@@ -226,9 +196,10 @@ typedef struct _T_DPS_INPUT_DATA_HEADER {
...
@@ -226,9 +196,10 @@ typedef struct _T_DPS_INPUT_DATA_HEADER {
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DPS_OUTPUT_DATA_HEADER
{
typedef
struct
_T_DPS_OUTPUT_DATA_HEADER
{
USIGN8
output_data_len
;
/* length of DP master output data, 0..244 */
USIGN8
output_data_len
;
/* length of DP master output data, 0..244 */
USIGN8
output_state
;
/* status of output image: DPS_OUTPUT_STATE_xxx */
USIGN8
output_state
;
/* status of output image: DPS_OUTPUT_STATE_xxx */
USIGN8
output_data
[
DP_MAX_OUTPUT_DATA_LEN
];
USIGN8
output_data
[
DP_MAX_OUTPUT_DATA_LEN
];
...
@@ -236,7 +207,8 @@ typedef struct _T_DPS_OUTPUT_DATA_HEADER {
...
@@ -236,7 +207,8 @@ typedef struct _T_DPS_OUTPUT_DATA_HEADER {
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DPS_CON_IND
{
typedef
struct
_T_DPS_CON_IND
{
USIGN16
status
;
USIGN16
status
;
}
T_DPS_CON_IND
;
}
T_DPS_CON_IND
;
...
@@ -245,25 +217,26 @@ typedef struct _T_DPS_CON_IND {
...
@@ -245,25 +217,26 @@ typedef struct _T_DPS_CON_IND {
/*--- DPS USIF SERVICE STRUCTURES ------------------------------------------*/
/*--- DPS USIF SERVICE STRUCTURES ------------------------------------------*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DPS_INIT_SLAVE_REQ
{
typedef
struct
_T_DPS_INIT_SLAVE_REQ
{
USIGN8
USIGN8
slave_add
;
/* 0..125, DPS_DEFAULT_SLAVE_ADD, DPS_NON_VOLATILE_SLAVE_ADD */
slave_add
;
/* 0..125, DPS_DEFAULT_SLAVE_ADD, DPS_NON_VOLATILE_SLAVE_ADD */
USIGN8
min_tsdr
;
/* min. station delay responder, default 0, 11..255 */
USIGN8
min_tsdr
;
/* min. station delay responder, default 0, 11..255 */
PB_BOOL
auto_cfg_response
;
/* CFG check by DPS_USR ? PB_FALSE : PB_TRUE */
PB_BOOL
auto_cfg_response
;
/* CFG check by DPS_USR ? PB_FALSE : PB_TRUE */
PB_BOOL
auto_prm_response
;
/* PRM check by DPS_USR ? PB_FALSE : PB_TRUE */
PB_BOOL
auto_prm_response
;
/* PRM check by DPS_USR ? PB_FALSE : PB_TRUE */
PB_BOOL
auto_startup_inputs
;
/* first input values by DPS at startup ? */
PB_BOOL
auto_startup_inputs
;
/* first input values by DPS at startup ? */
PB_BOOL
sync_mode_supported
;
/* activation of DPS operation modes ? */
PB_BOOL
sync_mode_supported
;
/* activation of DPS operation modes ? */
PB_BOOL
freeze_mode_supported
;
PB_BOOL
freeze_mode_supported
;
PB_BOOL
set_slave_add_supported
;
/* activation of DPS service ? */
PB_BOOL
set_slave_add_supported
;
/* activation of DPS service ? */
USIGN8
max_input_data_len
;
/* 0..DP_MAX_INPUT_DATA_LEN */
USIGN8
max_input_data_len
;
/* 0..DP_MAX_INPUT_DATA_LEN */
USIGN8
max_output_data_len
;
/* 0..DP_MAX_OUTPUT_DATA_LEN */
USIGN8
max_output_data_len
;
/* 0..DP_MAX_OUTPUT_DATA_LEN */
USIGN8
max_cfg_data_len
;
/* 1..DP_MAX_CFG_DATA_LEN */
USIGN8
max_cfg_data_len
;
/* 1..DP_MAX_CFG_DATA_LEN */
USIGN8
max_usr_prm_data_len
;
/* 0..DP_MAX_USER_PRM_DATA_LEN */
USIGN8
max_usr_prm_data_len
;
/* 0..DP_MAX_USER_PRM_DATA_LEN */
USIGN8
max_ext_diag_data_len
;
/* 0..DP_MAX_EXT_DIAG_DATA_LEN */
USIGN8
max_ext_diag_data_len
;
/* 0..DP_MAX_EXT_DIAG_DATA_LEN */
USIGN8
max_address_data_len
;
/* 0..DP_MAX_TELEGRAM_LEN */
USIGN8
max_address_data_len
;
/* 0..DP_MAX_TELEGRAM_LEN */
USIGN16
ident_number
;
/* 0 == Softing IdentNumber (Default) */
USIGN16
ident_number
;
/* 0 == Softing IdentNumber (Default) */
...
@@ -281,7 +254,8 @@ typedef struct _T_DPS_INIT_SLAVE_REQ {
...
@@ -281,7 +254,8 @@ typedef struct _T_DPS_INIT_SLAVE_REQ {
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DPS_INIT_SLAVE_CON
{
typedef
struct
_T_DPS_INIT_SLAVE_CON
{
USIGN16
status
;
/* OK, IV, NO */
USIGN16
status
;
/* OK, IV, NO */
INT16
remaining_frame_memory
;
/* left memory for telegram buffers */
INT16
remaining_frame_memory
;
/* left memory for telegram buffers */
...
@@ -294,7 +268,8 @@ typedef VOID T_DPS_EXIT_SLAVE_REQ; /* no request parameters */
...
@@ -294,7 +268,8 @@ typedef VOID T_DPS_EXIT_SLAVE_REQ; /* no request parameters */
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DPS_EXIT_SLAVE_CON
{
typedef
struct
_T_DPS_EXIT_SLAVE_CON
{
USIGN16
status
;
/* OK */
USIGN16
status
;
/* OK */
}
T_DPS_EXIT_SLAVE_CON
;
}
T_DPS_EXIT_SLAVE_CON
;
...
@@ -305,29 +280,30 @@ typedef VOID T_DPS_GET_STATUS_REQ; /* no request parameters */
...
@@ -305,29 +280,30 @@ typedef VOID T_DPS_GET_STATUS_REQ; /* no request parameters */
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DPS_GET_STATUS_CON_IND
{
typedef
struct
_T_DPS_GET_STATUS_CON_IND
{
USIGN16
status
;
/* OK, TO */
USIGN16
status
;
/* OK, TO */
USIGN8
slave_state
;
/* operation state of DP slave, DPS_STATE_xxx */
USIGN8
slave_state
;
/* operation state of DP slave, DPS_STATE_xxx */
USIGN8
diag_state
;
/* diagnostic state of DP slave, DPS_DIAG_BIT_xxx */
USIGN8
diag_state
;
/* diagnostic state of DP slave, DPS_DIAG_BIT_xxx */
USIGN16
ident_number
;
/* PNO ident number of this station */
USIGN16
ident_number
;
/* PNO ident number of this station */
USIGN8
number_inputs
;
/* I/O configuration in bytes */
USIGN8
number_inputs
;
/* I/O configuration in bytes */
USIGN8
number_outputs
;
USIGN8
number_outputs
;
USIGN8
slave_add
;
/* current station address, 0..125, 126 */
USIGN8
slave_add
;
/* current station address, 0..125, 126 */
USIGN8
non_volatile_slave_add
;
/* via Set_Slave_Add set address */
USIGN8
non_volatile_slave_add
;
/* via Set_Slave_Add set address */
USIGN8
master_add
;
/* 0..125 or DP_NO_MASTER_ADDRESS */
USIGN8
master_add
;
/* 0..125 or DP_NO_MASTER_ADDRESS */
USIGN8
baud_rate
;
/* DPS_KBAUD_xxx, DPS_MBAUD_xxx, DPS_NO_BUS_TRAFFIC */
USIGN8
baud_rate
;
/* DPS_KBAUD_xxx, DPS_MBAUD_xxx, DPS_NO_BUS_TRAFFIC */
PB_BOOL
sync_enabled
;
/* sync mode enabled by DP master ? */
PB_BOOL
sync_enabled
;
/* sync mode enabled by DP master ? */
PB_BOOL
freeze_enabled
;
/* freeze mode enabled by DP master ? */
PB_BOOL
freeze_enabled
;
/* freeze mode enabled by DP master ? */
PB_BOOL
clear_data
;
/* DP master in CLEAR operation mode ? */
PB_BOOL
clear_data
;
/* DP master in CLEAR operation mode ? */
PB_BOOL
prm_await_response
;
/* waits for DPS_Set_Prm.res from DPS_USR */
PB_BOOL
prm_await_response
;
/* waits for DPS_Set_Prm.res from DPS_USR */
PB_BOOL
cfg_await_response
;
/* waits for DPS_Chk_Cfg.res from DPS_USR */
PB_BOOL
cfg_await_response
;
/* waits for DPS_Chk_Cfg.res from DPS_USR */
PB_BOOL
await_startup_inputs
;
/* waits for first inputs from DPS_USR */
PB_BOOL
await_startup_inputs
;
/* waits for first inputs from DPS_USR */
USIGN8
reserved
[
16
];
/* reserved for extensions, ignore 0 value */
USIGN8
reserved
[
16
];
/* reserved for extensions, ignore 0 value */
...
@@ -336,7 +312,8 @@ typedef struct _T_DPS_GET_STATUS_CON_IND {
...
@@ -336,7 +312,8 @@ typedef struct _T_DPS_GET_STATUS_CON_IND {
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DPS_SLAVE_DIAG_REQ
{
typedef
struct
_T_DPS_SLAVE_DIAG_REQ
{
USIGN8
diag_state
;
/* diagnostic state of DP slave, DPS_DIAG_BIT_xxx */
USIGN8
diag_state
;
/* diagnostic state of DP slave, DPS_DIAG_BIT_xxx */
USIGN8
ext_diag_data_len
;
/* 0..DP_MAX_EXT_DIAG_DATA_LEN */
USIGN8
ext_diag_data_len
;
/* 0..DP_MAX_EXT_DIAG_DATA_LEN */
...
@@ -346,17 +323,19 @@ typedef struct _T_DPS_SLAVE_DIAG_REQ {
...
@@ -346,17 +323,19 @@ typedef struct _T_DPS_SLAVE_DIAG_REQ {
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DPS_SLAVE_DIAG_CON
{
typedef
struct
_T_DPS_SLAVE_DIAG_CON
{
USIGN16
status
;
/* OK, IV, NO */
USIGN16
status
;
/* OK, IV, NO */
}
T_DPS_SLAVE_DIAG_CON
;
}
T_DPS_SLAVE_DIAG_CON
;
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DPS_CHK_CFG_IND
{
typedef
struct
_T_DPS_CHK_CFG_IND
{
USIGN16
status
;
/* OK */
USIGN16
status
;
/* OK */
USIGN8
cfg_data_len
;
/* CFG from DP master, see EN 50170 */
USIGN8
cfg_data_len
;
/* CFG from DP master, see EN 50170 */
PB_BOOL
cfg_await_response
;
/* the indication has to be acknowledged */
PB_BOOL
cfg_await_response
;
/* the indication has to be acknowledged */
USIGN8
cfg_data
[
DP_MAX_CFG_DATA_LEN
];
/* cfg_data_len */
USIGN8
cfg_data
[
DP_MAX_CFG_DATA_LEN
];
/* cfg_data_len */
...
@@ -365,17 +344,19 @@ typedef struct _T_DPS_CHK_CFG_IND {
...
@@ -365,17 +344,19 @@ typedef struct _T_DPS_CHK_CFG_IND {
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DPS_CHK_CFG_RES
{
typedef
struct
_T_DPS_CHK_CFG_RES
{
USIGN16
status
;
/* OK, NO */
USIGN16
status
;
/* OK, NO */
}
T_DPS_CHK_CFG_RES
;
}
T_DPS_CHK_CFG_RES
;
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DPS_SET_PRM_IND
{
typedef
struct
_T_DPS_SET_PRM_IND
{
USIGN16
status
;
/* OK */
USIGN16
status
;
/* OK */
USIGN8
user_prm_data_len
;
/* 0..DP_MAX_USER_PRM_DATA_LEN */
USIGN8
user_prm_data_len
;
/* 0..DP_MAX_USER_PRM_DATA_LEN */
PB_BOOL
prm_await_response
;
/* the indication has to be acknowledged */
PB_BOOL
prm_await_response
;
/* the indication has to be acknowledged */
USIGN8
station_status
;
/* DP_PRM_xxx */
USIGN8
station_status
;
/* DP_PRM_xxx */
...
@@ -386,7 +367,7 @@ typedef struct _T_DPS_SET_PRM_IND {
...
@@ -386,7 +367,7 @@ typedef struct _T_DPS_SET_PRM_IND {
USIGN8
min_tsdr
;
/* minimum station delay responder */
USIGN8
min_tsdr
;
/* minimum station delay responder */
USIGN16
ident_number
;
/* PNO ident number */
USIGN16
ident_number
;
/* PNO ident number */
USIGN8
group_ident
;
/* groups for GLOBAL_CONTROL */
USIGN8
group_ident
;
/* groups for GLOBAL_CONTROL */
USIGN8
user_prm_data
[
DP_MAX_USER_PRM_DATA_LEN
];
/* user_prm_data_len */
USIGN8
user_prm_data
[
DP_MAX_USER_PRM_DATA_LEN
];
/* user_prm_data_len */
...
@@ -396,23 +377,25 @@ typedef struct _T_DPS_SET_PRM_IND {
...
@@ -396,23 +377,25 @@ typedef struct _T_DPS_SET_PRM_IND {
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
typedef
struct
_T_DPS_SET_PRM_RES
{
typedef
struct
_T_DPS_SET_PRM_RES
{
USIGN16
status
;
/* OK, NO */
USIGN16
status
;
/* OK, NO */
}
T_DPS_SET_PRM_RES
;
}
T_DPS_SET_PRM_RES
;
/*==========================================================================*/
/*==========================================================================*/
typedef
struct
_T_DPS_SET_SLAVE_ADD_IND
{
typedef
struct
_T_DPS_SET_SLAVE_ADD_IND
{
USIGN16
status
;
/* OK */
USIGN16
status
;
/* OK */
USIGN8
rem_slave_data_len
;
/* 0..DP_MAX_REM_SLAVE_DATA_LEN */
USIGN8
rem_slave_data_len
;
/* 0..DP_MAX_REM_SLAVE_DATA_LEN */
USIGN8
new_slave_add
;
/* new slave address set by DP master, 0..125 */
USIGN8
new_slave_add
;
/* new slave address set by DP master, 0..125 */
USIGN16
ident_number
;
/* PNO ident_number */
USIGN16
ident_number
;
/* PNO ident_number */
PB_BOOL
no_add_chg
;
/* PB_TRUE: address change after reset only */
PB_BOOL
no_add_chg
;
/* PB_TRUE: address change after reset only */
/* rem_slave_data_len */
/* rem_slave_data_len */
USIGN8
rem_slave_data
[
DP_MAX_REM_SLAVE_DATA_LEN
];
USIGN8
rem_slave_data
[
DP_MAX_REM_SLAVE_DATA_LEN
];
}
T_DPS_SET_SLAVE_ADD_IND
;
}
T_DPS_SET_SLAVE_ADD_IND
;
...
...
profibus/lib/rt/src/pb_err.h
View file @
ce758cd3
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************/
/*****************************************************************************/
/* */
/* */
/*
SOFTING AG
*/
/*
SOFTING Industrial Automation GmbH
*/
/* Richard-Reitzner-Allee 6 */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* */
/*
Copyright (C) SOFTING AG 1995-2003
*/
/*
Copyright (C) SOFTING Industrial Automation GmbH 1995-2012
*/
/* All Rights Reserved */
/* All Rights Reserved */
/* */
/* */
/*****************************************************************************/
/*****************************************************************************/
...
@@ -49,9 +14,9 @@
...
@@ -49,9 +14,9 @@
/* PROFIBUS ABORT-, REJECT-, EVENT- and ERROR DEFINES and -TYPES */
/* PROFIBUS ABORT-, REJECT-, EVENT- and ERROR DEFINES and -TYPES */
/* */
/* */
/* Filename : PB_ERR.H */
/* Filename : PB_ERR.H */
/* Version : 5.
26.1
.00.release */
/* Version : 5.
46.0
.00.release */
/* Date :
27-June-2003
*/
/* Date :
October-2011
*/
/* Author : SOFTING
AG
*/
/* Author : SOFTING
*/
/* */
/* */
/* Description : This file contains the ABORT, REJECT, EVENT and ERROR */
/* Description : This file contains the ABORT, REJECT, EVENT and ERROR */
/* types and defines and the according reason codes. */
/* types and defines and the according reason codes. */
...
@@ -84,31 +49,31 @@
...
@@ -84,31 +49,31 @@
#define USR_ABT_RC6 5
/* OD loading interacting (OD is beeing loaded)*/
#define USR_ABT_RC6 5
/* OD loading interacting (OD is beeing loaded)*/
/* --- FMS abort reasons --------------------------------------------------- */
/* --- FMS abort reasons --------------------------------------------------- */
#define FMS_ABT_RC1 0
/* FMS-CRL error (CRL entry invalid) */
#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_RC2 1
/* user error (protocol violation by user) */
#define FMS_ABT_RC3 2
/* FMS-PDU error (invalid FMS PDU received) */
#define FMS_ABT_RC3 2
/* FMS-PDU error (invalid FMS PDU received) */
#define FMS_ABT_RC4 3
/* connection state conflict LLI */
#define FMS_ABT_RC4 3
/* connection state conflict LLI */
#define FMS_ABT_RC5 4
/* LLI error */
#define FMS_ABT_RC5 4
/* LLI error */
#define FMS_ABT_RC6 5
/* PDU size exceeds maximum PDU size */
#define FMS_ABT_RC6 5
/* PDU size exceeds maximum PDU size */
#define FMS_ABT_RC7 6
/* feature not supported */
#define FMS_ABT_RC7 6
/* feature not supported */
#define FMS_ABT_RC8 7
/* invoke id error in service response */
#define FMS_ABT_RC8 7
/* invoke id error in service response */
#define FMS_ABT_RC9 8
/* max services overflow */
#define FMS_ABT_RC9 8
/* max services overflow */
#define FMS_ABT_RC10 9
/* connection state conflict FMS (Initiate.req) */
#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_RC11 10
/* service error (res != ind or con != req) */
#define FMS_ABT_RC12 11
/* invoke id error in service request */
#define FMS_ABT_RC12 11
/* invoke id error in service request */
#define FMS_ABT_RC13 12
/* FMS is disabled */
#define FMS_ABT_RC13 12
/* FMS is disabled */
/* --- FM7 abort reasons -------------------------------------------------- */
/* --- FM7 abort reasons -------------------------------------------------- */
#define FM7_ABT_RC1 0
/* FM7-CRL error */
#define FM7_ABT_RC1 0
/* FM7-CRL error */
#define FM7_ABT_RC2 1
/* user error */
#define FM7_ABT_RC2 1
/* user error */
#define FM7_ABT_RC3 2
/* FM7-PDU error */
#define FM7_ABT_RC3 2
/* FM7-PDU error */
#define FM7_ABT_RC4 3
/* connection state conflict LLI */
#define FM7_ABT_RC4 3
/* connection state conflict LLI */
#define FM7_ABT_RC5 4
/* LLI error */
#define FM7_ABT_RC5 4
/* LLI error */
#define FM7_ABT_RC6 5
/* PDU size */
#define FM7_ABT_RC6 5
/* PDU size */
#define FM7_ABT_RC7 6
/* feature not supported */
#define FM7_ABT_RC7 6
/* feature not supported */
#define FM7_ABT_RC8 7
/* response error */
#define FM7_ABT_RC8 7
/* response error */
#define FM7_ABT_RC9 8
/* max services overflow */
#define FM7_ABT_RC9 8
/* max services overflow */
#define FM7_ABT_RC10 9
/* connection state conflict FM7 */
#define FM7_ABT_RC10 9
/* connection state conflict FM7 */
#define FM7_ABT_RC11 10
/* service error */
#define FM7_ABT_RC11 10
/* service error */
#if (PB_VER < 500)
#if (PB_VER < 500)
...
@@ -126,16 +91,16 @@
...
@@ -126,16 +91,16 @@
#endif
#endif
/* --- LLI abort reasons --------------------------------------------------- */
/* --- LLI abort reasons --------------------------------------------------- */
#define LLI_ABT_RC1 0
/* LLI context check neg., remote context in AD */
#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_RC2 1
/* invalid LLI PDU during associate or abort */
#define LLI_ABT_RC3 2
/* invalid LLI PDU during data transfer phase */
#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_RC4 3
/* unknown or invalid LLI PDU received */
#define LLI_ABT_RC5 4
/* DTA_ACK_PDU received and SAC = 0 */
#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_RC6 5
/* max no of parallel services exceeded (by PDU)*/
#define LLI_ABT_RC7 6
/* unkown invoke id */
#define LLI_ABT_RC7 6
/* unkown invoke id */
#define LLI_ABT_RC8 7
/* priority error */
#define LLI_ABT_RC8 7
/* priority error */
#define LLI_ABT_RC9 8
/* local error at remote station */
#define LLI_ABT_RC9 8
/* local error at remote station */
#define LLI_ABT_RC10 9
/* timer 1 expired (associate) */
#define LLI_ABT_RC10 9
/* timer 1 expired (associate) */
#define LLI_ABT_RC11 10
/* timer 3 expired (supervision of connection) */
#define LLI_ABT_RC11 10
/* timer 3 expired (supervision of connection) */
#define LLI_ABT_RC12 11
/* receive timer expired */
#define LLI_ABT_RC12 11
/* receive timer expired */
#define LLI_ABT_RC13 12
/* error while activating LSAP (state in AD) */
#define LLI_ABT_RC13 12
/* error while activating LSAP (state in AD) */
...
@@ -171,18 +136,18 @@
...
@@ -171,18 +136,18 @@
#define LLI_ABT_AD7 6
/* receive error (CSRD.con) */
#define LLI_ABT_AD7 6
/* receive error (CSRD.con) */
/* --- FDL abort reasons --------------------------------------------------- */
/* --- FDL abort reasons --------------------------------------------------- */
#define FDL_ABT_UE 1
/* remote user interface error */
#define FDL_ABT_UE 1
/* remote user interface error */
#define FDL_ABT_RR 2
/* no remote resources available */
#define FDL_ABT_RR 2
/* no remote resources available */
#define FDL_ABT_RS 3
/* service not activated at remote sap */
#define FDL_ABT_RS 3
/* service not activated at remote sap */
#define FDL_ABT_RA 4
/* no access to 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_RDL 12
/* no resource for send response data low */
#define FDL_ABT_RDH 13
/* no resource for send response data high */
#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_LS 16
/* service not activated at local sap */
#define FDL_ABT_NA 17
/* no reaction from remote station */
#define FDL_ABT_NA 17
/* no reaction from remote station */
#define FDL_ABT_DS 18
/* disconnected station (NLT) */
#define FDL_ABT_DS 18
/* disconnected station (NLT) */
#define FDL_ABT_NO 19
/* FDL servcice not OK */
#define FDL_ABT_NO 19
/* FDL servcice not OK */
#define FDL_ABT_LR 20
/* no local resources available */
#define FDL_ABT_LR 20
/* no local resources available */
#define FDL_ABT_IV 21
/* invalid request parameters */
#define FDL_ABT_IV 21
/* invalid request parameters */
/*****************************************************************************/
/*****************************************************************************/
/************* DP/V1 ABORT INSTANCES AND REASON CODES *********************/
/************* DP/V1 ABORT INSTANCES AND REASON CODES *********************/
...
@@ -473,15 +438,15 @@
...
@@ -473,15 +438,15 @@
/*****************************************************************************/
/*****************************************************************************/
/* --- LLI-Fault-Indications ---------------------------------------------- */
/* --- LLI-Fault-Indications ---------------------------------------------- */
#define LLI_FM7_RC1 1
/* error while activating SAP (result in AD) */
#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_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_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_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_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_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_RC7 7
/* illegal FDL prim. in data transfer (see AD) */
#define LLI_FM7_RC8 8
/* unknown FDL primitive */
#define LLI_FM7_RC8 8
/* unknown FDL primitive */
#define LLI_FM7_RC9 9
/* unknown LLI 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_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_RC11 11
/* illegal LLI prim. in data transfer (see AD) */
#define LLI_FM7_RC12 12
/* SDA failed (result in AD) */
#define LLI_FM7_RC12 12
/* SDA failed (result in AD) */
...
@@ -505,15 +470,15 @@
...
@@ -505,15 +470,15 @@
#define LLI_FM7_RC30 30
/* LLI state error */
#define LLI_FM7_RC30 30
/* LLI state error */
#if (PB_VER < 500)
#if (PB_VER < 500)
#define LLI_FMA7_RC1 1
/* error while activating SAP (result in AD) */
#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_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_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_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_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_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_RC7 7
/* illegal FDL prim. in data transfer (see AD) */
#define LLI_FMA7_RC8 8
/* unknown FDL primitive */
#define LLI_FMA7_RC8 8
/* unknown FDL primitive */
#define LLI_FMA7_RC9 9
/* unknown LLI 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_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_RC11 11
/* illegal LLI prim. in data transfer (see AD) */
#define LLI_FMA7_RC12 12
/* SDA failed (result in AD) */
#define LLI_FMA7_RC12 12
/* SDA failed (result in AD) */
...
@@ -541,25 +506,25 @@
...
@@ -541,25 +506,25 @@
/*********************** FM2 EVENT CODES *****************************/
/*********************** FM2 EVENT CODES *****************************/
/****************************************************************************/
/****************************************************************************/
#define FM2_FAULT_ADDRESS 0x01
/* duplicate address recognized */
#define FM2_FAULT_ADDRESS 0x01
/* duplicate address recognized */
#define FM2_FAULT_PHY 0x02
/* phys.layer is malfunctioning */
#define FM2_FAULT_PHY 0x02
/* phys.layer is malfunctioning */
#define FM2_FAULT_TTO 0x03
/* time out on bus detected */
#define FM2_FAULT_TTO 0x03
/* time out on bus detected */
#define FM2_FAULT_SYN 0x04
/* no receiver synchronization */
#define FM2_FAULT_SYN 0x04
/* no receiver synchronization */
#define FM2_FAULT_OUT_OF_RING 0x05
/* station out of ring */
#define FM2_FAULT_OUT_OF_RING 0x05
/* station out of ring */
#define FM2_GAP_EVENT 0x06
/* new station in ring */
#define FM2_GAP_EVENT 0x06
/* new station in ring */
#if (PB_VER < 500)
#if (PB_VER < 500)
#define FMA2_FAULT_ADDRESS 0x01
/* duplicate address recognized */
#define FMA2_FAULT_ADDRESS 0x01
/* duplicate address recognized */
#define FMA2_FAULT_TRANSCEIVER 0x02
/* transceiver error occured */
#define FMA2_FAULT_TRANSCEIVER 0x02
/* transceiver error occured */
#define FMA2_FAULT_TTO 0x03
/* time out on bus detected */
#define FMA2_FAULT_TTO 0x03
/* time out on bus detected */
#define FMA2_FAULT_SYN 0x04
/* no receiver synchronization */
#define FMA2_FAULT_SYN 0x04
/* no receiver synchronization */
#define FMA2_FAULT_OUT_OF_RING 0x05
/* station out of ring */
#define FMA2_FAULT_OUT_OF_RING 0x05
/* station out of ring */
#define FMA2_GAP_EVENT 0x06
/* new station in ring */
#define FMA2_GAP_EVENT 0x06
/* new station in ring */
#endif
#endif
/* --- Additional FM2-Events ---------------------------------------------- */
/* --- Additional FM2-Events ---------------------------------------------- */
#define FM2_MAC_ERROR 0x13
/* fatal MAC error */
#define FM2_MAC_ERROR 0x13
/* fatal MAC error */
#define FM2_HW_ERROR 0x14
/* fatal HW error */
#define FM2_HW_ERROR 0x14
/* fatal HW error */
/****************************************************************************/
/****************************************************************************/
/************* FMB ERROR CLASSES and ERROR CODES *********************/
/************* FMB ERROR CLASSES and ERROR CODES *********************/
...
@@ -764,67 +729,68 @@
...
@@ -764,67 +729,68 @@
/*****************************************************************************/
/*****************************************************************************/
#if (PB_VER < 500)
#if (PB_VER < 500)
#define E_FATAL_ERROR 7
/* unrecoverable error on board */
#define E_FATAL_ERROR 7
/* unrecoverable error on board */
#define E_INIT_INVALID_PARAMETER 8
/* invalid initialize parameter*/
#define E_INIT_INVALID_PARAMETER 8
/* invalid initialize parameter*/
#define E_LOADER_ERROR 9
/* download error */
#define E_LOADER_ERROR 9
/* download error */
#define E_NO_CNTRL_RES 10
/* controller does not respond */
#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_CNTRL_TYPE_VERSION 11
/* inv. controller type or SW vers.*/
#define E_INVALID_LAYER 12
/* invalid layer */
#define E_INVALID_LAYER 12
/* invalid layer */
#define E_INVALID_SERVICE 13
/* invalid service identifier */
#define E_INVALID_SERVICE 13
/* invalid service identifier */
#define E_INVALID_PRIMITIVE 14
/* invalid service primitive */
#define E_INVALID_PRIMITIVE 14
/* invalid service primitive */
#define E_INVALID_DATA_SIZE 15
/* not enough cmi data block memory*/
#define E_INVALID_DATA_SIZE 15
/* not enough cmi data block memory*/
#define E_INVALID_COMM_REF 16
/* invalid communication reference */
#define E_INVALID_COMM_REF 16
/* invalid communication reference */
#define E_INVALID_FMS_COMM_REF 17
/* invalid FMS comm. 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_FMA_COMM_REF 18
/* invalid FMA7 comm. reference */
#define E_INVALID_CMI_CALL 19
/* invalid CMI call */
#define E_INVALID_CMI_CALL 19
/* invalid CMI call */
#define E_CMI_ERROR 20
/* error occured in CMI */
#define E_CMI_ERROR 20
/* error occured in CMI */
#define E_RESOURCE_UNAVAILABLE 21
/* no resource available */
#define E_RESOURCE_UNAVAILABLE 21
/* no resource available */
#define E_NO_PARALLEL_SERVICES 22
/* no parallel services allowed */
#define E_NO_PARALLEL_SERVICES 22
/* no parallel services allowed */
#define E_SERVICE_CONSTR_CONFLICT 23
/* serv. tempor. not executable */
#define E_SERVICE_CONSTR_CONFLICT 23
/* serv. tempor. not executable */
#define E_SERVICE_NOT_SUPPORTED 24
/* service not supported */
#define E_SERVICE_NOT_SUPPORTED 24
/* service not supported */
#define E_SERVICE_NOT_EXECUTABLE 25
/* service not executable */
#define E_SERVICE_NOT_EXECUTABLE 25
/* service not executable */
#endif
#endif
#define E_IF_FATAL_ERROR 7
/* unrecoverable error on board */
#define E_IF_FATAL_ERROR 7
/* unrecoverable error on board */
#define E_IF_INIT_INVALID_PARAMETER 8
/* invalid initialize parameter */
#define E_IF_INIT_INVALID_PARAMETER 8
/* invalid initialize parameter */
#define E_IF_LOADER_ERROR 9
/* download firmware error */
#define E_IF_LOADER_ERROR 9
/* download firmware error */
#define E_IF_NO_CNTRL_RES 10
/* controller does not respond */
#define E_IF_NO_CNTRL_RES 10
/* controller does not respond */
#define E_IF_INVALID_CNTRL_TYPE_VERSION \
#define E_IF_INVALID_CNTRL_TYPE_VERSION 11
/* inv. controller type or SW \
11
/* inv. controller type or SW \
vers.*/
vers.*/
#define E_IF_INVALID_LAYER 12
/* invalid layer */
#define E_IF_INVALID_LAYER 12
/* invalid layer */
#define E_IF_INVALID_SERVICE 13
/* invalid service identifier */
#define E_IF_INVALID_SERVICE 13
/* invalid service identifier */
#define E_IF_INVALID_PRIMITIVE 14
/* invalid service primitive */
#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_DATA_SIZE 15
/* not enough cmi data block memory*/
#define E_IF_INVALID_COMM_REF 16
/* invalid communication reference */
#define E_IF_INVALID_COMM_REF 16
/* invalid communication reference */
#define E_IF_INVALID_CMI_CALL 19
/* invalid CMI call */
#define E_IF_INVALID_CMI_CALL 19
/* invalid CMI call */
#define E_IF_CMI_ERROR 20
/* error occured in CMI */
#define E_IF_CMI_ERROR 20
/* error occured in CMI */
#define E_IF_RESOURCE_UNAVAILABLE 21
/* no resource available */
#define E_IF_RESOURCE_UNAVAILABLE 21
/* no resource available */
#define E_IF_NO_PARALLEL_SERVICES 22
/* no parallel services allowed */
#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_CONSTR_CONFLICT 23
/* serv. tempor. not executable */
#define E_IF_SERVICE_NOT_SUPPORTED 24
/* service not supported */
#define E_IF_SERVICE_NOT_SUPPORTED 24
/* service not supported */
#define E_IF_SERVICE_NOT_EXECUTABLE 25
/* service not executable */
#define E_IF_SERVICE_NOT_EXECUTABLE 25
/* service not executable */
#define E_IF_INVALID_VERSION 26
/* invalid version */
#define E_IF_INVALID_VERSION 26
/* invalid version */
#define E_IF_STATE_CONFLICT 27
/* state conflict */
#define E_IF_NO_CNTRL_PRESENT 28
/* controller not available */
#define E_IF_NO_CNTRL_PRESENT 28
/* controller not available */
#define E_IF_INVALID_PARAMETER 30
/* wrong parameter in REQ or RES */
#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_INIT_FAILED 31
/* init. API or Controller failed */
#define E_IF_EXIT_FAILED 32
/* exit 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 */
#define E_IF_PAPI_NOT_INITIALIZED 33
/* API not initialized */
#define E_IF_NO_DEVICE_CONNECTION 34
/* no PROFIBUS device connection */
#define E_IF_NO_DEVICE_CONNECTION 34
/* no PROFIBUS device connection */
/* error codes available only in Win NT ---------------------------------------
/* error codes available only in Win NT ---------------------------------------
*/
*/
#define E_IF_SLAVE_DIAG_DATA 0xF0
/* no data available */
#define E_IF_SLAVE_DIAG_DATA 0xF0
/* no data available */
/* new diagnostics data available */
/* new diagnostics data available */
#define E_IF_SLAVE_ERROR 0xF1
/* no data exchange */
#define E_IF_SLAVE_ERROR 0xF1
/* no data exchange */
#define E_IF_INVALID_DP_STATE 0xF2
/* DP is not in state clear/operate*/
#define E_IF_INVALID_DP_STATE 0xF2
/* DP is not in state clear/operate*/
#define E_IF_READING_REGISTRY 0xF3
/* error reading registry */
#define E_IF_READING_REGISTRY 0xF3
/* error reading registry */
#define E_IF_OS_ERROR 0xFF
/* OS system (WIN,DOS) error */
#define E_IF_SOCKET_ERROR 0xFE
/* TCP socket error */
/* get detail with GetLastError */
/* get detail with WSAGetLastError */
#define E_IF_OS_ERROR 0xFF
/* OS system (WIN,DOS) error */
/* get detail with GetLastError */
/* INTERFACE ERROR DETAIL CODES (only Win95/98) -------------------------------
/* INTERFACE ERROR DETAIL CODES (only Win95/98) -------------------------------
*/
*/
...
@@ -834,26 +800,26 @@
...
@@ -834,26 +800,26 @@
/* - E_IF_EXIT_FAILED */
/* - E_IF_EXIT_FAILED */
#define PBDRV PROFIBRD
#define PBDRV PROFIBRD
#define PROFIBRD_INTERNAL_ERROR 0x0030
/* internal driver error */
#define PROFIBRD_INTERNAL_ERROR 0x0030
/* internal driver error */
#define PROFIBRD_GENERAL_ERROR 0x0031
/* general driver error */
#define PROFIBRD_GENERAL_ERROR 0x0031
/* general driver error */
#define PROFIBRD_IO_PENDING 0x0032
/* driver timeout */
#define PROFIBRD_IO_PENDING 0x0032
/* driver timeout */
#define PROFIBRD_IO_CANCELLED 0x0033
/* driver call not finished */
#define PROFIBRD_IO_CANCELLED 0x0033
/* driver call not finished */
#define PROFIBRD_ILLEGAL_CALL 0x0034
/* driver call cancelled */
#define PROFIBRD_ILLEGAL_CALL 0x0034
/* driver call cancelled */
#define PROFIBRD_NOT_SUPPORTED 0x0035
/* driver call not supported */
#define PROFIBRD_NOT_SUPPORTED 0x0035
/* driver call not supported */
#define PROFIBRD_VERSION_ERROR 0x0036
/* driver interface version */
#define PROFIBRD_VERSION_ERROR 0x0036
/* driver interface version */
#define PROFIBRD_DRIVER_VERSION_ERROR 0x0037
/* driver version */
#define PROFIBRD_DRIVER_VERSION_ERROR 0x0037
/* driver version */
#define PROFIBRD_DRIVER_NOT_FOUND 0x0038
/* driver not found */
#define PROFIBRD_DRIVER_NOT_FOUND 0x0038
/* driver not found */
#define PROFIBRD_NOT_ENOUGH_MEMORY 0x0039
/* not enough memory */
#define PROFIBRD_NOT_ENOUGH_MEMORY 0x0039
/* not enough memory */
#define PROFIBRD_TOO_MANY_DEVICES 0x003A
/* to many devices */
#define PROFIBRD_TOO_MANY_DEVICES 0x003A
/* to many devices */
#define PROFIBRD_UNKNOWN_DEVICE 0x003B
/* unknown device */
#define PROFIBRD_UNKNOWN_DEVICE 0x003B
/* unknown device */
#define PROFIBRD_DEVICE_ACCESS_ERROR 0x003C
/* device access error */
#define PROFIBRD_DEVICE_ACCESS_ERROR 0x003C
/* device access error */
#define PROFIBRD_DPRAM_ALREADY_USED 0x003D
/* device already exists */
#define PROFIBRD_DPRAM_ALREADY_USED 0x003D
/* device already exists */
#define PROFIBRD_MAP_MEMORY_ERROR 0x003E
/* memory mapping error */
#define PROFIBRD_MAP_MEMORY_ERROR 0x003E
/* memory mapping error */
#define PROFIBRD_MEMORY_UNKNOWN 0x003F
/* unknown phys. memory */
#define PROFIBRD_MEMORY_UNKNOWN 0x003F
/* unknown phys. memory */
#define PROFIBRD_READ_REGISTRY_ERROR 0x0040
/* read registry error */
#define PROFIBRD_READ_REGISTRY_ERROR 0x0040
/* read registry error */
#define PROFIBRD_DEVICE_NOT_FOUND 0x0041
/* device not found */
#define PROFIBRD_DEVICE_NOT_FOUND 0x0041
/* device not found */
#define PROFIBRD_DEVICE_ALREADY_OPEN 0x0042
/* device already opened */
#define PROFIBRD_DEVICE_ALREADY_OPEN 0x0042
/* device already opened */
#define PROFIBRD_PORT_ALREADY_USED 0x0043
/* IO port already in use */
#define PROFIBRD_PORT_ALREADY_USED 0x0043
/* IO port already in use */
/*****************************************************************************/
/*****************************************************************************/
/************* ERROR DATA STRUCTURES *****************************/
/************* ERROR DATA STRUCTURES *****************************/
...
@@ -862,29 +828,33 @@
...
@@ -862,29 +828,33 @@
#define MAX_ERROR_DESCR_LENGTH _NAME_LENGTH(ERROR_DESCR_LENGTH)
#define MAX_ERROR_DESCR_LENGTH _NAME_LENGTH(ERROR_DESCR_LENGTH)
/* --- standard error data structure --------------------------------------- */
/* --- standard error data structure --------------------------------------- */
typedef
struct
_T_ERROR
{
typedef
struct
_T_ERROR
USIGN16
class_code
;
/* class and code */
{
INT16
add_detail
;
/* additional detail */
USIGN16
class_code
;
/* class and code */
INT16
add_detail
;
/* additional detail */
STRINGV
add_description
[
MAX_ERROR_DESCR_LENGTH
];
/* additional description */
STRINGV
add_description
[
MAX_ERROR_DESCR_LENGTH
];
/* additional description */
}
T_ERROR
;
}
T_ERROR
;
/* --- PI error data structure --------------------------------------------- */
/* --- PI error data structure --------------------------------------------- */
typedef
struct
_T_PI_ERROR
{
typedef
struct
_T_PI_ERROR
T_ERROR
error
;
/* standard error type */
{
T_ERROR
error
;
/* standard error type */
USIGN8
pi_state
;
/* pi state */
USIGN8
pi_state
;
/* pi state */
USIGN8
dummy
;
/* alignment */
USIGN8
dummy
;
/* alignment */
}
T_PI_ERROR
;
}
T_PI_ERROR
;
/* --- PI-LOC error data structure ----------------------------------------- */
/* --- PI-LOC error data structure ----------------------------------------- */
typedef
struct
_T_PI_LOC_ERROR
{
typedef
struct
_T_PI_LOC_ERROR
T_ERROR
error
;
/* standard error type */
{
USIGN8
pi_state
;
/* pi state */
T_ERROR
error
;
/* standard error type */
USIGN8
dummy
;
/* alignment */
USIGN8
pi_state
;
/* pi state */
USIGN8
dummy
;
/* alignment */
USIGN32
vfd_number
;
/* vfd number */
USIGN32
vfd_number
;
/* vfd number */
}
T_PI_LOC_ERROR
;
}
T_PI_LOC_ERROR
;
/* --- OD error data structure --------------------------------------------- */
/* --- OD error data structure --------------------------------------------- */
typedef
struct
_T_OD_ERROR
{
typedef
struct
_T_OD_ERROR
{
T_ERROR
error
;
/* standard error type */
T_ERROR
error
;
/* standard error type */
USIGN16
index
;
/* error index */
USIGN16
index
;
/* error index */
}
T_OD_ERROR
;
}
T_OD_ERROR
;
...
@@ -894,10 +864,11 @@ typedef T_OD_ERROR T_OV_ERROR;
...
@@ -894,10 +864,11 @@ typedef T_OD_ERROR T_OV_ERROR;
#endif
#endif
/* --- source OD error data structure -------------------------------------- */
/* --- source OD error data structure -------------------------------------- */
typedef
struct
_T_SRC_OD_ERROR
{
typedef
struct
_T_SRC_OD_ERROR
T_ERROR
error
;
/* standard error type */
{
T_ERROR
error
;
/* standard error type */
USIGN32
vfd_number
;
/* vfd number */
USIGN32
vfd_number
;
/* vfd number */
USIGN16
index
;
/* error index */
USIGN16
index
;
/* error index */
}
T_SRC_OD_ERROR
;
}
T_SRC_OD_ERROR
;
#if (PB_VER < 500)
#if (PB_VER < 500)
...
@@ -905,14 +876,16 @@ typedef T_SRC_OD_ERROR T_SRC_OV_ERROR;
...
@@ -905,14 +876,16 @@ typedef T_SRC_OD_ERROR T_SRC_OV_ERROR;
#endif
#endif
/* --- VFD error data structure -------------------------------------------- */
/* --- VFD error data structure -------------------------------------------- */
typedef
struct
_T_VFD_ERROR
{
typedef
struct
_T_VFD_ERROR
T_ERROR
error
;
/* standard error type */
{
T_ERROR
error
;
/* standard error type */
USIGN32
vfd_number
;
/* vfd number */
USIGN32
vfd_number
;
/* vfd number */
}
T_VFD_ERROR
;
}
T_VFD_ERROR
;
/* --- CRL error data structure -------------------------------------------- */
/* --- CRL error data structure -------------------------------------------- */
typedef
struct
_T_CRL_ERROR
{
typedef
struct
_T_CRL_ERROR
T_ERROR
error
;
/* standard error type */
{
T_ERROR
error
;
/* standard error type */
USIGN16
error_cr
;
/* error cr */
USIGN16
error_cr
;
/* error cr */
}
T_CRL_ERROR
;
}
T_CRL_ERROR
;
...
@@ -923,9 +896,10 @@ typedef T_CRL_ERROR T_KBL_ERROR;
...
@@ -923,9 +896,10 @@ typedef T_CRL_ERROR T_KBL_ERROR;
/*****************************************************************************/
/*****************************************************************************/
/************* FDLIF-ERROR DATA STRUCTURES *****************************/
/************* FDLIF-ERROR DATA STRUCTURES *****************************/
/*****************************************************************************/
/*****************************************************************************/
typedef
struct
_T_FDLIF_ERROR
{
typedef
struct
_T_FDLIF_ERROR
USIGN8
result
;
/* class and code */
{
USIGN8
dummy
;
/* alignment byte */
USIGN8
result
;
/* class and code */
USIGN8
dummy
;
/* alignment byte */
USIGN16
add_detail
;
/* additional detail */
USIGN16
add_detail
;
/* additional detail */
}
T_FDLIF_ERROR
;
}
T_FDLIF_ERROR
;
...
@@ -933,11 +907,12 @@ typedef struct _T_FDLIF_ERROR {
...
@@ -933,11 +907,12 @@ typedef struct _T_FDLIF_ERROR {
/************* EXCEPTION STRUCTURES *****************************/
/************* EXCEPTION STRUCTURES *****************************/
/*****************************************************************************/
/*****************************************************************************/
typedef
struct
_T_EXCEPTION
{
typedef
struct
_T_EXCEPTION
{
USIGN8
task_id
;
/* task identifier in which execption occurs */
USIGN8
task_id
;
/* task identifier in which execption occurs */
USIGN8
par1
;
/* parameter 1 */
USIGN8
par1
;
/* parameter 1 */
USIGN16
par2
;
/* parameter 2 */
USIGN16
par2
;
/* parameter 2 */
USIGN16
par3
;
/* parameter 3 */
USIGN16
par3
;
/* parameter 3 */
}
T_EXCEPTION
;
}
T_EXCEPTION
;
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
...
...
profibus/lib/rt/src/pb_fdl.h
View file @
ce758cd3
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************/
/*****************************************************************************/
/* */
/* */
/*
SOFTING AG
*/
/*
SOFTING Industrial Automation GmbH
*/
/* Richard-Reitzner-Allee 6 */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* */
/*
Copyright (C) SOFTING AG 1995-2003
*/
/*
Copyright (C) SOFTING Industrial Automation GmbH 1995-2012
*/
/* All Rights Reserved */
/* All Rights Reserved */
/* */
/* */
/*****************************************************************************/
/*****************************************************************************/
...
@@ -50,8 +15,8 @@
...
@@ -50,8 +15,8 @@
/* */
/* */
/* Filename : PB_FDL.H */
/* Filename : PB_FDL.H */
/* Version : 5.21.0.00.release */
/* Version : 5.21.0.00.release */
/* Date :
27-February-1998
*/
/* Date :
February-1998
*/
/* Author : SOFTING
AG
*/
/* Author : SOFTING
*/
/* */
/* */
/* Description : This file contains the types and defines of the FDL-User- */
/* Description : This file contains the types and defines of the FDL-User- */
/* Interface */
/* Interface */
...
@@ -96,12 +61,12 @@
...
@@ -96,12 +61,12 @@
0x02
/* neg. ack., resource of remote FDL \
0x02
/* neg. ack., resource of remote FDL \
entity not available or sufficient */
entity not available or sufficient */
#define FDL_RS \
#define FDL_RS \
0x03
/* neg. ack., service at remote SAP
\
0x03
/* neg. ack., service at remote SAP
\
or remote SAP not activated */
or remote SAP not activated */
#define FDL_RA 0x04
/* neg. ack., access of remote SAP blocked */
#define FDL_RA 0x04
/* neg. ack., access of remote SAP blocked */
#define FDL_DL \
#define FDL_DL \
0x08
/* pos. ack. for sent data, reply data
\
0x08
/* pos. ack. for sent data, reply data
\
with low priority available */
with low priority available */
#define FDL_NR 0x09
/* pos. ack. for sent data, no reply data */
#define FDL_NR 0x09
/* pos. ack. for sent data, no reply data */
#define FDL_DH \
#define FDL_DH \
0x0a
/* pos. ack. for sent data, reply data \
0x0a
/* pos. ack. for sent data, reply data \
...
@@ -113,21 +78,21 @@
...
@@ -113,21 +78,21 @@
0x0d
/* neg. ack. for sent data, reply data \
0x0d
/* neg. ack. for sent data, reply data \
with high priority available */
with high priority available */
#define FDL_LS \
#define FDL_LS \
0x10
/* service at local SAP or local SAP not
\
0x10
/* service at local SAP or local SAP not
\
activated */
activated */
#define FDL_NA 0x11
/* no reaction from remote station */
#define FDL_NA 0x11
/* no reaction from remote station */
#define FDL_DS 0x12
/* local FDL entity disconnected */
#define FDL_DS 0x12
/* local FDL entity disconnected */
#define FDL_NO 0x13
/* not ok */
#define FDL_NO 0x13
/* not ok */
#define FDL_LR 0x14
/* resource of local FDL not available */
#define FDL_LR 0x14
/* resource of local FDL not available */
#define FDL_IV 0x15
/* invalid parameter in request */
#define FDL_IV 0x15
/* invalid parameter in request */
#define FDL_LOW_DATA 0x20
/* low priority reply data transmitted */
#define FDL_LOW_DATA 0x20
/* low priority reply data transmitted */
#define FDL_HIGH_DATA 0x21
/* high priority reply data transmitted */
#define FDL_HIGH_DATA 0x21
/* high priority reply data transmitted */
#define FDL_NO_DATA 0x22
/* no reply data transmitted */
#define FDL_NO_DATA 0x22
/* no reply data transmitted */
/*****************************************************************************/
/*****************************************************************************/
/*** SAP and address constants ***/
/*** SAP and address constants ***/
/*****************************************************************************/
/*****************************************************************************/
#define BROADCAST 127
/* broadcast address */
#define BROADCAST 127
/* broadcast address */
#define FDL_DEFAULT_SAP 64
/* number of Default SAP */
#define FDL_DEFAULT_SAP 64
/* number of Default SAP */
/*****************************************************************************/
/*****************************************************************************/
...
@@ -154,7 +119,7 @@
...
@@ -154,7 +119,7 @@
/*** Data Mode for SRD and SDA indications ***/
/*** Data Mode for SRD and SDA indications ***/
/*****************************************************************************/
/*****************************************************************************/
#define NORMAL_MODE 0x00
/* all faultless telegrams are indicated */
#define NORMAL_MODE 0x00
/* all faultless telegrams are indicated */
#define DATA_MODE 0x08
/* indication only if data transmitted */
#define DATA_MODE 0x08
/* indication only if data transmitted */
/*****************************************************************************/
/*****************************************************************************/
/*** Constants for access in SAP block ***/
/*** Constants for access in SAP block ***/
...
@@ -173,111 +138,120 @@
...
@@ -173,111 +138,120 @@
/* ************** Busparameter block ********************* */
/* ************** Busparameter block ********************* */
/* ************************************************************************** */
/* ************************************************************************** */
typedef
struct
_T_FDLIF_SET_BUSPARAMETER_REQ
{
typedef
struct
_T_FDLIF_SET_BUSPARAMETER_REQ
USIGN8
loc_add
;
/* local station */
{
USIGN8
loc_segm
;
/* local segment */
USIGN8
loc_add
;
/* local station */
USIGN8
baud_rate
;
/* baud rate */
USIGN8
loc_segm
;
/* local segment */
USIGN8
medium_red
;
/* medium redundancy */
USIGN8
baud_rate
;
/* baud rate */
USIGN16
tsl
;
/* slot time */
USIGN8
medium_red
;
/* medium redundancy */
USIGN16
min_tsdr
;
/* min. station delay time resp. */
USIGN16
tsl
;
/* slot time */
USIGN16
max_tsdr
;
/* max. station delay time resp. */
USIGN16
min_tsdr
;
/* min. station delay time resp. */
USIGN8
tqui
;
/* quiet time */
USIGN16
max_tsdr
;
/* max. station delay time resp. */
USIGN8
tset
;
/* setup time */
USIGN8
tqui
;
/* quiet time */
USIGN32
ttr
;
/* target token rotation time */
USIGN8
tset
;
/* setup time */
USIGN8
g
;
/* gap update factor */
USIGN32
ttr
;
/* target token rotation time */
USIGN8
g
;
/* gap update factor */
PB_BOOL
in_ring_desired
;
/* active or passive station */
PB_BOOL
in_ring_desired
;
/* active or passive station */
USIGN8
hsa
;
/* highest station address */
USIGN8
hsa
;
/* highest station address */
USIGN8
max_retry_limit
;
/* max. retry limit */
USIGN8
max_retry_limit
;
/* max. retry limit */
USIGN16
reserved
;
/* not used */
USIGN16
reserved
;
/* not used */
USIGN8
ident
[
202
];
/* for internal use */
USIGN8
ident
[
202
];
/* for internal use */
}
T_FDLIF_SET_BUSPARAMETER_REQ
;
}
T_FDLIF_SET_BUSPARAMETER_REQ
;
typedef
struct
_T_FDLIF_READ_BUSPARAMETER_CNF
{
typedef
struct
_T_FDLIF_READ_BUSPARAMETER_CNF
USIGN8
loc_add
;
/* local station */
{
USIGN8
loc_segm
;
/* local segment */
USIGN8
loc_add
;
/* local station */
USIGN8
baud_rate
;
/* baud rate */
USIGN8
loc_segm
;
/* local segment */
USIGN8
medium_red
;
/* medium redundancy */
USIGN8
baud_rate
;
/* baud rate */
USIGN16
tsl
;
/* slot time */
USIGN8
medium_red
;
/* medium redundancy */
USIGN16
min_tsdr
;
/* min. station delay time resp. */
USIGN16
tsl
;
/* slot time */
USIGN16
max_tsdr
;
/* max. station delay time resp. */
USIGN16
min_tsdr
;
/* min. station delay time resp. */
USIGN8
tqui
;
/* quiet time */
USIGN16
max_tsdr
;
/* max. station delay time resp. */
USIGN8
tset
;
/* setup time */
USIGN8
tqui
;
/* quiet time */
USIGN32
ttr
;
/* target token rotation time */
USIGN8
tset
;
/* setup time */
USIGN8
g
;
/* gap update factor */
USIGN32
ttr
;
/* target token rotation time */
USIGN8
g
;
/* gap update factor */
PB_BOOL
in_ring_desired
;
/* active or passive station */
PB_BOOL
in_ring_desired
;
/* active or passive station */
USIGN8
hsa
;
/* highest station address */
USIGN8
hsa
;
/* highest station address */
USIGN8
max_retry_limit
;
/* max. retry limit */
USIGN8
max_retry_limit
;
/* max. retry limit */
USIGN16
reserved
;
/* not used */
USIGN16
reserved
;
/* not used */
USIGN8
ident
[
202
];
/* FDL-Ident-String */
USIGN8
ident
[
202
];
/* FDL-Ident-String */
}
T_FDLIF_READ_BUSPARAMETER_CNF
;
}
T_FDLIF_READ_BUSPARAMETER_CNF
;
/* ************************************************************************* */
/* ************************************************************************* */
/* ******************* SAP block ************************* */
/* ******************* SAP block ************************* */
/* ************************************************************************* */
/* ************************************************************************* */
typedef
struct
_T_FDLIF_SAP_ACTIVATE_REQ
{
typedef
struct
_T_FDLIF_SAP_ACTIVATE_REQ
USIGN8
sap_nr
;
/* SAP to be activated */
{
USIGN8
max_l_sdu_length_req
;
/* maximum length of request telegram */
USIGN8
sap_nr
;
/* SAP to be activated */
USIGN8
max_l_sdu_length_req
;
/* maximum length of request telegram */
USIGN8
max_l_sdu_length_con_ind
;
/* maximum length of con/ind telegram */
USIGN8
max_l_sdu_length_con_ind
;
/* maximum length of con/ind telegram */
USIGN8
access_sap
;
/* permitted request SAPs */
USIGN8
access_sap
;
/* permitted request SAPs */
USIGN8
access_station
;
/* permitted requestor */
USIGN8
access_station
;
/* permitted requestor */
USIGN8
sda
;
/* roles in SDA service */
USIGN8
sda
;
/* roles in SDA service */
USIGN8
sdn
;
/* roles in SDN service */
USIGN8
sdn
;
/* roles in SDN service */
USIGN8
srd
;
/* roles in SRD service */
USIGN8
srd
;
/* roles in SRD service */
USIGN8
csrd
;
/* not supported */
USIGN8
csrd
;
/* not supported */
USIGN8
data_mode
;
/* NORMAL_MODE, DATA_MODE */
USIGN8
data_mode
;
/* NORMAL_MODE, DATA_MODE */
USIGN8
credits
;
/* number of indication resources */
USIGN8
credits
;
/* number of indication resources */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_FDLIF_SAP_ACTIVATE_REQ
;
}
T_FDLIF_SAP_ACTIVATE_REQ
;
typedef
struct
_T_FDLIF_RSAP_ACTIVATE_REQ
{
typedef
struct
_T_FDLIF_RSAP_ACTIVATE_REQ
USIGN8
sap_nr
;
/* SAP to be activated */
{
USIGN8
sap_nr
;
/* SAP to be activated */
USIGN8
max_l_sdu_length_req
;
/* maximum length of req telegram */
USIGN8
max_l_sdu_length_req
;
/* maximum length of req telegram */
USIGN8
max_l_sdu_length_ind
;
/* maximum length of ind telegram */
USIGN8
max_l_sdu_length_ind
;
/* maximum length of ind telegram */
USIGN8
access_sap
;
/* permitted request SAPs */
USIGN8
access_sap
;
/* permitted request SAPs */
USIGN8
access_station
;
/* permitted requestor */
USIGN8
access_station
;
/* permitted requestor */
USIGN8
data_mode
;
/* NORMAL_MODE, DATA_MODE */
USIGN8
data_mode
;
/* NORMAL_MODE, DATA_MODE */
USIGN8
credits
;
/* number of indication resources */
USIGN8
credits
;
/* number of indication resources */
USIGN8
dummy
;
/* alignmnet byte */
USIGN8
dummy
;
/* alignmnet byte */
}
T_FDLIF_RSAP_ACTIVATE_REQ
;
}
T_FDLIF_RSAP_ACTIVATE_REQ
;
typedef
struct
_T_FDLIF_SAP_CHANGE_REQ
{
typedef
struct
_T_FDLIF_SAP_CHANGE_REQ
USIGN8
sap_nr
;
/* SAP to be activated */
{
USIGN8
access_sap
;
/* permitted request SAPs */
USIGN8
sap_nr
;
/* SAP to be activated */
USIGN8
access_sap
;
/* permitted request SAPs */
USIGN8
access_station
;
/* permitted requestor */
USIGN8
access_station
;
/* permitted requestor */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_FDLIF_SAP_CHANGE_REQ
;
}
T_FDLIF_SAP_CHANGE_REQ
;
typedef
struct
_T_FDLIF_SAP_DEACTIVATE_REQ
{
typedef
struct
_T_FDLIF_SAP_DEACTIVATE_REQ
{
USIGN8
sap_nr
;
/* SAP to be activated */
USIGN8
sap_nr
;
/* SAP to be activated */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_FDLIF_SAP_DEACTIVATE_REQ
;
}
T_FDLIF_SAP_DEACTIVATE_REQ
;
/* ************************************************************************* */
/* ************************************************************************* */
/* ************* Data transfer ********************* */
/* ************* Data transfer ********************* */
/* ************************************************************************* */
/* ************************************************************************* */
typedef
struct
_T_FDLIF_SDN_SDA_SRD_REQ
{
typedef
struct
_T_FDLIF_SDN_SDA_SRD_REQ
USIGN8
ssap
;
/* source SAP */
{
USIGN8
dsap
;
/* destination SAP */
USIGN8
ssap
;
/* source SAP */
USIGN8
rem_add
;
/* address of remote station */
USIGN8
dsap
;
/* destination SAP */
USIGN8
rem_add
;
/* address of remote station */
USIGN8
priority
;
/* priority of request */
USIGN8
priority
;
/* priority of request */
USIGN8
status
;
/* only used for SRD.IND */
USIGN8
status
;
/* only used for SRD.IND */
USIGN8
length
;
/* length of request data */
USIGN8
length
;
/* length of request data */
/* USIGN8 req_data [length] request data */
/* USIGN8 req_data [length] request data */
}
T_FDLIF_SDN_SDA_SRD_REQ
;
}
T_FDLIF_SDN_SDA_SRD_REQ
;
typedef
struct
_T_FDLIF_SRD_CNF
{
typedef
struct
_T_FDLIF_SRD_CNF
{
USIGN8
status
;
/* status */
USIGN8
status
;
/* status */
USIGN8
length
;
/* length of request data */
USIGN8
length
;
/* length of request data */
/* USIGN8 cnf_data [length]; request data */
/* USIGN8 cnf_data [length]; request data */
}
T_FDLIF_SRD_CNF
;
}
T_FDLIF_SRD_CNF
;
typedef
struct
_T_FDLIF_RUP_REQ
{
typedef
struct
_T_FDLIF_RUP_REQ
USIGN8
sap_nr
;
/* number of local SAP */
{
USIGN8
sap_nr
;
/* number of local SAP */
USIGN8
priority
;
/* priority of request */
USIGN8
priority
;
/* priority of request */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
USIGN8
length
;
/* length of request data */
USIGN8
length
;
/* length of request data */
/* USIGN8 req_data [length]; request data */
/* USIGN8 req_data [length]; request data */
}
T_FDLIF_RUP_REQ
;
}
T_FDLIF_RUP_REQ
;
...
@@ -286,7 +260,8 @@ typedef struct _T_FDLIF_RUP_REQ {
...
@@ -286,7 +260,8 @@ typedef struct _T_FDLIF_RUP_REQ {
/* ************************************************************************* */
/* ************************************************************************* */
/* the possible events are defined in the header file PB_ERR.H */
/* the possible events are defined in the header file PB_ERR.H */
typedef
struct
_T_FDLIF_EVENT_IND
{
typedef
struct
_T_FDLIF_EVENT_IND
{
USIGN8
event
;
/* event */
USIGN8
event
;
/* event */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_FDLIF_EVENT_IND
;
}
T_FDLIF_EVENT_IND
;
...
...
profibus/lib/rt/src/pb_fm7.h
View file @
ce758cd3
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************/
/*****************************************************************************/
/* */
/* */
/*
SOFTING AG
*/
/*
SOFTING Industrial Automation GmbH
*/
/* Richard-Reitzner-Allee 6 */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* */
/*
Copyright (C) SOFTING AG 1995-2003
*/
/*
Copyright (C) SOFTING Industrial Automation GmbH 1995-2012
*/
/* All Rights Reserved */
/* All Rights Reserved */
/* */
/* */
/*****************************************************************************/
/*****************************************************************************/
...
@@ -50,8 +15,8 @@
...
@@ -50,8 +15,8 @@
/* */
/* */
/* Filename : PB_FM7.H */
/* Filename : PB_FM7.H */
/* Version : 5.21.0.00.release */
/* Version : 5.21.0.00.release */
/* Date :
27-February-1998
*/
/* Date :
February-1998
*/
/* Author : SOFTING
AG
*/
/* Author : SOFTING
*/
/* */
/* */
/* Description : This file contains the types and defines of the FM7-User- */
/* Description : This file contains the types and defines of the FM7-User- */
/* Interface */
/* Interface */
...
@@ -157,13 +122,14 @@
...
@@ -157,13 +122,14 @@
/****************************************************************************/
/****************************************************************************/
#define DETAIL_LENGTH 16
/* length of abort detail */
#define DETAIL_LENGTH 16
/* length of abort detail */
#define FEAT_SUPP_LEN 6
/* length of supported feature field */
#define FEAT_SUPP_LEN 6
/* length of supported feature field */
/****************************************************************************/
/****************************************************************************/
/* Initiate Service */
/* Initiate Service */
/****************************************************************************/
/****************************************************************************/
typedef
struct
_T_FM7_INIT_REQ
{
typedef
struct
_T_FM7_INIT_REQ
{
USIGN8
snd_len_low
;
/* max FM7 PDU size to send with low priority */
USIGN8
snd_len_low
;
/* max FM7 PDU size to send with low priority */
USIGN8
rcv_len_low
;
/* max FM7 PDU size to receive with low priority */
USIGN8
rcv_len_low
;
/* max FM7 PDU size to receive with low priority */
USIGN8
supported_services
[
FEAT_SUPP_LEN
];
/* supported FM7 services */
USIGN8
supported_services
[
FEAT_SUPP_LEN
];
/* supported FM7 services */
...
@@ -173,7 +139,8 @@ typedef struct _T_FM7_INIT_REQ {
...
@@ -173,7 +139,8 @@ typedef struct _T_FM7_INIT_REQ {
typedef
T_FM7_INIT_REQ
T_FMA_INIT_REQ
;
typedef
T_FM7_INIT_REQ
T_FMA_INIT_REQ
;
#endif
#endif
typedef
struct
_T_FM7_INIT_ERR_CNF
{
typedef
struct
_T_FM7_INIT_ERR_CNF
{
USIGN16
class_code
;
/* error code and class */
USIGN16
class_code
;
/* error code and class */
USIGN8
snd_len_low
;
/* max FM7 PDU size to send with low priority */
USIGN8
snd_len_low
;
/* max FM7 PDU size to send with low priority */
USIGN8
rcv_len_low
;
/* max FM7 PDU size to receive with low priority */
USIGN8
rcv_len_low
;
/* max FM7 PDU size to receive with low priority */
...
@@ -188,11 +155,12 @@ typedef T_FM7_INIT_ERR_CNF T_FMA_INIT_ERR_CNF;
...
@@ -188,11 +155,12 @@ typedef T_FM7_INIT_ERR_CNF T_FMA_INIT_ERR_CNF;
/* Abort Service */
/* Abort Service */
/****************************************************************************/
/****************************************************************************/
typedef
struct
_T_FM7_ABORT_REQ
{
typedef
struct
_T_FM7_ABORT_REQ
PB_BOOL
local
;
/* local or remote detected */
{
USIGN8
abort_id
;
/* identifier (USR,LLI_USR,LLI,FDL) */
PB_BOOL
local
;
/* local or remote detected */
USIGN8
reason
;
/* abort reason code */
USIGN8
abort_id
;
/* identifier (USR,LLI_USR,LLI,FDL) */
USIGN8
detail_length
;
/* length of detail information */
USIGN8
reason
;
/* abort reason code */
USIGN8
detail_length
;
/* length of detail information */
USIGN8
detail
[
DETAIL_LENGTH
];
/* detail information about the reason */
USIGN8
detail
[
DETAIL_LENGTH
];
/* detail information about the reason */
}
T_FM7_ABORT_REQ
;
}
T_FM7_ABORT_REQ
;
...
@@ -267,13 +235,14 @@ typedef T_FM7_ABORT_REQ T_FMA_ABORT_REQ;
...
@@ -267,13 +235,14 @@ typedef T_FM7_ABORT_REQ T_FMA_ABORT_REQ;
#define O_CONN 0x02
#define O_CONN 0x02
/*--- CRL-Header -----------------------------------------------------------*/
/*--- CRL-Header -----------------------------------------------------------*/
typedef
struct
_T_CRL_HDR
{
typedef
struct
_T_CRL_HDR
INT16
nr_of_entries
;
/* number of CRL enries */
{
USIGN8
poll_sap
;
/* poll list SAP */
INT16
nr_of_entries
;
/* number of CRL enries */
USIGN8
symbol_length
;
/* max symbol lenght in CRL */
USIGN8
poll_sap
;
/* poll list SAP */
USIGN32
ass_abt_ci
;
/* ASS / ABT controll intervall */
USIGN8
symbol_length
;
/* max symbol lenght in CRL */
USIGN32
ass_abt_ci
;
/* ASS / ABT controll intervall */
PB_BOOL
vfd_pointer_supported
;
/* VFD pointer supported */
PB_BOOL
vfd_pointer_supported
;
/* VFD pointer supported */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_CRL_HDR
;
}
T_CRL_HDR
;
#if (PB_VER < 500)
#if (PB_VER < 500)
...
@@ -282,27 +251,28 @@ typedef T_CRL_HDR T_KBL_HDR;
...
@@ -282,27 +251,28 @@ typedef T_CRL_HDR T_KBL_HDR;
/*--- CRL-Static-Entry
/*--- CRL-Static-Entry
* -----------------------------------------------------------*/
* -----------------------------------------------------------*/
typedef
struct
_T_CRL_STATIC
{
typedef
struct
_T_CRL_STATIC
USIGN8
loc_lsap
;
/* local LSAP */
{
USIGN8
rem_add
;
/* remote address */
USIGN8
loc_lsap
;
/* local LSAP */
USIGN8
rem_segm
;
/* remote segment */
USIGN8
rem_add
;
/* remote address */
USIGN8
rem_lsap
;
/* remote LSAP */
USIGN8
rem_segm
;
/* remote segment */
USIGN8
conn_type
;
/* connection type */
USIGN8
rem_lsap
;
/* remote LSAP */
USIGN8
lli_sap
;
/* LLI-SAP */
USIGN8
conn_type
;
/* connection type */
USIGN8
multiplier
;
/* multiplier in cyclic connections */
USIGN8
lli_sap
;
/* LLI-SAP */
USIGN8
conn_attr
;
/* connection attribute */
USIGN8
multiplier
;
/* multiplier in cyclic connections */
USIGN8
max_scc
;
/* max. of send confirmed counter */
USIGN8
conn_attr
;
/* connection attribute */
USIGN8
max_rcc
;
/* max. of receive confirmed counter */
USIGN8
max_scc
;
/* max. of send confirmed counter */
USIGN8
max_sac
;
/* max. of send acknowledged counter */
USIGN8
max_rcc
;
/* max. of receive confirmed counter */
USIGN8
max_rac
;
/* max. of receive acknowledged ctr */
USIGN8
max_sac
;
/* max. of send acknowledged counter */
USIGN32
ci
;
/* controll intervall */
USIGN8
max_rac
;
/* max. of receive acknowledged ctr */
USIGN8
max_pdu_snd_high
;
/* max. length of FMS-PDU send high */
USIGN32
ci
;
/* controll intervall */
USIGN8
max_pdu_snd_low
;
/* max. length of FMS-PDU send low */
USIGN8
max_pdu_snd_high
;
/* max. length of FMS-PDU send high */
USIGN8
max_pdu_rcv_high
;
/* max. length of FMS-PDU rcv high */
USIGN8
max_pdu_snd_low
;
/* max. length of FMS-PDU send low */
USIGN8
max_pdu_rcv_low
;
/* max. length of FMS-PDU rcv low */
USIGN8
max_pdu_rcv_high
;
/* max. length of FMS-PDU rcv high */
USIGN8
feature_supp
[
FEAT_SUPP_LEN
];
/* FMS features supported */
USIGN8
max_pdu_rcv_low
;
/* max. length of FMS-PDU rcv low */
USIGN8
feature_supp
[
FEAT_SUPP_LEN
];
/* FMS features supported */
STRINGV
symbol
[
MAX_CRL_SYMBOL_LENGTH
];
/* symbolic name */
STRINGV
symbol
[
MAX_CRL_SYMBOL_LENGTH
];
/* symbolic name */
USIGN32
vfd_pointer
;
/* vfd number */
USIGN32
vfd_pointer
;
/* vfd number */
USIGN8
extension
[
MAX_CRL_EXTENSION_LENGTH
];
/* CRL-Extension */
USIGN8
extension
[
MAX_CRL_EXTENSION_LENGTH
];
/* CRL-Extension */
}
T_CRL_STATIC
;
}
T_CRL_STATIC
;
...
@@ -311,17 +281,18 @@ typedef T_CRL_STATIC T_KBL_STATIC;
...
@@ -311,17 +281,18 @@ typedef T_CRL_STATIC T_KBL_STATIC;
#endif
#endif
/*--- CRL-Dynamic-Entry ----------------------------------------------------*/
/*--- CRL-Dynamic-Entry ----------------------------------------------------*/
typedef
struct
_T_CRL_DYNAMIC
{
typedef
struct
_T_CRL_DYNAMIC
USIGN8
rem_add
;
/* current remote address */
{
USIGN8
rem_segm
;
/* current remote segment */
USIGN8
rem_add
;
/* current remote address */
USIGN8
rem_lsap
;
/* current remote LSAP */
USIGN8
rem_segm
;
/* current remote segment */
USIGN8
scc
;
/* send confirmed counter */
USIGN8
rem_lsap
;
/* current remote LSAP */
USIGN8
rcc
;
/* receive confirmed counter */
USIGN8
scc
;
/* send confirmed counter */
USIGN8
sac
;
/* send acknowledged counter */
USIGN8
rcc
;
/* receive confirmed counter */
USIGN8
rac
;
/* receive acknowledged counter */
USIGN8
sac
;
/* send acknowledged counter */
USIGN8
rac
;
/* receive acknowledged counter */
PB_BOOL
poll_entry_enabled
;
/* poll entry flag */
PB_BOOL
poll_entry_enabled
;
/* poll entry flag */
USIGN8
master_role
;
/* current master role */
USIGN8
master_role
;
/* current master role */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_CRL_DYNAMIC
;
}
T_CRL_DYNAMIC
;
#if (PB_VER < 500)
#if (PB_VER < 500)
...
@@ -333,19 +304,21 @@ typedef T_CRL_DYNAMIC T_KBL_DYNAMIC;
...
@@ -333,19 +304,21 @@ typedef T_CRL_DYNAMIC T_KBL_DYNAMIC;
/****************************************************************************/
/****************************************************************************/
/*--- Load-CRL-Service -----------------------------------------------------*/
/*--- Load-CRL-Service -----------------------------------------------------*/
typedef
struct
_T_LOAD_CRL_REQ
{
typedef
struct
_T_LOAD_CRL_REQ
{
USIGN16
desired_cr
;
/* desired communication reference */
USIGN16
desired_cr
;
/* desired communication reference */
union
{
union
{
T_CRL_HDR
crl_hdr
;
/* CRL-Header-Entry */
T_CRL_HDR
crl_hdr
;
/* CRL-Header-Entry */
T_CRL_STATIC
crl_static
;
/* CRL-Static-Entry */
T_CRL_STATIC
crl_static
;
/* CRL-Static-Entry */
}
id
;
}
id
;
}
T_LOAD_CRL_REQ
;
}
T_LOAD_CRL_REQ
;
#if (PB_VER < 500)
#if (PB_VER < 500)
typedef
struct
_T_LOAD_KBL_REQ
{
typedef
struct
_T_LOAD_KBL_REQ
{
USIGN16
desired_cr
;
/* desired communication reference */
USIGN16
desired_cr
;
/* desired communication reference */
union
{
union
{
T_KBL_HDR
kbl_hdr
;
/* CRL-Header-Entry */
T_KBL_HDR
kbl_hdr
;
/* CRL-Header-Entry */
T_KBL_STATIC
kbl_static
;
/* CRL-Static-Entry */
T_KBL_STATIC
kbl_static
;
/* CRL-Static-Entry */
}
id
;
}
id
;
}
T_LOAD_KBL_REQ
;
}
T_LOAD_KBL_REQ
;
...
@@ -446,7 +419,8 @@ typedef struct _T_LOAD_KBL_REQ {
...
@@ -446,7 +419,8 @@ typedef struct _T_LOAD_KBL_REQ {
/* --- DTU Receiver ------------------------------------------------------- */
/* --- DTU Receiver ------------------------------------------------------- */
#define CONLS_SERVER 0
#define CONLS_SERVER 0
typedef
struct
_T_READ_CRL_REQ
{
typedef
struct
_T_READ_CRL_REQ
{
USIGN16
desired_cr
;
/* desired communication reference */
USIGN16
desired_cr
;
/* desired communication reference */
}
T_READ_CRL_REQ
;
}
T_READ_CRL_REQ
;
...
@@ -455,37 +429,41 @@ typedef T_READ_CRL_REQ T_READ_KBL_REQ;
...
@@ -455,37 +429,41 @@ typedef T_READ_CRL_REQ T_READ_KBL_REQ;
#endif
#endif
/*--- CRL-Entry Data-Type --------------------------------------------------*/
/*--- CRL-Entry Data-Type --------------------------------------------------*/
typedef
struct
_T_CRL_ENTRY
{
typedef
struct
_T_CRL_ENTRY
T_CRL_STATIC
crl_static
;
/* CRL-Static-Entry */
{
T_CRL_STATIC
crl_static
;
/* CRL-Static-Entry */
T_CRL_DYNAMIC
crl_dynamic
;
/* CRL-Dynamic-Entry */
T_CRL_DYNAMIC
crl_dynamic
;
/* CRL-Dynamic-Entry */
USIGN8
dummy
;
/* alignment */
USIGN8
dummy
;
/* alignment */
USIGN8
crl_status_len
;
/* length of CRL-Status */
USIGN8
crl_status_len
;
/* length of CRL-Status */
/* USIGN8 crl_status[crl_status_len]; CRL-Status */
/* USIGN8 crl_status[crl_status_len]; CRL-Status */
}
T_CRL_ENTRY
;
}
T_CRL_ENTRY
;
#if (PB_VER < 500)
#if (PB_VER < 500)
typedef
struct
_T_KBL_ENTRY
{
typedef
struct
_T_KBL_ENTRY
T_KBL_STATIC
kbl_static
;
/* CRL-Static-Entry */
{
T_KBL_STATIC
kbl_static
;
/* CRL-Static-Entry */
T_KBL_DYNAMIC
kbl_dynamic
;
/* CRL-Dynamic-Entry */
T_KBL_DYNAMIC
kbl_dynamic
;
/* CRL-Dynamic-Entry */
USIGN8
dummy
;
/* alignment */
USIGN8
dummy
;
/* alignment */
USIGN8
kbl_status_len
;
/* length of CRL-Status */
USIGN8
kbl_status_len
;
/* length of CRL-Status */
/* USIGN8 kbl_status[crl_status_len]; CRL-Status */
/* USIGN8 kbl_status[crl_status_len]; CRL-Status */
}
T_KBL_ENTRY
;
}
T_KBL_ENTRY
;
#endif
#endif
typedef
struct
_T_READ_CRL_CNF
{
typedef
struct
_T_READ_CRL_CNF
{
USIGN16
desired_cr
;
/* desired communication reference */
USIGN16
desired_cr
;
/* desired communication reference */
union
{
union
{
T_CRL_HDR
crl_hdr
;
/* CRL-header */
T_CRL_HDR
crl_hdr
;
/* CRL-header */
T_CRL_ENTRY
crl_entry
;
/* CRL-Entry */
T_CRL_ENTRY
crl_entry
;
/* CRL-Entry */
}
id
;
}
id
;
}
T_READ_CRL_CNF
;
}
T_READ_CRL_CNF
;
#if (PB_VER < 500)
#if (PB_VER < 500)
typedef
struct
_T_READ_KBL_CNF
{
typedef
struct
_T_READ_KBL_CNF
{
USIGN16
desired_cr
;
/* desired communication reference */
USIGN16
desired_cr
;
/* desired communication reference */
union
{
union
{
T_KBL_HDR
kbl_hdr
;
/* CRL-header */
T_KBL_HDR
kbl_hdr
;
/* CRL-header */
T_KBL_ENTRY
kbl_entry
;
/* CRL-Entry */
T_KBL_ENTRY
kbl_entry
;
/* CRL-Entry */
}
id
;
}
id
;
}
T_READ_KBL_CNF
;
}
T_READ_KBL_CNF
;
...
@@ -548,46 +526,48 @@ typedef struct _T_READ_KBL_CNF {
...
@@ -548,46 +526,48 @@ typedef struct _T_READ_KBL_CNF {
#define C_NOT_IN_RING_DESIRED NOT_IN_RING_DESIRED
#define C_NOT_IN_RING_DESIRED NOT_IN_RING_DESIRED
#endif
#endif
typedef
struct
_T_SET_BUSPARAMETER_REQ
{
typedef
struct
_T_SET_BUSPARAMETER_REQ
USIGN8
loc_add
;
/* local station */
{
USIGN8
loc_segm
;
/* local segment */
USIGN8
loc_add
;
/* local station */
USIGN8
baud_rate
;
/* baud rate */
USIGN8
loc_segm
;
/* local segment */
USIGN8
medium_red
;
/* medium redundancy */
USIGN8
baud_rate
;
/* baud rate */
USIGN16
tsl
;
/* slot time */
USIGN8
medium_red
;
/* medium redundancy */
USIGN16
min_tsdr
;
/* min. station delay time resp. */
USIGN16
tsl
;
/* slot time */
USIGN16
max_tsdr
;
/* max. station delay time resp. */
USIGN16
min_tsdr
;
/* min. station delay time resp. */
USIGN8
tqui
;
/* quiet time */
USIGN16
max_tsdr
;
/* max. station delay time resp. */
USIGN8
tset
;
/* setup time */
USIGN8
tqui
;
/* quiet time */
USIGN32
ttr
;
/* target token rotation time */
USIGN8
tset
;
/* setup time */
USIGN8
g
;
/* gap update factor */
USIGN32
ttr
;
/* target token rotation time */
USIGN8
g
;
/* gap update factor */
PB_BOOL
in_ring_desired
;
/* active or passive station */
PB_BOOL
in_ring_desired
;
/* active or passive station */
USIGN8
hsa
;
/* highest station address */
USIGN8
hsa
;
/* highest station address */
USIGN8
max_retry_limit
;
/* max. retry limit */
USIGN8
max_retry_limit
;
/* max. retry limit */
USIGN16
reserved
;
/* not used */
USIGN16
reserved
;
/* not used */
USIGN8
ident
[
202
];
/* for internal use */
USIGN8
ident
[
202
];
/* for internal use */
}
T_SET_BUSPARAMETER_REQ
;
}
T_SET_BUSPARAMETER_REQ
;
/****************************************************************************/
/****************************************************************************/
/* Read-Busparameter Service (only local) */
/* Read-Busparameter Service (only local) */
/****************************************************************************/
/****************************************************************************/
typedef
struct
_T_READ_BUSPARAMETER_CNF
{
typedef
struct
_T_READ_BUSPARAMETER_CNF
USIGN8
loc_add
;
/* local station */
{
USIGN8
loc_segm
;
/* local segment */
USIGN8
loc_add
;
/* local station */
USIGN8
baud_rate
;
/* baud rate */
USIGN8
loc_segm
;
/* local segment */
USIGN8
medium_red
;
/* medium redundancy */
USIGN8
baud_rate
;
/* baud rate */
USIGN16
tsl
;
/* slot time */
USIGN8
medium_red
;
/* medium redundancy */
USIGN16
min_tsdr
;
/* min. station delay time resp. */
USIGN16
tsl
;
/* slot time */
USIGN16
max_tsdr
;
/* max. station delay time resp. */
USIGN16
min_tsdr
;
/* min. station delay time resp. */
USIGN8
tqui
;
/* quiet time */
USIGN16
max_tsdr
;
/* max. station delay time resp. */
USIGN8
tset
;
/* setup time */
USIGN8
tqui
;
/* quiet time */
USIGN32
ttr
;
/* target token rotation time */
USIGN8
tset
;
/* setup time */
USIGN8
g
;
/* gap update factor */
USIGN32
ttr
;
/* target token rotation time */
USIGN8
g
;
/* gap update factor */
PB_BOOL
in_ring_desired
;
/* active or passive station */
PB_BOOL
in_ring_desired
;
/* active or passive station */
USIGN8
hsa
;
/* highest station address */
USIGN8
hsa
;
/* highest station address */
USIGN8
max_retry_limit
;
/* max. retry limit */
USIGN8
max_retry_limit
;
/* max. retry limit */
USIGN16
reserved
;
/* not used */
USIGN16
reserved
;
/* not used */
USIGN8
ident
[
202
];
/* FDL-Ident-String */
USIGN8
ident
[
202
];
/* FDL-Ident-String */
}
T_READ_BUSPARAMETER_CNF
;
}
T_READ_BUSPARAMETER_CNF
;
/****************************************************************************/
/****************************************************************************/
...
@@ -625,16 +605,18 @@ typedef struct _T_READ_BUSPARAMETER_CNF {
...
@@ -625,16 +605,18 @@ typedef struct _T_READ_BUSPARAMETER_CNF {
/****************************************************************************/
/****************************************************************************/
#if (PB_VER < 500)
#if (PB_VER < 500)
typedef
struct
_T_STATISTICS_BLOCK
{
typedef
struct
_T_STATISTICS_BLOCK
{
USIGN32
frame_send_count
;
/* frame sent counter */
USIGN32
frame_send_count
;
/* frame sent counter */
USIGN32
sd_count
;
/* valid start delimiter counter */
USIGN32
sd_count
;
/* valid start delimiter counter */
USIGN16
retry_count
;
/* retry frame sent counter */
USIGN16
retry_count
;
/* retry frame sent counter */
USIGN16
sd_error_count
;
/* invalid start delimiter counter */
USIGN16
sd_error_count
;
/* invalid start delimiter counter */
}
T_STATISTICS_BLOCK
;
}
T_STATISTICS_BLOCK
;
#endif
#endif
typedef
struct
_T_SET_VALUE_REQ
{
typedef
struct
_T_SET_VALUE_REQ
USIGN8
id
;
/* value identifier */
{
USIGN8
id
;
/* value identifier */
USIGN8
length
;
/* # of values in byte */
USIGN8
length
;
/* # of values in byte */
/* USIGN8 value[length]; list of values */
/* USIGN8 value[length]; list of values */
}
T_SET_VALUE_REQ
;
}
T_SET_VALUE_REQ
;
...
@@ -643,21 +625,24 @@ typedef struct _T_SET_VALUE_REQ {
...
@@ -643,21 +625,24 @@ typedef struct _T_SET_VALUE_REQ {
/* Read-Value Service (Local and Remote) */
/* Read-Value Service (Local and Remote) */
/****************************************************************************/
/****************************************************************************/
#if (PB_VER < 500)
#if (PB_VER < 500)
typedef
struct
_T_READ_STATISTIC_CTR_CNF
{
typedef
struct
_T_READ_STATISTIC_CTR_CNF
{
USIGN32
frame_send_count
;
/* frame sent counter */
USIGN32
frame_send_count
;
/* frame sent counter */
USIGN32
sd_count
;
/* valid start delimiter counter */
USIGN32
sd_count
;
/* valid start delimiter counter */
USIGN16
retry_count
;
/* retry frame sent counter */
USIGN16
retry_count
;
/* retry frame sent counter */
USIGN16
sd_error_count
;
/* invalid start delimiter counter */
USIGN16
sd_error_count
;
/* invalid start delimiter counter */
}
T_READ_STATISTIC_CTR_CNF
;
}
T_READ_STATISTIC_CTR_CNF
;
#endif
#endif
typedef
struct
_T_READ_VALUE_REQ
{
typedef
struct
_T_READ_VALUE_REQ
USIGN8
id
;
/* value identifier */
{
USIGN8
id
;
/* value identifier */
USIGN8
dummy
;
/* alignment */
USIGN8
dummy
;
/* alignment */
}
T_READ_VALUE_REQ
;
}
T_READ_VALUE_REQ
;
typedef
struct
_T_READ_VALUE_CNF
{
typedef
struct
_T_READ_VALUE_CNF
USIGN8
id
;
/* value identifier */
{
USIGN8
id
;
/* value identifier */
USIGN8
length
;
/* # of values in byte */
USIGN8
length
;
/* # of values in byte */
/* USIGN8 value[length]; list of values */
/* USIGN8 value[length]; list of values */
}
T_READ_VALUE_CNF
;
}
T_READ_VALUE_CNF
;
...
@@ -678,84 +663,88 @@ typedef struct _T_READ_VALUE_CNF {
...
@@ -678,84 +663,88 @@ typedef struct _T_READ_VALUE_CNF {
#define ID_PHY 5
#define ID_PHY 5
#endif
#endif
typedef
struct
_T_IDENT_REQ
{
typedef
struct
_T_IDENT_REQ
{
USIGN8
instance_id
;
/* instance identifier */
USIGN8
instance_id
;
/* instance identifier */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_IDENT_REQ
;
}
T_IDENT_REQ
;
#if (PB_VER >= 500)
#if (PB_VER >= 500)
typedef
struct
_T_CHARACTERISTICS
{
typedef
struct
_T_CHARACTERISTICS
USIGN8
profile_number
[
2
];
/* profile number */
{
USIGN8
functions_supp
[
3
];
/* functions supported */
USIGN8
profile_number
[
2
];
/* profile number */
USIGN8
dummy1
;
/* alignment byte */
USIGN8
functions_supp
[
3
];
/* functions supported */
USIGN8
max_pdu_len
;
/* max. PDU length */
USIGN8
dummy1
;
/* alignment byte */
USIGN8
dummy2
;
/* alignment byte */
USIGN8
max_pdu_len
;
/* max. PDU length */
USIGN8
fms_features_supp
[
6
];
/* FMS features supported */
USIGN8
dummy2
;
/* alignment byte */
USIGN8
fm7_services_supp
[
6
];
/* FM7 features supported */
USIGN8
fms_features_supp
[
6
];
/* FMS features supported */
USIGN8
max_sap_value
;
/* max. LSAP number */
USIGN8
fm7_services_supp
[
6
];
/* FM7 features supported */
USIGN8
max_no_of_saps
;
/* max. number of LSAPs */
USIGN8
max_sap_value
;
/* max. LSAP number */
USIGN16
max_comref
;
/* max communication reference */
USIGN8
max_no_of_saps
;
/* max. number of LSAPs */
USIGN16
max_crl_len
;
/* max count of CRL-Entries */
USIGN16
max_comref
;
/* max communication reference */
USIGN32
total_len_of_pdu
;
/* total length of PDUs */
USIGN16
max_crl_len
;
/* max count of CRL-Entries */
USIGN16
no_of_parallel_serv
;
/* number of parallel serv. */
USIGN32
total_len_of_pdu
;
/* total length of PDUs */
USIGN16
max_od_index
;
/* max. OD-Index */
USIGN16
no_of_parallel_serv
;
/* number of parallel serv. */
USIGN16
max_od_entries
;
/* max. OD-Entries */
USIGN16
max_od_index
;
/* max. OD-Index */
USIGN8
max_vfd
;
/* max. VFDs */
USIGN16
max_od_entries
;
/* max. OD-Entries */
USIGN8
max_las_entries
;
/* max. no. of LAS entries */
USIGN8
max_vfd
;
/* max. VFDs */
USIGN8
min_tsdr
;
/* min. station delay time */
USIGN8
max_las_entries
;
/* max. no. of LAS entries */
USIGN8
trdy
;
/* ready time */
USIGN8
min_tsdr
;
/* min. station delay time */
USIGN8
tsdi
;
/* station delay initiatior */
USIGN8
trdy
;
/* ready time */
USIGN8
max_tsdr
;
/* station delay responder */
USIGN8
tsdi
;
/* station delay initiatior */
USIGN8
tset
;
/* setup time */
USIGN8
max_tsdr
;
/* station delay responder */
USIGN8
tqui
;
/* quiet time */
USIGN8
tset
;
/* setup time */
USIGN8
supported_data_types
[
4
];
/* supported data types */
USIGN8
tqui
;
/* quiet time */
USIGN8
supported_data_types
[
4
];
/* supported data types */
USIGN8
supported_access_rights
[
3
];
/* supported access rights */
USIGN8
supported_access_rights
[
3
];
/* supported access rights */
USIGN8
supported_var_types
;
/* supported variable types */
USIGN8
supported_var_types
;
/* supported variable types */
USIGN8
special_functions
[
2
];
/* special functions */
USIGN8
special_functions
[
2
];
/* special functions */
USIGN8
max_od_symbol_length
;
/* max length of symbol in OD */
USIGN8
max_od_symbol_length
;
/* max length of symbol in OD */
USIGN8
max_crl_symbol_length
;
/* max length of symbol in CRL */
USIGN8
max_crl_symbol_length
;
/* max length of symbol in CRL */
}
T_CHARACTERISTICS
;
}
T_CHARACTERISTICS
;
#else
#else
typedef
struct
_T_CHARACTERISTICS
{
typedef
struct
_T_CHARACTERISTICS
USIGN8
profile_number
[
2
];
/* profile number */
{
USIGN8
functions_supp
[
3
];
/* functions supported */
USIGN8
profile_number
[
2
];
/* profile number */
USIGN8
dummy1
;
/* alignment byte */
USIGN8
functions_supp
[
3
];
/* functions supported */
USIGN8
max_pdu_len
;
/* max. PDU length */
USIGN8
dummy1
;
/* alignment byte */
USIGN8
dummy2
;
/* alignment byte */
USIGN8
max_pdu_len
;
/* max. PDU length */
USIGN8
fms_features_supp
[
6
];
/* FMS features supported */
USIGN8
dummy2
;
/* alignment byte */
USIGN8
fma7_services_supp
[
6
];
/* FM7 features supported */
USIGN8
fms_features_supp
[
6
];
/* FMS features supported */
USIGN8
max_sap_value
;
/* max. LSAP number */
USIGN8
fma7_services_supp
[
6
];
/* FM7 features supported */
USIGN8
max_no_of_saps
;
/* max. number of LSAPs */
USIGN8
max_sap_value
;
/* max. LSAP number */
USIGN16
max_comref
;
/* max communication reference */
USIGN8
max_no_of_saps
;
/* max. number of LSAPs */
USIGN16
max_kbl_len
;
/* max count of CRL-Entries */
USIGN16
max_comref
;
/* max communication reference */
USIGN32
total_len_of_pdu
;
/* total length of PDUs */
USIGN16
max_kbl_len
;
/* max count of CRL-Entries */
USIGN16
no_of_parallel_serv
;
/* number of parallel serv. */
USIGN32
total_len_of_pdu
;
/* total length of PDUs */
USIGN16
max_ov_index
;
/* max. OD-Index */
USIGN16
no_of_parallel_serv
;
/* number of parallel serv. */
USIGN16
max_ov_entries
;
/* max. OD-Entries */
USIGN16
max_ov_index
;
/* max. OD-Index */
USIGN8
max_vfd
;
/* max. VFDs */
USIGN16
max_ov_entries
;
/* max. OD-Entries */
USIGN8
max_las_entries
;
/* max. no. of LAS entries */
USIGN8
max_vfd
;
/* max. VFDs */
USIGN8
min_tsdr
;
/* min. station delay time */
USIGN8
max_las_entries
;
/* max. no. of LAS entries */
USIGN8
trdy
;
/* ready time */
USIGN8
min_tsdr
;
/* min. station delay time */
USIGN8
tsdi
;
/* station delay initiatior */
USIGN8
trdy
;
/* ready time */
USIGN8
max_tsdr
;
/* station delay responder */
USIGN8
tsdi
;
/* station delay initiatior */
USIGN8
tset
;
/* setup time */
USIGN8
max_tsdr
;
/* station delay responder */
USIGN8
tqui
;
/* quiet time */
USIGN8
tset
;
/* setup time */
USIGN8
supported_data_types
[
4
];
/* supported data types */
USIGN8
tqui
;
/* quiet time */
USIGN8
supported_data_types
[
4
];
/* supported data types */
USIGN8
supported_access_rights
[
3
];
/* supported access rights */
USIGN8
supported_access_rights
[
3
];
/* supported access rights */
USIGN8
supported_var_types
;
/* supported variable types */
USIGN8
supported_var_types
;
/* supported variable types */
USIGN8
special_functions
[
2
];
/* special functions */
USIGN8
special_functions
[
2
];
/* special functions */
USIGN8
max_ov_symbol_length
;
/* max length of symbol in OD */
USIGN8
max_ov_symbol_length
;
/* max length of symbol in OD */
USIGN8
max_kbl_symbol_length
;
/* max length of symbol in CRL */
USIGN8
max_kbl_symbol_length
;
/* max length of symbol in CRL */
}
T_CHARACTERISTICS
;
}
T_CHARACTERISTICS
;
#endif
#endif
typedef
struct
_T_IDENT_CNF
{
typedef
struct
_T_IDENT_CNF
USIGN8
instance_id
;
/* instance ident */
{
USIGN8
dummy
;
/* alignment */
USIGN8
instance_id
;
/* instance ident */
STRINGV
vendor_name
[
MAX_IDENT_STRING_LENGTH
];
/* vendor name */
USIGN8
dummy
;
/* alignment */
STRINGV
vendor_name
[
MAX_IDENT_STRING_LENGTH
];
/* vendor name */
STRINGV
controller_type
[
MAX_IDENT_STRING_LENGTH
];
/* controller type */
STRINGV
controller_type
[
MAX_IDENT_STRING_LENGTH
];
/* controller type */
STRINGV
hw_release
[
MAX_IDENT_STRING_LENGTH
];
/* HW release */
STRINGV
hw_release
[
MAX_IDENT_STRING_LENGTH
];
/* HW release */
STRINGV
sw_release
[
MAX_IDENT_STRING_LENGTH
];
/* SW release */
STRINGV
sw_release
[
MAX_IDENT_STRING_LENGTH
];
/* SW release */
T_CHARACTERISTICS
characteristics
;
T_CHARACTERISTICS
characteristics
;
}
T_IDENT_CNF
;
}
T_IDENT_CNF
;
...
@@ -763,31 +752,35 @@ typedef struct _T_IDENT_CNF {
...
@@ -763,31 +752,35 @@ typedef struct _T_IDENT_CNF {
/* LSAP-Status Service (Local and Remote) */
/* LSAP-Status Service (Local and Remote) */
/****************************************************************************/
/****************************************************************************/
typedef
struct
_T_LSAP_STATUS_REQ
{
typedef
struct
_T_LSAP_STATUS_REQ
USIGN8
lsap
;
/* desired LSAP */
{
USIGN8
lsap
;
/* desired LSAP */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_LSAP_STATUS_REQ
;
}
T_LSAP_STATUS_REQ
;
typedef
struct
_T_LSAP_STATUS_CNF
{
typedef
struct
_T_LSAP_STATUS_CNF
USIGN8
access
;
/* station address or all */
{
USIGN8
access
;
/* station address or all */
USIGN8
addr_extension
;
/* segment number */
USIGN8
addr_extension
;
/* segment number */
USIGN8
sda
;
/* SDA */
USIGN8
sda
;
/* SDA */
USIGN8
sdn
;
/* SDN */
USIGN8
sdn
;
/* SDN */
USIGN8
srd
;
/* SRD */
USIGN8
srd
;
/* SRD */
USIGN8
csrd
;
/* CSRD */
USIGN8
csrd
;
/* CSRD */
}
T_LSAP_STATUS_CNF
;
}
T_LSAP_STATUS_CNF
;
/****************************************************************************/
/****************************************************************************/
/* Get-Live-List Service (Local and Remote) */
/* Get-Live-List Service (Local and Remote) */
/****************************************************************************/
/****************************************************************************/
typedef
struct
_T_LIVE_LIST
{
typedef
struct
_T_LIVE_LIST
{
USIGN8
station
;
/* station number */
USIGN8
station
;
/* station number */
USIGN8
status
;
/* current station of station */
USIGN8
status
;
/* current station of station */
}
T_LIVE_LIST
;
}
T_LIVE_LIST
;
typedef
struct
_T_GET_LIVE_LIST_CNF
{
typedef
struct
_T_GET_LIVE_LIST_CNF
USIGN8
dummy
;
/* alignment */
{
USIGN8
dummy
;
/* alignment */
USIGN8
no_of_elements
;
/* # of live list elements */
USIGN8
no_of_elements
;
/* # of live list elements */
/* T_LIVE_LIST live_list[no_of_elements]; list of live list elements */
/* T_LIVE_LIST live_list[no_of_elements]; list of live list elements */
}
T_GET_LIVE_LIST_CNF
;
}
T_GET_LIVE_LIST_CNF
;
...
@@ -802,12 +795,13 @@ typedef struct _T_GET_LIVE_LIST_CNF {
...
@@ -802,12 +795,13 @@ typedef struct _T_GET_LIVE_LIST_CNF {
/* NOTE: instance identifier see IDENT service ---------------------------- */
/* NOTE: instance identifier see IDENT service ---------------------------- */
/* reason-codes and additional details are defined in PB_ERR.H --- */
/* reason-codes and additional details are defined in PB_ERR.H --- */
typedef
struct
_T_FM7_EVENT_IND
{
typedef
struct
_T_FM7_EVENT_IND
USIGN16
comm_ref
;
/* communication reference */
{
USIGN16
comm_ref
;
/* communication reference */
USIGN8
instance_id
;
/* LLI, FDL, PHY */
USIGN8
instance_id
;
/* LLI, FDL, PHY */
USIGN8
reason
;
/* reason code */
USIGN8
reason
;
/* reason code */
USIGN8
add_detail
;
/* additional detail */
USIGN8
add_detail
;
/* additional detail */
USIGN8
dummy
;
/* alignment */
USIGN8
dummy
;
/* alignment */
}
T_FM7_EVENT_IND
;
}
T_FM7_EVENT_IND
;
#if (PB_VER < 500)
#if (PB_VER < 500)
...
@@ -823,7 +817,8 @@ typedef T_FM7_EVENT_IND T_FMA7_EVENT_IND;
...
@@ -823,7 +817,8 @@ typedef T_FM7_EVENT_IND T_FMA7_EVENT_IND;
/* Set-Configuration Service (only local) */
/* Set-Configuration Service (only local) */
/*****************************************************************************/
/*****************************************************************************/
typedef
struct
T_SET_CONFIGURATION_REQ
{
typedef
struct
T_SET_CONFIGURATION_REQ
{
USIGN16
max_nr_of_fal_msg_buffers
;
/* max # of Layer7-Message-Buffers
USIGN16
max_nr_of_fal_msg_buffers
;
/* max # of Layer7-Message-Buffers
(all CR) */
(all CR) */
USIGN16
max_nr_of_fdl_msg_buffers
;
/* max # of Layer2-Message-Buffers
USIGN16
max_nr_of_fdl_msg_buffers
;
/* max # of Layer2-Message-Buffers
...
@@ -833,7 +828,7 @@ typedef struct T_SET_CONFIGURATION_REQ {
...
@@ -833,7 +828,7 @@ typedef struct T_SET_CONFIGURATION_REQ {
USIGN16
max_nr_of_api_data_buffers
;
/* max # of abort/poll/idle PDU-Buffers
USIGN16
max_nr_of_api_data_buffers
;
/* max # of abort/poll/idle PDU-Buffers
(all CR) */
(all CR) */
USIGN16
USIGN16
max_nr_of_sap_buffers
;
/* max # of SAP-Buffers (all CR) */
max_nr_of_sap_buffers
;
/* max # of SAP-Buffers (all CR) */
USIGN16
max_nr_of_poll_list_entries
;
/* max # of Poll-List-Entries
USIGN16
max_nr_of_poll_list_entries
;
/* max # of Poll-List-Entries
(all CR) */
(all CR) */
USIGN16
max_data_buffer_size
;
/* max size of FMS-/FMA7-PDU-Buffer */
USIGN16
max_data_buffer_size
;
/* max size of FMS-/FMA7-PDU-Buffer */
...
...
profibus/lib/rt/src/pb_fmb.h
View file @
ce758cd3
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************/
/*****************************************************************************/
/* */
/* */
/*
SOFTING AG
*/
/*
SOFTING Industrial Automation GmbH
*/
/* Richard-Reitzner-Allee 6 */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* */
/*
Copyright (C) SOFTING AG 1995-2003
*/
/*
Copyright (C) SOFTING Industrial Automation GmbH 1995-2012
*/
/* All Rights Reserved */
/* All Rights Reserved */
/* */
/* */
/*****************************************************************************/
/*****************************************************************************/
...
@@ -50,8 +15,8 @@
...
@@ -50,8 +15,8 @@
/* */
/* */
/* Filename : PB_FMB.H */
/* Filename : PB_FMB.H */
/* Version : 5.21.0.00.release */
/* Version : 5.21.0.00.release */
/* Date :
27-February-1998
*/
/* Date :
February-1998
*/
/* Author : SOFTING
AG
*/
/* Author : SOFTING
*/
/* */
/* */
/* */
/* */
/* Description : This file contains the types and defines of the Fieldbus- */
/* Description : This file contains the types and defines of the Fieldbus- */
...
@@ -97,25 +62,27 @@
...
@@ -97,25 +62,27 @@
/*****************************************************************************/
/*****************************************************************************/
/* VFD-Configuration ------------------------------------------------------- */
/* VFD-Configuration ------------------------------------------------------- */
typedef
struct
_T_FMB_CONFIG_VFD
{
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.*/
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_name_length
;
/* max. size of OD object name */
USIGN8
max_obj_ext_length
;
/* max. size of OD object extension */
USIGN8
max_obj_ext_length
;
/* max. size of OD object extension */
}
T_FMB_CONFIG_VFD
;
}
T_FMB_CONFIG_VFD
;
/* --- CRL-Configuration --------------------------------------------------- */
/* --- CRL-Configuration --------------------------------------------------- */
typedef
struct
_T_FMB_CONFIG_CRL
{
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_fal_sdbs
;
/* max. number of FAL-SDBs */
USIGN16
max_no_data_buffer
;
/* max. number of PDU buffers */
USIGN16
max_no_fdl_sdbs
;
/* max. number of FDL-SDBs */
USIGN16
max_no_api_buffer
;
/* max. number of API buffers */
USIGN16
max_no_data_buffer
;
/* max. number of PDU buffers */
USIGN16
max_no_poll_entries
;
/* max. number of poll list entries */
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 */
USIGN16
max_no_subscr_entries
;
/* max. number of subscr.list entries */
PB_BOOL
resrc_check
;
/* for future use */
PB_BOOL
resrc_check
;
/* for future use */
USIGN8
max_no_parallel_req
;
/* for future use */
USIGN8
max_no_parallel_req
;
/* for future use */
USIGN8
max_no_parallel_ind
;
/* for future use */
USIGN8
max_no_parallel_ind
;
/* for future use */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_FMB_CONFIG_CRL
;
}
T_FMB_CONFIG_CRL
;
/* Notes on T_FMB_CONFIG_CRL: ------------------------------------------------
/* Notes on T_FMB_CONFIG_CRL: ------------------------------------------------
...
@@ -131,44 +98,48 @@ component 'max_no_parallel_ind' is introduced for future use - for
...
@@ -131,44 +98,48 @@ component 'max_no_parallel_ind' is introduced for future use - for
end of notes on T_FMB_CONFIG_CRL ------------------------------------------ */
end of notes on T_FMB_CONFIG_CRL ------------------------------------------ */
/* DP-Configuration -------------------------------------------------------- */
/* DP-Configuration -------------------------------------------------------- */
typedef
struct
_T_FMB_CONFIG_DP
{
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_number_slaves
;
/* maximum number DP Slaves supported */
USIGN8
max_slave_input_len
;
/* max. length of slave input data */
USIGN8
max_slave_output_len
;
/* max. length of slave output data */
USIGN8
max_slave_diag_len
;
/* max. length of one diag entry */
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_slave_diag_entries
;
/* max. number entries in diag buffer */
USIGN16
max_bus_para_len
;
/* max. length of bus parameter set */
USIGN16
max_bus_para_len
;
/* max. length of bus parameter set */
USIGN16
max_slave_para_len
;
/* max. length of slave parameter set */
USIGN16
max_slave_para_len
;
/* max. length of slave parameter set */
}
T_FMB_CONFIG_DP
;
}
T_FMB_CONFIG_DP
;
/* FDLIF-Configuration ----------------------------------------------------- */
/* FDLIF-Configuration ----------------------------------------------------- */
typedef
struct
_T_FMB_CONFIG_FDLIF
{
typedef
struct
_T_FMB_CONFIG_FDLIF
{
USIGN8
send_req_credits
;
/* max. number of send credits for SDA and SDN
USIGN8
send_req_credits
;
/* max. number of send credits for SDA and SDN
services */
services */
USIGN8
srd_req_credits
;
/* max. number of send credits for SRD services */
USIGN8
srd_req_credits
;
/* max. number of send credits for SRD services */
USIGN8
receive_credits
;
/* max. number of receive credits */
USIGN8
receive_credits
;
/* max. number of receive credits */
USIGN8
max_no_resp_saps
;
/* max. number of FDL responder SAPs */
USIGN8
max_no_resp_saps
;
/* max. number of FDL responder SAPs */
}
T_FMB_CONFIG_FDLIF
;
}
T_FMB_CONFIG_FDLIF
;
/* SM7-Configuration ------------------------------------------------------- */
/* SM7-Configuration ------------------------------------------------------- */
typedef
struct
_T_FMB_CONFIG_SM7
{
typedef
struct
_T_FMB_CONFIG_SM7
{
USIGN16
reserved
;
USIGN16
reserved
;
}
T_FMB_CONFIG_SM7
;
}
T_FMB_CONFIG_SM7
;
/* Fieldbus-Basic-Management-Configuration --------------------------------- */
/* Fieldbus-Basic-Management-Configuration --------------------------------- */
typedef
struct
_T_FMB_SET_CONFIGURATION_REQ
{
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
fms_active
;
/* FMS and FM7 services are usable */
PB_BOOL
fdlif_active
;
/* FDLIF services are usable */
PB_BOOL
dp_active
;
/* DP services are usable */
PB_BOOL
sm7_active
;
/* SM7 services are usable */
PB_BOOL
fdlif_active
;
/* FDLIF services are usable */
USIGN16
fdl_evt_receiver
;
/* receiver of FDL events:
PB_BOOL
sm7_active
;
/* SM7 services are usable */
FMB_USR,FM7_USR,DP_USR,FDLIF_USR */
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 */
USIGN16
data_buffer_length
;
/* max. size of PDU buffer */
T_FMB_CONFIG_VFD
vfd
;
/* VFD configuration parameters */
T_FMB_CONFIG_VFD
vfd
;
/* VFD configuration parameters */
T_FMB_CONFIG_CRL
crl
;
/* CRL configuration parameters */
T_FMB_CONFIG_CRL
crl
;
/* CRL configuration parameters */
T_FMB_CONFIG_DP
dp
;
/* DP configuration parameter */
T_FMB_CONFIG_DP
dp
;
/* DP configuration parameter */
T_FMB_CONFIG_FDLIF
fdlif
;
/* FDLIF configuration parameter */
T_FMB_CONFIG_FDLIF
fdlif
;
/* FDLIF configuration parameter */
T_FMB_CONFIG_SM7
sm7
;
/* SM7 configuration parameters */
T_FMB_CONFIG_SM7
sm7
;
/* SM7 configuration parameters */
}
T_FMB_SET_CONFIGURATION_REQ
;
}
T_FMB_SET_CONFIGURATION_REQ
;
/*****************************************************************************/
/*****************************************************************************/
...
@@ -198,44 +169,46 @@ typedef struct _T_FMB_SET_CONFIGURATION_REQ {
...
@@ -198,44 +169,46 @@ typedef struct _T_FMB_SET_CONFIGURATION_REQ {
#define IN_RING_DESIRED PB_TRUE
#define IN_RING_DESIRED PB_TRUE
#define NOT_IN_RING_DESIRED PB_FALSE
#define NOT_IN_RING_DESIRED PB_FALSE
typedef
struct
_T_FMB_SET_BUSPARAMETER_REQ
{
typedef
struct
_T_FMB_SET_BUSPARAMETER_REQ
USIGN8
loc_add
;
/* local station */
{
USIGN8
loc_segm
;
/* local segment */
USIGN8
loc_add
;
/* local station */
USIGN8
baud_rate
;
/* baud rate */
USIGN8
loc_segm
;
/* local segment */
USIGN8
medium_red
;
/* medium redundancy */
USIGN8
baud_rate
;
/* baud rate */
USIGN16
tsl
;
/* slot time */
USIGN8
medium_red
;
/* medium redundancy */
USIGN16
min_tsdr
;
/* min. station delay time resp. */
USIGN16
tsl
;
/* slot time */
USIGN16
max_tsdr
;
/* max. station delay time resp. */
USIGN16
min_tsdr
;
/* min. station delay time resp. */
USIGN8
tqui
;
/* quiet time */
USIGN16
max_tsdr
;
/* max. station delay time resp. */
USIGN8
tset
;
/* setup time */
USIGN8
tqui
;
/* quiet time */
USIGN32
ttr
;
/* target token rotation time */
USIGN8
tset
;
/* setup time */
USIGN8
g
;
/* gap update factor */
USIGN32
ttr
;
/* target token rotation time */
USIGN8
g
;
/* gap update factor */
PB_BOOL
in_ring_desired
;
/* active or passive station */
PB_BOOL
in_ring_desired
;
/* active or passive station */
USIGN8
hsa
;
/* highest station address */
USIGN8
hsa
;
/* highest station address */
USIGN8
max_retry_limit
;
/* max. retry limit */
USIGN8
max_retry_limit
;
/* max. retry limit */
}
T_FMB_SET_BUSPARAMETER_REQ
;
}
T_FMB_SET_BUSPARAMETER_REQ
;
/*****************************************************************************/
/*****************************************************************************/
/* FMB-Read-FDL-Busparameter */
/* FMB-Read-FDL-Busparameter */
/*****************************************************************************/
/*****************************************************************************/
typedef
struct
_T_FMB_READ_BUSPARAMETER_CNF
{
typedef
struct
_T_FMB_READ_BUSPARAMETER_CNF
USIGN8
loc_add
;
/* local station */
{
USIGN8
loc_segm
;
/* local segment */
USIGN8
loc_add
;
/* local station */
USIGN8
baud_rate
;
/* baud rate */
USIGN8
loc_segm
;
/* local segment */
USIGN8
medium_red
;
/* medium redundancy */
USIGN8
baud_rate
;
/* baud rate */
USIGN16
tsl
;
/* slot time */
USIGN8
medium_red
;
/* medium redundancy */
USIGN16
min_tsdr
;
/* min. station delay time resp. */
USIGN16
tsl
;
/* slot time */
USIGN16
max_tsdr
;
/* max. station delay time resp. */
USIGN16
min_tsdr
;
/* min. station delay time resp. */
USIGN8
tqui
;
/* quiet time */
USIGN16
max_tsdr
;
/* max. station delay time resp. */
USIGN8
tset
;
/* setup time */
USIGN8
tqui
;
/* quiet time */
USIGN32
ttr
;
/* target token rotation time */
USIGN8
tset
;
/* setup time */
USIGN8
g
;
/* gap update factor */
USIGN32
ttr
;
/* target token rotation time */
USIGN8
g
;
/* gap update factor */
PB_BOOL
in_ring_desired
;
/* active or passive station */
PB_BOOL
in_ring_desired
;
/* active or passive station */
USIGN8
hsa
;
/* highest station address */
USIGN8
hsa
;
/* highest station address */
USIGN8
max_retry_limit
;
/* max. retry limit */
USIGN8
max_retry_limit
;
/* max. retry limit */
USIGN16
reserved
;
/* not used */
USIGN16
reserved
;
/* not used */
USIGN8
ident
[
202
];
/* FDL-Ident-String */
USIGN8
ident
[
202
];
/* FDL-Ident-String */
}
T_FMB_READ_BUSPARAMETER_CNF
;
}
T_FMB_READ_BUSPARAMETER_CNF
;
/*****************************************************************************/
/*****************************************************************************/
...
@@ -271,8 +244,9 @@ typedef struct _T_FMB_READ_BUSPARAMETER_CNF {
...
@@ -271,8 +244,9 @@ typedef struct _T_FMB_READ_BUSPARAMETER_CNF {
#endif
#endif
typedef
struct
_T_FMB_SET_VALUE_REQ
{
typedef
struct
_T_FMB_SET_VALUE_REQ
USIGN8
id
;
/* value identifier */
{
USIGN8
id
;
/* value identifier */
USIGN8
length
;
/* # of values in byte */
USIGN8
length
;
/* # of values in byte */
/* USIGN8 value[length]; list of values */
/* USIGN8 value[length]; list of values */
}
T_FMB_SET_VALUE_REQ
;
}
T_FMB_SET_VALUE_REQ
;
...
@@ -281,13 +255,15 @@ typedef struct _T_FMB_SET_VALUE_REQ {
...
@@ -281,13 +255,15 @@ typedef struct _T_FMB_SET_VALUE_REQ {
/* FMB-Read-Value Service */
/* FMB-Read-Value Service */
/*****************************************************************************/
/*****************************************************************************/
typedef
struct
_T_FMB_READ_VALUE_REQ
{
typedef
struct
_T_FMB_READ_VALUE_REQ
USIGN8
id
;
/* value identifier */
{
USIGN8
id
;
/* value identifier */
USIGN8
dummy
;
/* alignment */
USIGN8
dummy
;
/* alignment */
}
T_FMB_READ_VALUE_REQ
;
}
T_FMB_READ_VALUE_REQ
;
typedef
struct
_T_FMB_READ_VALUE_CNF
{
typedef
struct
_T_FMB_READ_VALUE_CNF
USIGN8
id
;
/* value identifier */
{
USIGN8
id
;
/* value identifier */
USIGN8
length
;
/* # of values in byte */
USIGN8
length
;
/* # of values in byte */
/* USIGN8 value[length]; list of values */
/* USIGN8 value[length]; list of values */
}
T_FMB_READ_VALUE_CNF
;
}
T_FMB_READ_VALUE_CNF
;
...
@@ -296,27 +272,30 @@ typedef struct _T_FMB_READ_VALUE_CNF {
...
@@ -296,27 +272,30 @@ typedef struct _T_FMB_READ_VALUE_CNF {
/* FMB-LSAP-Status Service */
/* FMB-LSAP-Status Service */
/*****************************************************************************/
/*****************************************************************************/
typedef
struct
_T_FMB_LSAP_STATUS_REQ
{
typedef
struct
_T_FMB_LSAP_STATUS_REQ
USIGN8
lsap
;
/* desired LSAP */
{
USIGN8
lsap
;
/* desired LSAP */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_FMB_LSAP_STATUS_REQ
;
}
T_FMB_LSAP_STATUS_REQ
;
typedef
struct
_T_FMB_LSAP_STATUS_CNF
{
typedef
struct
_T_FMB_LSAP_STATUS_CNF
USIGN8
access
;
/* station address or all */
{
USIGN8
access
;
/* station address or all */
USIGN8
addr_extension
;
/* segment number */
USIGN8
addr_extension
;
/* segment number */
USIGN8
sda
;
/* SDA */
USIGN8
sda
;
/* SDA */
USIGN8
sdn
;
/* SDN */
USIGN8
sdn
;
/* SDN */
USIGN8
srd
;
/* SRD */
USIGN8
srd
;
/* SRD */
USIGN8
csrd
;
/* CSRD */
USIGN8
csrd
;
/* CSRD */
}
T_FMB_LSAP_STATUS_CNF
;
}
T_FMB_LSAP_STATUS_CNF
;
/*****************************************************************************/
/*****************************************************************************/
/* FMB-Validate-Master Service */
/* FMB-Validate-Master Service */
/*****************************************************************************/
/*****************************************************************************/
typedef
struct
_T_FMB_VALIDATE_MASTER_REQ
{
typedef
struct
_T_FMB_VALIDATE_MASTER_REQ
{
USIGN8
rem_add
;
/* desired remote station */
USIGN8
rem_add
;
/* desired remote station */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_FMB_VALIDATE_MASTER_REQ
;
}
T_FMB_VALIDATE_MASTER_REQ
;
/*****************************************************************************/
/*****************************************************************************/
...
@@ -328,13 +307,15 @@ typedef struct _T_FMB_VALIDATE_MASTER_REQ {
...
@@ -328,13 +307,15 @@ typedef struct _T_FMB_VALIDATE_MASTER_REQ {
#define ACTIVE_READY 0x02
#define ACTIVE_READY 0x02
#define ACTIVE_IN_RING 0x03
#define ACTIVE_IN_RING 0x03
typedef
struct
_T_FMB_LIVE_LIST
{
typedef
struct
_T_FMB_LIVE_LIST
{
USIGN8
station
;
/* station number */
USIGN8
station
;
/* station number */
USIGN8
status
;
/* current station of station */
USIGN8
status
;
/* current station of station */
}
T_FMB_LIVE_LIST
;
}
T_FMB_LIVE_LIST
;
typedef
struct
_T_FMB_GET_LIVE_LIST_CNF
{
typedef
struct
_T_FMB_GET_LIVE_LIST_CNF
USIGN8
dummy
;
/* alignment */
{
USIGN8
dummy
;
/* alignment */
USIGN8
no_of_elements
;
/* # of live list elements */
USIGN8
no_of_elements
;
/* # of live list elements */
/* T_FMB_LIVE_LIST live_list[no_of_elements]; list of live list elements
/* T_FMB_LIVE_LIST live_list[no_of_elements]; list of live list elements
*/
*/
...
@@ -344,18 +325,19 @@ typedef struct _T_FMB_GET_LIVE_LIST_CNF {
...
@@ -344,18 +325,19 @@ typedef struct _T_FMB_GET_LIVE_LIST_CNF {
/* FMB-Event-Management */
/* FMB-Event-Management */
/****************************************************************************/
/****************************************************************************/
#define FM2_FAULT_ADDRESS 0x01
/* duplicate address recognized */
#define FM2_FAULT_ADDRESS 0x01
/* duplicate address recognized */
#define FM2_FAULT_PHY 0x02
/* phys.layer is malfunctioning */
#define FM2_FAULT_PHY 0x02
/* phys.layer is malfunctioning */
#define FM2_FAULT_TTO 0x03
/* time out on bus detected */
#define FM2_FAULT_TTO 0x03
/* time out on bus detected */
#define FM2_FAULT_SYN 0x04
/* no receiver synchronization */
#define FM2_FAULT_SYN 0x04
/* no receiver synchronization */
#define FM2_FAULT_OUT_OF_RING 0x05
/* station out of ring */
#define FM2_FAULT_OUT_OF_RING 0x05
/* station out of ring */
#define FM2_GAP_EVENT 0x06
/* new station in ring */
#define FM2_GAP_EVENT 0x06
/* new station in ring */
/* Additional FM2-Events (Error messages from ASPC2) ---------------------- */
/* Additional FM2-Events (Error messages from ASPC2) ---------------------- */
#define FM2_MAC_ERROR 0x13
/* fatal MAC error */
#define FM2_MAC_ERROR 0x13
/* fatal MAC error */
#define FM2_HW_ERROR 0x14
/* fatal HW error */
#define FM2_HW_ERROR 0x14
/* fatal HW error */
typedef
struct
_T_FMB_FM2_EVENT_IND
{
typedef
struct
_T_FMB_FM2_EVENT_IND
{
USIGN16
reason
;
/* reason code */
USIGN16
reason
;
/* reason code */
}
T_FMB_FM2_EVENT_IND
;
}
T_FMB_FM2_EVENT_IND
;
...
...
profibus/lib/rt/src/pb_fms.h
View file @
ce758cd3
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************/
/*****************************************************************************/
/* */
/* */
/*
SOFTING AG
*/
/*
SOFTING Industrial Automation GmbH
*/
/* Richard-Reitzner-Allee 6 */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* */
/*
Copyright (C) SOFTING AG 1995-2003
*/
/*
Copyright (C) SOFTING Industrial Automation GmbH 1995-2012
*/
/* All Rights Reserved */
/* All Rights Reserved */
/* */
/* */
/*****************************************************************************/
/*****************************************************************************/
...
@@ -50,8 +15,8 @@
...
@@ -50,8 +15,8 @@
/* */
/* */
/* Filename : PB_FMS.H */
/* Filename : PB_FMS.H */
/* Version : 5.21.0.00.release */
/* Version : 5.21.0.00.release */
/* Date :
27-February-1998
*/
/* Date :
February-1998
*/
/* Author : SOFTING
AG
*/
/* Author : SOFTING
*/
/* */
/* */
/* Description : This file contains the types and defines of the FMS-User- */
/* Description : This file contains the types and defines of the FMS-User- */
/* Interface */
/* Interface */
...
@@ -217,31 +182,31 @@
...
@@ -217,31 +182,31 @@
/* --- codes for object access mode, to be used as tag in T_ACC_SPEC-------- */
/* --- codes for object access mode, to be used as tag in T_ACC_SPEC-------- */
/* --- fixed size ---------------------------------------------------------- */
/* --- fixed size ---------------------------------------------------------- */
#define ACCESS_INDEX 0
/* access by index */
#define ACCESS_INDEX 0
/* access by index */
#define ACCESS_NAME 1
/* acess by name */
#define ACCESS_NAME 1
/* acess by name */
#define ACCESS_NAME_LIST 2
/* acess by name list */
#define ACCESS_NAME_LIST 2
/* acess by name list */
/* --- codes for object access mode, to be used as tag in T_DYN_ACC_SPEC --- */
/* --- codes for object access mode, to be used as tag in T_DYN_ACC_SPEC --- */
/* --- dynamic size -------------------------------------------------------- */
/* --- dynamic size -------------------------------------------------------- */
#define DYN_ACCESS_INDEX 3
/* access by index */
#define DYN_ACCESS_INDEX 3
/* access by index */
#define DYN_ACCESS_NAME 4
/* acess by name */
#define DYN_ACCESS_NAME 4
/* acess by name */
/* --- codes for named access specification, to be used for od services only */
/* --- codes for named access specification, to be used for od services only */
/* --- fixed size ---------------------------------------------------------- */
/* --- fixed size ---------------------------------------------------------- */
#define INDEX_ACCESS 1
/* access by index */
#define INDEX_ACCESS 1
/* access by index */
#define VAR_NAME_ACCESS 2
/* access by variable name */
#define VAR_NAME_ACCESS 2
/* access by variable name */
#define VAR_LIST_NAME_ACCESS 3
/* access by variable list name */
#define VAR_LIST_NAME_ACCESS 3
/* access by variable list name */
#define DOMAIN_NAME_ACCESS 4
/* access by domain name */
#define DOMAIN_NAME_ACCESS 4
/* access by domain name */
#define PI_NAME_ACCESS 5
/* access by pi name */
#define PI_NAME_ACCESS 5
/* access by pi name */
#define EVENT_NAME_ACCESS 6
/* access by event name */
#define EVENT_NAME_ACCESS 6
/* access by event name */
#define START_INDEX_ACCESS 7
/* access by start index */
#define START_INDEX_ACCESS 7
/* access by start index */
/*****************************************************************************/
/*****************************************************************************/
/************* FMS CONTEXT MANAGEMENT *********************/
/************* FMS CONTEXT MANAGEMENT *********************/
/*****************************************************************************/
/*****************************************************************************/
#define DETAIL_LENGTH 16
/* length of abort detail */
#define DETAIL_LENGTH 16
/* length of abort detail */
#define FEAT_SUPP_LEN 6
/* length of supp. feat. field */
#define FEAT_SUPP_LEN 6
/* length of supp. feat. field */
/*****************************************************************************/
/*****************************************************************************/
/************* VFD SUPPORT MANAGEMENT *********************/
/************* VFD SUPPORT MANAGEMENT *********************/
...
@@ -310,20 +275,20 @@
...
@@ -310,20 +275,20 @@
#endif
#endif
/* --- codes of FMS objects ------------------------------------------------ */
/* --- codes of FMS objects ------------------------------------------------ */
#define NULL_OBJECT 0
/* null object */
#define NULL_OBJECT 0
/* null object */
#define OD_OBJECT 1
/* OD object */
#define OD_OBJECT 1
/* OD object */
#define OV_OBJECT 1
/* OD object */
#define OV_OBJECT 1
/* OD object */
#define DOMAIN_OBJECT 2
/* domain object */
#define DOMAIN_OBJECT 2
/* domain object */
#define INVOCATION_OBJECT 3
/* program invocation object */
#define INVOCATION_OBJECT 3
/* program invocation object */
#define EVENT_OBJECT 4
/* event object */
#define EVENT_OBJECT 4
/* event object */
#define TYPE_OBJECT 5
/* basic data type description */
#define TYPE_OBJECT 5
/* basic data type description */
#define TYPE_STRUCT_OBJECT 6
/* structured data type descript.*/
#define TYPE_STRUCT_OBJECT 6
/* structured data type descript.*/
#define SIMPLE_VAR_OBJECT 7
/* simple variable object */
#define SIMPLE_VAR_OBJECT 7
/* simple variable object */
#define ARRAY_OBJECT 8
/* array object */
#define ARRAY_OBJECT 8
/* array object */
#define RECORD_OBJECT 9
/* record object */
#define RECORD_OBJECT 9
/* record object */
#define VAR_LIST_OBJECT 10
/* variable list object */
#define VAR_LIST_OBJECT 10
/* variable list object */
#define VAR_OBJECT 11
/* class of all variable objects */
#define VAR_OBJECT 11
/* class of all variable objects */
#define ALL_OBJECT 12
/* super class of all objects */
#define ALL_OBJECT 12
/* super class of all objects */
/* --- OD loading selection -------------------------------------------------*/
/* --- OD loading selection -------------------------------------------------*/
#define CONSEQUENCE_0 0
#define CONSEQUENCE_0 0
...
@@ -408,8 +373,9 @@
...
@@ -408,8 +373,9 @@
/************* ACCESS CONTROL *********************/
/************* ACCESS CONTROL *********************/
/*****************************************************************************/
/*****************************************************************************/
typedef
struct
_T_ACCESS
{
typedef
struct
_T_ACCESS
USIGN8
pass_word
;
/* password */
{
USIGN8
pass_word
;
/* password */
USIGN8
acc_groups
;
/* access groups */
USIGN8
acc_groups
;
/* access groups */
USIGN16
acc_right
;
/* access rights */
USIGN16
acc_right
;
/* access rights */
}
T_ACCESS
;
}
T_ACCESS
;
...
@@ -419,19 +385,21 @@ typedef struct _T_ACCESS {
...
@@ -419,19 +385,21 @@ typedef struct _T_ACCESS {
/*****************************************************************************/
/*****************************************************************************/
/* --- standard access specification data structure (fixed size) ----------- */
/* --- standard access specification data structure (fixed size) ----------- */
typedef
struct
_T_ACC_SPEC
{
typedef
struct
_T_ACC_SPEC
USIGN8
tag
;
/* id of the access specification */
{
USIGN8
tag
;
/* id of the access specification */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
union
{
union
{
USIGN16
index
;
/* access by index */
USIGN16
index
;
/* access by index */
STRINGV
name
[
MAX_ACCESS_NAME_LENGTH
];
/* access by symbolic name */
STRINGV
name
[
MAX_ACCESS_NAME_LENGTH
];
/* access by symbolic name */
}
id
;
}
id
;
}
T_ACC_SPEC
;
}
T_ACC_SPEC
;
/* --- dynamic access specification data structure (used in T_PI_CR8_REQ
/* --- dynamic access specification data structure (used in T_PI_CR8_REQ
and in T_VAR_DEFINE_VAR_LIST_REQ data structure (dynamic size) ----- */
and in T_VAR_DEFINE_VAR_LIST_REQ data structure (dynamic size) ----- */
typedef
struct
_T_DYN_ACC_SPEC
{
typedef
struct
_T_DYN_ACC_SPEC
USIGN8
tag
;
/* id of the access specification */
{
USIGN8
tag
;
/* id of the access specification */
USIGN8
length
;
/* length of access specification */
USIGN8
length
;
/* length of access specification */
/* USIGN8 acc_spec[length] access specification (index / name)
/* USIGN8 acc_spec[length] access specification (index / name)
*/
*/
...
@@ -442,83 +410,92 @@ typedef struct _T_DYN_ACC_SPEC {
...
@@ -442,83 +410,92 @@ typedef struct _T_DYN_ACC_SPEC {
/*****************************************************************************/
/*****************************************************************************/
/* --- Initiate-Service -----------------------------------------------------*/
/* --- Initiate-Service -----------------------------------------------------*/
typedef
struct
_T_CTXT_INIT_REQ
{
typedef
struct
_T_CTXT_INIT_REQ
{
USIGN8
profile_number
[
2
];
/* profile number */
USIGN8
profile_number
[
2
];
/* profile number */
PB_BOOL
protection
;
/* access protection */
PB_BOOL
protection
;
/* access protection */
USIGN8
password
;
/* password */
USIGN8
password
;
/* password */
USIGN8
access_groups
;
/* access groups */
USIGN8
access_groups
;
/* access groups */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
INT16
od_version
;
/* od version */
INT16
od_version
;
/* od version */
USIGN8
snd_len_h
;
/* max pdu size to send (high prio) */
USIGN8
snd_len_h
;
/* max pdu size to send (high prio) */
USIGN8
snd_len_l
;
/* max pdu size to send (low prio) */
USIGN8
snd_len_l
;
/* max pdu size to send (low prio) */
USIGN8
rcv_len_h
;
/* max pdu size to receive (high) */
USIGN8
rcv_len_h
;
/* max pdu size to receive (high) */
USIGN8
rcv_len_l
;
/* max pdu size to receive (low) */
USIGN8
rcv_len_l
;
/* max pdu size to receive (low) */
USIGN8
supported_features
[
FEAT_SUPP_LEN
];
/* supported features */
USIGN8
supported_features
[
FEAT_SUPP_LEN
];
/* supported features */
}
T_CTXT_INIT_REQ
;
}
T_CTXT_INIT_REQ
;
typedef
struct
_T_CTXT_INIT_CNF
{
typedef
struct
_T_CTXT_INIT_CNF
{
USIGN8
profile_number
[
2
];
/* profile number */
USIGN8
profile_number
[
2
];
/* profile number */
INT16
od_version
;
/* od version */
INT16
od_version
;
/* od version */
PB_BOOL
protection
;
/* access protection */
PB_BOOL
protection
;
/* access protection */
USIGN8
password
;
/* password */
USIGN8
password
;
/* password */
USIGN8
access_groups
;
/* access groups */
USIGN8
access_groups
;
/* access groups */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_CTXT_INIT_CNF
;
}
T_CTXT_INIT_CNF
;
typedef
struct
_T_CTXT_INIT_ERR_CNF
{
typedef
struct
_T_CTXT_INIT_ERR_CNF
{
USIGN16
class_code
;
/* error class, error code */
USIGN16
class_code
;
/* error class, error code */
USIGN8
snd_len_h
;
/* max pdu size to send (high prio) */
USIGN8
snd_len_h
;
/* max pdu size to send (high prio) */
USIGN8
snd_len_l
;
/* max pdu size to send (low prio) */
USIGN8
snd_len_l
;
/* max pdu size to send (low prio) */
USIGN8
rcv_len_h
;
/* max pdu size to receive (high) */
USIGN8
rcv_len_h
;
/* max pdu size to receive (high) */
USIGN8
rcv_len_l
;
/* max pdu size to receive (low) */
USIGN8
rcv_len_l
;
/* max pdu size to receive (low) */
USIGN8
supported_features
[
FEAT_SUPP_LEN
];
/* supported features */
USIGN8
supported_features
[
FEAT_SUPP_LEN
];
/* supported features */
}
T_CTXT_INIT_ERR_CNF
;
}
T_CTXT_INIT_ERR_CNF
;
/*--- abort service ---------------------------------------------------------*/
/*--- abort service ---------------------------------------------------------*/
typedef
struct
_T_CTXT_ABORT_REQ
{
typedef
struct
_T_CTXT_ABORT_REQ
PB_BOOL
local
;
/* local or remote detected */
{
USIGN8
abort_id
;
/* abort identifier USR, FMS, ... */
PB_BOOL
local
;
/* local or remote detected */
USIGN8
reason
;
/* abort reason code */
USIGN8
abort_id
;
/* abort identifier USR, FMS, ... */
USIGN8
detail_length
;
/* length of abort detail */
USIGN8
reason
;
/* abort reason code */
USIGN8
detail_length
;
/* length of abort detail */
USIGN8
detail
[
DETAIL_LENGTH
];
/* detail information */
USIGN8
detail
[
DETAIL_LENGTH
];
/* detail information */
}
T_CTXT_ABORT_REQ
;
}
T_CTXT_ABORT_REQ
;
/*--- reject service --------------------------------------------------------*/
/*--- reject service --------------------------------------------------------*/
typedef
struct
_T_CTXT_REJECT_IND
{
typedef
struct
_T_CTXT_REJECT_IND
{
PB_BOOL
detected_here
;
/* local or remote detected */
PB_BOOL
detected_here
;
/* local or remote detected */
USIGN8
orig_invoke_id
;
/* original invoke ID */
USIGN8
orig_invoke_id
;
/* original invoke ID */
USIGN8
pdu_type
;
/* reject PDU types */
USIGN8
pdu_type
;
/* reject PDU types */
USIGN8
reject_code
;
/* reject code */
USIGN8
reject_code
;
/* reject code */
}
T_CTXT_REJECT_IND
;
}
T_CTXT_REJECT_IND
;
/*****************************************************************************/
/*****************************************************************************/
/************* VARIABLE ACCESS MANAGEMENT *********************/
/************* VARIABLE ACCESS MANAGEMENT *********************/
/*****************************************************************************/
/*****************************************************************************/
typedef
struct
_T_SIMPLE_TYPE
{
typedef
struct
_T_SIMPLE_TYPE
{
USIGN16
data_type_index
;
/* index of data type */
USIGN16
data_type_index
;
/* index of data type */
USIGN8
length
;
/* size of data type */
USIGN8
length
;
/* size of data type */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_SIMPLE_TYPE
;
}
T_SIMPLE_TYPE
;
typedef
struct
_T_ARRAY_TYPE
{
typedef
struct
_T_ARRAY_TYPE
{
USIGN16
data_type_index
;
/* index of data type */
USIGN16
data_type_index
;
/* index of data type */
USIGN8
length
;
/* size of data type */
USIGN8
length
;
/* size of data type */
USIGN8
no_of_elements
;
/* number of data types */
USIGN8
no_of_elements
;
/* number of data types */
}
T_ARRAY_TYPE
;
}
T_ARRAY_TYPE
;
typedef
struct
_T_RECORD_TYPE
{
typedef
struct
_T_RECORD_TYPE
USIGN8
no_of_elements
;
/* number of record elem. */
{
USIGN8
dummy
;
/* alignment byte */
USIGN8
no_of_elements
;
/* number of record elem. */
USIGN8
dummy
;
/* alignment byte */
T_SIMPLE_TYPE
simple
[
MAX_VAR_RECORD_ELEMENTS
];
/* list of simple types */
T_SIMPLE_TYPE
simple
[
MAX_VAR_RECORD_ELEMENTS
];
/* list of simple types */
}
T_RECORD_TYPE
;
}
T_RECORD_TYPE
;
typedef
struct
_T_TYPE_DESCR
{
typedef
struct
_T_TYPE_DESCR
USIGN8
tag
;
/* type description identifier */
{
USIGN8
tag
;
/* type description identifier */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
union
{
union
{
T_SIMPLE_TYPE
simple
;
/* simple type */
T_SIMPLE_TYPE
simple
;
/* simple type */
T_ARRAY_TYPE
array
;
/* array type */
T_ARRAY_TYPE
array
;
/* array type */
T_RECORD_TYPE
record
;
/* record type */
T_RECORD_TYPE
record
;
/* record type */
}
id
;
}
id
;
}
T_TYPE_DESCR
;
}
T_TYPE_DESCR
;
...
@@ -528,86 +505,94 @@ typedef struct _T_TYPE_DESCR {
...
@@ -528,86 +505,94 @@ typedef struct _T_TYPE_DESCR {
/*--- Simple-Variable-Object-Description
/*--- Simple-Variable-Object-Description
* ------------------------------------------*/
* ------------------------------------------*/
typedef
struct
_T_SIMPLE_VAR_OBJECT
{
typedef
struct
_T_SIMPLE_VAR_OBJECT
USIGN16
index
;
/* logical address of the object */
{
USIGN8
obj_code
;
/* object code */
USIGN16
index
;
/* logical address of the object */
USIGN8
length
;
/* length of object in octets */
USIGN8
obj_code
;
/* object code */
USIGN16
index_of_type
;
/* logical address of the type */
USIGN8
length
;
/* length of object in octets */
T_ACCESS
access
;
/* access right structure */
USIGN16
index_of_type
;
/* logical address of the type */
USIGN32
local_address
;
/* local address */
T_ACCESS
access
;
/* access right structure */
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* name */
USIGN32
local_address
;
/* local address */
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* name */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
}
T_SIMPLE_VAR_OBJECT
;
}
T_SIMPLE_VAR_OBJECT
;
/*--- Array-Variable-Object-Description
/*--- Array-Variable-Object-Description
* -------------------------------------------*/
* -------------------------------------------*/
typedef
struct
_T_ARRAY_OBJECT
{
typedef
struct
_T_ARRAY_OBJECT
USIGN16
index
;
/* logical address of the object */
{
USIGN8
obj_code
;
/* object code */
USIGN16
index
;
/* logical address of the object */
USIGN8
length
;
/* length of an element in octets */
USIGN8
obj_code
;
/* object code */
USIGN16
index_of_type
;
/* logical address of the type */
USIGN8
length
;
/* length of an element in octets */
USIGN8
nof_elements
;
/* number of array elements */
USIGN16
index_of_type
;
/* logical address of the type */
USIGN8
dummy
;
/* alignment byte */
USIGN8
nof_elements
;
/* number of array elements */
T_ACCESS
access
;
/* access right structure */
USIGN8
dummy
;
/* alignment byte */
USIGN32
local_address
;
/* local address */
T_ACCESS
access
;
/* access right structure */
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* name */
USIGN32
local_address
;
/* local address */
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* name */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
}
T_ARRAY_OBJECT
;
}
T_ARRAY_OBJECT
;
/*--- Record-Variable-Object-Description
/*--- Record-Variable-Object-Description
* ------------------------------------------*/
* ------------------------------------------*/
typedef
struct
_T_RECORD_OBJECT
{
typedef
struct
_T_RECORD_OBJECT
USIGN16
index
;
/* index */
{
USIGN8
obj_code
;
/* object code */
USIGN16
index
;
/* index */
USIGN8
no_of_address
;
/* number of local address */
USIGN8
obj_code
;
/* object code */
USIGN16
index_of_type
;
/* logical address of the type */
USIGN8
no_of_address
;
/* number of local address */
T_ACCESS
access
;
/* access right structure */
USIGN16
index_of_type
;
/* logical address of the type */
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* name */
T_ACCESS
access
;
/* access right structure */
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* name */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
USIGN32
reserved
;
/* for internal use */
USIGN32
reserved
;
/* for internal use */
/* USIGN32 local_address_list[no_of_address]; local address list */
/* USIGN32 local_address_list[no_of_address]; local address list */
}
T_RECORD_OBJECT
;
}
T_RECORD_OBJECT
;
/*--- Variable-List-Object-Description
/*--- Variable-List-Object-Description
* --------------------------------------------*/
* --------------------------------------------*/
typedef
struct
_T_VAR_LIST_OBJECT
{
typedef
struct
_T_VAR_LIST_OBJECT
USIGN16
index
;
/* logical address of the object */
{
USIGN8
obj_code
;
/* object code */
USIGN16
index
;
/* logical address of the object */
USIGN8
no_of_var
;
/* number of variables */
USIGN8
obj_code
;
/* object code */
T_ACCESS
access
;
/* access right */
USIGN8
no_of_var
;
/* number of variables */
PB_BOOL
deletable
;
/* TRUE - deletable; else FALSE */
T_ACCESS
access
;
/* access right */
USIGN8
dummy
;
/* alignment-byte */
PB_BOOL
deletable
;
/* TRUE - deletable; else FALSE */
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* name */
USIGN8
dummy
;
/* alignment-byte */
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* name */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
USIGN32
reserved
;
/* for internal use */
USIGN32
reserved
;
/* for internal use */
/* USIGN16 var_list[no_of_var]; list of variables */
/* USIGN16 var_list[no_of_var]; list of variables */
}
T_VAR_LIST_OBJECT
;
}
T_VAR_LIST_OBJECT
;
/* --- Read-Service
/* --- Read-Service
* ---------------------------------------------------------------*/
* ---------------------------------------------------------------*/
typedef
struct
_T_VAR_READ_REQ
{
typedef
struct
_T_VAR_READ_REQ
{
T_ACC_SPEC
acc_spec
;
/* access specification */
T_ACC_SPEC
acc_spec
;
/* access specification */
USIGN8
subindex
;
/* subindex */
USIGN8
subindex
;
/* subindex */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_VAR_READ_REQ
;
}
T_VAR_READ_REQ
;
typedef
struct
_T_VAR_READ_CNF
{
typedef
struct
_T_VAR_READ_CNF
USIGN8
dummy
;
/* alignment byte */
{
USIGN8
dummy
;
/* alignment byte */
USIGN8
length
;
/* length of values in bytes */
USIGN8
length
;
/* length of values in bytes */
/* USIGN8 value[lenght]; list of data */
/* USIGN8 value[lenght]; list of data */
}
T_VAR_READ_CNF
;
}
T_VAR_READ_CNF
;
/*--- Read-With-Type-Service
/*--- Read-With-Type-Service
* ------------------------------------------------------*/
* ------------------------------------------------------*/
typedef
struct
_T_VAR_READ_WITH_TYPE_REQ
{
typedef
struct
_T_VAR_READ_WITH_TYPE_REQ
{
T_ACC_SPEC
acc_spec
;
/* access specification */
T_ACC_SPEC
acc_spec
;
/* access specification */
USIGN8
subindex
;
/* subindex */
USIGN8
subindex
;
/* subindex */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_VAR_READ_WITH_TYPE_REQ
;
}
T_VAR_READ_WITH_TYPE_REQ
;
typedef
struct
_T_VAR_READ_WITH_TYPE_CNF
{
typedef
struct
_T_VAR_READ_WITH_TYPE_CNF
{
USIGN8
no_of_type_descr
;
/* number of typedescription */
USIGN8
no_of_type_descr
;
/* number of typedescription */
USIGN8
length
;
/* # of values in bytes */
USIGN8
length
;
/* # of values in bytes */
/* T_TYPE_DESCR type_descr_list[no_of_type_descr]; list of type
/* T_TYPE_DESCR type_descr_list[no_of_type_descr]; list of type
* description */
* description */
/* USIGN8 value[length]; list of data */
/* USIGN8 value[length]; list of data */
...
@@ -615,21 +600,23 @@ typedef struct _T_VAR_READ_WITH_TYPE_CNF {
...
@@ -615,21 +600,23 @@ typedef struct _T_VAR_READ_WITH_TYPE_CNF {
/*--- Write-Service
/*--- Write-Service
* ---------------------------------------------------------------*/
* ---------------------------------------------------------------*/
typedef
struct
_T_VAR_WRITE_REQ
{
typedef
struct
_T_VAR_WRITE_REQ
{
T_ACC_SPEC
acc_spec
;
/* access specification */
T_ACC_SPEC
acc_spec
;
/* access specification */
USIGN8
subindex
;
/* subindex */
USIGN8
subindex
;
/* subindex */
USIGN8
length
;
/* # number of values in bytes */
USIGN8
length
;
/* # number of values in bytes */
/* USIGN8 value[length]; list of values */
/* USIGN8 value[length]; list of values */
}
T_VAR_WRITE_REQ
;
}
T_VAR_WRITE_REQ
;
/*--- Write-With-Type-Service
/*--- Write-With-Type-Service
* -----------------------------------------------------*/
* -----------------------------------------------------*/
typedef
struct
_T_VAR_WRITE_WITH_TYPE_REQ
{
typedef
struct
_T_VAR_WRITE_WITH_TYPE_REQ
T_ACC_SPEC
acc_spec
;
/* access specification */
{
USIGN8
subindex
;
/* subindex */
T_ACC_SPEC
acc_spec
;
/* access specification */
USIGN8
dummy
;
/* alignment byte */
USIGN8
subindex
;
/* subindex */
USIGN8
dummy
;
/* alignment byte */
USIGN8
no_of_type_descr
;
/* number of type descriptions */
USIGN8
no_of_type_descr
;
/* number of type descriptions */
USIGN8
length
;
/* # of values in bytes */
USIGN8
length
;
/* # of values in bytes */
/* T_TYPE_DESCR type_descr_list[no_of_type_descr]; list of type
/* T_TYPE_DESCR type_descr_list[no_of_type_descr]; list of type
* descriptions */
* descriptions */
/* USIGN8 value[length]; list of datas */
/* USIGN8 value[length]; list of datas */
...
@@ -637,23 +624,25 @@ typedef struct _T_VAR_WRITE_WITH_TYPE_REQ {
...
@@ -637,23 +624,25 @@ typedef struct _T_VAR_WRITE_WITH_TYPE_REQ {
/*--- Information-Report-Service
/*--- Information-Report-Service
* --------------------------------------------------*/
* --------------------------------------------------*/
typedef
struct
_T_VAR_INFO_RPT_REQ
{
typedef
struct
_T_VAR_INFO_RPT_REQ
USIGN8
priority
;
/* priority */
{
USIGN8
subindex
;
/* subindex */
USIGN8
priority
;
/* priority */
USIGN8
subindex
;
/* subindex */
T_ACC_SPEC
acc_spec
;
/* access specification */
T_ACC_SPEC
acc_spec
;
/* access specification */
USIGN8
dummy
;
/* alignment-byte */
USIGN8
dummy
;
/* alignment-byte */
USIGN8
length
;
/* # of values in bytes */
USIGN8
length
;
/* # of values in bytes */
/* USIGN8 value[length]; list of data */
/* USIGN8 value[length]; list of data */
}
T_VAR_INFO_RPT_REQ
;
}
T_VAR_INFO_RPT_REQ
;
/*--- Information-Report-With-Type-Service
/*--- Information-Report-With-Type-Service
* ----------------------------------------*/
* ----------------------------------------*/
typedef
struct
_T_VAR_INFO_RPT_WITH_TYPE_REQ
{
typedef
struct
_T_VAR_INFO_RPT_WITH_TYPE_REQ
USIGN8
priority
;
/* priority */
{
USIGN8
subindex
;
/* subindex */
USIGN8
priority
;
/* priority */
T_ACC_SPEC
acc_spec
;
/* access specification */
USIGN8
subindex
;
/* subindex */
T_ACC_SPEC
acc_spec
;
/* access specification */
USIGN8
no_of_type_descr
;
/* number of typedescription */
USIGN8
no_of_type_descr
;
/* number of typedescription */
USIGN8
length
;
/* # of values in bytes */
USIGN8
length
;
/* # of values in bytes */
/* T_TYPE_DESCR type_descr_list[no_of_type_descr]; list of type
/* T_TYPE_DESCR type_descr_list[no_of_type_descr]; list of type
* description */
* description */
/* USIGN8 value[length]; list of data */
/* USIGN8 value[length]; list of data */
...
@@ -661,13 +650,14 @@ typedef struct _T_VAR_INFO_RPT_WITH_TYPE_REQ {
...
@@ -661,13 +650,14 @@ typedef struct _T_VAR_INFO_RPT_WITH_TYPE_REQ {
/*--- Define-Variable-List-Service
/*--- Define-Variable-List-Service
* ------------------------------------------------*/
* ------------------------------------------------*/
typedef
struct
_T_VAR_DEFINE_VAR_LIST_REQ
{
typedef
struct
_T_VAR_DEFINE_VAR_LIST_REQ
T_ACCESS
access
;
/* access rights */
{
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* variable list name */
T_ACCESS
access
;
/* access rights */
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* variable list name */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
USIGN16
index
;
/* index of variable list */
USIGN16
index
;
/* index of variable list */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
USIGN8
no_of_var
;
/* number of variables */
USIGN8
no_of_var
;
/* number of variables */
#if (PB_VER >= 500)
#if (PB_VER >= 500)
/* T_DYN_ACC_SPEC var_list[no_of_var]; list of variables */
/* T_DYN_ACC_SPEC var_list[no_of_var]; list of variables */
#else
#else
...
@@ -675,44 +665,50 @@ typedef struct _T_VAR_DEFINE_VAR_LIST_REQ {
...
@@ -675,44 +665,50 @@ typedef struct _T_VAR_DEFINE_VAR_LIST_REQ {
#endif
#endif
}
T_VAR_DEFINE_VAR_LIST_REQ
;
}
T_VAR_DEFINE_VAR_LIST_REQ
;
typedef
struct
_T_VAR_DEFINE_VAR_LIST_CNF
{
typedef
struct
_T_VAR_DEFINE_VAR_LIST_CNF
{
USIGN16
index
;
/* index of variable list */
USIGN16
index
;
/* index of variable list */
}
T_VAR_DEFINE_VAR_LIST_CNF
;
}
T_VAR_DEFINE_VAR_LIST_CNF
;
/*--- Delete-Variable-List-Service
/*--- Delete-Variable-List-Service
* ------------------------------------------------*/
* ------------------------------------------------*/
typedef
struct
_T_VAR_DELETE_VAR_LIST_REQ
{
typedef
struct
_T_VAR_DELETE_VAR_LIST_REQ
{
T_ACC_SPEC
acc_spec
;
/* access specification */
T_ACC_SPEC
acc_spec
;
/* access specification */
}
T_VAR_DELETE_VAR_LIST_REQ
;
}
T_VAR_DELETE_VAR_LIST_REQ
;
/*--- Physical-Read-Service
/*--- Physical-Read-Service
* -------------------------------------------------------*/
* -------------------------------------------------------*/
typedef
struct
_T_VAR_PHYS_READ_REQ
{
typedef
struct
_T_VAR_PHYS_READ_REQ
{
USIGN32
int_addr
;
/* physical address to be read */
USIGN32
int_addr
;
/* physical address to be read */
USIGN8
length
;
/* length in octets */
USIGN8
length
;
/* length in octets */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_VAR_PHYS_READ_REQ
;
}
T_VAR_PHYS_READ_REQ
;
typedef
struct
_T_VAR_PHYS_READ_CNF
{
typedef
struct
_T_VAR_PHYS_READ_CNF
USIGN8
dummy
;
/* alignment byte */
{
USIGN8
dummy
;
/* alignment byte */
USIGN8
length
;
/* length of values in bytes */
USIGN8
length
;
/* length of values in bytes */
/* USIGN8 data[length]; list of data */
/* USIGN8 data[length]; list of data */
}
T_VAR_PHYS_READ_CNF
;
}
T_VAR_PHYS_READ_CNF
;
/*--- Physical-Write-Service
/*--- Physical-Write-Service
* ------------------------------------------------------*/
* ------------------------------------------------------*/
typedef
struct
_T_VAR_PHYS_WRITE_REQ
{
typedef
struct
_T_VAR_PHYS_WRITE_REQ
{
USIGN32
int_addr
;
/* physical address to be write */
USIGN32
int_addr
;
/* physical address to be write */
USIGN8
dummy
;
/* length in octets */
USIGN8
dummy
;
/* length in octets */
USIGN8
length
;
/* length in octets */
USIGN8
length
;
/* length in octets */
/* USIGN8 data[length]; list of datas */
/* USIGN8 data[length]; list of datas */
}
T_VAR_PHYS_WRITE_REQ
;
}
T_VAR_PHYS_WRITE_REQ
;
/*--- Data-Event service
/*--- Data-Event service
* ----------------------------------------------------------*/
* ----------------------------------------------------------*/
typedef
struct
_T_VAR_DATA_EVENT_IND
{
typedef
struct
_T_VAR_DATA_EVENT_IND
{
USIGN16
index
;
/* index */
USIGN16
index
;
/* index */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
USIGN8
length
;
/* length of values in bytes */
USIGN8
length
;
/* length of values in bytes */
/* USIGN8 value[lenght]; list of data */
/* USIGN8 value[lenght]; list of data */
}
T_VAR_DATA_EVENT_IND
;
}
T_VAR_DATA_EVENT_IND
;
...
@@ -722,51 +718,56 @@ typedef struct _T_VAR_DATA_EVENT_IND {
...
@@ -722,51 +718,56 @@ typedef struct _T_VAR_DATA_EVENT_IND {
/*****************************************************************************/
/*****************************************************************************/
/*--- Event-Object-Description ----------------------------------------------*/
/*--- Event-Object-Description ----------------------------------------------*/
typedef
struct
_T_EVENT_OBJECT
{
typedef
struct
_T_EVENT_OBJECT
USIGN16
index_event
;
/* index */
{
USIGN8
obj_code
;
/* object code */
USIGN16
index_event
;
/* index */
USIGN8
data_length
;
/* size of event data */
USIGN8
obj_code
;
/* object code */
USIGN16
index_event_data
;
/* index of event-data */
USIGN8
data_length
;
/* size of event data */
T_ACCESS
access
;
/* access protection */
USIGN16
index_event_data
;
/* index of event-data */
PB_BOOL
enabled
;
/* =>TRUE event is enabled */
T_ACCESS
access
;
/* access protection */
USIGN8
dummy
;
/* alignment byte */
PB_BOOL
enabled
;
/* =>TRUE event is enabled */
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* symbolic name */
USIGN8
dummy
;
/* alignment byte */
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* symbolic name */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
}
T_EVENT_OBJECT
;
}
T_EVENT_OBJECT
;
/*--- Event-Notification-Service --------------------------------------------*/
/*--- Event-Notification-Service --------------------------------------------*/
typedef
struct
_T_EVENT_NOTIFY_REQ
{
typedef
struct
_T_EVENT_NOTIFY_REQ
USIGN8
priority
;
/* priority */
{
USIGN8
priority
;
/* priority */
USIGN8
event_number
;
/* event number */
USIGN8
event_number
;
/* event number */
T_ACC_SPEC
acc_spec
;
/* access specification */
T_ACC_SPEC
acc_spec
;
/* access specification */
USIGN8
dummy
;
/* alignment */
USIGN8
dummy
;
/* alignment */
USIGN8
data_length
;
/* # of event datas in byte */
USIGN8
data_length
;
/* # of event datas in byte */
/* USIGN8 event_data[data_length]; list of event_datas */
/* USIGN8 event_data[data_length]; list of event_datas */
}
T_EVENT_NOTIFY_REQ
;
}
T_EVENT_NOTIFY_REQ
;
/*--- Event-Notification-With-Type-Service ----------------------------------*/
/*--- Event-Notification-With-Type-Service ----------------------------------*/
typedef
struct
_T_EVENT_NOTIFY_WITH_TYPE_REQ
{
typedef
struct
_T_EVENT_NOTIFY_WITH_TYPE_REQ
USIGN8
priority
;
/* priority */
{
USIGN8
event_number
;
/* event number */
USIGN8
priority
;
/* priority */
T_ACC_SPEC
acc_spec
;
/* access specification */
USIGN8
event_number
;
/* event number */
T_ACC_SPEC
acc_spec
;
/* access specification */
T_TYPE_DESCR
type_descr
;
/* type description */
T_TYPE_DESCR
type_descr
;
/* type description */
USIGN8
dummy
;
/* alignment */
USIGN8
dummy
;
/* alignment */
USIGN8
data_length
;
/* length of event data */
USIGN8
data_length
;
/* length of event data */
/* USIGN8 event_data[data_length]; list of event_datas */
/* USIGN8 event_data[data_length]; list of event_datas */
}
T_EVENT_NOTIFY_WITH_TYPE_REQ
;
}
T_EVENT_NOTIFY_WITH_TYPE_REQ
;
/*--- Alter-Event-Condition-Monitoring --------------------------------------*/
/*--- Alter-Event-Condition-Monitoring --------------------------------------*/
typedef
struct
_T_ALT_EVN_CND_MNT_REQ
{
typedef
struct
_T_ALT_EVN_CND_MNT_REQ
{
T_ACC_SPEC
acc_spec
;
/* access specification */
T_ACC_SPEC
acc_spec
;
/* access specification */
PB_BOOL
enabled
;
/* enable or disable the event */
PB_BOOL
enabled
;
/* enable or disable the event */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_ALT_EVN_CND_MNT_REQ
;
}
T_ALT_EVN_CND_MNT_REQ
;
/*--- Acknowledge-Event-Notification ----------------------------------------*/
/*--- Acknowledge-Event-Notification ----------------------------------------*/
typedef
struct
_T_ACK_EVN_NOTIFY_REQ
{
typedef
struct
_T_ACK_EVN_NOTIFY_REQ
{
T_ACC_SPEC
acc_spec
;
/* access specification */
T_ACC_SPEC
acc_spec
;
/* access specification */
USIGN8
event_number
;
/* event count number */
USIGN8
event_number
;
/* event count number */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_ACK_EVN_NOTIFY_REQ
;
}
T_ACK_EVN_NOTIFY_REQ
;
/*****************************************************************************/
/*****************************************************************************/
...
@@ -774,16 +775,17 @@ typedef struct _T_ACK_EVN_NOTIFY_REQ {
...
@@ -774,16 +775,17 @@ typedef struct _T_ACK_EVN_NOTIFY_REQ {
/*****************************************************************************/
/*****************************************************************************/
/*--- Domain-Object-Description ---------------------------------------------*/
/*--- Domain-Object-Description ---------------------------------------------*/
typedef
struct
_T_DOM_OBJECT
{
typedef
struct
_T_DOM_OBJECT
USIGN16
index
;
/* index */
{
USIGN8
obj_code
;
/* object code */
USIGN16
index
;
/* index */
USIGN8
state
;
/* domain state */
USIGN8
obj_code
;
/* object code */
USIGN8
upload_state
;
/* upload state */
USIGN8
state
;
/* domain state */
INT8
counter
;
/* in use counter */
USIGN8
upload_state
;
/* upload state */
USIGN16
max_octets
;
/* max domain length */
INT8
counter
;
/* in use counter */
T_ACCESS
access
;
/* access protection */
USIGN16
max_octets
;
/* max domain length */
USIGN32
local_address
;
/* local address */
T_ACCESS
access
;
/* access protection */
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* symbolic name */
USIGN32
local_address
;
/* local address */
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* symbolic name */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
}
T_DOM_OBJECT
;
}
T_DOM_OBJECT
;
...
@@ -791,37 +793,43 @@ typedef struct _T_DOM_OBJECT {
...
@@ -791,37 +793,43 @@ typedef struct _T_DOM_OBJECT {
/*--- Generic-Domain-Download-Services --------------------------------------*/
/*--- Generic-Domain-Download-Services --------------------------------------*/
/*--- Domain-Upload-Services ----------------------------------------------*/
/*--- Domain-Upload-Services ----------------------------------------------*/
typedef
struct
_T_DOM_REQ
{
typedef
struct
_T_DOM_REQ
{
T_ACC_SPEC
acc_spec
;
/* access specification */
T_ACC_SPEC
acc_spec
;
/* access specification */
}
T_DOM_REQ
;
}
T_DOM_REQ
;
typedef
struct
_T_DNL_UPL_SEG_CNF
{
typedef
struct
_T_DNL_UPL_SEG_CNF
{
PB_BOOL
more_follows
;
/* more_follows */
PB_BOOL
more_follows
;
/* more_follows */
USIGN8
data_len
;
/* data length */
USIGN8
data_len
;
/* data length */
/* USIGN8 data[data_len]; list of data */
/* USIGN8 data[data_len]; list of data */
}
T_DNL_UPL_SEG_CNF
;
}
T_DNL_UPL_SEG_CNF
;
typedef
struct
_T_GEN_DNL_SEG_REQ
{
typedef
struct
_T_GEN_DNL_SEG_REQ
T_ACC_SPEC
acc_spec
;
/* access specification */
{
T_ACC_SPEC
acc_spec
;
/* access specification */
PB_BOOL
more_follows
;
/* more_follows */
PB_BOOL
more_follows
;
/* more_follows */
USIGN8
data_len
;
/* data length */
USIGN8
data_len
;
/* data length */
/* USIGN8 data[data_len]; list of data */
/* USIGN8 data[data_len]; list of data */
}
T_GEN_DNL_SEG_REQ
;
}
T_GEN_DNL_SEG_REQ
;
typedef
struct
_T_TERM_DNL_REQ
{
typedef
struct
_T_TERM_DNL_REQ
T_ACC_SPEC
acc_spec
;
/* access specification */
{
T_ACC_SPEC
acc_spec
;
/* access specification */
PB_BOOL
final_result
;
/* final result */
PB_BOOL
final_result
;
/* final result */
USIGN8
dummy
;
/* alignment */
USIGN8
dummy
;
/* alignment */
}
T_TERM_DNL_REQ
;
}
T_TERM_DNL_REQ
;
typedef
struct
_T_GEN_TERM_DNL_CNF
{
typedef
struct
_T_GEN_TERM_DNL_CNF
{
PB_BOOL
final_result
;
/* final result */
PB_BOOL
final_result
;
/* final result */
USIGN8
dummy
;
/* alignment */
USIGN8
dummy
;
/* alignment */
}
T_GEN_TERM_DNL_CNF
;
}
T_GEN_TERM_DNL_CNF
;
typedef
struct
_T_REQUEST_DOM_REQ
{
typedef
struct
_T_REQUEST_DOM_REQ
T_ACC_SPEC
acc_spec
;
/* access specification */
{
USIGN8
dummy
;
/* alignment */
T_ACC_SPEC
acc_spec
;
/* access specification */
USIGN8
dummy
;
/* alignment */
USIGN8
add_info_length
;
/* length of add. information */
USIGN8
add_info_length
;
/* length of add. information */
/* STRINGV add_info[add_info_length]; additional information */
/* STRINGV add_info[add_info_length]; additional information */
}
T_REQUEST_DOM_REQ
;
}
T_REQUEST_DOM_REQ
;
...
@@ -831,28 +839,30 @@ typedef struct _T_REQUEST_DOM_REQ {
...
@@ -831,28 +839,30 @@ typedef struct _T_REQUEST_DOM_REQ {
/*****************************************************************************/
/*****************************************************************************/
/*--- Program-Invocation-Object ---------------------------------------------*/
/*--- Program-Invocation-Object ---------------------------------------------*/
typedef
struct
_T_PI_OBJECT
{
typedef
struct
_T_PI_OBJECT
USIGN16
index
;
/* pi_index in OD */
{
USIGN8
obj_code
;
/* object code for OD */
USIGN16
index
;
/* pi_index in OD */
USIGN8
cnt_dom
;
/* # domains */
USIGN8
obj_code
;
/* object code for OD */
T_ACCESS
access
;
/* access */
USIGN8
cnt_dom
;
/* # domains */
PB_BOOL
deletable
;
/* deletable */
T_ACCESS
access
;
/* access */
PB_BOOL
reusable
;
/* reusable */
PB_BOOL
deletable
;
/* deletable */
USIGN8
pi_state
;
/* state of pi */
PB_BOOL
reusable
;
/* reusable */
USIGN8
dummy
;
/* alignment byte */
USIGN8
pi_state
;
/* state of pi */
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* symbolic name of pi */
USIGN8
dummy
;
/* alignment byte */
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* symbolic name of pi */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
USIGN32
reserved
;
/* for internal use */
USIGN32
reserved
;
/* for internal use */
/* USIGN16 dom_list[cnt_dom]; domain index list */
/* USIGN16 dom_list[cnt_dom]; domain index list */
}
T_PI_OBJECT
;
}
T_PI_OBJECT
;
/*--- Create-PI-Service -----------------------------------------------------*/
/*--- Create-PI-Service -----------------------------------------------------*/
typedef
struct
_T_PI_CR8_REQ
{
typedef
struct
_T_PI_CR8_REQ
T_ACCESS
access
;
/* access rights */
{
USIGN8
cnt_dom
;
/* number of domains */
T_ACCESS
access
;
/* access rights */
PB_BOOL
reusable
;
/* => TRUE pi is reusable */
USIGN8
cnt_dom
;
/* number of domains */
USIGN16
index
;
/* PI-index */
PB_BOOL
reusable
;
/* => TRUE pi is reusable */
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* symbolic name */
USIGN16
index
;
/* PI-index */
STRINGV
name
[
MAX_OBJECT_NAME_LENGTH
];
/* symbolic name */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
USIGN8
extension
[
MAX_EXTENSION_LENGTH
];
/* extension */
#if (PB_VER >= 500)
#if (PB_VER >= 500)
/* T_DYN_ACC_SPEC dom_list[cnt_dom]; list of domains */
/* T_DYN_ACC_SPEC dom_list[cnt_dom]; list of domains */
...
@@ -861,51 +871,60 @@ typedef struct _T_PI_CR8_REQ {
...
@@ -861,51 +871,60 @@ typedef struct _T_PI_CR8_REQ {
#endif
#endif
}
T_PI_CR8_REQ
;
}
T_PI_CR8_REQ
;
typedef
struct
_T_PI_CR8_CNF
{
typedef
struct
_T_PI_CR8_CNF
{
USIGN16
index
;
/* index of PI */
USIGN16
index
;
/* index of PI */
}
T_PI_CR8_CNF
;
}
T_PI_CR8_CNF
;
/*--- Delete-PI-Service -----------------------------------------------------*/
/*--- Delete-PI-Service -----------------------------------------------------*/
typedef
struct
_T_PI_DEL_REQ
{
typedef
struct
_T_PI_DEL_REQ
{
T_ACC_SPEC
acc_spec
;
/* access specification */
T_ACC_SPEC
acc_spec
;
/* access specification */
}
T_PI_DEL_REQ
;
}
T_PI_DEL_REQ
;
/*--- Start-PI-Service ------------------------------------------------------*/
/*--- Start-PI-Service ------------------------------------------------------*/
typedef
struct
_T_PI_START_REQ
{
typedef
struct
_T_PI_START_REQ
T_ACC_SPEC
acc_spec
;
/* access specific. */
{
T_ACC_SPEC
acc_spec
;
/* access specific. */
USIGN8
exec_arg
[
MAX_EXECUTION_ARGUMENT_LENGTH
];
/* execution arg. */
USIGN8
exec_arg
[
MAX_EXECUTION_ARGUMENT_LENGTH
];
/* execution arg. */
}
T_PI_START_REQ
;
}
T_PI_START_REQ
;
/*--- Stop-PI-Service -------------------------------------------------------*/
/*--- Stop-PI-Service -------------------------------------------------------*/
typedef
struct
_T_PI_STOP_REQ
{
typedef
struct
_T_PI_STOP_REQ
{
T_ACC_SPEC
acc_spec
;
/* access specific. */
T_ACC_SPEC
acc_spec
;
/* access specific. */
}
T_PI_STOP_REQ
;
}
T_PI_STOP_REQ
;
/*--- Resume-PI-Service -----------------------------------------------------*/
/*--- Resume-PI-Service -----------------------------------------------------*/
typedef
struct
_T_PI_RESUME_REQ
{
typedef
struct
_T_PI_RESUME_REQ
T_ACC_SPEC
acc_spec
;
/* access specific. */
{
T_ACC_SPEC
acc_spec
;
/* access specific. */
USIGN8
exec_arg
[
MAX_EXECUTION_ARGUMENT_LENGTH
];
/* execution arg. */
USIGN8
exec_arg
[
MAX_EXECUTION_ARGUMENT_LENGTH
];
/* execution arg. */
}
T_PI_RESUME_REQ
;
}
T_PI_RESUME_REQ
;
/*--- Reset-PI-Service ------------------------------------------------------*/
/*--- Reset-PI-Service ------------------------------------------------------*/
typedef
struct
_T_PI_RESET_REQ
{
typedef
struct
_T_PI_RESET_REQ
{
T_ACC_SPEC
acc_spec
;
/* access specific. */
T_ACC_SPEC
acc_spec
;
/* access specific. */
}
T_PI_RESET_REQ
;
}
T_PI_RESET_REQ
;
/*--- Kill-PI-Service -------------------------------------------------------*/
/*--- Kill-PI-Service -------------------------------------------------------*/
typedef
struct
_T_PI_KILL_REQ
{
typedef
struct
_T_PI_KILL_REQ
{
T_ACC_SPEC
acc_spec
;
/* access specific. */
T_ACC_SPEC
acc_spec
;
/* access specific. */
}
T_PI_KILL_REQ
;
}
T_PI_KILL_REQ
;
/*--- PI-SET-STATE-Service ( only local Service ) ---------------------------*/
/*--- PI-SET-STATE-Service ( only local Service ) ---------------------------*/
typedef
struct
_T_PI_SET_STATE_REQ
{
typedef
struct
_T_PI_SET_STATE_REQ
USIGN32
vfd_number
;
/* vfd number */
{
USIGN32
vfd_number
;
/* vfd number */
T_ACC_SPEC
acc_spec
;
/* access specification */
T_ACC_SPEC
acc_spec
;
/* access specification */
USIGN8
state
;
/* new PI state */
USIGN8
state
;
/* new PI state */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_PI_SET_STATE_REQ
;
}
T_PI_SET_STATE_REQ
;
typedef
struct
_T_PI_SET_STATE_CNF
{
typedef
struct
_T_PI_SET_STATE_CNF
{
USIGN32
vfd_number
;
/* vfd number */
USIGN32
vfd_number
;
/* vfd number */
}
T_PI_SET_STATE_CNF
;
}
T_PI_SET_STATE_CNF
;
...
@@ -915,55 +934,58 @@ typedef struct _T_PI_SET_STATE_CNF {
...
@@ -915,55 +934,58 @@ typedef struct _T_PI_SET_STATE_CNF {
/* --- OD-Object-Description
/* --- OD-Object-Description
* ---------------------------------------------------*/
* ---------------------------------------------------*/
typedef
struct
_T_OD_OBJ_DESCR_HDR
{
typedef
struct
_T_OD_OBJ_DESCR_HDR
USIGN16
index
;
/* index = 0 */
{
USIGN8
obj_code
;
/* object-code = 1 */
USIGN16
index
;
/* index = 0 */
PB_BOOL
flag
;
/* => TRUE write protected */
USIGN8
obj_code
;
/* object-code = 1 */
USIGN8
length
;
/* size of names (0-32) */
PB_BOOL
flag
;
/* => TRUE write protected */
PB_BOOL
protection
;
/* access protection supported */
USIGN8
length
;
/* size of names (0-32) */
INT16
version
;
/* version */
PB_BOOL
protection
;
/* access protection supported */
INT16
len_st_od
;
/* length of the static type description */
INT16
version
;
/* version */
USIGN16
first_index_s_od
;
/* start index of the static object description */
INT16
len_st_od
;
/* length of the static type description */
INT16
len_s_od
;
/* length of the static object description */
USIGN16
first_index_s_od
;
/* start index of the static object description */
INT16
len_s_od
;
/* length of the static object description */
USIGN16
first_index_dv_od
;
/* start index of the dyn. var. list description */
USIGN16
first_index_dv_od
;
/* start index of the dyn. var. list description */
INT16
len_dv_od
;
/* length of the dyn. variable list description */
INT16
len_dv_od
;
/* length of the dyn. variable list description */
USIGN16
first_index_dp_od
;
/* start index of the dyn. pi description */
USIGN16
first_index_dp_od
;
/* start index of the dyn. pi description */
INT16
len_dp_od
;
/* length of the dyn. pi description */
INT16
len_dp_od
;
/* length of the dyn. pi description */
USIGN32
int_addr
;
/* internal address of OD description */
USIGN32
int_addr
;
/* internal address of OD description */
USIGN32
int_addr_st_od
;
/* internal address of the static type descr. */
USIGN32
int_addr_st_od
;
/* internal address of the static type descr. */
USIGN32
int_addr_s_od
;
/* internal address of the static object descr. */
USIGN32
int_addr_s_od
;
/* internal address of the static object descr. */
USIGN32
int_addr_dv_od
;
/* internal address of the dyn. var. list descr. */
USIGN32
int_addr_dv_od
;
/* internal address of the dyn. var. list descr. */
USIGN32
int_addr_dp_od
;
/* internal address of the dyn. pi description */
USIGN32
int_addr_dp_od
;
/* internal address of the dyn. pi description */
}
T_OD_OBJ_DESCR_HDR
;
}
T_OD_OBJ_DESCR_HDR
;
#if (PB_VER < 500)
#if (PB_VER < 500)
typedef
struct
T_OV_OBJ_DESCR_HDR
{
typedef
struct
T_OV_OBJ_DESCR_HDR
USIGN16
index
;
/* index = 0 */
{
USIGN8
obj_code
;
/* object-code = 1 */
USIGN16
index
;
/* index = 0 */
BOOL
flag
;
/* => TRUE write protected */
USIGN8
obj_code
;
/* object-code = 1 */
USIGN8
length
;
/* size of names (0-32) */
BOOL
flag
;
/* => TRUE write protected */
BOOL
protection
;
/* access protection supported */
USIGN8
length
;
/* size of names (0-32) */
INT16
version
;
/* version */
BOOL
protection
;
/* access protection supported */
INT16
len_st_ov
;
/* length of the static type description */
INT16
version
;
/* version */
USIGN16
first_index_s_ov
;
/* start index of the static object descr. */
INT16
len_st_ov
;
/* length of the static type description */
INT16
len_s_ov
;
/* length of the static object description */
USIGN16
first_index_s_ov
;
/* start index of the static object descr. */
INT16
len_s_ov
;
/* length of the static object description */
USIGN16
first_index_dv_ov
;
/* start index of the dyn. var. list descr. */
USIGN16
first_index_dv_ov
;
/* start index of the dyn. var. list descr. */
INT16
len_dv_ov
;
/* length of the dyn. variable list descr. */
INT16
len_dv_ov
;
/* length of the dyn. variable list descr. */
USIGN16
first_index_dp_ov
;
/* start index of the dyn. pi description */
USIGN16
first_index_dp_ov
;
/* start index of the dyn. pi description */
INT16
len_dp_ov
;
/* length of the dyn. pi description */
INT16
len_dp_ov
;
/* length of the dyn. pi description */
USIGN32
int_addr
;
/* internal address of ov description */
USIGN32
int_addr
;
/* internal address of ov description */
USIGN32
int_addr_st_ov
;
/* internal address of the static type descr. */
USIGN32
int_addr_st_ov
;
/* internal address of the static type descr. */
USIGN32
int_addr_s_ov
;
/* internal address of the static object descr.*/
USIGN32
int_addr_s_ov
;
/* internal address of the static object descr.*/
USIGN32
int_addr_dv_ov
;
/* internal address of the dyn. var. list descr*/
USIGN32
int_addr_dv_ov
;
/* internal address of the dyn. var. list descr*/
USIGN32
int_addr_dp_ov
;
/* internal address of the dyn. pi description */
USIGN32
int_addr_dp_ov
;
/* internal address of the dyn. pi description */
}
T_OV_OBJ_DESCR_HDR
;
}
T_OV_OBJ_DESCR_HDR
;
#endif
#endif
/* --- OD-Null-Object-Description -------------------------------------------*/
/* --- OD-Null-Object-Description -------------------------------------------*/
typedef
struct
_T_OD_NULL_OBJECT
{
typedef
struct
_T_OD_NULL_OBJECT
USIGN16
index
;
/* index */
{
USIGN16
index
;
/* index */
USIGN8
obj_code
;
/* object code */
USIGN8
obj_code
;
/* object code */
USIGN8
dummy
;
/* alignment reasons */
USIGN8
dummy
;
/* alignment reasons */
}
T_OD_NULL_OBJECT
;
}
T_OD_NULL_OBJECT
;
#if (PB_VER < 500)
#if (PB_VER < 500)
...
@@ -971,10 +993,11 @@ typedef T_OD_NULL_OBJECT T_OV_NULL_OBJECT;
...
@@ -971,10 +993,11 @@ typedef T_OD_NULL_OBJECT T_OV_NULL_OBJECT;
#endif
#endif
/* --- OD-Static-Type-Object-Description ------------------------------------*/
/* --- OD-Static-Type-Object-Description ------------------------------------*/
typedef
struct
_T_OD_ST_DT_DESCR
{
typedef
struct
_T_OD_ST_DT_DESCR
USIGN16
index
;
/* index */
{
USIGN8
obj_code
;
/* object code */
USIGN16
index
;
/* index */
USIGN8
dummy
;
/* alignment byte */
USIGN8
obj_code
;
/* object code */
USIGN8
dummy
;
/* alignment byte */
STRINGV
meaning
[
MAX_OBJECT_NAME_LENGTH
];
/* meaning of the type */
STRINGV
meaning
[
MAX_OBJECT_NAME_LENGTH
];
/* meaning of the type */
}
T_OD_ST_DT_DESCR
;
}
T_OD_ST_DT_DESCR
;
...
@@ -983,37 +1006,41 @@ typedef T_OD_ST_DT_DESCR T_OV_ST_DT_DESCR;
...
@@ -983,37 +1006,41 @@ typedef T_OD_ST_DT_DESCR T_OV_ST_DT_DESCR;
#endif
#endif
/* --- OD-Static-Structure-Object-Description -------------------------------*/
/* --- OD-Static-Structure-Object-Description -------------------------------*/
typedef
struct
_T_OD_DT_LIST
{
typedef
struct
_T_OD_DT_LIST
{
USIGN16
index_of_type
;
/* logical address of the type */
USIGN16
index_of_type
;
/* logical address of the type */
USIGN8
length
;
/* length of the element in octets */
USIGN8
length
;
/* length of the element in octets */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_OD_DT_LIST
;
}
T_OD_DT_LIST
;
#if (PB_VER < 500)
#if (PB_VER < 500)
typedef
T_OD_DT_LIST
T_OV_DT_LIST
;
typedef
T_OD_DT_LIST
T_OV_DT_LIST
;
#endif
#endif
typedef
struct
_T_OD_ST_DS_DESCR
{
typedef
struct
_T_OD_ST_DS_DESCR
USIGN16
index
;
/* index */
{
USIGN8
obj_code
;
/* object code */
USIGN16
index
;
/* index */
USIGN8
obj_code
;
/* object code */
USIGN8
no_of_elements
;
/* number of record elements */
USIGN8
no_of_elements
;
/* number of record elements */
USIGN32
reserved
;
/* for internal use */
USIGN32
reserved
;
/* for internal use */
/* T_OD_DT_LIST dt_list[no_of_elements]; data type list */
/* T_OD_DT_LIST dt_list[no_of_elements]; data type list */
}
T_OD_ST_DS_DESCR
;
}
T_OD_ST_DS_DESCR
;
#if (PB_VER < 500)
#if (PB_VER < 500)
typedef
struct
_T_OV_ST_DS_DESCR
{
typedef
struct
_T_OV_ST_DS_DESCR
USIGN16
index
;
/* index */
{
USIGN8
obj_code
;
/* object code */
USIGN16
index
;
/* index */
USIGN8
obj_code
;
/* object code */
USIGN8
no_of_elements
;
/* number of record elements */
USIGN8
no_of_elements
;
/* number of record elements */
USIGN32
reserved
;
/* for internal use */
USIGN32
reserved
;
/* for internal use */
/* T_OV_DT_LIST dt_list[no_of_elements]; data type list */
/* T_OV_DT_LIST dt_list[no_of_elements]; data type list */
}
T_OV_ST_DS_DESCR
;
}
T_OV_ST_DS_DESCR
;
#endif
#endif
/* --- OD-OBJECT-DESCRIPTION ----------------------------------------------- */
/* --- OD-OBJECT-DESCRIPTION ----------------------------------------------- */
#if (PB_VER >= 500)
#if (PB_VER >= 500)
typedef
struct
_T_OBJECT_DESCR
{
typedef
struct
_T_OBJECT_DESCR
{
union
{
union
{
T_OD_OBJ_DESCR_HDR
od_obj_descr
;
T_OD_OBJ_DESCR_HDR
od_obj_descr
;
T_OD_NULL_OBJECT
null_obj_descr
;
T_OD_NULL_OBJECT
null_obj_descr
;
...
@@ -1029,7 +1056,8 @@ typedef struct _T_OBJECT_DESCR {
...
@@ -1029,7 +1056,8 @@ typedef struct _T_OBJECT_DESCR {
}
id
;
}
id
;
}
T_OBJECT_DESCR
;
}
T_OBJECT_DESCR
;
#else
#else
typedef
struct
_T_OBJECT_DESCR
{
typedef
struct
_T_OBJECT_DESCR
{
union
{
union
{
T_OV_OBJ_DESCR_HDR
ov_obj_descr
;
T_OV_OBJ_DESCR_HDR
ov_obj_descr
;
T_OV_NULL_OBJECT
null_obj_descr
;
T_OV_NULL_OBJECT
null_obj_descr
;
...
@@ -1047,15 +1075,17 @@ typedef struct _T_OBJECT_DESCR {
...
@@ -1047,15 +1075,17 @@ typedef struct _T_OBJECT_DESCR {
#endif
#endif
/* --- OD-PACKED-OBJECT-DESCRIPTION ---------------------------------------- */
/* --- OD-PACKED-OBJECT-DESCRIPTION ---------------------------------------- */
typedef
struct
_T_PACKED_OBJECT_DESCR
{
typedef
struct
_T_PACKED_OBJECT_DESCR
{
USIGN8
length
;
/* length of packed object description*/
USIGN8
length
;
/* length of packed object description*/
/* USIGN8 packed_obj_descr[length]; packed object description */
/* USIGN8 packed_obj_descr[length]; packed object description */
}
T_PACKED_OBJECT_DESCR
;
}
T_PACKED_OBJECT_DESCR
;
/* --- Get-OD-Service -------------------------------------------------------*/
/* --- Get-OD-Service -------------------------------------------------------*/
typedef
struct
_T_GET_OD_REQ
{
typedef
struct
_T_GET_OD_REQ
PB_BOOL
format
;
/* TRUE = long format / FALSE = short */
{
USIGN8
dummy
;
/* alignment byte */
PB_BOOL
format
;
/* TRUE = long format / FALSE = short */
USIGN8
dummy
;
/* alignment byte */
T_ACC_SPEC
acc_spec
;
/* access specification */
T_ACC_SPEC
acc_spec
;
/* access specification */
}
T_GET_OD_REQ
;
}
T_GET_OD_REQ
;
...
@@ -1063,16 +1093,18 @@ typedef struct _T_GET_OD_REQ {
...
@@ -1063,16 +1093,18 @@ typedef struct _T_GET_OD_REQ {
typedef
T_GET_OD_REQ
T_GET_OV_REQ
;
typedef
T_GET_OD_REQ
T_GET_OV_REQ
;
#endif
#endif
typedef
struct
_T_GET_OD_CNF
{
typedef
struct
_T_GET_OD_CNF
PB_BOOL
more_follows
;
/* further object descr. follow */
{
PB_BOOL
more_follows
;
/* further object descr. follow */
USIGN8
no_of_od_descr
;
/* # of object description */
USIGN8
no_of_od_descr
;
/* # of object description */
/* T_PACKED_OBJECT_DESCR obj_descr_list[no_of_od_descr]; list of object
/* T_PACKED_OBJECT_DESCR obj_descr_list[no_of_od_descr]; list of object
* descriptions */
* descriptions */
}
T_GET_OD_CNF
;
}
T_GET_OD_CNF
;
#if (PB_VER < 500)
#if (PB_VER < 500)
typedef
struct
_T_GET_OV_CNF
{
typedef
struct
_T_GET_OV_CNF
PB_BOOL
more_follows
;
/* further object descr. follow */
{
PB_BOOL
more_follows
;
/* further object descr. follow */
USIGN8
no_of_ov_descr
;
/* # of object description */
USIGN8
no_of_ov_descr
;
/* # of object description */
/* T_PACKED_OBJECT_DESCR obj_descr_list[no_of_ov_descr]; list of object
/* T_PACKED_OBJECT_DESCR obj_descr_list[no_of_ov_descr]; list of object
* descriptions */
* descriptions */
...
@@ -1080,25 +1112,28 @@ typedef struct _T_GET_OV_CNF {
...
@@ -1080,25 +1112,28 @@ typedef struct _T_GET_OV_CNF {
#endif
#endif
/* --- Put-OD-Services ------------------------------------------------------*/
/* --- Put-OD-Services ------------------------------------------------------*/
typedef
struct
_T_INIT_PUT_OD_REQ
{
typedef
struct
_T_INIT_PUT_OD_REQ
{
INT8
consequence
;
/* Loading interactive/non-interactive */
INT8
consequence
;
/* Loading interactive/non-interactive */
USIGN8
dummy
;
/* alignment */
USIGN8
dummy
;
/* alignment */
}
T_INIT_PUT_OD_REQ
;
}
T_INIT_PUT_OD_REQ
;
#if (PB_VER < 500)
#if (PB_VER < 500)
typedef
T_INIT_PUT_OD_REQ
T_INIT_PUT_OV_REQ
;
typedef
T_INIT_PUT_OD_REQ
T_INIT_PUT_OV_REQ
;
#endif
#endif
typedef
struct
_T_PUT_OD_REQ
{
typedef
struct
_T_PUT_OD_REQ
USIGN8
dummy
;
/* alignment */
{
USIGN8
dummy
;
/* alignment */
USIGN8
no_of_od_descr
;
/* # of object description */
USIGN8
no_of_od_descr
;
/* # of object description */
/* T_PACKED_OBJECT_DESCR obj_descr_list[no_of_od_descr]; list of object
/* T_PACKED_OBJECT_DESCR obj_descr_list[no_of_od_descr]; list of object
* descriptions */
* descriptions */
}
T_PUT_OD_REQ
;
}
T_PUT_OD_REQ
;
#if (PB_VER < 500)
#if (PB_VER < 500)
typedef
struct
_T_PUT_OV_REQ
{
typedef
struct
_T_PUT_OV_REQ
USIGN8
dummy
;
/* alignment */
{
USIGN8
dummy
;
/* alignment */
USIGN8
no_of_ov_descr
;
/* # of object description */
USIGN8
no_of_ov_descr
;
/* # of object description */
/* T_PACKED_OBJECT_DESCR obj_descr_list[no_of_ov_descr]; list of object
/* T_PACKED_OBJECT_DESCR obj_descr_list[no_of_ov_descr]; list of object
* descriptions */
* descriptions */
...
@@ -1106,7 +1141,8 @@ typedef struct _T_PUT_OV_REQ {
...
@@ -1106,7 +1141,8 @@ typedef struct _T_PUT_OV_REQ {
#endif
#endif
/* --- Load-OD-Local-Service ------------------------------------------------*/
/* --- Load-OD-Local-Service ------------------------------------------------*/
typedef
struct
_T_INIT_LOAD_OD_REQ
{
typedef
struct
_T_INIT_LOAD_OD_REQ
{
USIGN32
vfd_number
;
USIGN32
vfd_number
;
INT8
consequence
;
INT8
consequence
;
USIGN8
dummy
;
USIGN8
dummy
;
...
@@ -1116,7 +1152,8 @@ typedef struct _T_INIT_LOAD_OD_REQ {
...
@@ -1116,7 +1152,8 @@ typedef struct _T_INIT_LOAD_OD_REQ {
typedef
T_INIT_LOAD_OD_REQ
T_INIT_LOAD_OV_REQ
;
typedef
T_INIT_LOAD_OD_REQ
T_INIT_LOAD_OV_REQ
;
#endif
#endif
typedef
struct
_T_INIT_LOAD_OD_CNF
{
typedef
struct
_T_INIT_LOAD_OD_CNF
{
USIGN32
vfd_number
;
USIGN32
vfd_number
;
}
T_INIT_LOAD_OD_CNF
;
}
T_INIT_LOAD_OD_CNF
;
...
@@ -1124,7 +1161,8 @@ typedef struct _T_INIT_LOAD_OD_CNF {
...
@@ -1124,7 +1161,8 @@ typedef struct _T_INIT_LOAD_OD_CNF {
typedef
T_INIT_LOAD_OD_CNF
T_INIT_LOAD_OV_CNF
;
typedef
T_INIT_LOAD_OD_CNF
T_INIT_LOAD_OV_CNF
;
#endif
#endif
typedef
struct
_T_LOAD_OD_REQ
{
typedef
struct
_T_LOAD_OD_REQ
{
USIGN32
vfd_number
;
USIGN32
vfd_number
;
T_OBJECT_DESCR
obj_descr
;
T_OBJECT_DESCR
obj_descr
;
}
T_LOAD_OD_REQ
;
}
T_LOAD_OD_REQ
;
...
@@ -1133,7 +1171,8 @@ typedef struct _T_LOAD_OD_REQ {
...
@@ -1133,7 +1171,8 @@ typedef struct _T_LOAD_OD_REQ {
typedef
T_LOAD_OD_REQ
T_LOAD_OV_REQ
;
typedef
T_LOAD_OD_REQ
T_LOAD_OV_REQ
;
#endif
#endif
typedef
struct
_T_LOAD_OD_CNF
{
typedef
struct
_T_LOAD_OD_CNF
{
USIGN32
vfd_number
;
USIGN32
vfd_number
;
}
T_LOAD_OD_CNF
;
}
T_LOAD_OD_CNF
;
...
@@ -1141,7 +1180,8 @@ typedef struct _T_LOAD_OD_CNF {
...
@@ -1141,7 +1180,8 @@ typedef struct _T_LOAD_OD_CNF {
typedef
T_LOAD_OD_CNF
T_LOAD_OV_CNF
;
typedef
T_LOAD_OD_CNF
T_LOAD_OV_CNF
;
#endif
#endif
typedef
struct
_T_TERM_LOAD_OD_REQ
{
typedef
struct
_T_TERM_LOAD_OD_REQ
{
USIGN32
vfd_number
;
USIGN32
vfd_number
;
}
T_TERM_LOAD_OD_REQ
;
}
T_TERM_LOAD_OD_REQ
;
...
@@ -1149,7 +1189,8 @@ typedef struct _T_TERM_LOAD_OD_REQ {
...
@@ -1149,7 +1189,8 @@ typedef struct _T_TERM_LOAD_OD_REQ {
typedef
T_TERM_LOAD_OD_REQ
T_TERM_LOAD_OV_REQ
;
typedef
T_TERM_LOAD_OD_REQ
T_TERM_LOAD_OV_REQ
;
#endif
#endif
typedef
struct
_T_TERM_LOAD_OD_CNF
{
typedef
struct
_T_TERM_LOAD_OD_CNF
{
USIGN32
vfd_number
;
USIGN32
vfd_number
;
}
T_TERM_LOAD_OD_CNF
;
}
T_TERM_LOAD_OD_CNF
;
...
@@ -1158,7 +1199,8 @@ typedef T_TERM_LOAD_OD_CNF T_TERM_LOAD_OV_CNF;
...
@@ -1158,7 +1199,8 @@ typedef T_TERM_LOAD_OD_CNF T_TERM_LOAD_OV_CNF;
#endif
#endif
/*--- Read-OD-Local-Service -------------------------------------------------*/
/*--- Read-OD-Local-Service -------------------------------------------------*/
typedef
struct
_T_OD_READ_LOC_REQ
{
typedef
struct
_T_OD_READ_LOC_REQ
{
USIGN32
vfd_number
;
USIGN32
vfd_number
;
USIGN8
obj_code
;
USIGN8
obj_code
;
USIGN8
dummy
;
USIGN8
dummy
;
...
@@ -1169,8 +1211,9 @@ typedef struct _T_OD_READ_LOC_REQ {
...
@@ -1169,8 +1211,9 @@ typedef struct _T_OD_READ_LOC_REQ {
typedef
T_OD_READ_LOC_REQ
T_OV_READ_LOC_REQ
;
typedef
T_OD_READ_LOC_REQ
T_OV_READ_LOC_REQ
;
#endif
#endif
typedef
struct
_T_OD_READ_LOC_CNF
{
typedef
struct
_T_OD_READ_LOC_CNF
USIGN32
vfd_number
;
/* vfd number */
{
USIGN32
vfd_number
;
/* vfd number */
T_OBJECT_DESCR
obj_descr
;
/* object description */
T_OBJECT_DESCR
obj_descr
;
/* object description */
}
T_OD_READ_LOC_CNF
;
}
T_OD_READ_LOC_CNF
;
...
@@ -1183,52 +1226,59 @@ typedef T_OD_READ_LOC_CNF T_OV_READ_LOC_CNF;
...
@@ -1183,52 +1226,59 @@ typedef T_OD_READ_LOC_CNF T_OV_READ_LOC_CNF;
/*****************************************************************************/
/*****************************************************************************/
/*--- Create-VFD-Service ----------------------------------------------------*/
/*--- Create-VFD-Service ----------------------------------------------------*/
typedef
struct
_T_VFD_CREATE_REQ
{
typedef
struct
_T_VFD_CREATE_REQ
USIGN32
vfd_number
;
/* vfd number */
{
USIGN32
vfd_number
;
/* vfd number */
STRINGV
vendor_name
[
MAX_VFD_STRING_LENGTH
];
/* vendor name */
STRINGV
vendor_name
[
MAX_VFD_STRING_LENGTH
];
/* vendor name */
STRINGV
model_name
[
MAX_VFD_STRING_LENGTH
];
/* model-name */
STRINGV
model_name
[
MAX_VFD_STRING_LENGTH
];
/* model-name */
STRINGV
revision
[
MAX_VFD_STRING_LENGTH
];
/* revision no */
STRINGV
revision
[
MAX_VFD_STRING_LENGTH
];
/* revision no */
USIGN8
profile_number
[
2
];
/* profile number */
USIGN8
profile_number
[
2
];
/* profile number */
}
T_VFD_CREATE_REQ
;
}
T_VFD_CREATE_REQ
;
typedef
struct
_T_VFD_CREATE_CNF
{
typedef
struct
_T_VFD_CREATE_CNF
{
USIGN32
vfd_number
;
/* vfd number */
USIGN32
vfd_number
;
/* vfd number */
}
T_VFD_CREATE_CNF
;
}
T_VFD_CREATE_CNF
;
/*--- VFD-Set-Physical-Status -----------------------------------------------*/
/*--- VFD-Set-Physical-Status -----------------------------------------------*/
typedef
struct
_T_VFD_SET_PHYS_STATUS_REQ
{
typedef
struct
_T_VFD_SET_PHYS_STATUS_REQ
USIGN32
vfd_number
;
/* vfd number */
{
USIGN32
vfd_number
;
/* vfd number */
USIGN8
physical_status
;
/* physical status */
USIGN8
physical_status
;
/* physical status */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_VFD_SET_PHYS_STATUS_REQ
;
}
T_VFD_SET_PHYS_STATUS_REQ
;
typedef
struct
_T_VFD_SET_PHYS_STATUS_CNF
{
typedef
struct
_T_VFD_SET_PHYS_STATUS_CNF
{
USIGN32
vfd_number
;
/* vfd number */
USIGN32
vfd_number
;
/* vfd number */
}
T_VFD_SET_PHYS_STATUS_CNF
;
}
T_VFD_SET_PHYS_STATUS_CNF
;
/*--- Status-Service --------------------------------------------------------*/
/*--- Status-Service --------------------------------------------------------*/
typedef
struct
_T_VFD_STATUS_CNF
{
typedef
struct
_T_VFD_STATUS_CNF
USIGN8
logical_status
;
/* logical status */
{
USIGN8
logical_status
;
/* logical status */
USIGN8
physical_status
;
/* physical status */
USIGN8
physical_status
;
/* physical status */
USIGN8
local_detail
[
3
];
/* local detail */
USIGN8
local_detail
[
3
];
/* local detail */
USIGN8
dummy
;
/* alignment byte */
USIGN8
dummy
;
/* alignment byte */
}
T_VFD_STATUS_CNF
;
}
T_VFD_STATUS_CNF
;
/*--- Unsolicited-Status-Service --------------------------------------------*/
/*--- Unsolicited-Status-Service --------------------------------------------*/
typedef
struct
_T_VFD_UNSOL_STATUS_REQ
{
typedef
struct
_T_VFD_UNSOL_STATUS_REQ
USIGN8
priority
;
/* priority */
{
USIGN8
logical_status
;
/* logical status */
USIGN8
priority
;
/* priority */
USIGN8
logical_status
;
/* logical status */
USIGN8
physical_status
;
/* physical status */
USIGN8
physical_status
;
/* physical status */
USIGN8
dummy1
;
/* alignment byte */
USIGN8
dummy1
;
/* alignment byte */
USIGN8
local_detail
[
3
];
/* local detail */
USIGN8
local_detail
[
3
];
/* local detail */
USIGN8
dummy2
;
/* alignment byte */
USIGN8
dummy2
;
/* alignment byte */
}
T_VFD_UNSOL_STATUS_REQ
;
}
T_VFD_UNSOL_STATUS_REQ
;
/*--- Identify-Service ------------------------------------------------------*/
/*--- Identify-Service ------------------------------------------------------*/
typedef
struct
_T_VFD_IDENTIFY_CNF
{
typedef
struct
_T_VFD_IDENTIFY_CNF
{
STRINGV
vendor_name
[
MAX_VFD_STRING_LENGTH
];
/* producer of the device */
STRINGV
vendor_name
[
MAX_VFD_STRING_LENGTH
];
/* producer of the device */
STRINGV
model_name
[
MAX_VFD_STRING_LENGTH
];
/* model-name of the device */
STRINGV
model_name
[
MAX_VFD_STRING_LENGTH
];
/* model-name of the device */
STRINGV
revision
[
MAX_VFD_STRING_LENGTH
];
/* revision of the device */
STRINGV
revision
[
MAX_VFD_STRING_LENGTH
];
/* revision of the device */
}
T_VFD_IDENTIFY_CNF
;
}
T_VFD_IDENTIFY_CNF
;
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
#if defined(WIN32) || defined(_WIN32) || defined(WIN16) || defined(_WIN16)
...
...
profibus/lib/rt/src/pb_hw.h
deleted
100644 → 0
View file @
9344a78b
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2011 SSAB Oxelosund AB.
*
* This file is part of Proview.
* Copyright (C) SOFTING GmbH 1995-1999.
* 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.
*/
/*****************************************************************************/
/* */
/* 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 */
/* */
/*****************************************************************************/
/*****************************************************************************/
/* 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
profibus/lib/rt/src/pb_if.h
View file @
ce758cd3
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************/
/*****************************************************************************/
/* */
/* */
/*
SOFTING AG
*/
/*
SOFTING Industrial Automation GmbH
*/
/* Richard-Reitzner-Allee 6 */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* */
/*
Copyright (C) SOFTING AG 1995-2003
*/
/*
Copyright (C) SOFTING Industrial Automation GmbH 1995-2012
*/
/* All Rights Reserved */
/* All Rights Reserved */
/* */
/* */
/*****************************************************************************/
/*****************************************************************************/
...
@@ -49,9 +14,9 @@
...
@@ -49,9 +14,9 @@
/* PROFIBUS APPLICATION PROGRAM INTERFACE */
/* PROFIBUS APPLICATION PROGRAM INTERFACE */
/* */
/* */
/* Filename : PB_IF.H */
/* Filename : PB_IF.H */
/* Version : 5.
26.1
.00.release */
/* Version : 5.
46.0
.00.release */
/* Date :
27-June-2003
*/
/* Date :
October-2011
*/
/* Author : SOFTING
AG
*/
/* Author : SOFTING
*/
/* */
/* */
/* Description : This file contains the extern function declarations, */
/* Description : This file contains the extern function declarations, */
/* defines and types of the PROFIBUS Communication Interface */
/* defines and types of the PROFIBUS Communication Interface */
...
@@ -98,18 +63,17 @@
...
@@ -98,18 +63,17 @@
#define DEVICE_BASIC_MANAGEMENT 8
#define DEVICE_BASIC_MANAGEMENT 8
/* --- contants for IRQ values -------------------------------- */
/* --- contants for IRQ values -------------------------------- */
#define REQ_IRQ 0xF0
/* IND/CON IRQ is received */
#define REQ_IRQ 0xF0
/* IND/CON IRQ is received */
#define ACK_IRQ 0x0F
/* acknowledge REQ/RES */
#define ACK_IRQ 0x0F
/* acknowledge REQ/RES */
#define DP_SLAVE_IO_REQ_IRQ 0xE0
/* MASTER: DP-SLAVE-IO IND/REQ */
#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_SLAVE_IO_ACK_IRQ 0x0E
/* MASTER: DP-SLAVE-IO acknowldege IND/REQ */
#define DP_DATA_STOP_REQ_IRQ \
#define DP_DATA_STOP_REQ_IRQ 0xD0
/* MASTER: data transfer stop REQ received \
0xD0
/* MASTER: data transfer stop REQ received \
*/
*/
#define DP_DATA_STOP_ACK_IRQ 0x0D
/* MASTER: data transfer stop Acknowldege */
#define DP_DATA_STOP_ACK_IRQ 0x0D
/* MASTER: data transfer stop Acknowldege */
#define TRC_REQ_IRQ 0xC0
/* TRACE REQ is received */
#define TRC_REQ_IRQ 0xC0
/* TRACE REQ is received */
#define TRC_ACK_IRQ 0x0C
/* TRACE acknowledge */
#define TRC_ACK_IRQ 0x0C
/* TRACE acknowledge */
#define EXCEPTION_REQ_IRQ 0xB0
/* Exception Request */
#define EXCEPTION_REQ_IRQ 0xB0
/* Exception Request */
#define EXCEPTION_ACK_IRQ 0x0B
/* Exception Acknowledge */
#define EXCEPTION_ACK_IRQ 0x0B
/* Exception Acknowledge */
#define DPS_SLAVE_INP_REQ_IRQ 0xA0
/* SLAVE: DP-SLAVE-INPUT request */
#define DPS_SLAVE_INP_REQ_IRQ 0xA0
/* SLAVE: DP-SLAVE-INPUT request */
#define DPS_SLAVE_INP_ACK_IRQ 0x0A
/* SLAVE: DP-SLAVE-INPUT Acknowldege */
#define DPS_SLAVE_INP_ACK_IRQ 0x0A
/* SLAVE: DP-SLAVE-INPUT Acknowldege */
#define DPS_SLAVE_OUTP_REQ_IRQ 0x90
/* SLAVE: DP-SLAVE-OUTPUT request */
#define DPS_SLAVE_OUTP_REQ_IRQ 0x90
/* SLAVE: DP-SLAVE-OUTPUT request */
...
@@ -117,7 +81,7 @@
...
@@ -117,7 +81,7 @@
/* --- contants to receive an indication or confirmation
/* --- contants to receive an indication or confirmation
* ------------------------ */
* ------------------------ */
#define CON_IND_RECEIVED 0x0001
/* ind. or con. has been received */
#define CON_IND_RECEIVED 0x0001
/* ind. or con. has been received */
#define NO_CON_IND_RECEIVED 0x0000
/* nothing has been received */
#define NO_CON_IND_RECEIVED 0x0000
/* nothing has been received */
/* --- values > CON_IND_RECEIVED are error returns (see pb_err.h)
/* --- values > CON_IND_RECEIVED are error returns (see pb_err.h)
...
@@ -136,7 +100,7 @@
...
@@ -136,7 +100,7 @@
/* --- service priority
/* --- service priority
* --------------------------------------------------------- */
* --------------------------------------------------------- */
#define LOW 0x00
/* high priority */
#define LOW 0x00
/* high priority */
#define HIGH 0x01
/* low priority */
#define HIGH 0x01
/* low priority */
/* --- service primitives
/* --- service primitives
...
@@ -149,27 +113,27 @@
...
@@ -149,27 +113,27 @@
/* --- layer identifiers
/* --- layer identifiers
* -------------------------------------------------------- */
* -------------------------------------------------------- */
#define USR 0x00
/* identifier USER */
#define USR 0x00
/* identifier USER */
#define FMS 0x01
/* identifier FMS */
#define FMS 0x01
/* identifier FMS */
#define LLI 0x02
/* identifier LLI */
#define LLI 0x02
/* identifier LLI */
#define FDL 0x03
/* identifier FDL */
#define FDL 0x03
/* identifier FDL */
#define FM7 0x04
/* identifier FM7 */
#define FM7 0x04
/* identifier FM7 */
#define FMB 0x05
/* identifier FMB */
#define FMB 0x05
/* identifier FMB */
#define FMS_USR 0x06
/* identifier FMS-USER */
#define FMS_USR 0x06
/* identifier FMS-USER */
#define FM7_USR 0x07
/* identifier FM7-USER */
#define FM7_USR 0x07
/* identifier FM7-USER */
#define FMB_USR 0x08
/* identifier FMB-USER */
#define FMB_USR 0x08
/* identifier FMB-USER */
#define DPS 0x09
/* identifier DPS */
#define DPS 0x09
/* identifier DPS */
#define DPS_USR 0x0A
/* identifier DPS-USER */
#define DPS_USR 0x0A
/* identifier DPS-USER */
#define DP 0x0B
/* identifier DP */
#define DP 0x0B
/* identifier DP */
#define DP_USR 0x0C
/* identifier DP-USER */
#define DP_USR 0x0C
/* identifier DP-USER */
#define FDLIF 0x0D
/* identifier FDLIF */
#define FDLIF 0x0D
/* identifier FDLIF */
#define FDLIF_USR 0x0E
/* identifier FDLIF-USER */
#define FDLIF_USR 0x0E
/* identifier FDLIF-USER */
#define PAPI 0xF0
/* identifier Application-Layer-IF */
#define PAPI 0xF0
/* identifier Application-Layer-IF */
#if (PB_VER < 500)
#if (PB_VER < 500)
#define FMA7 FM7
/* identifier FMA7 */
#define FMA7 FM7
/* identifier FMA7 */
#define FMA2 FMB
/* identifier FMA2 */
#define FMA2 FMB
/* identifier FMA2 */
#define FMA7_USR FM7_USR
/* identifier FMA7-USER */
#define FMA7_USR FM7_USR
/* identifier FMA7-USER */
#endif
#endif
...
@@ -185,28 +149,28 @@
...
@@ -185,28 +149,28 @@
* ----------------------------------------------- */
* ----------------------------------------------- */
/* --- DP-MASTER
/* --- DP-MASTER
* ---------------------------------------------------------------- */
* ---------------------------------------------------------------- */
#define ID_DP_SLAVE_IO_IMAGE 0x80
/* MASTER: image for slave io datas */
#define ID_DP_SLAVE_IO_IMAGE 0x80
/* MASTER: image for slave io datas */
#define ID_DP_STATUS_IMAGE 0x81
/* MASTER: image for status datas */
#define ID_DP_STATUS_IMAGE 0x81
/* MASTER: image for status datas */
#define ID_DP_SLAVE_IO_CONFIG_IMAGE \
#define ID_DP_SLAVE_IO_CONFIG_IMAGE 0x82
/* MASTER: DPRAM layout of slave io \
0x82
/* MASTER: DPRAM layout of slave io \
*/
*/
/* --- DP-SLAVE
/* --- DP-SLAVE
* ----------------------------------------------------------------- */
* ----------------------------------------------------------------- */
#define ID_DPS_SLAVE_INPUT_IMAGE 0x90
/* SLAVE: image for slave input datas */
#define ID_DPS_SLAVE_INPUT_IMAGE 0x90
/* SLAVE: image for slave input datas */
#define ID_DPS_SLAVE_OUTPUT_IMAGE \
#define ID_DPS_SLAVE_OUTPUT_IMAGE 0x91
/* SLAVE: image for slave output datas \
0x91
/* SLAVE: image for slave output datas \
*/
*/
/* --- 0x92 reserved for internal use
*/
/* --- 0xA0 - 0xEF reserved for future use --- (no identifiers defined)
/* --- 0xA0 - 0xEF reserved for future use --- (no identifiers defined)
* --------- */
* --------- */
/* --- 0xF0 - 0xFF reserved for diagonsis
/* --- 0xF0 - 0xFF reserved for diagonsis
* -------------------------------------- */
* -------------------------------------- */
#define ID_EXCEPTION_IMAGE 0xF0
/* image for exeption datas */
#define ID_EXCEPTION_IMAGE 0xF0
/* image for exeption datas */
#define ID_FW_VERS_IMAGE 0xF1
/* image for firmware version */
#define ID_FW_VERS_IMAGE 0xF1
/* image for firmware version */
#define ID_SERIAL_DEVICE_NUMBER 0xF2
/* image for serial device number */
#define ID_SERIAL_DEVICE_NUMBER 0xF2
/* image for serial device number */
#define ID_TRACE_IMAGE 0xF3
/* image for TRACE datas */
#define ID_TRACE_IMAGE 0xF3
/* image for TRACE datas */
/* --- idebtifier for end of data description list
/* --- idebtifier for end of data description list
* ------------------------------ */
* ------------------------------ */
...
@@ -216,50 +180,39 @@
...
@@ -216,50 +180,39 @@
/* PROFI SERVICE DESCRIPTION BLOCK */
/* PROFI SERVICE DESCRIPTION BLOCK */
/**********************************************************************************/
/**********************************************************************************/
typedef
struct
_T_PROFI_DEVICE_HANDLE
{
typedef
struct
_T_PROFI_SERVICE_DESCR
HANDLE
hServiceReadDevice
;
// Handle for Service device
{
HANDLE
hServiceWriteDevice
;
// Handle for Service device
HANDLE
hDpDataDevice
;
// Handle for DP-Data device
HANDLE
hDpsInputDataDevice
;
// Handle for DP-Slave Input-Data device
HANDLE
hDpsOutputDataDevice
;
// Handle for DP-Slave Output-Data device
USIGN8
CurrentBoardNumber
;
}
T_PROFI_DEVICE_HANDLE
;
/**********************************************************************************/
/* PROFI SERVICE DESCRIPTION BLOCK */
/**********************************************************************************/
typedef
struct
_T_PROFI_SERVICE_DESCR
{
USIGN16
comm_ref
;
/* communication reference */
USIGN16
comm_ref
;
/* communication reference */
USIGN8
layer
;
/* layer identifier */
USIGN8
layer
;
/* layer identifier */
USIGN8
service
;
/* service identifier */
USIGN8
service
;
/* service identifier */
USIGN8
primitive
;
/* service primitive */
USIGN8
primitive
;
/* service primitive */
INT8
invoke_id
;
/* invoke id */
INT8
invoke_id
;
/* invoke id */
INT16
result
;
/* service result (POS or NEG) */
INT16
result
;
/* service result (POS or NEG) */
}
T_PROFI_SERVICE_DESCR
;
}
T_PROFI_SERVICE_DESCR
;
#ifdef WIN16
#ifdef WIN16
/**********************************************************************************/
/**********************************************************************************/
/* PROFI INITIALIZATION DATA STRUCTURE */
/* PROFI INITIALIZATION DATA STRUCTURE */
/**********************************************************************************/
/**********************************************************************************/
typedef
struct
_T_PROFI_INIT
{
typedef
struct
_T_PROFI_INIT
USIGN32
dpr_address
;
/* DPR address */
{
INT16
io_port_address
;
/* IO port address */
USIGN32
dpr_address
;
/* DPR address */
PB_BOOL
load_firmware
;
/* PB_TRUE for PROFI-IF
INT16
io_port_address
;
/* IO port address */
PB_FALSE for PROFIboard,PROFIcard and PROFI104 */
PB_BOOL
load_firmware
;
/* PB_TRUE for PROFI-IF
USIGN8
time_out
;
/* time out interval in seconds */
PB_FALSE for PROFIboard,PROFIcard and PROFI104 */
CSTRING
*
loader_file
;
/* loader file (PROFI-IF only) */
USIGN8
time_out
;
/* time out interval in seconds */
CSTRING
*
loader_file
;
/* loader file (PROFI-IF only) */
CSTRING
*
firmware_file
;
/* firmware file (PROFI-IF only */
CSTRING
*
firmware_file
;
/* firmware file (PROFI-IF only */
USIGN8
host_type
;
/* for internal use */
USIGN8
host_type
;
/* for internal use */
USIGN8
irq_vector
;
/* IRQ line to host */
USIGN8
irq_vector
;
/* IRQ line to host */
USIGN8
dpr_access_mode
;
/* DPR access mode (8/16 Bit ...) */
USIGN8
dpr_access_mode
;
/* DPR access mode (8/16 Bit ...) */
USIGN8
address_mode
;
/* host address mode */
USIGN8
address_mode
;
/* host address mode */
USIGN8
poll_int_mode
;
/* host POLL / IRQ mode */
USIGN8
poll_int_mode
;
/* host POLL / IRQ mode */
USIGN8
cntrl_type
;
/* for internal use */
USIGN8
cntrl_type
;
/* for internal use */
USIGN8
token_drive
;
/* indicates the token drive (only PROFI-IF)*/
USIGN8
token_drive
;
/* indicates the token drive (only PROFI-IF)*/
USIGN8
reserved_1
;
/* reserved */
USIGN8
reserved_1
;
/* reserved */
USIGN16
reserved_2
;
/* reserved */
USIGN16
reserved_2
;
/* reserved */
USIGN16
reserved_3
;
/* reserved */
USIGN16
reserved_3
;
/* reserved */
}
T_PROFI_INIT
;
}
T_PROFI_INIT
;
/* --- macro to set T_PROFI_INIT data structure with default values ------------
/* --- macro to set T_PROFI_INIT data structure with default values ------------
...
@@ -287,9 +240,10 @@ extern "C" {
...
@@ -287,9 +240,10 @@ extern "C" {
#endif
#endif
#if defined(WIN32) || defined(_LINUX)
#if defined(WIN32) || defined(_LINUX)
FUNCTION
extern
INT16
CALL_CONV
profi_set_default
(
FUNCTION
extern
INT16
CALL_CONV
profi_set_default
(
IN
USIGN8
Board
,
OUT
T_PROFI_DEVICE_HANDLE
*
hDevice
,
IN
USIGN8
Board
,
IN
USIGN8
Channel
,
IN
USIGN8
Channel
,
IN
USIGN32
ReadTimeout
,
IN
USIGN32
WriteTimeout
)
IN
USIGN32
ReadTimeout
,
IN
USIGN32
WriteTimeout
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -316,8 +270,9 @@ FUNCTION extern INT16 CALL_CONV profi_set_default(
...
@@ -316,8 +270,9 @@ FUNCTION extern INT16 CALL_CONV profi_set_default(
-----------------------------------------------------------------------------*/
-----------------------------------------------------------------------------*/
;
;
FUNCTION
extern
INT16
CALL_CONV
profi_init
(
OUT
T_PROFI_DEVICE_HANDLE
*
hDevice
,
FUNCTION
extern
INT16
CALL_CONV
profi_init
(
IN
USIGN8
Board
,
IN
USIGN8
Board
,
IN
USIGN32
ReadTimeout
,
IN
USIGN32
WriteTimeout
)
IN
USIGN32
ReadTimeout
,
IN
USIGN32
WriteTimeout
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -345,8 +300,9 @@ FUNCTION extern INT16 CALL_CONV profi_init(OUT T_PROFI_DEVICE_HANDLE* hDevice,
...
@@ -345,8 +300,9 @@ FUNCTION extern INT16 CALL_CONV profi_init(OUT T_PROFI_DEVICE_HANDLE* hDevice,
;
;
#endif
#endif
FUNCTION
extern
INT16
CALL_CONV
init_profibus
(
FUNCTION
extern
INT16
CALL_CONV
init_profibus
(
IN
USIGN32
DprAdress
,
IN
USIGN32
DprAdress
,
IN
USIGN16
IoPortAdress
,
IN
PB_BOOL
Dummy
)
IN
USIGN16
IoPortAdress
,
IN
PB_BOOL
Dummy
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -374,7 +330,7 @@ FUNCTION extern INT16 CALL_CONV init_profibus(
...
@@ -374,7 +330,7 @@ FUNCTION extern INT16 CALL_CONV init_profibus(
-----------------------------------------------------------------------------*/
-----------------------------------------------------------------------------*/
;
;
FUNCTION
extern
INT16
CALL_CONV
profi_end
(
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
)
FUNCTION
extern
INT16
CALL_CONV
profi_end
(
VOID
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -389,8 +345,7 @@ FUNCTION extern INT16 CALL_CONV profi_end(IN T_PROFI_DEVICE_HANDLE* hDevice)
...
@@ -389,8 +345,7 @@ FUNCTION extern INT16 CALL_CONV profi_end(IN T_PROFI_DEVICE_HANDLE* hDevice)
;
;
FUNCTION
extern
INT16
CALL_CONV
profi_snd_req_res
(
FUNCTION
extern
INT16
CALL_CONV
profi_snd_req_res
(
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
IN
T_PROFI_SERVICE_DESCR
*
pSdb
,
IN
T_PROFI_SERVICE_DESCR
*
pSdb
,
IN
VOID
*
pData
,
IN
PB_BOOL
dummy
)
IN
VOID
*
pData
,
IN
PB_BOOL
dummy
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -426,9 +381,9 @@ FUNCTION extern INT16 CALL_CONV profi_snd_req_res(
...
@@ -426,9 +381,9 @@ FUNCTION extern INT16 CALL_CONV profi_snd_req_res(
----------------------------------------------------------------------------*/
----------------------------------------------------------------------------*/
;
;
FUNCTION
extern
INT16
CALL_CONV
profi_rcv_con_ind
(
FUNCTION
extern
INT16
CALL_CONV
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
OUT
T_PROFI_SERVICE_DESCR
*
pSdb
,
profi_rcv_con_ind
(
OUT
T_PROFI_SERVICE_DESCR
*
pSdb
,
OUT
VOID
*
pData
,
OUT
VOID
*
pData
,
INOUT
USIGN16
*
pDataLength
)
INOUT
USIGN16
*
pDataLength
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -455,9 +410,10 @@ FUNCTION extern INT16 CALL_CONV profi_rcv_con_ind(
...
@@ -455,9 +410,10 @@ FUNCTION extern INT16 CALL_CONV profi_rcv_con_ind(
----------------------------------------------------------------------------*/
----------------------------------------------------------------------------*/
;
;
FUNCTION
extern
INT16
CALL_CONV
profi_set_data
(
FUNCTION
extern
INT16
CALL_CONV
profi_set_data
(
IN
USIGN8
DataId
,
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
IN
USIGN8
DataId
,
IN
USIGN16
Offset
,
IN
USIGN16
Offset
,
IN
USIGN16
DataLength
,
IN
VOID
*
pData
)
IN
USIGN16
DataLength
,
IN
VOID
*
pData
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -485,9 +441,10 @@ FUNCTION extern INT16 CALL_CONV profi_set_data(
...
@@ -485,9 +441,10 @@ FUNCTION extern INT16 CALL_CONV profi_set_data(
-----------------------------------------------------------------------------*/
-----------------------------------------------------------------------------*/
;
;
FUNCTION
extern
INT16
CALL_CONV
profi_get_data
(
FUNCTION
extern
INT16
CALL_CONV
profi_get_data
(
IN
USIGN8
DataId
,
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
IN
USIGN8
DataId
,
IN
USIGN16
Offset
,
IN
USIGN16
Offset
,
INOUT
USIGN16
*
pDataLength
,
OUT
VOID
*
pData
)
INOUT
USIGN16
*
pDataLength
,
OUT
VOID
*
pData
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -515,9 +472,9 @@ FUNCTION extern INT16 CALL_CONV profi_get_data(
...
@@ -515,9 +472,9 @@ FUNCTION extern INT16 CALL_CONV profi_get_data(
-----------------------------------------------------------------------------*/
-----------------------------------------------------------------------------*/
;
;
FUNCTION
extern
INT16
CALL_CONV
profi_set_dps_input_data
(
FUNCTION
extern
INT16
CALL_CONV
profi_set_dps_input_data
(
IN
USIGN8
*
pData
,
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
IN
USIGN8
*
pData
,
IN
USIGN8
DataLength
,
IN
USIGN8
DataLength
,
OUT
USIGN8
*
pState
)
OUT
USIGN8
*
pState
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -540,8 +497,7 @@ FUNCTION extern INT16 CALL_CONV profi_set_dps_input_data(
...
@@ -540,8 +497,7 @@ FUNCTION extern INT16 CALL_CONV profi_set_dps_input_data(
;
;
FUNCTION
extern
INT16
CALL_CONV
profi_get_dps_input_data
(
FUNCTION
extern
INT16
CALL_CONV
profi_get_dps_input_data
(
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
OUT
USIGN8
*
pData
,
OUT
USIGN8
*
pData
,
INOUT
USIGN8
*
pDataLength
,
OUT
USIGN8
*
pState
)
INOUT
USIGN8
*
pDataLength
,
OUT
USIGN8
*
pState
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -561,8 +517,7 @@ FUNCTION extern INT16 CALL_CONV profi_get_dps_input_data(
...
@@ -561,8 +517,7 @@ FUNCTION extern INT16 CALL_CONV profi_get_dps_input_data(
;
;
FUNCTION
extern
INT16
CALL_CONV
profi_get_dps_output_data
(
FUNCTION
extern
INT16
CALL_CONV
profi_get_dps_output_data
(
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
OUT
USIGN8
*
pData
,
OUT
USIGN8
*
pData
,
INOUT
USIGN8
*
pDataLength
,
OUT
USIGN8
*
pState
)
INOUT
USIGN8
*
pDataLength
,
OUT
USIGN8
*
pState
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -583,9 +538,8 @@ FUNCTION extern INT16 CALL_CONV profi_get_dps_output_data(
...
@@ -583,9 +538,8 @@ FUNCTION extern INT16 CALL_CONV profi_get_dps_output_data(
-----------------------------------------------------------------------------*/
-----------------------------------------------------------------------------*/
;
;
FUNCTION
extern
INT16
CALL_CONV
profi_get_versions
(
FUNCTION
extern
INT16
CALL_CONV
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
OUT
CSTRING
*
pPapiVersion
,
profi_get_versions
(
OUT
CSTRING
*
pPapiVersion
,
OUT
CSTRING
*
pFirmwareVersion
)
OUT
CSTRING
*
pFirmwareVersion
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -604,8 +558,8 @@ FUNCTION extern INT16 CALL_CONV profi_get_versions(
...
@@ -604,8 +558,8 @@ FUNCTION extern INT16 CALL_CONV profi_get_versions(
-----------------------------------------------------------------------------*/
-----------------------------------------------------------------------------*/
;
;
FUNCTION
extern
INT16
CALL_CONV
profi_get_serial_device_number
(
FUNCTION
extern
INT16
CALL_CONV
IN
T_PROFI_DEVICE_HANDLE
*
hDevice
,
OUT
USIGN32
*
pSerialDeviceNumber
)
profi_get_serial_device_number
(
OUT
USIGN32
*
pSerialDeviceNumber
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -686,7 +640,9 @@ FUNCTION extern HANDLE CALL_CONV profi_open_basic_management(
...
@@ -686,7 +640,9 @@ FUNCTION extern HANDLE CALL_CONV profi_open_basic_management(
;
;
FUNCTION
extern
HANDLE
CALL_CONV
profi_open
(
IN
HANDLE
hBasicMgmtDevice
,
FUNCTION
extern
HANDLE
CALL_CONV
profi_open
(
IN
HANDLE
hBasicMgmtDevice
,
IN
INT32
DeviceType
,
IN
USIGN32
Index
,
IN
INT32
DesiredAccess
)
IN
INT32
DeviceType
,
IN
USIGN32
Index
,
IN
INT32
DesiredAccess
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -737,9 +693,9 @@ FUNCTION extern BOOL CALL_CONV profi_close(IN HANDLE hDevice)
...
@@ -737,9 +693,9 @@ FUNCTION extern BOOL CALL_CONV profi_close(IN HANDLE hDevice)
-----------------------------------------------------------------------------*/
-----------------------------------------------------------------------------*/
;
;
FUNCTION
extern
INT16
CALL_CONV
profi_read_service
(
IN
HANDLE
hDevice
,
FUNCTION
extern
INT16
CALL_CONV
OUT
T_PROFI_SERVICE_DESCR
*
pSdb
,
OUT
VOID
*
pData
,
profi_read_service
(
IN
HANDLE
hDevice
,
OUT
T_PROFI_SERVICE_DESCR
*
pSdb
,
INOUT
USIGN16
*
pDataLength
)
OUT
VOID
*
pData
,
INOUT
USIGN16
*
pDataLength
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -840,8 +796,9 @@ FUNCTION extern INT16 CALL_CONV profi_read_multi(
...
@@ -840,8 +796,9 @@ FUNCTION extern INT16 CALL_CONV profi_read_multi(
-----------------------------------------------------------------------------*/
-----------------------------------------------------------------------------*/
;
;
FUNCTION
extern
INT16
CALL_CONV
profi_read_data
(
FUNCTION
extern
INT16
CALL_CONV
profi_read_data
(
IN
HANDLE
hDevice
,
IN
HANDLE
hDevice
,
OUT
VOID
*
pData
,
OUT
USIGN16
*
pDataLength
)
OUT
VOID
*
pData
,
OUT
USIGN16
*
pDataLength
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -867,8 +824,9 @@ FUNCTION extern INT16 CALL_CONV profi_read_data(
...
@@ -867,8 +824,9 @@ FUNCTION extern INT16 CALL_CONV profi_read_data(
-----------------------------------------------------------------------------*/
-----------------------------------------------------------------------------*/
;
;
FUNCTION
extern
INT16
CALL_CONV
profi_write_data
(
FUNCTION
extern
INT16
CALL_CONV
profi_write_data
(
IN
HANDLE
hDevice
,
IN
HANDLE
hDevice
,
IN
VOID
*
pData
,
IN
USIGN16
DataLength
)
IN
VOID
*
pData
,
IN
USIGN16
DataLength
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -894,7 +852,9 @@ FUNCTION extern INT16 CALL_CONV profi_write_data(
...
@@ -894,7 +852,9 @@ FUNCTION extern INT16 CALL_CONV profi_write_data(
;
;
FUNCTION
extern
INT16
CALL_CONV
profi_read_dps_data
(
IN
HANDLE
hDevice
,
FUNCTION
extern
INT16
CALL_CONV
profi_read_dps_data
(
IN
HANDLE
hDevice
,
OUT
USIGN8
*
pData
,
INOUT
USIGN8
*
pDataLength
,
OUT
USIGN8
*
pState
)
OUT
USIGN8
*
pData
,
INOUT
USIGN8
*
pDataLength
,
OUT
USIGN8
*
pState
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -922,7 +882,9 @@ FUNCTION extern INT16 CALL_CONV profi_read_dps_data(IN HANDLE hDevice,
...
@@ -922,7 +882,9 @@ FUNCTION extern INT16 CALL_CONV profi_read_dps_data(IN HANDLE hDevice,
;
;
FUNCTION
extern
INT16
CALL_CONV
profi_write_dps_data
(
IN
HANDLE
hDevice
,
FUNCTION
extern
INT16
CALL_CONV
profi_write_dps_data
(
IN
HANDLE
hDevice
,
IN
USIGN8
*
pData
,
IN
USIGN8
DataLength
,
OUT
USIGN8
*
pState
)
IN
USIGN8
*
pData
,
IN
USIGN8
DataLength
,
OUT
USIGN8
*
pState
)
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -944,8 +906,9 @@ FUNCTION extern INT16 CALL_CONV profi_write_dps_data(IN HANDLE hDevice,
...
@@ -944,8 +906,9 @@ FUNCTION extern INT16 CALL_CONV profi_write_dps_data(IN HANDLE hDevice,
-----------------------------------------------------------------------------*/
-----------------------------------------------------------------------------*/
;
;
FUNCTION
extern
BOOL
CALL_CONV
profi_get_cntrl_info
(
IN
USIGN8
Board
,
FUNCTION
extern
BOOL
CALL_CONV
OUT
char
*
pFirmwareVersion
,
OUT
USIGN32
*
pSerialDeviceNumber
)
profi_get_cntrl_info
(
IN
USIGN8
Board
,
OUT
char
*
pFirmwareVersion
,
OUT
USIGN32
*
pSerialDeviceNumber
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -967,8 +930,9 @@ FUNCTION extern BOOL CALL_CONV profi_get_cntrl_info(IN USIGN8 Board,
...
@@ -967,8 +930,9 @@ FUNCTION extern BOOL CALL_CONV profi_get_cntrl_info(IN USIGN8 Board,
-----------------------------------------------------------------------------*/
-----------------------------------------------------------------------------*/
;
;
FUNCTION
extern
BOOL
CALL_CONV
profi_set_timeout
(
FUNCTION
extern
BOOL
CALL_CONV
profi_set_timeout
(
IN
HANDLE
hBasicMgmtDevice
,
IN
HANDLE
hBasicMgmtDevice
,
IN
USIGN32
ReadTimeout
,
IN
USIGN32
WriteTimeout
)
IN
USIGN32
ReadTimeout
,
IN
USIGN32
WriteTimeout
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -990,7 +954,8 @@ FUNCTION extern BOOL CALL_CONV profi_set_timeout(
...
@@ -990,7 +954,8 @@ FUNCTION extern BOOL CALL_CONV profi_set_timeout(
;
;
FUNCTION
extern
BOOL
CALL_CONV
profi_get_timeout
(
IN
HANDLE
hBasicMgmtDevice
,
FUNCTION
extern
BOOL
CALL_CONV
profi_get_timeout
(
IN
HANDLE
hBasicMgmtDevice
,
OUT
USIGN32
*
pReadTimeout
,
OUT
USIGN32
*
pWriteTimeout
)
OUT
USIGN32
*
pReadTimeout
,
OUT
USIGN32
*
pWriteTimeout
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -1011,8 +976,8 @@ FUNCTION extern BOOL CALL_CONV profi_get_timeout(IN HANDLE hBasicMgmtDevice,
...
@@ -1011,8 +976,8 @@ FUNCTION extern BOOL CALL_CONV profi_get_timeout(IN HANDLE hBasicMgmtDevice,
-----------------------------------------------------------------------------*/
-----------------------------------------------------------------------------*/
;
;
FUNCTION
extern
BOOL
CALL_CONV
profi_set_queue_size
(
FUNCTION
extern
BOOL
CALL_CONV
profi_set_queue_size
(
IN
HANDLE
hBasicMgmtDevice
,
IN
HANDLE
hBasicMgmtDevice
,
IN
USIGN32
QueueSize
)
IN
USIGN32
QueueSize
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -1029,8 +994,8 @@ FUNCTION extern BOOL CALL_CONV profi_set_queue_size(
...
@@ -1029,8 +994,8 @@ FUNCTION extern BOOL CALL_CONV profi_set_queue_size(
-----------------------------------------------------------------------------*/
-----------------------------------------------------------------------------*/
;
;
FUNCTION
extern
BOOL
CALL_CONV
profi_get_queue_size
(
FUNCTION
extern
BOOL
CALL_CONV
profi_get_queue_size
(
IN
HANDLE
hBasicMgmtDevice
,
IN
HANDLE
hBasicMgmtDevice
,
OUT
USIGN32
*
pQueueSize
)
OUT
USIGN32
*
pQueueSize
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -1047,8 +1012,8 @@ FUNCTION extern BOOL CALL_CONV profi_get_queue_size(
...
@@ -1047,8 +1012,8 @@ FUNCTION extern BOOL CALL_CONV profi_get_queue_size(
-----------------------------------------------------------------------------*/
-----------------------------------------------------------------------------*/
;
;
FUNCTION
extern
BOOL
CALL_CONV
profi_get_overrun_count
(
FUNCTION
extern
BOOL
CALL_CONV
IN
HANDLE
hBasicMgmtDevice
,
OUT
USIGN32
*
pOverrunCount
)
profi_get_overrun_count
(
IN
HANDLE
hBasicMgmtDevice
,
OUT
USIGN32
*
pOverrunCount
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
...
profibus/lib/rt/src/pb_ioctl.h
View file @
ce758cd3
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************/
/*****************************************************************************/
/* */
/* */
/*
SOFTING AG
*/
/*
SOFTING Industrial Automation GmbH
*/
/* Richard-Reitzner-Allee 6 */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* */
/*
Copyright (C) SOFTING AG 1995-2003
*/
/*
Copyright (C) SOFTING Industrial Automation GmbH 1995-2012
*/
/* All Rights Reserved */
/* All Rights Reserved */
/* */
/* */
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
/*
PROFIBUS WINDOWS NT DRIVERS
*/
/*
PROFIBUS LINUX DRIVERS
*/
/* */
/* */
/* Filename : PB_IOCTL.H */
/* Filename : PB_IOCTL.H */
/* Version : 5.
26.0.01
.release */
/* Version : 5.
45.0.00
.release */
/* Date :
30-April-2003
*/
/* Date :
December-2009
*/
/* Author : SOFTING
AG
*/
/* Author : SOFTING
*/
/* */
/* */
/* Description : This file contains the global declarations */
/* Description : This file contains the global declarations */
/* to access the PROFIBUS Drivers for Linux */
/* to access the PROFIBUS Drivers for Linux */
...
@@ -77,40 +42,50 @@
...
@@ -77,40 +42,50 @@
#define IOCTL_PROFI_SET_DEBUGLEVEL 0x6909
#define IOCTL_PROFI_SET_DEBUGLEVEL 0x6909
#ifdef __KERNEL__
#ifdef __KERNEL__
extern
int
pb_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32)
unsigned
long
arg
);
long
pb_ioctl
(
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
);
#else
int
pb_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
);
#endif
#endif
#endif
/*****************************************************************************/
/*****************************************************************************/
/* Structure for data image description */
/* Structure for data image description */
/*****************************************************************************/
/*****************************************************************************/
typedef
struct
_StatusAndData
{
// #pragma pack(push,1)
typedef
struct
_StatusAndData
{
void
*
StatusImage
;
void
*
StatusImage
;
int
StatusLength
;
__s32
StatusLength
;
void
*
Data
;
void
*
Data
;
int
DataLength
;
__s32
DataLength
;
}
StatusAndData
;
}
__attribute__
((
aligned
(
8
)))
StatusAndData
;
typedef
struct
_NTIoctl
{
typedef
struct
_NTIoctl
{
void
*
InBuf
;
void
*
InBuf
;
int
InBufLength
;
__s32
InBufLength
;
void
*
OutBuf
;
void
*
OutBuf
;
int
OutBufLength
;
__s32
OutBufLength
;
}
NTIoctl
;
}
__attribute__
((
aligned
(
8
)))
NTIoctl
;
typedef
struct
_DataImage
{
typedef
struct
_DataImage
int
id
;
{
__s32
id
;
void
*
Buf
;
void
*
Buf
;
unsigned
short
Length
;
// sizeof( Buf )
__u16
Length
;
// sizeof( Buf )
}
DataImage
;
}
__attribute__
((
aligned
(
8
)))
DataImage
;
// #pragma pack(pop)
/*****************************************************************************/
/*****************************************************************************/
/* Operation Mode as (FMS/DPV1-Master or DP-Slave) */
/* Operation Mode as (FMS/DPV1-Master or DP-Slave) */
/*****************************************************************************/
/*****************************************************************************/
#define FMS_DPV1_MASTER_MODE 0x00 // FMS/DPV1-Master
#define FMS_DPV1_MASTER_MODE 0x00 // FMS/DPV1-Master
#define DPV1_MASTER_MODE 0x01 // for future use
#define DPV1_MASTER_MODE 0x01
// for future use
#define DPV1_SLAVE_MODE 0x02 // DP-Slave
#define DPV1_SLAVE_MODE 0x02
// DP-Slave
#endif
#endif
profibus/lib/rt/src/pb_ntdrv.h
View file @
ce758cd3
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************/
/*****************************************************************************/
/* */
/* */
/*
SOFTING AG
*/
/*
SOFTING Industrial Automation GmbH
*/
/* Richard-Reitzner-Allee 6 */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* */
/*
Copyright (C) SOFTING AG 1995-2003
*/
/*
Copyright (C) SOFTING Industrial Automation GmbH 1995-2012
*/
/* All Rights Reserved */
/* All Rights Reserved */
/* */
/* */
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
/*
PROFIBUS WINDOWS NT DRIVERS
*/
/*
PROFIBUS LINUX DRIVERS
*/
/* */
/* */
/* Filename : PB_NTDRV.H */
/* Filename : PB_NTDRV.H */
/* Version : 5.
26.0.01
.release */
/* Version : 5.
45.0.00
.release */
/* Date :
30-April-2003
*/
/* Date :
December-2009
*/
/* Author : SOFTING
AG
*/
/* Author : SOFTING
*/
/* */
/* */
/* Description : This file contains the global declarations */
/* Description : This file contains the global declarations */
/* to access the PROFIBUS Drivers for
Windows NT
*/
/* to access the PROFIBUS Drivers for
Linux
*/
/* */
/* */
/*****************************************************************************/
/*****************************************************************************/
...
@@ -72,66 +37,66 @@
...
@@ -72,66 +37,66 @@
#define FILE_DEVICE_PROFIBOARD 0x8000
#define FILE_DEVICE_PROFIBOARD 0x8000
#define IOCTL_PROFI_CREATE_DP_MANAGEMENT \
#define IOCTL_PROFI_CREATE_DP_MANAGEMENT \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x800, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x800, METHOD_BUFFERED,
FILE_ANY_ACCESS)
FILE_ANY_ACCESS)
#define IOCTL_PROFI_CREATE_DP_SERVICE \
#define IOCTL_PROFI_CREATE_DP_SERVICE \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x801, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x801, METHOD_BUFFERED,
FILE_ANY_ACCESS)
FILE_ANY_ACCESS)
#define IOCTL_PROFI_CREATE_DP_SLAVE_DATA \
#define IOCTL_PROFI_CREATE_DP_SLAVE_DATA \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x802, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x802, METHOD_BUFFERED,
FILE_ANY_ACCESS)
FILE_ANY_ACCESS)
#define IOCTL_PROFI_CREATE_FDL_MANAGEMENT \
#define IOCTL_PROFI_CREATE_FDL_MANAGEMENT \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x803, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x803, METHOD_BUFFERED,
FILE_ANY_ACCESS)
FILE_ANY_ACCESS)
#define IOCTL_PROFI_CREATE_FDL_SAP \
#define IOCTL_PROFI_CREATE_FDL_SAP \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x804, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x804, METHOD_BUFFERED,
FILE_ANY_ACCESS)
FILE_ANY_ACCESS)
#define IOCTL_PROFI_CREATE_FMS_MANAGEMENT \
#define IOCTL_PROFI_CREATE_FMS_MANAGEMENT \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x805, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x805, METHOD_BUFFERED,
FILE_ANY_ACCESS)
FILE_ANY_ACCESS)
#define IOCTL_PROFI_CREATE_FMS_CR \
#define IOCTL_PROFI_CREATE_FMS_CR \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x806, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x806, METHOD_BUFFERED,
FILE_ANY_ACCESS)
FILE_ANY_ACCESS)
#define IOCTL_PROFI_CREATE_DP_MSAC \
#define IOCTL_PROFI_CREATE_DP_MSAC \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x80e, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x80e, METHOD_BUFFERED,
FILE_ANY_ACCESS)
FILE_ANY_ACCESS)
#define IOCTL_PROFI_SET_TIMEOUT \
#define IOCTL_PROFI_SET_TIMEOUT \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x808, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x808, METHOD_BUFFERED,
FILE_READ_ACCESS)
FILE_READ_ACCESS)
#define IOCTL_PROFI_GET_TIMEOUT \
#define IOCTL_PROFI_GET_TIMEOUT \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x809, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x809, METHOD_BUFFERED,
FILE_ANY_ACCESS)
FILE_ANY_ACCESS)
#define IOCTL_PROFI_SET_QUEUE_SIZE \
#define IOCTL_PROFI_SET_QUEUE_SIZE \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x80a, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x80a, METHOD_BUFFERED,
FILE_ANY_ACCESS)
FILE_ANY_ACCESS)
#define IOCTL_PROFI_GET_QUEUE_SIZE \
#define IOCTL_PROFI_GET_QUEUE_SIZE \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x80b, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x80b, METHOD_BUFFERED,
FILE_ANY_ACCESS)
FILE_ANY_ACCESS)
#define IOCTL_PROFI_GET_OVERRUN_COUNT \
#define IOCTL_PROFI_GET_OVERRUN_COUNT \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x80c, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x80c, METHOD_BUFFERED,
FILE_ANY_ACCESS)
FILE_ANY_ACCESS)
#define IOCTL_PROFI_READ_MULTI \
#define IOCTL_PROFI_READ_MULTI \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x80d, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x80d, METHOD_BUFFERED,
FILE_ANY_ACCESS)
FILE_ANY_ACCESS)
#define IOCTL_PROFI_GET_DATA_IMAGE \
#define IOCTL_PROFI_GET_DATA_IMAGE \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x80f, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x80f, METHOD_BUFFERED,
FILE_ANY_ACCESS)
FILE_ANY_ACCESS)
#define IOCTL_PROFI_SET_DPS_DATA \
#define IOCTL_PROFI_SET_DPS_DATA \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x810, METHOD_IN_DIRECT,
\
FILE_DEVICE_PROFIBOARD, 0x810, METHOD_IN_DIRECT,
FILE_ANY_ACCESS)
FILE_ANY_ACCESS)
#define IOCTL_PROFI_SET_DP_BITS \
#define IOCTL_PROFI_SET_DP_BITS \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x811, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x811, METHOD_BUFFERED,
FILE_WRITE_ACCESS)
FILE_WRITE_ACCESS)
#define IOCTL_PROFI_CLEAR_DP_BITS \
#define IOCTL_PROFI_CLEAR_DP_BITS \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x812, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x812, METHOD_BUFFERED,
FILE_WRITE_ACCESS)
FILE_WRITE_ACCESS)
#define IOCTL_PROFI_CHECK_DEV_CONN \
#define IOCTL_PROFI_CHECK_DEV_CONN \
(ULONG) CTL_CODE(
\
(ULONG) CTL_CODE(
FILE_DEVICE_PROFIBOARD, 0x813, METHOD_BUFFERED,
\
FILE_DEVICE_PROFIBOARD, 0x813, METHOD_BUFFERED,
FILE_ANY_ACCESS)
FILE_ANY_ACCESS)
/*****************************************************************************/
/*****************************************************************************/
/* Macros to access for PROFIBUS specific error codes */
/* Macros to access for PROFIBUS specific error codes */
...
@@ -139,7 +104,7 @@
...
@@ -139,7 +104,7 @@
#define PROFI_ERROR_FLAG 0xe0000000
#define PROFI_ERROR_FLAG 0xe0000000
#define CUSTOMER_OK_FLAG 0x20000000 // Bit 29 set
#define CUSTOMER_OK_FLAG 0x20000000
// Bit 29 set
#define CUSTOMER_ERROR_FLAG 0xe0000000 // Bit 29..31 set
#define CUSTOMER_ERROR_FLAG 0xe0000000 // Bit 29..31 set
#define PROFI_ERROR(code) ((code) | PROFI_ERROR_FLAG)
#define PROFI_ERROR(code) ((code) | PROFI_ERROR_FLAG)
...
@@ -153,7 +118,8 @@
...
@@ -153,7 +118,8 @@
#define WAIT_FOREVER ((ULONG)-1)
#define WAIT_FOREVER ((ULONG)-1)
typedef
struct
_PROFI_TIMEOUT
{
typedef
struct
_PROFI_TIMEOUT
{
ULONG
TimeoutRead
;
ULONG
TimeoutRead
;
ULONG
TimeoutWrite
;
ULONG
TimeoutWrite
;
}
PROFI_TIMEOUT
,
T_PROFI_TIMEOUT
;
}
PROFI_TIMEOUT
,
T_PROFI_TIMEOUT
;
...
@@ -162,7 +128,8 @@ typedef struct _PROFI_TIMEOUT {
...
@@ -162,7 +128,8 @@ typedef struct _PROFI_TIMEOUT {
/* Structure for data image description */
/* Structure for data image description */
/*****************************************************************************/
/*****************************************************************************/
typedef
struct
_PROFI_DATA_IMAGE_DESCR
{
typedef
struct
_PROFI_DATA_IMAGE_DESCR
{
UCHAR
imageId
;
UCHAR
imageId
;
USHORT
offset
;
USHORT
offset
;
UCHAR
bus
;
UCHAR
bus
;
...
@@ -172,7 +139,8 @@ typedef struct _PROFI_DATA_IMAGE_DESCR {
...
@@ -172,7 +139,8 @@ typedef struct _PROFI_DATA_IMAGE_DESCR {
/* Structure for bit access in DP output data */
/* Structure for bit access in DP output data */
/*****************************************************************************/
/*****************************************************************************/
typedef
struct
_PROFI_DP_BIT_ACCESS
{
typedef
struct
_PROFI_DP_BIT_ACCESS
{
USHORT
offset
;
USHORT
offset
;
UCHAR
mask
;
UCHAR
mask
;
}
PROFI_DP_BIT_ACCESS
,
T_PROFI_DP_BIT_ACCESS
;
}
PROFI_DP_BIT_ACCESS
,
T_PROFI_DP_BIT_ACCESS
;
...
@@ -190,7 +158,7 @@ typedef struct _PROFI_DP_BIT_ACCESS {
...
@@ -190,7 +158,7 @@ typedef struct _PROFI_DP_BIT_ACCESS {
/*****************************************************************************/
/*****************************************************************************/
#define FMS_DPV1_MASTER_MODE 0x00 // FMS/DPV1-Master
#define FMS_DPV1_MASTER_MODE 0x00 // FMS/DPV1-Master
#define DPV1_MASTER_MODE 0x01 // for future use
#define DPV1_MASTER_MODE 0x01
// for future use
#define DPV1_SLAVE_MODE 0x02 // DP-Slave
#define DPV1_SLAVE_MODE 0x02
// DP-Slave
#endif
#endif
profibus/lib/rt/src/pb_tools.h
View file @
ce758cd3
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************/
/*****************************************************************************/
/* */
/* */
/*
SOFTING AG
*/
/*
SOFTING Industrial Automation GmbH
*/
/* Richard-Reitzner-Allee 6 */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* */
/*
Copyright (C) SOFTING AG 1995-2003
*/
/*
Copyright (C) SOFTING Industrial Automation GmbH 1995-2012
*/
/* All Rights Reserved */
/* All Rights Reserved */
/* */
/* */
/*****************************************************************************/
/*****************************************************************************/
...
@@ -50,8 +15,8 @@
...
@@ -50,8 +15,8 @@
/* */
/* */
/* Filename : PB_TOOLS.H */
/* Filename : PB_TOOLS.H */
/* Version : 5.21.0.00.release */
/* Version : 5.21.0.00.release */
/* Date :
27-February-1998
*/
/* Date :
February-1998
*/
/* Author : SOFTING
AG
*/
/* Author : SOFTING
*/
/* */
/* */
/* Description : This file contains the global function declarations, */
/* Description : This file contains the global function declarations, */
/* defines and types of the PROFIBUS-TOOLS-Interface */
/* defines and types of the PROFIBUS-TOOLS-Interface */
...
@@ -79,8 +44,8 @@ extern "C" {
...
@@ -79,8 +44,8 @@ extern "C" {
/*----- function prototypes to get default busparameters -------------------*/
/*----- function prototypes to get default busparameters -------------------*/
#ifdef __PB_DP__
#ifdef __PB_DP__
FUNCTION
extern
PB_BOOL
CALL_CONV
pbt_get_dp_def_bus_param
(
IN
USIGN8
BaudRate
,
FUNCTION
extern
PB_BOOL
CALL_CONV
pbt_get_dp_def_bus_param
(
IN
USIGN8
StationAddr
,
IN
USIGN16
Mode
,
IN
USIGN8
BaudRate
,
IN
USIGN8
StationAddr
,
IN
USIGN16
Mode
,
OUT
T_DP_BUS_PARA_SET
FAR
*
pBusParameters
)
OUT
T_DP_BUS_PARA_SET
FAR
*
pBusParameters
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
...
@@ -158,9 +123,9 @@ FUNCTION extern PB_BOOL CALL_CONV pbt_get_fdlif_def_bus_param(
...
@@ -158,9 +123,9 @@ FUNCTION extern PB_BOOL CALL_CONV pbt_get_fdlif_def_bus_param(
#endif
#endif
#ifdef __PB_FMB__
#ifdef __PB_FMB__
FUNCTION
extern
PB_BOOL
CALL_CONV
pbt_get_fmb_def_bus_param
(
IN
USIGN8
BaudRate
,
FUNCTION
extern
PB_BOOL
CALL_CONV
pbt_get_fmb_def_bus_param
(
IN
USIGN8
StationAddr
,
IN
PB_BOOL
InRingDesired
,
IN
USIGN16
Mode
,
IN
USIGN8
BaudRate
,
IN
USIGN8
StationAddr
,
IN
PB_BOOL
InRingDesired
,
OUT
T_FMB_SET_BUSPARAMETER_REQ
FAR
*
pBusParameters
)
IN
USIGN16
Mode
,
OUT
T_FMB_SET_BUSPARAMETER_REQ
FAR
*
pBusParameters
)
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
@@ -200,8 +165,9 @@ FUNCTION extern VOID CALL_CONV ccrl_resrces_init(IN T_CRL_HDR FAR* pCrlHdr)
...
@@ -200,8 +165,9 @@ FUNCTION extern VOID CALL_CONV ccrl_resrces_init(IN T_CRL_HDR FAR* pCrlHdr)
----------------------------------------------------------------------------*/
----------------------------------------------------------------------------*/
;
;
FUNCTION
extern
USIGN16
CALL_CONV
ccrl_resrces_add_entry
(
IN
USIGN16
Cr
,
FUNCTION
extern
USIGN16
CALL_CONV
IN
T_CRL_STATIC
FAR
*
pCrlStatic
,
OUT
T_FMB_CONFIG_CRL
FAR
*
pCrlConfig
)
ccrl_resrces_add_entry
(
IN
USIGN16
Cr
,
IN
T_CRL_STATIC
FAR
*
pCrlStatic
,
OUT
T_FMB_CONFIG_CRL
FAR
*
pCrlConfig
)
/*------------------------------------------------------------------------------
/*------------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
FUNCTIONAL_DESCRIPTION
...
...
profibus/lib/rt/src/pb_type.h
View file @
ce758cd3
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/*****************************************************************************/
/*****************************************************************************/
/* */
/* */
/*
SOFTING AG
*/
/*
SOFTING Industrial Automation GmbH
*/
/* Richard-Reitzner-Allee 6 */
/* Richard-Reitzner-Allee 6 */
/* D-85540 Haar */
/* D-85540 Haar */
/* Phone: (++49)-(0)89-45656-0 */
/* Phone: (++49)-(0)89-45656-0 */
/* Fax: (++49)-(0)89-45656-399 */
/* Fax: (++49)-(0)89-45656-399 */
/* */
/* */
/*
Copyright (C) SOFTING AG 1995-2003
*/
/*
Copyright (C) SOFTING Industrial Automation GmbH 1995-2012
*/
/* All Rights Reserved */
/* All Rights Reserved */
/* */
/* */
/*****************************************************************************/
/*****************************************************************************/
...
@@ -50,8 +15,8 @@
...
@@ -50,8 +15,8 @@
/* */
/* */
/* Filename : PB_TYPE.H */
/* Filename : PB_TYPE.H */
/* Version : 5.22.0.00.release */
/* Version : 5.22.0.00.release */
/* Date :
26-February-1999
*/
/* Date :
February-1999
*/
/* Author : SOFTING
AG
*/
/* Author : SOFTING
*/
/* */
/* */
/* Description : This file contains the PROFIBUS basic types */
/* Description : This file contains the PROFIBUS basic types */
/* */
/* */
...
@@ -60,6 +25,10 @@
...
@@ -60,6 +25,10 @@
#ifndef __PB_TYPE__
#ifndef __PB_TYPE__
#define __PB_TYPE__
#define __PB_TYPE__
#ifdef _LINUX
#include <linux/types.h>
#endif
#include "pb_conf.h"
/* PAPI configuration parameters */
#include "pb_conf.h"
/* PAPI configuration parameters */
#ifndef NULL
#ifndef NULL
...
@@ -84,7 +53,7 @@ typedef unsigned char PB_BOOL;
...
@@ -84,7 +53,7 @@ typedef unsigned char PB_BOOL;
typedef
unsigned
char
OCTET
;
typedef
unsigned
char
OCTET
;
typedef
unsigned
char
USIGN8
;
typedef
unsigned
char
USIGN8
;
typedef
unsigned
short
USIGN16
;
typedef
unsigned
short
USIGN16
;
typedef
unsigned
long
USIGN32
;
typedef
__u32
USIGN32
;
typedef
signed
char
INT8
;
typedef
signed
char
INT8
;
typedef
signed
short
INT16
;
typedef
signed
short
INT16
;
...
@@ -92,7 +61,7 @@ typedef signed short INT16;
...
@@ -92,7 +61,7 @@ typedef signed short INT16;
#ifdef WIN32
#ifdef WIN32
typedef
int
INT32
;
typedef
int
INT32
;
#else
#else
typedef
signed
long
INT32
;
typedef
__s32
INT32
;
#endif
#endif
#ifdef _LINUX
#ifdef _LINUX
...
...
profibus/wbl/mcomp/src/profibus.wb_load
View file @
ce758cd3
Volume Profibus $ClassVolume 0.0.250.7
Volume Profibus $ClassVolume 0.0.250.7
Body SysBody 05-SEP-2005 17:51:40.00
Body SysBody 05-SEP-2005 17:51:40.00
Attr NextOix = "_X263"
Attr NextOix = "_X263"
Attr NextCix = "_X22"
Attr NextCix = "_X22"
...
@@ -1208,7 +1208,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -1208,7 +1208,7 @@ Volume Profibus $ClassVolume 0.0.250.7
! @Summary Process that handles the slave. Plc(1), rt_io_comm(2) or application process(4).
! @Summary Process that handles the slave. Plc(1), rt_io_comm(2) or application process(4).
! Process that handles the slave. All slaves belonging to the same Profiboard must be handled
! Process that handles the slave. All slaves belonging to the same Profiboard must be handled
! by the same process.
! by the same process.
!
!
! 1: The slave is handled by the plc process, and by a specific
! 1: The slave is handled by the plc process, and by a specific
! thread in the plc, which is specified in the ThreadObject attribute.
! thread in the plc, which is specified in the ThreadObject attribute.
! 2: The slave is handled by the rt_io_comm process.
! 2: The slave is handled by the rt_io_comm process.
...
@@ -1225,7 +1225,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -1225,7 +1225,7 @@ Volume Profibus $ClassVolume 0.0.250.7
! @Summary Plc thread that handles the slave.
! @Summary Plc thread that handles the slave.
! The PlcThread object of the plc thread that handles the slave.
! The PlcThread object of the plc thread that handles the slave.
! The slave is handled with the scantime of the thread.
! The slave is handled with the scantime of the thread.
! All slaves
! All slaves
!*/
!*/
Object ThreadObject $Attribute 5 16-JAN-2006 09:46:40.50
Object ThreadObject $Attribute 5 16-JAN-2006 09:46:40.50
Body SysBody 16-JAN-2006 09:46:40.50
Body SysBody 16-JAN-2006 09:46:40.50
...
@@ -1393,7 +1393,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -1393,7 +1393,7 @@ Volume Profibus $ClassVolume 0.0.250.7
! The parameters WdFact1 and WdFact2 represent factors for setting
! The parameters WdFact1 and WdFact2 represent factors for setting
! the watchdog control. The watchdog control in a DP-Slave takes care
! the watchdog control. The watchdog control in a DP-Slave takes care
! that, if the master fails, the outputs fall in the safe state after
! that, if the master fails, the outputs fall in the safe state after
! the expiration of this time.
! the expiration of this time.
! t[ms] = 10*WdFact1*WdFact2
! t[ms] = 10*WdFact1*WdFact2
!*/
!*/
Object WdFact1 $Attribute 21 16-JAN-2006 09:46:40.50
Object WdFact1 $Attribute 21 16-JAN-2006 09:46:40.50
...
@@ -1408,7 +1408,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -1408,7 +1408,7 @@ Volume Profibus $ClassVolume 0.0.250.7
! The parameters WdFact1 and WdFact2 represent factors for setting
! The parameters WdFact1 and WdFact2 represent factors for setting
! the watchdog control. The watchdog control in a DP-Slave takes care
! the watchdog control. The watchdog control in a DP-Slave takes care
! that, if the master fails, the outputs fall in the safe state after
! that, if the master fails, the outputs fall in the safe state after
! the expiration of this time.
! the expiration of this time.
! t[ms] = 10*WdFact1*WdFact2
! t[ms] = 10*WdFact1*WdFact2
!*/
!*/
Object WdFact2 $Attribute 22 16-JAN-2006 09:46:40.50
Object WdFact2 $Attribute 22 16-JAN-2006 09:46:40.50
...
@@ -2005,7 +2005,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2005,7 +2005,7 @@ Volume Profibus $ClassVolume 0.0.250.7
! @Group Profibus
! @Group Profibus
! @Summary Configuration of a Profibus module
! @Summary Configuration of a Profibus module
! Configuration of a Profibus module.
! Configuration of a Profibus module.
!
!
!*/
!*/
Object Pb_Module $ClassDef 11 16-JAN-2006 09:46:40.50
Object Pb_Module $ClassDef 11 16-JAN-2006 09:46:40.50
Body SysBody 16-JAN-2006 09:46:40.50
Body SysBody 16-JAN-2006 09:46:40.50
...
@@ -2048,7 +2048,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2048,7 +2048,7 @@ Volume Profibus $ClassVolume 0.0.250.7
!/**
!/**
! @Summary Process that handles the card. Plc(1), rt_io_comm(2) or application process(4).
! @Summary Process that handles the card. Plc(1), rt_io_comm(2) or application process(4).
! Process that handles the card.
! Process that handles the card.
!
!
! 1: The card is read by the plc process, and is handled by a specific
! 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.
! thread in the plc, which is specified in the ThreadObject attribute.
! 2: The card is read by the rt_io_comm process.
! 2: The card is read by the rt_io_comm process.
...
@@ -2150,13 +2150,15 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2150,13 +2150,15 @@ Volume Profibus $ClassVolume 0.0.250.7
EndObject
EndObject
EndObject
EndObject
!/**
!/**
! @Author Claes Jurstrand
! @Author Claes Jurstrand
/Marcus Nordenberg
! @Version 1.
0
! @Version 1.
1
! @Group Profibus
! @Group Profibus
! @Summary Configurates a Profibus PCI master card (Softing profiboard)
! @Summary Configurates a Profibus PCI master card (Softing profiboard)
! Configurates a Profibus PCI master card (Softing Profiboard). Available on LynxOS and Linux.
! 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.
! 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.
! You can have maximum two buses (master cards) on each system. The latest API from Softing
! can only handle one board per process. So you have to make sure to select PlcThread
! objects from different PlcProcess objects.
!*/
!*/
Object Pb_Profiboard $ClassDef 13 16-JAN-2006 09:46:40.51
Object Pb_Profiboard $ClassDef 13 16-JAN-2006 09:46:40.51
Body SysBody 16-JAN-2006 09:46:40.51
Body SysBody 16-JAN-2006 09:46:40.51
...
@@ -2300,8 +2302,8 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2300,8 +2302,8 @@ Volume Profibus $ClassVolume 0.0.250.7
EndObject
EndObject
!/**
!/**
! Baud rate for the bus in Kbit/s. Possible values are 500, 1500, 3000, 6000, 12000.
! 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
! 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
! baud rate. For further information about these bus parameters, please refer to the
! documentation from Softing.
! documentation from Softing.
!*/
!*/
Object BaudRate $Attribute 11 16-JAN-2006 09:46:40.51
Object BaudRate $Attribute 11 16-JAN-2006 09:46:40.51
...
@@ -2312,9 +2314,9 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2312,9 +2314,9 @@ Volume Profibus $ClassVolume 0.0.250.7
EndBody
EndBody
EndObject
EndObject
!/**
!/**
! Watchdog timer for write supervision in the master card. This watchdog is
! Watchdog timer for write supervision in the master card. This watchdog is
! activated at the first write operation after initialization. If the timer later
! 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
! 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.
! will stop, leaving all slaves to stall when their own stalltime elapses.
! Range 100..10000 ms
! Range 100..10000 ms
!*/
!*/
...
@@ -2326,7 +2328,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2326,7 +2328,7 @@ Volume Profibus $ClassVolume 0.0.250.7
EndBody
EndBody
EndObject
EndObject
!/**
!/**
! Slot time, the maximum time a master station must wait for a transaction response.
! Slot time, the maximum time a master station must wait for a transaction response.
! Range 37..16383 Bit Times.
! Range 37..16383 Bit Times.
! Recommended values for each baudrate:
! Recommended values for each baudrate:
! 500 kbit/s - 200
! 500 kbit/s - 200
...
@@ -2343,7 +2345,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2343,7 +2345,7 @@ Volume Profibus $ClassVolume 0.0.250.7
EndBody
EndBody
EndObject
EndObject
!/**
!/**
! Minimum station delay time for responder, the period of time which may elapse before
! 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.
! the responder can send the response frame. Range 11..1023 Bit Times.
! Recommended values for each baudrate:
! Recommended values for each baudrate:
! 500 kbit/s - 11
! 500 kbit/s - 11
...
@@ -2394,7 +2396,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2394,7 +2396,7 @@ Volume Profibus $ClassVolume 0.0.250.7
EndBody
EndBody
EndObject
EndObject
!/**
!/**
! Setup time, the time between the occurance of an interrupt request and the necessary request
! Setup time, the time between the occurance of an interrupt request and the necessary request
! action is performed. Range 1..494-Tqui BitTimes.
! action is performed. Range 1..494-Tqui BitTimes.
! Recommended values for each baudrate:
! Recommended values for each baudrate:
! 500 kbit/s - 1
! 500 kbit/s - 1
...
@@ -2412,7 +2414,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2412,7 +2414,7 @@ Volume Profibus $ClassVolume 0.0.250.7
EndObject
EndObject
!/**
!/**
! Target rotation time, the anticipated time for one token rotation on the bus, including
! Target rotation time, the anticipated time for one token rotation on the bus, including
! allowances for high and low priority transactions and GAP maintenance.
! allowances for high and low priority transactions and GAP maintenance.
! Range 256..2^24-1 Bit Times.
! Range 256..2^24-1 Bit Times.
! The value is irrelevant in Profibus DP operations.
! The value is irrelevant in Profibus DP operations.
!*/
!*/
...
@@ -2451,7 +2453,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2451,7 +2453,7 @@ Volume Profibus $ClassVolume 0.0.250.7
EndBody
EndBody
EndObject
EndObject
!/**
!/**
! Maximum retry limit, indicates how often FDL has to repeat the request frame when no response
! 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.
! or acknowledge frame is receive from the recognized station within the slot time. Range 0..7.
! Recommended values for each baudrate:
! Recommended values for each baudrate:
! 500 kbit/s - 1
! 500 kbit/s - 1
...
@@ -2691,7 +2693,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2691,7 +2693,7 @@ Volume Profibus $ClassVolume 0.0.250.7
EndObject
EndObject
!/**
!/**
! Baud rate for the bus in Kbit/s. Possible values are 500, 1500, 3000, 6000, 12000.
! 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
! Note that the values for some of the following attributes are depending on the
! baud rate.
! baud rate.
!*/
!*/
Object BaudRate $Attribute 37 09-DEC-2008 13:19:32.10
Object BaudRate $Attribute 37 09-DEC-2008 13:19:32.10
...
@@ -2702,9 +2704,9 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2702,9 +2704,9 @@ Volume Profibus $ClassVolume 0.0.250.7
EndBody
EndBody
EndObject
EndObject
!/**
!/**
! Watchdog timer for write supervision in the master card. This watchdog is
! Watchdog timer for write supervision in the master card. This watchdog is
! activated at the first write operation after initialization. If the timer later
! 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
! elapses without a write operation, the master card will reset itself, and the bus
! will stop, leaving all slaves to stall when their own stall time elapses.
! will stop, leaving all slaves to stall when their own stall time elapses.
! A value of 0 will disable the board's watchdog functionality altogether.
! A value of 0 will disable the board's watchdog functionality altogether.
! Range 0..65535 ms
! Range 0..65535 ms
...
@@ -2717,7 +2719,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2717,7 +2719,7 @@ Volume Profibus $ClassVolume 0.0.250.7
EndBody
EndBody
EndObject
EndObject
!/**
!/**
! Slot time, the maximum time a master station must wait for a transaction response.
! Slot time, the maximum time a master station must wait for a transaction response.
! Range 37..16383 Bit Times.
! Range 37..16383 Bit Times.
! Recommended values for each baud rate:
! Recommended values for each baud rate:
! 500 kbit/s - 200
! 500 kbit/s - 200
...
@@ -2734,7 +2736,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2734,7 +2736,7 @@ Volume Profibus $ClassVolume 0.0.250.7
EndBody
EndBody
EndObject
EndObject
!/**
!/**
! Minimum station delay time for responder, the period of time which may elapse before
! 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.
! the responder can send the response frame. Range 11..1023 Bit Times.
! Recommended values for each baud rate:
! Recommended values for each baud rate:
! 500 kbit/s - 11
! 500 kbit/s - 11
...
@@ -2785,7 +2787,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2785,7 +2787,7 @@ Volume Profibus $ClassVolume 0.0.250.7
EndBody
EndBody
EndObject
EndObject
!/**
!/**
! Setup time, the time between the occurrence of an interrupt request and the necessary request
! Setup time, the time between the occurrence of an interrupt request and the necessary request
! action is performed. Range 1..494-Tqui BitTimes.
! action is performed. Range 1..494-Tqui BitTimes.
! Recommended values for each baud rate:
! Recommended values for each baud rate:
! 500 kbit/s - 1
! 500 kbit/s - 1
...
@@ -2803,7 +2805,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2803,7 +2805,7 @@ Volume Profibus $ClassVolume 0.0.250.7
EndObject
EndObject
!/**
!/**
! Target rotation time, the anticipated time for one token rotation on the bus, including
! Target rotation time, the anticipated time for one token rotation on the bus, including
! allowances for high and low priority transactions and GAP maintenance.
! allowances for high and low priority transactions and GAP maintenance.
! Range 256..2^24-1 Bit Times.
! Range 256..2^24-1 Bit Times.
! The value is irrelevant in Profibus DP operations.
! The value is irrelevant in Profibus DP operations.
!*/
!*/
...
@@ -2842,7 +2844,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2842,7 +2844,7 @@ Volume Profibus $ClassVolume 0.0.250.7
EndBody
EndBody
EndObject
EndObject
!/**
!/**
! Maximum retry limit, indicates how often FDL has to repeat the request frame when no response
! 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.
! or acknowledge frame is receive from the recognized station within the slot time. Range 0..7.
! Recommended values for each baud rate:
! Recommended values for each baud rate:
! 500 kbit/s - 1
! 500 kbit/s - 1
...
@@ -2985,73 +2987,73 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -2985,73 +2987,73 @@ Volume Profibus $ClassVolume 0.0.250.7
Attr NextAix = "_X11"
Attr NextAix = "_X11"
EndBody
EndBody
!/**
!/**
! Diagnosis appears Alarm
! Diagnosis appears Alarm
! A diagnosis appears alarm signals an event within a submodule,
! A diagnosis appears alarm signals an event within a submodule,
! for instance overtemperature, short circuit, etc.
! for instance overtemperature, short circuit, etc.
! The content of the alarm is defined by the Diagnosis ASE for this type.
! The content of the alarm is defined by the Diagnosis ASE for this type.
!
!
! Process Alarm
! Process Alarm
! A process alarm signals the occurrence of an event in the
! A process alarm signals the occurrence of an event in the
! connected process, for instance upper limit value exceeded.
! connected process, for instance upper limit value exceeded.
!
!
! Pull Alarm
! Pull Alarm
! A slot signals the withdrawal of a submodule/module or change
! A slot signals the withdrawal of a submodule/module or change
! in configuration (reduction).
! in configuration (reduction).
!
!
! Plug Alarm
! Plug Alarm
! A slot signals the insertion of a submodule/module, a new need
! A slot signals the insertion of a submodule/module, a new need
! for parametrization, or a change in configuration (addition).
! for parametrization, or a change in configuration (addition).
!
!
! Status Alarm
! Status Alarm
! A status alarm signals a change in the state of a submodule,
! A status alarm signals a change in the state of a submodule,
! for instance run, stop or ready.
! for instance run, stop or ready.
!
!
! Update Alarm
! Update Alarm
! An update alarm signals the change of a parameter in a submodule
! An update alarm signals the change of a parameter in a submodule
! e.g. by a local operation or a remote access.
! e.g. by a local operation or a remote access.
!
!
! Redundancy Alarm
! Redundancy Alarm
! A redundancy alarm signals the fault of one IO controller to the
! A redundancy alarm signals the fault of one IO controller to the
! remaining IO controller for redundant IO ARs.
! remaining IO controller for redundant IO ARs.
!
!
! Controlled by supervisor
! Controlled by supervisor
! A slot signals the logical withdrawal of a submodule by the
! A slot signals the logical withdrawal of a submodule by the
! IO supervisor. The actions shall be according to the Pull Alarm.
! IO supervisor. The actions shall be according to the Pull Alarm.
!
!
! Released Alarm
! Released Alarm
! A slot signals the logical insertion of a submodule by the IO supervisor.
! A slot signals the logical insertion of a submodule by the IO supervisor.
! The actions shall be according to the Plug Alarm.
! The actions shall be according to the Plug Alarm.
!
!
! Plug Wrong Submodule Alarm
! Plug Wrong Submodule Alarm
! A slot signals the insertion of a wrong submodule/module or a
! A slot signals the insertion of a wrong submodule/module or a
! change in configuration (addition).
! change in configuration (addition).
!
!
! Return of Submodule Alarm
! Return of Submodule Alarm
! A slot signals that a submodule is ready to switch its IOCS/IOPS from
! A slot signals that a submodule is ready to switch its IOCS/IOPS from
! "BAD" to "GOOD" again without new parameterization.
! "BAD" to "GOOD" again without new parameterization.
!
!
! Diagnosis disappears Alarm
! Diagnosis disappears Alarm
! A diagnosis disappears alarm signals a disappearing diagnosis event
! A diagnosis disappears alarm signals a disappearing diagnosis event
! within a submodule. The content of the alarm is defined by the
! within a submodule. The content of the alarm is defined by the
! Diagnosis ASE for this type.
! Diagnosis ASE for this type.
!
!
! Multicast Communication Mismatch
! Multicast Communication Mismatch
! A multicast consumer submodule signals that communication
! A multicast consumer submodule signals that communication
! relationship to the associated multicast provider is failed.
! relationship to the associated multicast provider is failed.
!
!
! Port Data Change Notification Alarm
! Port Data Change Notification Alarm
! A port submodule signals that port data has been changed.
! A port submodule signals that port data has been changed.
!
!
! Sync Data Change Notification Alarm
! Sync Data Change Notification Alarm
! An interface submodule signals that synchronization data has been changed.
! An interface submodule signals that synchronization data has been changed.
!
!
! Isochronous Mode Problem Notification Alarm
! Isochronous Mode Problem Notification Alarm
! The application signals that problems with isochronously execution
! The application signals that problems with isochronously execution
! have been detected.
! have been detected.
!
!
! Furthermore, manufacturer specific alarms may be used and alarms
! Furthermore, manufacturer specific alarms may be used and alarms
! are reserved for profile specific definitions.
! are reserved for profile specific definitions.
!
!
!*/
!*/
Object Type $Attribute 1 10-JUN-2010 10:53:19.20
Object Type $Attribute 1 10-JUN-2010 10:53:19.20
Body SysBody 21-OCT-2010 08:59:53.40
Body SysBody 21-OCT-2010 08:59:53.40
...
@@ -3106,7 +3108,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -3106,7 +3108,7 @@ Volume Profibus $ClassVolume 0.0.250.7
EndBody
EndBody
EndObject
EndObject
!/**
!/**
! Module ident number identifying the module the
! Module ident number identifying the module the
! alarm comes from (see GSDML-file)
! alarm comes from (see GSDML-file)
!*/
!*/
Object ModuleIdentNumber $Attribute 6 10-JUN-2010 11:49:40.15
Object ModuleIdentNumber $Attribute 6 10-JUN-2010 11:49:40.15
...
@@ -3118,7 +3120,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -3118,7 +3120,7 @@ Volume Profibus $ClassVolume 0.0.250.7
EndBody
EndBody
EndObject
EndObject
!/**
!/**
! Subodule ident number identifying the module the
! Subodule ident number identifying the module the
! alarm comes from (see GSDML-file)
! alarm comes from (see GSDML-file)
!*/
!*/
Object SubmoduleIdentNumber $Attribute 7 10-JUN-2010 11:49:56.34
Object SubmoduleIdentNumber $Attribute 7 10-JUN-2010 11:49:56.34
...
@@ -3272,31 +3274,31 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -3272,31 +3274,31 @@ Volume Profibus $ClassVolume 0.0.250.7
! @Group Profinet
! @Group Profinet
! @Summary Configures a Softing Profinet controller stack.
! @Summary Configures a Softing Profinet controller stack.
! Configures a Sofing Profinet controller stack.
! Configures a Sofing Profinet controller stack.
!
!
! ProviewR has support for a Profinet stack from Softing (www.softing.com).
! ProviewR has support for a Profinet stack from Softing (www.softing.com).
! The Profinet stack is implemented as three Linux kernel modules. The stack
! The Profinet stack is implemented as three Linux kernel modules. The stack
! is configured by the current object and is placed below the $Node object.
! is configured by the current object and is placed below the $Node object.
!
!
! See ProviewR documentation 'Guide to I/O System' for more information. See also
! See ProviewR documentation 'Guide to I/O System' for more information. See also
! a Case Study in class help class ABB_ACS880_PnDevice
! a Case Study in class help class ABB_ACS880_PnDevice
!
!
! Note due to Softing licens requirements the NIC must have a specific macadress.
! Note due to Softing licens requirements the NIC must have a specific macadress.
!
!
! Example:
! Example:
!
!
! auto eth1
! auto eth1
! iface eth1 inet static
! iface eth1 inet static
! address 192.168.90.1
! address 192.168.90.1
! netmask 255.255.254.0
! netmask 255.255.254.0
! hwaddress ether xx:xx:xx:xx:xx:xx
! hwaddress ether xx:xx:xx:xx:xx:xx
!
!
! where xx:xx:xx:xx:xx:xx needs to be:
! where xx:xx:xx:xx:xx:xx needs to be:
!
!
! AA:00:04:00:xx:14 where xx is 21-52 (hex, i.e. max 50 device available)
! AA:00:04:00:xx:14 where xx is 21-52 (hex, i.e. max 50 device available)
!
!
! See also an example 9 'Ethernet interface settings in file' /etc/network/interfaces
! See also an example 9 'Ethernet interface settings in file' /etc/network/interfaces
! in class ABB_ACS880_PnDevice.
! in class ABB_ACS880_PnDevice.
!
!
! @b See also
! @b See also
! @classlink PnDevice profibus_pndevice.html
! @classlink PnDevice profibus_pndevice.html
! @classlink PnModule profibus_pnmodule.html
! @classlink PnModule profibus_pnmodule.html
...
@@ -3415,29 +3417,29 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -3415,29 +3417,29 @@ Volume Profibus $ClassVolume 0.0.250.7
! @Group Profinet
! @Group Profinet
! @Summary Configures a Profinet device.
! @Summary Configures a Profinet device.
! Configures a Profinet device.
! Configures a Profinet device.
!
!
! Baseobject for a profinet device. Reside below a profinet agent object.
! Baseobject for a profinet device. Reside below a profinet agent object.
! In the attribute GSDMfile the gsdmlfile for the current device is stated.
! In the attribute GSDMfile the gsdmlfile for the current device is stated.
! When the gsdmlfile is supplied the device can be configured by the Profinet
! When the gsdmlfile is supplied the device can be configured by the Profinet
! configurator. See ProviewR documentation 'Guide to I/O System' for more
! configurator. See ProviewR documentation 'Guide to I/O System' for more
! information. See also a Case Study class ABB_ACS880_PnDevice.
! information. See also a Case Study class ABB_ACS880_PnDevice.
!
!
! Note 'DeviceName' is the most important setting and defines the device on
! Note 'DeviceName' is the most important setting and defines the device on
! the network. When IO communication starts the Profinet stack will first
! the network. When IO communication starts the Profinet stack will first
! look up all the devices on the network by the name.
! look up all the devices on the network by the name.
!
!
! There is a viewer tool for searching a network for Profinet devices and to set the
! There is a viewer tool for searching a network for Profinet devices and to set the
! 'DeviceName'. The viewer is started from a terminal window with the shell command:
! 'DeviceName'. The viewer is started from a terminal window with the shell command:
!
!
! > profinet_viewer [device]
! > profinet_viewer [device]
!
!
! Where 'device' is the network device, eg eth0. By default the profinet_viewer will
! Where 'device' is the network device, eg eth0. By default the profinet_viewer will
! connect to eth1.
! connect to eth1.
!
!
! @bNote.
! @bNote.
! The ProviewR runtime environment should be stopped on the current node before the
! The ProviewR runtime environment should be stopped on the current node before the
! the viewer is started.
! the viewer is started.
!
!
! @b See also
! @b See also
! @classlink PnControllerSoftingPNAK profibus_pncontrollersoftingpnak.html
! @classlink PnControllerSoftingPNAK profibus_pncontrollersoftingpnak.html
! @classlink Hilscher_cifX_PnController otherio_hilscher_cifx_pncontroller.html
! @classlink Hilscher_cifX_PnController otherio_hilscher_cifx_pncontroller.html
...
@@ -3509,7 +3511,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -3509,7 +3511,7 @@ Volume Profibus $ClassVolume 0.0.250.7
!/**
!/**
! @Summary Process that handles the device. Plc(1), rt_io_comm(2) or application process(4).
! @Summary Process that handles the device. Plc(1), rt_io_comm(2) or application process(4).
! Process that handles the device.
! Process that handles the device.
!
!
! 1: The device is read by the plc process, and is handled by a specific
! 1: The device is read by the plc process, and is handled by a specific
! thread in the plc, which is specified in the ThreadObject attribute.
! thread in the plc, which is specified in the ThreadObject attribute.
! 2: The device is read by the rt_io_comm process.
! 2: The device is read by the rt_io_comm process.
...
@@ -3863,22 +3865,22 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -3863,22 +3865,22 @@ Volume Profibus $ClassVolume 0.0.250.7
! @Group Profinet
! @Group Profinet
! @Summary Configures a Profinet module.
! @Summary Configures a Profinet module.
! Configures a Profinet module.
! Configures a Profinet module.
!
!
! This object configures the data exchange between a Profinet Slave Device and a
! This object configures the data exchange between a Profinet Slave Device and a
! Profinet Master.
! Profinet Master.
!
!
! The class PnModule will be valid for all types of modules. In many cases there exist
! The class PnModule will be valid for all types of modules. In many cases there exist
! prepared subclasses of the PnModuleclass for the specific module. This is for example
! prepared subclasses of the PnModuleclass for the specific module. This is for example
! the case for a Siemens ET200M device. For the prepared classes the IO channels will
! the case for a Siemens ET200M device. For the prepared classes the IO channels will
! exist as a part of the moduleobject. The prepared classes should be used if they exist.
! exist as a part of the moduleobject. The prepared classes should be used if they exist.
! See ProviewR documentation 'Guide to I/O Systemfor more information.
! See ProviewR documentation 'Guide to I/O Systemfor more information.
!
!
! @bConfiguration (prepared subclasses)
! @bConfiguration (prepared subclasses)
! One device object (not this module object) are placed as children to the master. For
! One device object (not this module object) are placed as children to the master. For
! the device object, a profinet configurator is opened, that configures the device object
! the device object, a profinet configurator is opened, that configures the device object
! and creates this module objects for the modules handled by the device. See
! and creates this module objects for the modules handled by the device. See
! a Case Study in class ABB_ACS880_PnDevice for more information.
! a Case Study in class ABB_ACS880_PnDevice for more information.
!
!
! @classlink PnControllerSoftingPNAK profibus_pncontrollersoftingpnak.html
! @classlink PnControllerSoftingPNAK profibus_pncontrollersoftingpnak.html
! @classlink PnDevice profibus_pndevice.html
! @classlink PnDevice profibus_pndevice.html
! @classlink ABB_ACS880_PnDevice abb_abb_acs880_pndevice.html
! @classlink ABB_ACS880_PnDevice abb_abb_acs880_pndevice.html
...
@@ -3938,7 +3940,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -3938,7 +3940,7 @@ Volume Profibus $ClassVolume 0.0.250.7
!/**
!/**
! @Summary Process that handles the module. Plc(1), rt_io_comm(2) or application process(4).
! @Summary Process that handles the module. Plc(1), rt_io_comm(2) or application process(4).
! Process that handles the module.
! Process that handles the module.
!
!
! 1: The module is read by the plc process, and is handled by a specific
! 1: The module is read by the plc process, and is handled by a specific
! thread in the plc, which is specified in the ThreadObject attribute.
! thread in the plc, which is specified in the ThreadObject attribute.
! 2: The module is read by the rt_io_comm process.
! 2: The module is read by the rt_io_comm process.
...
@@ -4041,34 +4043,34 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -4041,34 +4043,34 @@ Volume Profibus $ClassVolume 0.0.250.7
! @Group Profibus
! @Group Profibus
! @Summary Configures a Profibus FDL Service Access Point (SAP) or Remote Service Access Point (RSAP).
! @Summary Configures a Profibus FDL Service Access Point (SAP) or Remote Service Access Point (RSAP).
! Configures a Profibus FDL (R)SAP.
! Configures a Profibus FDL (R)SAP.
!
!
! With Profibus FDL Service Access Points data transfer services between nodes on a Profibus
! With Profibus FDL Service Access Points data transfer services between nodes on a Profibus
! network is made possible.
! network is made possible.
! There are two SAP types reflecting the different characteristics of Master Stations and
! There are two SAP types reflecting the different characteristics of Master Stations and
! Slave Stations. Usually, "regular" SAP's are activated o Master Stations whereas Responder
! Slave Stations. Usually, "regular" SAP's are activated o Master Stations whereas Responder
! SAP's (RSAP's) are activated on Slave Stations. However both can be used on either one.
! SAP's (RSAP's) are activated on Slave Stations. However both can be used on either one.
!
!
! A (R)SAP is defined by an address in the interval 0-63. A SAP is used to issue data transfers
! A (R)SAP is defined by an address in the interval 0-63. A SAP is used to issue data transfers
! to a remote SAP or RSAP. A SAP can also be used to request data from a remote RSAP.
! to a remote SAP or RSAP. A SAP can also be used to request data from a remote RSAP.
! A RSAP cannot request data from a remote (R)SAP. It is used to respond on a data request
! A RSAP cannot request data from a remote (R)SAP. It is used to respond on a data request
! and to receive data.
! and to receive data.
!
!
! This object defines a SAP or RSAP and it's address. Also defined is the slave address
! This object defines a SAP or RSAP and it's address. Also defined is the slave address
! of the node that this SAP will exchange data with. It should be created as a child to a
! of the node that this SAP will exchange data with. It should be created as a child to a
! Pb_Profiboard.
! Pb_Profiboard.
!
!
! See ProviewR documentation 'Guide to I/O Systems' for more information.
! See ProviewR documentation 'Guide to I/O Systems' for more information.
!
!
! @bConfiguration
! @bConfiguration
! Instances of the class Pb_FDL_DataTransfer are created as children to the Pb_FDL_SAP object.
! Instances of the class Pb_FDL_DataTransfer are created as children to the Pb_FDL_SAP object.
!
!
! For the SAP more than one instance can be created of the types SDA, SDN and SRD. These
! For the SAP more than one instance can be created of the types SDA, SDN and SRD. These
! different type are used to send data to a remote SAP (types SDA and SDN) or to request data and
! different type are used to send data to a remote SAP (types SDA and SDN) or to request data and
! if needed, at the same time send, data (type SRD). See more on class Pb_FDL_DataTransfer.
! if needed, at the same time send, data (type SRD). See more on class Pb_FDL_DataTransfer.
!
!
! For a RSAP instance only one instance can be created of type RUM used to recieve data and to update
! For a RSAP instance only one instance can be created of type RUM used to recieve data and to update
! the data that will be sent back by a SRD request.
! the data that will be sent back by a SRD request.
!
!
! @classlink Pb_Profiboard profibus_pb_profiboard.html
! @classlink Pb_Profiboard profibus_pb_profiboard.html
! @classlink Pb_FDL_DataTransfer profibus_pb_fdl_datatransfer.html
! @classlink Pb_FDL_DataTransfer profibus_pb_fdl_datatransfer.html
!*/
!*/
...
@@ -4158,7 +4160,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -4158,7 +4160,7 @@ Volume Profibus $ClassVolume 0.0.250.7
! @Summary Process that handles the slave. Plc(1), rt_io_comm(2) or application process(4).
! @Summary Process that handles the slave. Plc(1), rt_io_comm(2) or application process(4).
! Process that handles the slave. All slaves belonging to the same Profiboard must be handled
! Process that handles the slave. All slaves belonging to the same Profiboard must be handled
! by the same process.
! by the same process.
!
!
! 1: The slave is handled by the plc process, and by a specific
! 1: The slave is handled by the plc process, and by a specific
! thread in the plc, which is specified in the ThreadObject attribute.
! thread in the plc, which is specified in the ThreadObject attribute.
! 2: The slave is handled by the rt_io_comm process.
! 2: The slave is handled by the rt_io_comm process.
...
@@ -4175,7 +4177,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -4175,7 +4177,7 @@ Volume Profibus $ClassVolume 0.0.250.7
! @Summary Plc thread that handles the slave.
! @Summary Plc thread that handles the slave.
! The PlcThread object of the plc thread that handles the slave.
! The PlcThread object of the plc thread that handles the slave.
! The slave is handled with the scantime of the thread.
! The slave is handled with the scantime of the thread.
! All slaves
! All slaves
!*/
!*/
Object ThreadObject $Attribute 7 14-AUG-2014 13:30:57.23
Object ThreadObject $Attribute 7 14-AUG-2014 13:30:57.23
Body SysBody 14-AUG-2014 13:30:57.23
Body SysBody 14-AUG-2014 13:30:57.23
...
@@ -4327,43 +4329,43 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -4327,43 +4329,43 @@ Volume Profibus $ClassVolume 0.0.250.7
! @Group Profibus
! @Group Profibus
! @Summary Configures a Profibus FDL Data Transfer Service.
! @Summary Configures a Profibus FDL Data Transfer Service.
! Configures a Profibus FDL Data Transfer Service.
! Configures a Profibus FDL Data Transfer Service.
!
!
! With Profibus FDL Service Access Points data transfer services between nodes on a Profibus
! With Profibus FDL Service Access Points data transfer services between nodes on a Profibus
! network is made possible.
! network is made possible.
!
!
! There are two SAP types reflecting the different characteristics of Master Stations and
! There are two SAP types reflecting the different characteristics of Master Stations and
! Slave Stations. Usually, "regular" SAP's are activated on Master Stations whereas Responder
! Slave Stations. Usually, "regular" SAP's are activated on Master Stations whereas Responder
! SAP's (RSAP's) are activated on Slave Stations. However both can be used on either one.
! SAP's (RSAP's) are activated on Slave Stations. However both can be used on either one.
!
!
! There are five types of data transfer services that can be configured. Three for sending and/or
! There are five types of data transfer services that can be configured. Three for sending and/or
! requesting data and two for preparing reply data (only one supported).
! requesting data and two for preparing reply data (only one supported).
!
!
! The first three of them are used from a SAP and cannot be used with a responder SAP (RSAP). These
! The first three of them are used from a SAP and cannot be used with a responder SAP (RSAP). These
! are SDA (Send Data with Acknowledge), SDN (Send Data with No acknowledge) and SRD (Send and Request
! are SDA (Send Data with Acknowledge), SDN (Send Data with No acknowledge) and SRD (Send and Request
! Data with reply). When requesting data no data need to be sent.
! Data with reply). When requesting data no data need to be sent.
!
!
! The other two services are used together with a responder SAP (RSAP) to prepare the reply data
! The other two services are used together with a responder SAP (RSAP) to prepare the reply data
! that will be sent back to a SAP upon the receipt of a SDA, SDN or SRD. These are RU (Reply-Update,
! that will be sent back to a SAP upon the receipt of a SDA, SDN or SRD. These are RU (Reply-Update,
! this one is not supported) and RUM (Reply-Update-Multiple)
! this one is not supported) and RUM (Reply-Update-Multiple)
!
!
! Each data transfer is configured with the destination address (address of remote (R)SAP).
! Each data transfer is configured with the destination address (address of remote (R)SAP).
!
!
! The data that is to be sent or received are created as standard I/O channels which should be
! The data that is to be sent or received are created as standard I/O channels which should be
! created as children to the Pb_FDL_DataTransfer-object. When receiveing data, the data will always
! created as children to the Pb_FDL_DataTransfer-object. When receiveing data, the data will always
! be directed to the first (top) Pb_FDL_DataTransfer-object found as a child to the
! be directed to the first (top) Pb_FDL_DataTransfer-object found as a child to the
! Pb_FDL_SAP-object.
! Pb_FDL_SAP-object.
!
!
! See ProviewR documentation 'Guide to I/O Systems' for more information.
! See ProviewR documentation 'Guide to I/O Systems' for more information.
!
!
! @bConfiguration
! @bConfiguration
! Instances of the class Pb_FDL_DataTransfer are created as children to the Pb_FDL_SAP object.
! Instances of the class Pb_FDL_DataTransfer are created as children to the Pb_FDL_SAP object.
!
!
! I/O-channels are created as children to the Pb_FDL_DataTransfer-object to represent the
! I/O-channels are created as children to the Pb_FDL_DataTransfer-object to represent the
! data being sent and/or received.
! data being sent and/or received.
!
!
! For a RSAP instance only one instance can be created of type RUM used to recieve data and to update
! For a RSAP instance only one instance can be created of type RUM used to recieve data and to update
! the data that will be sent back by a SRD request.
! the data that will be sent back by a SRD request.
!
!
! @classlink Pb_FDL_SAP profibus_pb_fdl_sap.html
! @classlink Pb_FDL_SAP profibus_pb_fdl_sap.html
!*/
!*/
Object Pb_FDL_DataTransfer $ClassDef 21 14-AUG-2014 15:41:30.53
Object Pb_FDL_DataTransfer $ClassDef 21 14-AUG-2014 15:41:30.53
...
@@ -4414,8 +4416,8 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -4414,8 +4416,8 @@ Volume Profibus $ClassVolume 0.0.250.7
! FDLIF_SRD - Send and Request Data with reply
! FDLIF_SRD - Send and Request Data with reply
! FDLIF_RU - Reply Update (not supprted, RUM will always be used)
! FDLIF_RU - Reply Update (not supprted, RUM will always be used)
! FDLIF_RUM - Reply Update Multiple
! FDLIF_RUM - Reply Update Multiple
!
!
! SDA and SDN can also receive data explictly sent with a SDA or SDN service from a
! SDA and SDN can also receive data explictly sent with a SDA or SDN service from a
! remote SAP. If more than one Pb_FDL_DataTransfer objects have been created for a single
! remote SAP. If more than one Pb_FDL_DataTransfer objects have been created for a single
! SAP then the first child will receive the data.
! SAP then the first child will receive the data.
!*/
!*/
...
@@ -4452,7 +4454,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -4452,7 +4454,7 @@ Volume Profibus $ClassVolume 0.0.250.7
! @Summary Process that handles the slave. Plc(1), rt_io_comm(2) or application process(4).
! @Summary Process that handles the slave. Plc(1), rt_io_comm(2) or application process(4).
! Process that handles the slave. All slaves belonging to the same Profiboard must be handled
! Process that handles the slave. All slaves belonging to the same Profiboard must be handled
! by the same process.
! by the same process.
!
!
! 1: The slave is handled by the plc process, and by a specific
! 1: The slave is handled by the plc process, and by a specific
! thread in the plc, which is specified in the ThreadObject attribute.
! thread in the plc, which is specified in the ThreadObject attribute.
! 2: The slave is handled by the rt_io_comm process.
! 2: The slave is handled by the rt_io_comm process.
...
@@ -4469,7 +4471,7 @@ Volume Profibus $ClassVolume 0.0.250.7
...
@@ -4469,7 +4471,7 @@ Volume Profibus $ClassVolume 0.0.250.7
! @Summary Plc thread that handles the slave.
! @Summary Plc thread that handles the slave.
! The PlcThread object of the plc thread that handles the slave.
! The PlcThread object of the plc thread that handles the slave.
! The slave is handled with the scantime of the thread.
! The slave is handled with the scantime of the thread.
! All slaves
! All slaves
!*/
!*/
Object ThreadObject $Attribute 12 14-AUG-2014 15:41:08.64
Object ThreadObject $Attribute 12 14-AUG-2014 15:41:08.64
Body SysBody 14-AUG-2014 15:41:08.64
Body SysBody 14-AUG-2014 15:41:08.64
...
...
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