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
af1e6379
Commit
af1e6379
authored
Aug 27, 2014
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of pwrcvs:/data1/git/pwr
parents
4e0c38b9
fb9829ef
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
2235 additions
and
295 deletions
+2235
-295
profibus/changelog.txt
profibus/changelog.txt
+1
-0
profibus/lib/rt/src/os_linux/rt_io_m_pb_ai.c
profibus/lib/rt/src/os_linux/rt_io_m_pb_ai.c
+1
-2
profibus/lib/rt/src/os_linux/rt_io_m_pb_ao.c
profibus/lib/rt/src/os_linux/rt_io_m_pb_ao.c
+2
-2
profibus/lib/rt/src/os_linux/rt_io_m_pb_di.c
profibus/lib/rt/src/os_linux/rt_io_m_pb_di.c
+2
-2
profibus/lib/rt/src/os_linux/rt_io_m_pb_do.c
profibus/lib/rt/src/os_linux/rt_io_m_pb_do.c
+2
-2
profibus/lib/rt/src/os_linux/rt_io_m_pb_dp_slave.c
profibus/lib/rt/src/os_linux/rt_io_m_pb_dp_slave.c
+9
-2
profibus/lib/rt/src/os_linux/rt_io_m_pb_fdl_datatransfer.c
profibus/lib/rt/src/os_linux/rt_io_m_pb_fdl_datatransfer.c
+330
-0
profibus/lib/rt/src/os_linux/rt_io_m_pb_fdl_sap.c
profibus/lib/rt/src/os_linux/rt_io_m_pb_fdl_sap.c
+108
-0
profibus/lib/rt/src/os_linux/rt_io_m_pb_hilscher.c
profibus/lib/rt/src/os_linux/rt_io_m_pb_hilscher.c
+26
-26
profibus/lib/rt/src/os_linux/rt_io_m_pb_ii.c
profibus/lib/rt/src/os_linux/rt_io_m_pb_ii.c
+2
-2
profibus/lib/rt/src/os_linux/rt_io_m_pb_io.c
profibus/lib/rt/src/os_linux/rt_io_m_pb_io.c
+2
-2
profibus/lib/rt/src/os_linux/rt_io_m_pb_module.c
profibus/lib/rt/src/os_linux/rt_io_m_pb_module.c
+2
-2
profibus/lib/rt/src/os_linux/rt_io_m_pb_profiboard.c
profibus/lib/rt/src/os_linux/rt_io_m_pb_profiboard.c
+824
-229
profibus/lib/rt/src/os_linux/rt_io_pb_locals.h
profibus/lib/rt/src/os_linux/rt_io_pb_locals.h
+38
-2
profibus/lib/rt/src/rt_io_profibus.meth
profibus/lib/rt/src/rt_io_profibus.meth
+2
-0
profibus/wbl/mcomp/src/profibus.wb_load
profibus/wbl/mcomp/src/profibus.wb_load
+884
-22
No files found.
profibus/changelog.txt
View file @
af1e6379
...
...
@@ -61,4 +61,5 @@
130415 rk profibus Removed re-request for diagnostics
131107 rk profibus Fixed problem with profibus diagnostic messages handling
131113 cs profibus Profibus gsd file for ABB ACS880 added
140825 rk profibus Added support for Profibus FDL.
profibus/lib/rt/src/os_linux/rt_io_m_pb_ai.c
View file @
af1e6379
...
...
@@ -45,8 +45,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
...
...
@@ -54,6 +52,7 @@
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_pb_locals.h"
/*----------------------------------------------------------------------------*\
Convert ai from rawvalue to actualvalue.
...
...
profibus/lib/rt/src/os_linux/rt_io_m_pb_ao.c
View file @
af1e6379
...
...
@@ -43,8 +43,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
...
...
@@ -53,6 +51,8 @@
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_pb_locals.h"
/*----------------------------------------------------------------------------*\
Init method for the Pb module Ao
...
...
profibus/lib/rt/src/os_linux/rt_io_m_pb_di.c
View file @
af1e6379
...
...
@@ -43,8 +43,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
...
...
@@ -53,6 +51,8 @@
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_pb_locals.h"
#define IO_CONVMASK_ALL 0xFFFF
/*----------------------------------------------------------------------------*\
...
...
profibus/lib/rt/src/os_linux/rt_io_m_pb_do.c
View file @
af1e6379
...
...
@@ -43,8 +43,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
...
...
@@ -53,6 +51,8 @@
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_pb_locals.h"
/*----------------------------------------------------------------------------*\
Init method for the Pb module Do
...
...
profibus/lib/rt/src/os_linux/rt_io_m_pb_dp_slave.c
View file @
af1e6379
...
...
@@ -42,8 +42,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "co_cdh.h"
#include "pwr_baseclasses.h"
...
...
@@ -57,6 +55,8 @@
#include "rt_io_profiboard.h"
#include "rt_pb_msg.h"
#include "rt_io_pb_locals.h"
/* Check if channel should be fetched from diagnostic area,
i.e. channel name starts with "Diag_" */
...
...
@@ -98,6 +98,13 @@ static pwr_tStatus IoRackInit (
pwr_sClass_ChanAo
*
chan_ao
;
pwr_sClass_ChanIo
*
chan_io
;
io_sRackLocal
*
local
;
local
=
calloc
(
1
,
sizeof
(
*
local
));
rp
->
Local
=
local
;
local
->
dp
=
1
;
sts
=
gdh_ObjidToName
(
rp
->
Objid
,
(
char
*
)
&
name
,
sizeof
(
name
),
cdh_mNName
);
errh_Info
(
"Init of Profibus DP Slave and Modules %s"
,
name
);
...
...
profibus/lib/rt/src/os_linux/rt_io_m_pb_fdl_datatransfer.c
0 → 100644
View file @
af1e6379
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2014 SSAB EMEA AB.
*
* This file is part of Proview.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. 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
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview 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 Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <math.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "rt_io_base.h"
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_pb_msg.h"
#include "rt_io_pb_locals.h"
#include "keywords.h"
#pragma pack(1)
#include "pb_type.h"
#include "pb_conf.h"
#include "pb_if.h"
#include "pb_err.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "pb_fdl.h"
#pragma pack(0)
static
unsigned
char
req_res_buffer
[
512
];
static
short
fdlif_sda_sdn_sdr_req
(
io_sAgentLocal
*
local_agent
,
pwr_sClass_Pb_FDL_SAP
*
sap
,
pwr_sClass_Pb_FDL_DataTransfer
*
op
,
io_sFDLCardLocal
*
local
)
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
this function is used to activate a SAP
possible return values:
- == E_OK -> no error
- != E_OK -> error
-----------------------------------------------------------------------------*/
{
// LOCAL_VARIABLES
short
result
;
/* !!! local result variable !!! */
// FUNCTION_BODY
T_FDLIF_SDN_SDA_SRD_REQ
*
req
=
(
T_FDLIF_SDN_SDA_SRD_REQ
*
)
req_res_buffer
;
unsigned
char
*
data_ptr
;
T_PROFI_SERVICE_DESCR
sdb
;
/* --- set data block parameters ------------------------------------------- */
data_ptr
=
(
USIGN8
*
)
(
req
+
1
);
req
->
ssap
=
sap
->
SAP_Nr
;
req
->
dsap
=
op
->
DestSAP
;
req
->
rem_add
=
sap
->
SlaveAddress
;
req
->
priority
=
HIGH
;
memcpy
(
data_ptr
,
local
->
output_area
,
local
->
output_area_size
);
req
->
length
=
local
->
output_area_size
;
/* --- set parameter block parameters -------------------------------------- */
sdb
.
comm_ref
=
0
;
sdb
.
layer
=
FDLIF
;
switch
(
op
->
Type
)
{
case
pwr_ePbFDLDataTransferTypeEnum_FDLIF_SDA
:
{
sdb
.
service
=
FDLIF_SDA
;
break
;
}
case
pwr_ePbFDLDataTransferTypeEnum_FDLIF_SDN
:
{
sdb
.
service
=
FDLIF_SDN
;
break
;
}
case
pwr_ePbFDLDataTransferTypeEnum_FDLIF_SRD
:
{
sdb
.
service
=
FDLIF_SRD
;
break
;
}
default:
sdb
.
service
=
FDLIF_SDN
;
break
;
}
sdb
.
primitive
=
REQ
;
sdb
.
invoke_id
=
local
->
invoke_id
=
local_agent
->
invoke_id
;
local_agent
->
invoke_id
=
(
local_agent
->
invoke_id
+
1
)
%
128
;
result
=
profi_snd_req_res
((
T_PROFI_DEVICE_HANDLE
*
)
local_agent
,
&
sdb
,
(
void
*
)
req
,
PB_FALSE
);
return
((
pwr_tBoolean
)
(
result
==
E_OK
));
}
static
short
fdlif_reply_update_mult_req
(
io_sAgentLocal
*
local_agent
,
pwr_sClass_Pb_FDL_SAP
*
sap
,
pwr_sClass_Pb_FDL_DataTransfer
*
op
,
io_sFDLCardLocal
*
local
)
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
this function is used to activate a SAP
possible return values:
- == E_OK -> no error
- != E_OK -> error
-----------------------------------------------------------------------------*/
{
// LOCAL_VARIABLES
INT16
result
;
/* !!! local result variable !!! */
// FUNCTION_BODY
T_FDLIF_RUP_REQ
*
req
=
(
T_FDLIF_RUP_REQ
*
)
req_res_buffer
;
USIGN8
*
data_ptr
;
T_PROFI_SERVICE_DESCR
sdb
;
/* --- set data block parameters ------------------------------------------- */
data_ptr
=
(
USIGN8
*
)
(
req
+
1
);
req
->
sap_nr
=
sap
->
SAP_Nr
;
req
->
priority
=
HIGH
;
memcpy
(
data_ptr
,
local
->
output_area
,
local
->
output_area_size
);
req
->
length
=
local
->
output_area_size
;
/* --- set parameter block parameters -------------------------------------- */
sdb
.
comm_ref
=
0
;
sdb
.
layer
=
FDLIF
;
sdb
.
service
=
FDLIF_REPLY_UPDATE_MULTIPLE
;
sdb
.
primitive
=
REQ
;
sdb
.
invoke_id
=
local
->
invoke_id
=
local_agent
->
invoke_id
;
local_agent
->
invoke_id
=
(
local_agent
->
invoke_id
+
1
)
%
128
;
result
=
profi_snd_req_res
((
T_PROFI_DEVICE_HANDLE
*
)
local_agent
,
&
sdb
,
(
void
*
)
req
,
PB_FALSE
);
return
((
pwr_tBoolean
)
(
result
==
E_OK
));
}
/*----------------------------------------------------------------------------*\
Init method for the Pb module
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sFDLCardLocal
*
local
;
pwr_sClass_Pb_FDL_DataTransfer
*
op
=
(
pwr_sClass_Pb_FDL_DataTransfer
*
)
cp
->
op
;
unsigned
int
input_area_offset
=
0
;
unsigned
int
input_area_chansize
=
0
;
unsigned
int
output_area_offset
=
0
;
unsigned
int
output_area_chansize
=
0
;
local
=
(
io_sFDLCardLocal
*
)
calloc
(
1
,
sizeof
(
io_sFDLCardLocal
));
cp
->
Local
=
local
;
/* Initialize remote address structure */
local
->
byte_ordering
=
((
pwr_sClass_Pb_FDL_SAP
*
)
rp
->
op
)
->
ByteOrdering
;
io_bus_card_init
(
ctx
,
cp
,
&
input_area_offset
,
&
input_area_chansize
,
&
output_area_offset
,
&
output_area_chansize
,
local
->
byte_ordering
,
io_eAlignment_Packed
);
local
->
input_area_size
=
input_area_offset
+
input_area_chansize
;
local
->
output_area_size
=
output_area_offset
+
output_area_chansize
;
if
(
local
->
input_area_size
>
0
)
local
->
input_area
=
calloc
(
1
,
local
->
input_area_size
);
if
(
local
->
output_area_size
>
0
)
local
->
output_area
=
calloc
(
1
,
local
->
output_area_size
);
errh_Info
(
"Init of Profibus FDL Data transfer '%s'"
,
cp
->
Name
);
op
->
Status
=
PB__NORMAL
;
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Read method for the Pb FDL Data transfer module
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardRead
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sFDLCardLocal
*
local
=
(
io_sFDLCardLocal
*
)
cp
->
Local
;
io_bus_card_read
(
ctx
,
rp
,
cp
,
local
->
input_area
,
0
,
local
->
byte_ordering
,
local
->
float_representation
);
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Write method for the Pb FDL Data transfer module
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardWrite
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sAgentLocal
*
local_agent
=
(
io_sAgentLocal
*
)
ap
->
Local
;
pwr_sClass_Pb_FDL_DataTransfer
*
op
=
(
pwr_sClass_Pb_FDL_DataTransfer
*
)
cp
->
op
;
pwr_sClass_Pb_FDL_SAP
*
sap
=
(
pwr_sClass_Pb_FDL_SAP
*
)
rp
->
op
;
io_sFDLCardLocal
*
local
=
(
io_sFDLCardLocal
*
)
cp
->
Local
;
op
->
Status
=
sap
->
Status
;
if
(
op
->
Status
==
PB__NORMAL
)
{
io_bus_card_write
(
ctx
,
cp
,
local
->
output_area
,
local
->
byte_ordering
,
local
->
float_representation
);
if
(
op
->
SendReq
)
{
pthread_mutex_lock
(
&
local_agent
->
mutex
);
if
(
sap
->
Responder
)
{
fdlif_reply_update_mult_req
(
local_agent
,
sap
,
op
,
local
);
}
else
{
fdlif_sda_sdn_sdr_req
(
local_agent
,
sap
,
op
,
local
);
}
op
->
SendReq
=
0
;
pthread_mutex_unlock
(
&
local_agent
->
mutex
);
}
}
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Close method for the Pb module
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardClose
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
local
=
cp
->
Local
;
free
((
char
*
)
local
);
printf
(
"Method Pb_Module-IoCardClose
\n
"
);
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport
pwr_BindIoMethods
(
Pb_FDL_DataTransfer
)
=
{
pwr_BindIoMethod
(
IoCardInit
),
pwr_BindIoMethod
(
IoCardRead
),
pwr_BindIoMethod
(
IoCardWrite
),
pwr_BindIoMethod
(
IoCardClose
),
pwr_NullMethod
};
profibus/lib/rt/src/os_linux/rt_io_m_pb_fdl_sap.c
0 → 100644
View file @
af1e6379
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2014 SSAB EMEA AB.
*
* This file is part of Proview.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. 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
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview 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 Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* rt_io_m_pb_fdl_sap.c -- io methods for a profibus FDL SAP */
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include "pwr.h"
#include "co_cdh.h"
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "rt_gdh.h"
#include "rt_io_base.h"
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "co_cdh.h"
#include "rt_io_profiboard.h"
#include "rt_pb_msg.h"
#include "rt_io_pb_locals.h"
/*----------------------------------------------------------------------------*\
Init method for the Pb FDL SAP
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoRackInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
)
{
io_sRackLocal
*
local
;
char
name
[
196
];
pwr_tStatus
sts
;
sts
=
gdh_ObjidToName
(
rp
->
Objid
,
(
char
*
)
&
name
,
sizeof
(
name
),
cdh_mNName
);
errh_Info
(
"Init of Profibus FDL SAP %s"
,
name
);
local
=
calloc
(
1
,
sizeof
(
*
local
));
rp
->
Local
=
local
;
local
->
fdl
=
1
;
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoRackClose
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
)
{
return
IO__SUCCESS
;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport
pwr_BindIoMethods
(
Pb_FDL_SAP
)
=
{
pwr_BindIoMethod
(
IoRackInit
),
pwr_BindIoMethod
(
IoRackClose
),
pwr_NullMethod
};
profibus/lib/rt/src/os_linux/rt_io_m_pb_hilscher.c
View file @
af1e6379
...
...
@@ -74,8 +74,6 @@ The code refers to some documents provided by Hilscher, the documents are:
#include "rcs_user.h"
#include "dpm_user.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "co_cdh.h"
#include "pwr_baseclasses.h"
...
...
@@ -87,6 +85,8 @@ The code refers to some documents provided by Hilscher, the documents are:
#include "rt_io_agent_init.h"
#include "rt_pb_msg.h"
#include "rt_io_pb_locals.h"
typedef
struct
{
/* Board number. */
unsigned
short
dev_number
;
...
...
@@ -101,7 +101,7 @@ typedef struct {
/* Watchdog counter, used by DevTriggerWatchDog() as explained on page
58 of CIFLinux_en.pdf. */
unsigned
short
watchdog
;
}
io_sAgentLocal
;
}
io_sAgentLocal
Hilscher
;
/* Prototypes for functions exported to Proview. */
static
pwr_tStatus
IoAgentInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
);
...
...
@@ -141,7 +141,7 @@ boards known_boards[] = {
/* Initializes Profibus DP interface on the CIF board referred to by local.
DRV_NO_ERROR is returned upon success. */
static
short
dpm_init_master
(
io_sAgentLocal
*
local
,
pwr_sClass_Pb_Hilscher
*
op
,
dpm_init_master
(
io_sAgentLocal
Hilscher
*
local
,
pwr_sClass_Pb_Hilscher
*
op
,
io_sAgent
*
ap
)
{
short
rv
;
...
...
@@ -193,7 +193,7 @@ dpm_init_master(io_sAgentLocal *local, pwr_sClass_Pb_Hilscher *op,
/* Opens and initializes the board referred to by local. Upon success
* DRV_NO_ERROR will be returned. */
static
short
dpm_init
(
io_sAgentLocal
*
local
,
io_sAgent
*
ap
)
dpm_init
(
io_sAgentLocal
Hilscher
*
local
,
io_sAgent
*
ap
)
{
short
rv
;
...
...
@@ -215,7 +215,7 @@ dpm_init(io_sAgentLocal *local, io_sAgent *ap)
/* Closes the board referred to by local. Upon success DRV_NO_ERROR will
be returned. */
static
short
dpm_exit
(
io_sAgentLocal
*
local
,
io_sAgent
*
ap
)
dpm_exit
(
io_sAgentLocal
Hilscher
*
local
,
io_sAgent
*
ap
)
{
short
rv
;
short
rv_ret
=
DRV_NO_ERROR
;
...
...
@@ -414,9 +414,9 @@ dpm_set_add_tab(pwr_sClass_Pb_DP_Slave *op, io_sAgent *ap, io_sRack *rp,
slaves/modules have occupied so far. */
unsigned
short
*
input_size
;
unsigned
short
*
output_size
;
input_size
=
(
unsigned
short
*
)
&
((
io_sAgentLocal
*
)
ap
->
Local
)
->
input_size
;
input_size
=
(
unsigned
short
*
)
&
((
io_sAgentLocal
Hilscher
*
)
ap
->
Local
)
->
input_size
;
output_size
=
(
unsigned
short
*
)
&
((
io_sAgentLocal
*
)
ap
->
Local
)
->
output_size
;
(
unsigned
short
*
)
&
((
io_sAgentLocal
Hilscher
*
)
ap
->
Local
)
->
output_size
;
/* This lets Proview find the IO-area for this module (in this case it is
actually handled at the agent level, thus in this file). The offsets
...
...
@@ -606,7 +606,7 @@ or 127 to set master bus parameters. The bus parameters are read from
the buffer prmdata and shall be of length prmlen. DRV_NO_ERROR is returned
if successful. */
static
short
dpm_ddlm_download
(
io_sAgentLocal
*
local
,
unsigned
char
address
,
dpm_ddlm_download
(
io_sAgentLocal
Hilscher
*
local
,
unsigned
char
address
,
unsigned
int
prmlen
,
void
*
prmdata
,
io_sAgent
*
ap
)
{
short
rv
;
...
...
@@ -673,7 +673,7 @@ dpm_ddlm_download(io_sAgentLocal *local, unsigned char address,
/* Configures the master bus parameters of the board referred to by
local, the struct containing the parameters should be passed in op. */
static
short
dpm_download_master_prm
(
io_sAgentLocal
*
local
,
pwr_sClass_Pb_Hilscher
*
op
,
dpm_download_master_prm
(
io_sAgentLocal
Hilscher
*
local
,
pwr_sClass_Pb_Hilscher
*
op
,
io_sAgent
*
ap
)
{
DPM_BUS_DP
prm
;
...
...
@@ -719,7 +719,7 @@ is passed in local. op holds the slave to configure, the corresponding
agent pointer and rack pointer must be passed in ap and rp respectively.
DRV_NO_ERROR will be returned upon success. */
static
short
dpm_download_slave_prm
(
io_sAgentLocal
*
local
,
pwr_sClass_Pb_DP_Slave
*
op
,
dpm_download_slave_prm
(
io_sAgentLocal
Hilscher
*
local
,
pwr_sClass_Pb_DP_Slave
*
op
,
io_sAgent
*
ap
,
io_sRack
*
rp
)
{
unsigned
char
buf
[
DPM_MAX_LEN_DATA_UNIT
];
...
...
@@ -815,7 +815,7 @@ board referred to by local. The function will return DRV_NO_ERROR if
the request was sent without error, however, it tells us nothing
about whether any diagnostics data was sent back. */
static
short
dpm_req_slave_diag
(
io_sAgentLocal
*
local
,
unsigned
char
address
,
io_sAgent
*
ap
)
dpm_req_slave_diag
(
io_sAgentLocal
Hilscher
*
local
,
unsigned
char
address
,
io_sAgent
*
ap
)
{
short
rv
;
RCS_MESSAGETELEGRAM_10
msg
;
...
...
@@ -858,7 +858,7 @@ to gather diagnostics data asynchronously. The desired agent's local
struct is passed via local and the associated rack list (Profibus slaves) is
passed in slave_list. */
static
void
dpm_update_slave_diag
(
io_sAgentLocal
*
local
,
io_sRack
*
slave_list
,
dpm_update_slave_diag
(
io_sAgentLocal
Hilscher
*
local
,
io_sRack
*
slave_list
,
io_sAgent
*
ap
)
{
short
rv
;
...
...
@@ -1000,7 +1000,7 @@ dpm_print_diag(io_sAgent *ap, DPM_DIAGNOSTICS *diag)
If the board was found in the database, the function returns DRV_NO_ERROR
and the startsegment will be written to what db_startsegment points to. */
static
short
dpm_check_board_type
(
io_sAgentLocal
*
local
,
io_sAgent
*
ap
,
dpm_check_board_type
(
io_sAgentLocal
Hilscher
*
local
,
io_sAgent
*
ap
,
unsigned
char
*
db_startsegment
)
{
short
rv
;
...
...
@@ -1064,7 +1064,7 @@ dpm_check_board_type(io_sAgentLocal *local, io_sAgent *ap,
/* Deletes the "PROFIBUS" protocol settings database from the card referred
to by local, this procedure is described on page 32 -- 33 in dpm_pie.pdf. */
static
short
dpm_delete_flash_prmdb
(
io_sAgentLocal
*
local
,
io_sAgent
*
ap
)
dpm_delete_flash_prmdb
(
io_sAgentLocal
Hilscher
*
local
,
io_sAgent
*
ap
)
{
unsigned
char
db_startsegment
;
int
s
=
3
;
...
...
@@ -1151,7 +1151,7 @@ dpm_delete_flash_prmdb(io_sAgentLocal *local, io_sAgent *ap)
/* Wrapper for dpm_init_master(), takes care of checking for (and optionally
removing) the sycon database if present. */
static
short
dpm_init_master_check_sycon_db
(
io_sAgentLocal
*
local
,
dpm_init_master_check_sycon_db
(
io_sAgentLocal
Hilscher
*
local
,
pwr_sClass_Pb_Hilscher
*
op
,
io_sAgent
*
ap
)
{
short
rv
;
...
...
@@ -1201,7 +1201,7 @@ IoAgentInit(io_tCtx ctx, io_sAgent *ap)
{
pwr_sClass_Pb_Hilscher
*
op
;
pwr_tStatus
status
;
io_sAgentLocal
*
local
;
io_sAgentLocal
Hilscher
*
local
;
char
ok
;
pwr_tObjid
slave_objid
;
...
...
@@ -1215,7 +1215,7 @@ IoAgentInit(io_tCtx ctx, io_sAgent *ap)
int
retry
;
/* Allocates area for local data structure */
ap
->
Local
=
calloc
(
1
,
sizeof
(
io_sAgentLocal
));
ap
->
Local
=
calloc
(
1
,
sizeof
(
io_sAgentLocal
Hilscher
));
if
(
!
ap
->
Local
)
{
errh_Error
(
"ERROR config Profibus DP Master %s - %s"
,
ap
->
Name
,
"calloc"
);
...
...
@@ -1223,7 +1223,7 @@ IoAgentInit(io_tCtx ctx, io_sAgent *ap)
}
/* Handles for easy access to local variables. */
local
=
(
io_sAgentLocal
*
)
ap
->
Local
;
local
=
(
io_sAgentLocal
Hilscher
*
)
ap
->
Local
;
op
=
(
pwr_sClass_Pb_Hilscher
*
)
ap
->
op
;
op
->
Status
=
PB__NOTINIT
;
...
...
@@ -1342,7 +1342,7 @@ IoAgentRead(io_tCtx ctx, io_sAgent *ap)
{
pwr_sClass_Pb_Hilscher
*
mp
;
pwr_sClass_Pb_DP_Slave
*
sp
;
io_sAgentLocal
*
local
;
io_sAgentLocal
Hilscher
*
local
;
io_sRack
*
slave_list
;
pwr_sClass_Pb_Hilscher
*
op
;
...
...
@@ -1352,7 +1352,7 @@ IoAgentRead(io_tCtx ctx, io_sAgent *ap)
DPM_DIAGNOSTICS
diag
;
/* Handle for local data structure. */
local
=
(
io_sAgentLocal
*
)
ap
->
Local
;
local
=
(
io_sAgentLocal
Hilscher
*
)
ap
->
Local
;
/*** Data exchange code goes here: ***/
...
...
@@ -1382,7 +1382,7 @@ IoAgentRead(io_tCtx ctx, io_sAgent *ap)
/*** Diagnostics collecting code goes here: ***/
local
=
(
io_sAgentLocal
*
)
ap
->
Local
;
local
=
(
io_sAgentLocal
Hilscher
*
)
ap
->
Local
;
op
=
(
pwr_sClass_Pb_Hilscher
*
)
ap
->
op
;
/* If everything is fine we should be in state OPERATE.
...
...
@@ -1474,11 +1474,11 @@ IoAgentWrite(io_tCtx ctx, io_sAgent *ap)
{
pwr_sClass_Pb_Hilscher
*
mp
;
pwr_sClass_Pb_DP_Slave
*
sp
;
io_sAgentLocal
*
local
;
io_sAgentLocal
Hilscher
*
local
;
io_sRack
*
slave_list
;
/* Handle for local data structure. */
local
=
(
io_sAgentLocal
*
)
ap
->
Local
;
local
=
(
io_sAgentLocal
Hilscher
*
)
ap
->
Local
;
/* Iterates over the slaves on the bus and writes process data to their
respective addresses. This is really the rack level's responsibility,
...
...
@@ -1519,9 +1519,9 @@ IoAgentWrite(io_tCtx ctx, io_sAgent *ap)
static
pwr_tStatus
IoAgentClose
(
io_tCtx
ctx
,
io_sAgent
*
ap
)
{
io_sAgentLocal
*
local
;
io_sAgentLocal
Hilscher
*
local
;
local
=
(
io_sAgentLocal
*
)
ap
->
Local
;
local
=
(
io_sAgentLocal
Hilscher
*
)
ap
->
Local
;
dpm_exit
(
local
,
ap
);
free
(
local
);
...
...
profibus/lib/rt/src/os_linux/rt_io_m_pb_ii.c
View file @
af1e6379
...
...
@@ -42,8 +42,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
...
...
@@ -52,6 +50,8 @@
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_pb_locals.h"
/*----------------------------------------------------------------------------*\
Init method for the Pb module Ii
...
...
profibus/lib/rt/src/os_linux/rt_io_m_pb_io.c
View file @
af1e6379
...
...
@@ -40,8 +40,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
...
...
@@ -50,6 +48,8 @@
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_pb_locals.h"
/*----------------------------------------------------------------------------*\
Init method for the Pb module Io
...
...
profibus/lib/rt/src/os_linux/rt_io_m_pb_module.c
View file @
af1e6379
...
...
@@ -42,8 +42,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "rt_io_pb_locals.h"
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
...
...
@@ -53,6 +51,8 @@
#include "rt_errh.h"
#include "rt_pb_msg.h"
#include "rt_io_pb_locals.h"
/*----------------------------------------------------------------------------*\
Init method for the Pb module
\*----------------------------------------------------------------------------*/
...
...
profibus/lib/rt/src/os_linux/rt_io_m_pb_profiboard.c
View file @
af1e6379
This diff is collapsed.
Click to expand it.
profibus/lib/rt/src/os_linux/rt_io_pb_locals.h
View file @
af1e6379
...
...
@@ -72,12 +72,48 @@
/* io_sAgentLocal now lives in the respective agent modules. */
typedef
struct
{
int
initialized
;
typedef
struct
_io_sRackLocal
{
unsigned
char
fdl
;
unsigned
char
dp
;
}
io_sRackLocal
;
typedef
struct
{
void
*
input_area
;
void
*
output_area
;
int
scancount
[
IO_MAXCHAN
];
}
io_sCardLocal
;
typedef
struct
{
unsigned
short
invoke_id
;
unsigned
short
input_area_size
;
unsigned
short
output_area_size
;
unsigned
char
*
input_area
;
unsigned
char
*
output_area
;
unsigned
short
byte_ordering
;
unsigned
short
float_representation
;
}
io_sFDLCardLocal
;
typedef
struct
_agent_args
{
void
*
local
;
io_sAgent
*
ap
;
}
agent_args
;
typedef
struct
{
int
hServiceReadDevice
;
// Handle for Service device
int
hServiceWriteDevice
;
// Handle for Service device
int
hDpDataDevice
;
// Handle for DP-Data device
int
hDpsInputDataDevice
;
// Handle for DP-Slave Input-Data device
int
hDpsOutputDataDevice
;
// Handle for DP-Slave Output-Data device
unsigned
char
CurrentBoardNumber
;
int
slave_diag_requested
;
// Slave diag requested
int
parallel_service
;
// parallel activity
int
hDpsBoardDevice
;
// Handle for DP-Slave Output-Data device
pthread_t
events
;
pthread_mutex_t
mutex
;
agent_args
args
;
unsigned
char
fdl
;
unsigned
char
dp
;
unsigned
char
invoke_id
;
}
io_sAgentLocal
;
profibus/lib/rt/src/rt_io_profibus.meth
View file @
af1e6379
...
...
@@ -9,6 +9,8 @@ Pb_Ai
Pb_Ao
Pb_Ii
Pb_Io
Pb_FDL_SAP
Pb_FDL_DataTransfer
PnControllerSoftingPNAK
PnDevice
PnModule
...
...
profibus/wbl/mcomp/src/profibus.wb_load
View file @
af1e6379
This diff is collapsed.
Click to expand it.
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