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
74f05bbb
Commit
74f05bbb
authored
May 24, 2011
by
Claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for Hilscher cifX Profinet Controller added
parent
5bc8a36a
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1604 additions
and
177 deletions
+1604
-177
otherio/lib/rt/src/os_linux/rt_io_m_hilscher_cifx.h
otherio/lib/rt/src/os_linux/rt_io_m_hilscher_cifx.h
+38
-0
otherio/lib/rt/src/os_linux/rt_io_m_hilscher_cifx_master.c
otherio/lib/rt/src/os_linux/rt_io_m_hilscher_cifx_master.c
+6
-2
otherio/lib/rt/src/os_linux/rt_io_m_hilscher_cifx_pncontroller.cpp
...ib/rt/src/os_linux/rt_io_m_hilscher_cifx_pncontroller.cpp
+1188
-0
otherio/lib/rt/src/rt_io_otherio.meth
otherio/lib/rt/src/rt_io_otherio.meth
+1
-0
otherio/wbl/mcomp/src/otherio.wb_load
otherio/wbl/mcomp/src/otherio.wb_load
+172
-2
profibus/lib/rt/src/os_linux/rt_io_m_pncontrollersoftingpnak.cpp
...s/lib/rt/src/os_linux/rt_io_m_pncontrollersoftingpnak.cpp
+4
-3
profibus/lib/rt/src/os_linux/rt_io_m_pndevice.cpp
profibus/lib/rt/src/os_linux/rt_io_m_pndevice.cpp
+8
-11
profibus/lib/rt/src/os_linux/rt_io_m_pnmodule.cpp
profibus/lib/rt/src/os_linux/rt_io_m_pnmodule.cpp
+8
-8
profibus/lib/rt/src/os_linux/rt_io_pn_locals.h
profibus/lib/rt/src/os_linux/rt_io_pn_locals.h
+10
-150
profibus/lib/rt/src/os_linux/rt_io_pnak_locals.h
profibus/lib/rt/src/os_linux/rt_io_pnak_locals.h
+167
-0
profibus/lib/rt/src/os_linux/rt_pn_iface.cpp
profibus/lib/rt/src/os_linux/rt_pn_iface.cpp
+2
-1
No files found.
otherio/lib/rt/src/os_linux/rt_io_m_hilscher_cifx.h
View file @
74f05bbb
/*
* Proview $Id$
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef rt_io_hilscher_cifx_h
#define rt_io_hilscher_cifx_h
typedef
struct
{
typedef
struct
{
unsigned
long
channel
;
unsigned
long
channel
;
...
@@ -9,6 +29,7 @@ typedef struct {
...
@@ -9,6 +29,7 @@ typedef struct {
unsigned
int
dev_init
;
unsigned
int
dev_init
;
unsigned
int
dev_init_cnt
;
unsigned
int
dev_init_cnt
;
unsigned
int
dev_init_limit
;
unsigned
int
dev_init_limit
;
int
softlimit_logged
;
int
input_area_size
;
int
input_area_size
;
int
output_area_size
;
int
output_area_size
;
void
*
input_area
;
void
*
input_area
;
...
@@ -20,3 +41,20 @@ typedef struct {
...
@@ -20,3 +41,20 @@ typedef struct {
int
float_representation
;
int
float_representation
;
}
io_sLocalHilscher_cifX_Device
;
}
io_sLocalHilscher_cifX_Device
;
typedef
struct
{
unsigned
long
channel
;
unsigned
long
board
;
CIFXHANDLE
chan
;
unsigned
int
diag_cnt
;
unsigned
int
diag_interval
;
unsigned
int
dev_init
;
unsigned
int
dev_init_cnt
;
unsigned
int
dev_init_limit
;
int
softlimit_logged
;
int
input_area_size
;
int
output_area_size
;
void
*
input_area
;
void
*
output_area
;
}
io_sLocalHilscher_cifX_PnController
;
#endif
otherio/lib/rt/src/os_linux/rt_io_m_hilscher_cifx_master.c
View file @
74f05bbb
...
@@ -322,8 +322,10 @@ static pwr_tStatus IoAgentRead( io_tCtx ctx, io_sAgent *ap)
...
@@ -322,8 +322,10 @@ static pwr_tStatus IoAgentRead( io_tCtx ctx, io_sAgent *ap)
op
->
ErrorCount
++
;
op
->
ErrorCount
++
;
}
}
if
(
op
->
ErrorCount
==
op
->
ErrorSoftLimit
)
if
(
op
->
ErrorCount
==
op
->
ErrorSoftLimit
&&
!
local
->
softlimit_logged
)
{
errh_Error
(
"IO Error soft limit reached on agent '%s'"
,
ap
->
Name
);
errh_Error
(
"IO Error soft limit reached on agent '%s'"
,
ap
->
Name
);
local
->
softlimit_logged
=
1
;
}
if
(
op
->
ErrorCount
>=
op
->
ErrorHardLimit
)
{
if
(
op
->
ErrorCount
>=
op
->
ErrorHardLimit
)
{
ctx
->
Node
->
EmergBreakTrue
=
1
;
ctx
->
Node
->
EmergBreakTrue
=
1
;
return
IO__ERRDEVICE
;
return
IO__ERRDEVICE
;
...
@@ -360,8 +362,10 @@ static pwr_tStatus IoAgentWrite( io_tCtx ctx, io_sAgent *ap)
...
@@ -360,8 +362,10 @@ static pwr_tStatus IoAgentWrite( io_tCtx ctx, io_sAgent *ap)
xDriverGetErrorDescription
(
sts
,
op
->
ErrorStr
,
sizeof
(
op
->
ErrorStr
));
xDriverGetErrorDescription
(
sts
,
op
->
ErrorStr
,
sizeof
(
op
->
ErrorStr
));
}
}
if
(
op
->
ErrorCount
==
op
->
ErrorSoftLimit
)
if
(
op
->
ErrorCount
==
op
->
ErrorSoftLimit
&&
!
local
->
softlimit_logged
)
{
errh_Error
(
"IO Error soft limit reached on agent '%s'"
,
ap
->
Name
);
errh_Error
(
"IO Error soft limit reached on agent '%s'"
,
ap
->
Name
);
local
->
softlimit_logged
=
1
;
}
if
(
op
->
ErrorCount
>=
op
->
ErrorHardLimit
)
{
if
(
op
->
ErrorCount
>=
op
->
ErrorHardLimit
)
{
ctx
->
Node
->
EmergBreakTrue
=
1
;
ctx
->
Node
->
EmergBreakTrue
=
1
;
return
IO__ERRDEVICE
;
return
IO__ERRDEVICE
;
...
...
otherio/lib/rt/src/os_linux/rt_io_m_hilscher_cifx_pncontroller.cpp
0 → 100644
View file @
74f05bbb
This diff is collapsed.
Click to expand it.
otherio/lib/rt/src/rt_io_otherio.meth
View file @
74f05bbb
...
@@ -12,6 +12,7 @@ GPIO_Module
...
@@ -12,6 +12,7 @@ GPIO_Module
Maxim_DS18B20
Maxim_DS18B20
USB_Agent
USB_Agent
Velleman_K8055_Board
Velleman_K8055_Board
Hilscher_cifX_PnController
Hilscher_cifX_Master
Hilscher_cifX_Master
Hilscher_cifX_Module
Hilscher_cifX_Module
USB_Joystick
USB_Joystick
...
...
otherio/wbl/mcomp/src/otherio.wb_load
View file @
74f05bbb
Volume OtherIO $ClassVolume 0.0.250.10
Volume OtherIO $ClassVolume 0.0.250.10
Body SysBody 01-JAN-1970 01:00:00.00
Body SysBody 01-JAN-1970 01:00:00.00
Attr NextOix = "_X2
33
"
Attr NextOix = "_X2
42
"
Attr NextCix = "_X2
4
"
Attr NextCix = "_X2
5
"
Attr NextTix[0] = "_X10"
Attr NextTix[0] = "_X10"
EndBody
EndBody
Object Type $TypeHier 1 15-NOV-2007 14:35:37.90
Object Type $TypeHier 1 15-NOV-2007 14:35:37.90
...
@@ -2904,6 +2904,176 @@ Volume OtherIO $ClassVolume 0.0.250.10
...
@@ -2904,6 +2904,176 @@ Volume OtherIO $ClassVolume 0.0.250.10
EndBody
EndBody
EndObject
EndObject
EndObject
EndObject
Object Hilscher_cifX_PnController $ClassDef 24 23-MAY-2011 11:01:53.65
Body SysBody 23-MAY-2011 11:01:37.07
Attr Editor = 0
Attr Method = 0
Attr Flags = 38992
EndBody
Object RtBody $ObjBodyDef 1 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:02:08.50
Attr StructName = "Hilscher_cifX_PnController"
Attr NextAix = "_X31"
EndBody
Object Description $Attribute 14 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:01:37.07
Attr PgmName = "Description"
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
Object Specification $Attribute 15 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:01:37.07
Attr PgmName = "Specification"
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
Object DataSheet $Attribute 16 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:01:37.07
Attr PgmName = "DataSheet"
Attr TypeRef = "pwrs:Type-$URL"
EndBody
EndObject
Object IP_Address $Attribute 27 24-MAY-2011 08:21:37.53
Body SysBody 24-MAY-2011 08:21:12.63
Attr PgmName = "IP_Address"
Attr TypeRef = "pwrs:Type-$String32"
EndBody
EndObject
Object SubnetMask $Attribute 28 24-MAY-2011 08:21:57.03
Body SysBody 24-MAY-2011 08:23:57.17
Attr PgmName = "SubnetMask"
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
Object DeviceName $Attribute 29 24-MAY-2011 08:22:20.62
Body SysBody 24-MAY-2011 08:24:00.64
Attr PgmName = "DeviceName"
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
Object DeviceType $Attribute 30 24-MAY-2011 08:22:25.89
Body SysBody 24-MAY-2011 08:24:03.36
Attr PgmName = "DeviceType"
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
Object Alias $Attribute 17 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:01:37.07
Attr PgmName = "Alias"
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
Object Channel $Attribute 18 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:01:37.07
Attr PgmName = "Channel"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object Status $Attribute 19 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:01:37.07
Attr PgmName = "Status"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object Process $Attribute 20 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:01:37.07
Attr PgmName = "Process"
Attr TypeRef = "pwrb:Type-IoProcessMask"
EndBody
EndObject
Object ThreadObject $Attribute 21 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:01:37.07
Attr PgmName = "ThreadObject"
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
Object ErrorCount $Attribute 22 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:01:37.07
Attr PgmName = "ErrorCount"
Attr Flags = 1040
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorStr $Attribute 23 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:01:37.07
Attr PgmName = "ErrorStr"
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
Object ErrorSoftLimit $Attribute 24 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:01:37.07
Attr PgmName = "ErrorSoftLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorHardLimit $Attribute 25 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:01:37.07
Attr PgmName = "ErrorHardLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object Diag $Attribute 26 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:01:37.07
Attr PgmName = "Diag"
Attr Flags = 131072
Attr TypeRef = "OtherIO:Class-Hilscher_cifX_Diag"
EndBody
EndObject
EndObject
Object IoMethods $RtMethod 234 23-MAY-2011 11:01:37.07
Object IoAgentInit $Method 235 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:02:25.93
Attr MethodName = "Hilscher_cifX_PnController-IoAgentInit"
EndBody
EndObject
Object IoAgentClose $Method 236 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:02:36.54
Attr MethodName = "Hilscher_cifX_PnController-IoAgentClose"
EndBody
EndObject
Object IoAgentRead $Method 237 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:02:43.74
Attr MethodName = "Hilscher_cifX_PnController-IoAgentRead"
EndBody
EndObject
Object IoAgentWrite $Method 238 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:02:50.73
Attr MethodName = "Hilscher_cifX_PnController-IoAgentWrite"
EndBody
EndObject
EndObject
Object ConfiguratorPoson $Menu 239 23-MAY-2011 11:01:37.07
Object Pointed $Menu 240 23-MAY-2011 11:01:37.07
Object Connect $MenuButton 241 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:01:37.07
Attr ButtonName = "Connect PlcThread"
Attr MethodName = "$Objid-Connect"
Attr MethodArguments[0] = "ThreadObject"
Attr MethodArguments[1] = "PlcThread"
Attr FilterName = "$Objid-IsOkConnect"
Attr FilterArguments[0] = "ThreadObject"
Attr FilterArguments[1] = "PlcThread"
EndBody
EndObject
EndObject
EndObject
Object PostCreate $DbCallBack 242 23-MAY-2011 11:01:37.07
Body SysBody 23-MAY-2011 11:01:37.07
Attr MethodName = "BaseIORack-PostCreate"
EndBody
EndObject
Object Template Hilscher_cifX_PnController 2154004480 01-JAN-1970 01:00:00.00
Body RtBody 24-MAY-2011 08:26:34.69
Attr IP_Address = "10.0.0.1"
Attr SubnetMask = "255.255.255.0"
Attr DeviceName = "controller"
Attr DeviceType = "cifX RE/PNM"
Attr Process = 1
Attr ErrorSoftLimit = 25
Attr ErrorHardLimit = 50
EndBody
EndObject
EndObject
Object Hilscher_cifX_Master $ClassDef 17 23-FEB-2011 15:22:46.32
Object Hilscher_cifX_Master $ClassDef 17 23-FEB-2011 15:22:46.32
Body SysBody 23-FEB-2011 14:03:13.10
Body SysBody 23-FEB-2011 14:03:13.10
Attr Editor = 0
Attr Editor = 0
...
...
profibus/lib/rt/src/os_linux/rt_io_m_pncontrollersoftingpnak.cpp
View file @
74f05bbb
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
#include "rt_pnak.h"
#include "rt_pnak.h"
#include "co_dcli.h"
#include "co_dcli.h"
#include "rt_pn_gsdml_data.h"
#include "rt_pn_gsdml_data.h"
#include "rt_io_pnak_locals.h"
#include "rt_io_pn_locals.h"
#include "rt_io_pn_locals.h"
#include "rt_pn_iface.h"
#include "rt_pn_iface.h"
...
@@ -86,7 +87,7 @@ static pwr_tStatus IoAgentInit (
...
@@ -86,7 +87,7 @@ static pwr_tStatus IoAgentInit (
pwr_sClass_PnControllerSoftingPNAK
*
op
;
pwr_sClass_PnControllerSoftingPNAK
*
op
;
pwr_tUInt16
sts
;
pwr_tUInt16
sts
;
io_sAgentLocal
*
local
;
io_sAgentLocal
*
local
;
io_sRackLocal
*
r_local
;
io_s
Pn
RackLocal
*
r_local
;
char
fname
[
196
];
char
fname
[
196
];
char
hname
[
40
];
char
hname
[
40
];
...
@@ -281,8 +282,8 @@ static pwr_tStatus IoAgentInit (
...
@@ -281,8 +282,8 @@ static pwr_tStatus IoAgentInit (
for
(
slave_list
=
ap
->
racklist
,
ii
=
0
;
slave_list
!=
NULL
;
for
(
slave_list
=
ap
->
racklist
,
ii
=
0
;
slave_list
!=
NULL
;
slave_list
=
slave_list
->
next
,
ii
++
)
{
slave_list
=
slave_list
->
next
,
ii
++
)
{
slave_list
->
Local
=
(
unsigned
char
*
)
calloc
(
1
,
sizeof
(
io_sRackLocal
));
slave_list
->
Local
=
(
unsigned
char
*
)
calloc
(
1
,
sizeof
(
io_s
Pn
RackLocal
));
r_local
=
(
io_sRackLocal
*
)
slave_list
->
Local
;
r_local
=
(
io_s
Pn
RackLocal
*
)
slave_list
->
Local
;
for
(
jj
=
0
;
jj
<
local
->
device_data
[
ii
+
1
]
->
iocr_data
.
size
();
jj
++
)
{
for
(
jj
=
0
;
jj
<
local
->
device_data
[
ii
+
1
]
->
iocr_data
.
size
();
jj
++
)
{
...
...
profibus/lib/rt/src/os_linux/rt_io_m_pndevice.cpp
View file @
74f05bbb
...
@@ -36,10 +36,11 @@
...
@@ -36,10 +36,11 @@
#include "rt_errh.h"
#include "rt_errh.h"
#include "rt_pb_msg.h"
#include "rt_pb_msg.h"
#include "rt_profinet.h"
//
#include "rt_profinet.h"
#include "rt_pnak.h"
//
#include "rt_pnak.h"
#include "co_dcli.h"
#include "co_dcli.h"
#include "rt_pn_gsdml_data.h"
#include "rt_pn_gsdml_data.h"
//#include "rt_io_pnak_locals.h"
#include "rt_io_pn_locals.h"
#include "rt_io_pn_locals.h"
...
@@ -53,7 +54,7 @@ static pwr_tStatus IoRackInit (
...
@@ -53,7 +54,7 @@ static pwr_tStatus IoRackInit (
io_sRack
*
rp
io_sRack
*
rp
)
)
{
{
io_sCardLocal
*
local_card
;
io_s
Pn
CardLocal
*
local_card
;
io_sCard
*
cardp
;
io_sCard
*
cardp
;
short
input_counter
;
short
input_counter
;
short
output_counter
;
short
output_counter
;
...
@@ -89,10 +90,10 @@ static pwr_tStatus IoRackInit (
...
@@ -89,10 +90,10 @@ static pwr_tStatus IoRackInit (
latent_output_count
=
0
;
latent_output_count
=
0
;
while
(
cardp
)
{
while
(
cardp
)
{
local_card
=
(
io_sCardLocal
*
)
calloc
(
1
,
sizeof
(
*
local_card
));
local_card
=
(
io_s
Pn
CardLocal
*
)
calloc
(
1
,
sizeof
(
*
local_card
));
cardp
->
Local
=
local_card
;
cardp
->
Local
=
local_card
;
local_card
->
input_area
=
((
io_sRackLocal
*
)(
rp
->
Local
))
->
inputs
;
local_card
->
input_area
=
((
io_s
Pn
RackLocal
*
)(
rp
->
Local
))
->
inputs
;
local_card
->
output_area
=
((
io_sRackLocal
*
)(
rp
->
Local
))
->
outputs
;
local_card
->
output_area
=
((
io_s
Pn
RackLocal
*
)(
rp
->
Local
))
->
outputs
;
/* From v4.1.3 we can have subclasses, find the super class */
/* From v4.1.3 we can have subclasses, find the super class */
...
@@ -230,11 +231,9 @@ static pwr_tStatus IoRackRead (
...
@@ -230,11 +231,9 @@ static pwr_tStatus IoRackRead (
io_sRack
*
rp
io_sRack
*
rp
)
)
{
{
pwr_sClass_PnControllerSoftingPNAK
*
mp
;
pwr_sClass_PnDevice
*
sp
;
pwr_sClass_PnDevice
*
sp
;
sp
=
(
pwr_sClass_PnDevice
*
)
rp
->
op
;
sp
=
(
pwr_sClass_PnDevice
*
)
rp
->
op
;
mp
=
(
pwr_sClass_PnControllerSoftingPNAK
*
)
ap
->
op
;
/* The reading of the process image is now performed at the agent level,
/* The reading of the process image is now performed at the agent level,
this eliminates the need for board specific code at the rack level. */
this eliminates the need for board specific code at the rack level. */
...
@@ -247,7 +246,7 @@ static pwr_tStatus IoRackRead (
...
@@ -247,7 +246,7 @@ static pwr_tStatus IoRackRead (
}
}
if
(
sp
->
ErrorCount
>
sp
->
ErrorSoftLimit
)
{
if
(
sp
->
ErrorCount
>
sp
->
ErrorSoftLimit
)
{
memset
(((
io_s
RackLocal
*
)(
rp
->
Local
))
->
inputs
,
0
,
((
io_s
RackLocal
*
)(
rp
->
Local
))
->
bytes_of_input
);
memset
(((
io_s
PnRackLocal
*
)(
rp
->
Local
))
->
inputs
,
0
,
((
io_sPn
RackLocal
*
)(
rp
->
Local
))
->
bytes_of_input
);
}
}
// if (sp->ErrorCount > sp->ErrorHardLimit && sp->StallAction >= pwr_ePbStallAction_EmergencyBreak) {
// if (sp->ErrorCount > sp->ErrorHardLimit && sp->StallAction >= pwr_ePbStallAction_EmergencyBreak) {
...
@@ -267,11 +266,9 @@ static pwr_tStatus IoRackWrite (
...
@@ -267,11 +266,9 @@ static pwr_tStatus IoRackWrite (
io_sRack
*
rp
io_sRack
*
rp
)
)
{
{
pwr_sClass_PnControllerSoftingPNAK
*
mp
;
pwr_sClass_PnDevice
*
sp
;
pwr_sClass_PnDevice
*
sp
;
sp
=
(
pwr_sClass_PnDevice
*
)
rp
->
op
;
sp
=
(
pwr_sClass_PnDevice
*
)
rp
->
op
;
mp
=
(
pwr_sClass_PnControllerSoftingPNAK
*
)
ap
->
op
;
/* The writing of the process image is now performed at the agent level,
/* The writing of the process image is now performed at the agent level,
this eliminates the need for board specific code at the rack level. */
this eliminates the need for board specific code at the rack level. */
...
...
profibus/lib/rt/src/os_linux/rt_io_m_pnmodule.cpp
View file @
74f05bbb
...
@@ -52,11 +52,11 @@ static pwr_tStatus IoCardInit (
...
@@ -52,11 +52,11 @@ static pwr_tStatus IoCardInit (
io_sCard
*
cp
io_sCard
*
cp
)
)
{
{
io_sCardLocal
*
local
;
io_s
Pn
CardLocal
*
local
;
pwr_sClass_PnModule
*
op
;
pwr_sClass_PnModule
*
op
;
op
=
(
pwr_sClass_PnModule
*
)
cp
->
op
;
op
=
(
pwr_sClass_PnModule
*
)
cp
->
op
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
local
=
(
io_s
Pn
CardLocal
*
)
cp
->
Local
;
op
->
Status
=
PB__NORMAL
;
op
->
Status
=
PB__NORMAL
;
...
@@ -74,12 +74,12 @@ static pwr_tStatus IoCardRead (
...
@@ -74,12 +74,12 @@ static pwr_tStatus IoCardRead (
io_sCard
*
cp
io_sCard
*
cp
)
)
{
{
io_sCardLocal
*
local
;
io_s
Pn
CardLocal
*
local
;
pwr_sClass_PnModule
*
op
;
pwr_sClass_PnModule
*
op
;
pwr_sClass_PnDevice
*
slave
;
pwr_sClass_PnDevice
*
slave
;
op
=
(
pwr_sClass_PnModule
*
)
cp
->
op
;
op
=
(
pwr_sClass_PnModule
*
)
cp
->
op
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
local
=
(
io_s
Pn
CardLocal
*
)
cp
->
Local
;
slave
=
(
pwr_sClass_PnDevice
*
)
rp
->
op
;
slave
=
(
pwr_sClass_PnDevice
*
)
rp
->
op
;
op
->
Status
=
slave
->
Status
;
op
->
Status
=
slave
->
Status
;
...
@@ -105,12 +105,12 @@ static pwr_tStatus IoCardWrite (
...
@@ -105,12 +105,12 @@ static pwr_tStatus IoCardWrite (
io_sCard
*
cp
io_sCard
*
cp
)
)
{
{
io_sCardLocal
*
local
;
io_s
Pn
CardLocal
*
local
;
pwr_sClass_PnModule
*
op
;
pwr_sClass_PnModule
*
op
;
pwr_sClass_PnDevice
*
slave
;
pwr_sClass_PnDevice
*
slave
;
op
=
(
pwr_sClass_PnModule
*
)
cp
->
op
;
op
=
(
pwr_sClass_PnModule
*
)
cp
->
op
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
local
=
(
io_s
Pn
CardLocal
*
)
cp
->
Local
;
slave
=
(
pwr_sClass_PnDevice
*
)
rp
->
op
;
slave
=
(
pwr_sClass_PnDevice
*
)
rp
->
op
;
op
->
Status
=
slave
->
Status
;
op
->
Status
=
slave
->
Status
;
...
@@ -134,8 +134,8 @@ static pwr_tStatus IoCardClose (
...
@@ -134,8 +134,8 @@ static pwr_tStatus IoCardClose (
io_sCard
*
cp
io_sCard
*
cp
)
)
{
{
io_sCardLocal
*
local
;
io_s
Pn
CardLocal
*
local
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
local
=
(
io_s
Pn
CardLocal
*
)
cp
->
Local
;
free
((
char
*
)
local
);
free
((
char
*
)
local
);
...
...
profibus/lib/rt/src/os_linux/rt_io_pn_locals.h
View file @
74f05bbb
...
@@ -20,160 +20,20 @@
...
@@ -20,160 +20,20 @@
#ifndef rt_io_pn_locals_h
#ifndef rt_io_pn_locals_h
#define rt_io_pn_locals_h
#define rt_io_pn_locals_h
#include "rt_profinet.h"
#include "rt_pnak.h"
/* rt_io_pn_locals.h -- Profinet io handling locals. */
/* rt_io_pn_locals.h -- Profinet io handling locals. */
typedef
struct
_PN_Alarm_Data
{
typedef
struct
_io_sPnRackLocal
{
unsigned
short
alarm_type
;
unsigned
short
bytes_of_input
;
unsigned
short
alarm_prio
;
unsigned
short
bytes_of_output
;
unsigned
short
rem_alarms
;
unsigned
char
*
inputs
;
unsigned
int
slot_number
;
unsigned
char
*
outputs
;
unsigned
int
sub_slot_number
;
}
io_sPnRackLocal
;
unsigned
int
module_ident_number
;
unsigned
int
submodule_ident_number
;
unsigned
short
alarm_spec
;
unsigned
short
data_length
;
unsigned
char
*
data
;
}
PN_Alarm_Data
;
class
PnIOCRData
{
public:
PnIOCRData
()
:
type
(
0
),
number_modules
(
0
),
identifier
(
0
),
io_data_length
(
0
)
{}
unsigned
short
type
;
unsigned
short
number_modules
;
unsigned
short
identifier
;
unsigned
short
io_data_length
;
// bytes of io-data including status;
unsigned
short
clean_io_data_length
;
// bytes of io-data including status;
unsigned
char
*
io_data
;
unsigned
char
*
clean_io_data
;
~
PnIOCRData
()
{}
int
print
(
ofstream
&
fp
);
};
class
PnSubmoduleData
{
public:
PnSubmoduleData
()
:
subslot_number
(
0
),
subslot_idx
(
0
),
type
(
0
),
state
(
0
),
ident_number
(
0
),
phys_ident_number
(
0
)
{}
unsigned
short
subslot_number
;
unsigned
short
subslot_idx
;
unsigned
short
type
;
unsigned
short
state
;
unsigned
int
ident_number
;
unsigned
int
phys_ident_number
;
unsigned
short
io_in_data_length
;
// bytes of pure io-data
unsigned
short
offset_io_in
;
// offset in io-data area for this iocr
unsigned
short
offset_clean_io_in
;
// offset in io-data area for this iocr
unsigned
short
offset_status_in
;
// offset in io-data area for this iocr
unsigned
short
io_out_data_length
;
// bytes of pure io-data
unsigned
short
offset_io_out
;
// offset in io-data area for this iocr
unsigned
short
offset_clean_io_out
;
// offset in io-data area for this iocr
unsigned
short
offset_status_out
;
// offset in io-data area for this iocr
~
PnSubmoduleData
()
{}
int
print
(
ofstream
&
fp
);
};
class
PnModuleData
{
public:
PnModuleData
()
:
slot_number
(
0
),
slot_idx
(
0
),
state
(
0
),
ident_number
(
0
),
phys_ident_number
(
0
)
{}
unsigned
int
slot_number
;
unsigned
int
slot_idx
;
unsigned
short
state
;
unsigned
int
ident_number
;
unsigned
int
phys_ident_number
;
vector
<
PnSubmoduleData
*>
submodule_data
;
~
PnModuleData
()
{
for
(
unsigned
int
i
=
0
;
i
<
submodule_data
.
size
();
i
++
)
delete
submodule_data
[
i
];
}
int
print
(
ofstream
&
fp
);
};
class
PnDeviceData
{
public:
PnDeviceData
()
:
device_ref
(
0
),
alarm_ref
(
0
),
device_state
(
0
),
no_diff_modules
(
0
)
{
memset
(
&
alarm_data
,
0
,
sizeof
(
PN_Alarm_Data
));}
unsigned
short
device_ref
;
unsigned
short
alarm_ref
;
unsigned
short
device_state
;
unsigned
short
no_diff_modules
;
PN_Alarm_Data
alarm_data
;
vector
<
PnModuleData
*>
module_data
;
vector
<
PnIOCRData
*>
iocr_data
;
~
PnDeviceData
()
{
device_reset
();}
void
device_reset
()
{
for
(
unsigned
int
i
=
0
;
i
<
module_data
.
size
();
i
++
)
delete
module_data
[
i
];
module_data
.
clear
();
for
(
unsigned
int
i
=
0
;
i
<
iocr_data
.
size
();
i
++
)
delete
iocr_data
[
i
];
iocr_data
.
clear
();
}
int
copy_slot
(
unsigned
int
slot_idx
);
int
cut_slot
(
unsigned
int
slot_idx
);
int
paste_slot
(
unsigned
int
slot_idx
);
};
class
PnDeviceInfo
{
public:
PnDeviceInfo
()
{}
unsigned
char
ipaddress
[
4
];
unsigned
char
macaddress
[
6
];
unsigned
char
subnetmask
[
4
];
char
devname
[
80
];
int
vendorid
;
int
deviceid
;
};
typedef
struct
_agent_args
{
void
*
local
;
io_sAgent
*
ap
;
}
agent_args
;
class
io_sAgentLocal
{
public
:
io_sAgentLocal
()
{}
T_PNAK_SERVICE_REQ_RES
service_req_res
;
T_PNAK_SERVICE_CON
service_con
;
unsigned
char
ipaddress
[
4
];
unsigned
char
macaddress
[
6
];
unsigned
char
subnetmask
[
4
];
vector
<
PnDeviceData
*>
device_data
;
vector
<
PnDeviceInfo
*>
dev_info
;
pthread_t
handle_events
;
agent_args
args
;
};
typedef
struct
_io_sRackLocal
{
unsigned
short
bytes_of_input
;
unsigned
short
bytes_of_output
;
unsigned
char
*
inputs
;
unsigned
char
*
outputs
;
}
io_sRackLocal
;
typedef
struct
_io_sCardLocal
{
typedef
struct
_io_sPnCardLocal
{
unsigned
int
input_area_size
;
unsigned
int
output_area_size
;
unsigned
char
*
input_area
;
unsigned
char
*
input_area
;
unsigned
char
*
output_area
;
unsigned
char
*
output_area
;
}
io_sCardLocal
;
}
io_s
Pn
CardLocal
;
#endif
#endif
profibus/lib/rt/src/os_linux/rt_io_pnak_locals.h
0 → 100644
View file @
74f05bbb
/*
* Proview $Id$
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef rt_io_pnak_locals_h
#define rt_io_pnak_locals_h
#include "rt_profinet.h"
#include "rt_pnak.h"
/* rt_io_pnak_locals.h -- Profinet io handling locals. */
typedef
struct
_PN_Alarm_Data
{
unsigned
short
alarm_type
;
unsigned
short
alarm_prio
;
unsigned
short
rem_alarms
;
unsigned
int
slot_number
;
unsigned
int
sub_slot_number
;
unsigned
int
module_ident_number
;
unsigned
int
submodule_ident_number
;
unsigned
short
alarm_spec
;
unsigned
short
data_length
;
unsigned
char
*
data
;
}
PN_Alarm_Data
;
class
PnIOCRData
{
public:
PnIOCRData
()
:
type
(
0
),
number_modules
(
0
),
identifier
(
0
),
io_data_length
(
0
)
{}
unsigned
short
type
;
unsigned
short
number_modules
;
unsigned
short
identifier
;
unsigned
short
io_data_length
;
// bytes of io-data including status;
unsigned
short
clean_io_data_length
;
// bytes of io-data including status;
unsigned
char
*
io_data
;
unsigned
char
*
clean_io_data
;
~
PnIOCRData
()
{}
int
print
(
ofstream
&
fp
);
};
class
PnSubmoduleData
{
public:
PnSubmoduleData
()
:
subslot_number
(
0
),
subslot_idx
(
0
),
type
(
0
),
state
(
0
),
ident_number
(
0
),
phys_ident_number
(
0
)
{}
unsigned
short
subslot_number
;
unsigned
short
subslot_idx
;
unsigned
short
type
;
unsigned
short
state
;
unsigned
int
ident_number
;
unsigned
int
phys_ident_number
;
unsigned
short
io_in_data_length
;
// bytes of pure io-data
unsigned
short
offset_io_in
;
// offset in io-data area for this iocr
unsigned
short
offset_clean_io_in
;
// offset in io-data area for this iocr
unsigned
short
offset_status_in
;
// offset in io-data area for this iocr
unsigned
short
io_out_data_length
;
// bytes of pure io-data
unsigned
short
offset_io_out
;
// offset in io-data area for this iocr
unsigned
short
offset_clean_io_out
;
// offset in io-data area for this iocr
unsigned
short
offset_status_out
;
// offset in io-data area for this iocr
~
PnSubmoduleData
()
{}
int
print
(
ofstream
&
fp
);
};
class
PnModuleData
{
public:
PnModuleData
()
:
slot_number
(
0
),
slot_idx
(
0
),
state
(
0
),
ident_number
(
0
),
phys_ident_number
(
0
)
{}
unsigned
int
slot_number
;
unsigned
int
slot_idx
;
unsigned
short
state
;
unsigned
int
ident_number
;
unsigned
int
phys_ident_number
;
vector
<
PnSubmoduleData
*>
submodule_data
;
~
PnModuleData
()
{
for
(
unsigned
int
i
=
0
;
i
<
submodule_data
.
size
();
i
++
)
delete
submodule_data
[
i
];
}
int
print
(
ofstream
&
fp
);
};
class
PnDeviceData
{
public:
PnDeviceData
()
:
device_ref
(
0
),
alarm_ref
(
0
),
device_state
(
0
),
no_diff_modules
(
0
)
{
memset
(
&
alarm_data
,
0
,
sizeof
(
PN_Alarm_Data
));}
unsigned
short
device_ref
;
unsigned
short
alarm_ref
;
unsigned
short
device_state
;
unsigned
short
no_diff_modules
;
PN_Alarm_Data
alarm_data
;
vector
<
PnModuleData
*>
module_data
;
vector
<
PnIOCRData
*>
iocr_data
;
~
PnDeviceData
()
{
device_reset
();}
void
device_reset
()
{
for
(
unsigned
int
i
=
0
;
i
<
module_data
.
size
();
i
++
)
delete
module_data
[
i
];
module_data
.
clear
();
for
(
unsigned
int
i
=
0
;
i
<
iocr_data
.
size
();
i
++
)
delete
iocr_data
[
i
];
iocr_data
.
clear
();
}
int
copy_slot
(
unsigned
int
slot_idx
);
int
cut_slot
(
unsigned
int
slot_idx
);
int
paste_slot
(
unsigned
int
slot_idx
);
};
class
PnDeviceInfo
{
public:
PnDeviceInfo
()
{}
unsigned
char
ipaddress
[
4
];
unsigned
char
macaddress
[
6
];
unsigned
char
subnetmask
[
4
];
char
devname
[
80
];
int
vendorid
;
int
deviceid
;
};
typedef
struct
_agent_args
{
void
*
local
;
io_sAgent
*
ap
;
}
agent_args
;
class
io_sAgentLocal
{
public
:
io_sAgentLocal
()
{}
T_PNAK_SERVICE_REQ_RES
service_req_res
;
T_PNAK_SERVICE_CON
service_con
;
unsigned
char
ipaddress
[
4
];
unsigned
char
macaddress
[
6
];
unsigned
char
subnetmask
[
4
];
vector
<
PnDeviceData
*>
device_data
;
vector
<
PnDeviceInfo
*>
dev_info
;
pthread_t
handle_events
;
agent_args
args
;
};
#endif
profibus/lib/rt/src/os_linux/rt_pn_iface.cpp
View file @
74f05bbb
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
#include "co_dcli.h"
#include "co_dcli.h"
#include "rt_pn_gsdml_data.h"
#include "rt_pn_gsdml_data.h"
#include "rt_io_base.h"
#include "rt_io_base.h"
#include "rt_io_pn_locals.h"
#include "rt_io_pn
ak
_locals.h"
#define _PN_U32_HIGH_WORD(U32) ((PN_U16) ((U32) >> 16))
#define _PN_U32_HIGH_WORD(U32) ((PN_U16) ((U32) >> 16))
#define _PN_U32_LOW_WORD(U32) ((PN_U16) (U32) )
#define _PN_U32_LOW_WORD(U32) ((PN_U16) (U32) )
...
@@ -1546,5 +1546,6 @@ void *handle_events(void *ptr) {
...
@@ -1546,5 +1546,6 @@ void *handle_events(void *ptr) {
// pThisSmObject->Running = PN_FALSE;
// pThisSmObject->Running = PN_FALSE;
}
}
}
}
return
0
;
}
}
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