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
9bace7cb
Commit
9bace7cb
authored
Feb 22, 2014
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IO PiFace Digital for Raspberry Pi added
parent
b507ffc0
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
397 additions
and
70 deletions
+397
-70
otherio/lib/piface_dummy/src/os_templ/hw_templ/makefile
otherio/lib/piface_dummy/src/os_templ/hw_templ/makefile
+15
-0
otherio/lib/piface_dummy/src/piface_dummy.c
otherio/lib/piface_dummy/src/piface_dummy.c
+18
-0
otherio/lib/rt/src/os_linux/rt_io_m_piface_digital.c
otherio/lib/rt/src/os_linux/rt_io_m_piface_digital.c
+166
-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
+189
-68
src/tools/pwre/src/os_linux/pwre_configure.sh
src/tools/pwre/src/os_linux/pwre_configure.sh
+7
-1
wb/exp/com/src/os_linux/hw_arm/wb_gcg.sh
wb/exp/com/src/os_linux/hw_arm/wb_gcg.sh
+1
-1
No files found.
otherio/lib/piface_dummy/src/os_templ/hw_templ/makefile
0 → 100644
View file @
9bace7cb
include
$(pwre_dir_symbols)
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq
($($(type_name)_generic_mk),)
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq
($($(type_name)_generic_mk),)
include
$(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include
../../special.mk
-include
../special.mk
-include
special.mk
otherio/lib/piface_dummy/src/piface_dummy.c
0 → 100644
View file @
9bace7cb
/*
Dummy for piface
*/
#include <stdint.h>
int
pfio_init
(
void
)
{
return
1
;}
int
pfio_deinit
(
void
)
{
return
1
;}
uint8_t
pfio_digital_read
(
uint8_t
pin_number
)
{
return
0
;}
void
pfio_digital_write
(
uint8_t
pin_number
,
uint8_t
value
)
{}
uint8_t
pfio_read_input
(
void
)
{
return
0
;}
uint8_t
pfio_read_output
(
void
)
{
return
0
;}
void
pfio_write_output
(
uint8_t
value
)
{}
uint8_t
pfio_get_pin_bit_mask
(
uint8_t
pin_number
)
{
return
0
;}
uint8_t
pfio_get_pin_number
(
uint8_t
bit_mask
)
{
return
0
;}
otherio/lib/rt/src/os_linux/rt_io_m_piface_digital.c
0 → 100644
View file @
9bace7cb
/*
* 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_piface_digital.c -- I/O methods for class PiFace_Digital. */
#include "pwr.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_otherioclasses.h"
#include "co_time.h"
#include "rt_io_base.h"
#include "rt_io_card_init.h"
#include "rt_io_card_close.h"
#include "rt_io_card_read.h"
#include "rt_io_card_write.h"
#include "rt_io_msg.h"
#if defined PWRE_CONF_LIBPIFACE && PWRE_CONF_PIFACE
#include <libpiface-1.0/pfio.h>
typedef
struct
{
pwr_tStatus
sts
;
}
io_sLocal_PiFace
;
static
pwr_tStatus
IoCardInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sLocal_PiFace
*
local
;
pwr_sClass_PiFace_Digital
*
op
=
(
pwr_sClass_PiFace_Digital
*
)
cp
->
op
;
local
=
(
io_sLocal_PiFace
*
)
calloc
(
1
,
sizeof
(
io_sLocal_PiFace
));
cp
->
Local
=
local
;
local
->
sts
=
pfio_init
();
if
(
local
->
sts
!=
0
)
{
op
->
Status
=
IO__INITFAIL
;
return
op
->
Status
;
}
errh_Info
(
"Init of PiFace Digital '%s'"
,
cp
->
Name
);
op
->
Status
=
IO__SUCCESS
;
return
IO__SUCCESS
;
}
static
pwr_tStatus
IoCardClose
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sLocal_PiFace
*
local
=
(
io_sLocal_PiFace
*
)
cp
->
Local
;
if
(
local
->
sts
==
0
)
pfio_deinit
();
if
(
cp
->
Local
)
free
(
cp
->
Local
);
return
IO__SUCCESS
;
}
static
pwr_tStatus
IoCardRead
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sLocal_PiFace
*
local
=
(
io_sLocal_PiFace
*
)
cp
->
Local
;
uint8_t
value
;
uint8_t
m
;
int
i
;
if
(
local
->
sts
!=
0
)
return
0
;
// Handle Di
value
=
pfio_read_input
();
m
=
1
;
for
(
i
=
0
;
i
<
8
;
i
++
)
{
if
(
cp
->
chanlist
[
i
].
sop
)
*
(
pwr_tBoolean
*
)
cp
->
chanlist
[
i
].
vbp
=
((
value
&
m
)
!=
0
);
m
=
m
<<
1
;
}
return
IO__SUCCESS
;
}
static
pwr_tStatus
IoCardWrite
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sLocal_PiFace
*
local
=
(
io_sLocal_PiFace
*
)
cp
->
Local
;
uint8_t
value
;
uint8_t
m
;
int
i
;
if
(
local
->
sts
!=
0
)
return
0
;
// Handle Do
m
=
1
;
for
(
i
=
0
;
i
<
8
;
i
++
)
{
if
(
cp
->
chanlist
[
i
+
8
].
sop
)
{
if
(
*
(
pwr_tBoolean
*
)
cp
->
chanlist
[
i
+
8
].
vbp
)
value
|=
m
;
}
m
=
m
<<
1
;
}
pfio_write_output
(
value
);
return
IO__SUCCESS
;
}
#else
static
pwr_tStatus
IoCardInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
return
IO__RELEASEBUILD
;}
static
pwr_tStatus
IoCardClose
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
return
IO__RELEASEBUILD
;}
static
pwr_tStatus
IoCardRead
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
return
IO__RELEASEBUILD
;}
static
pwr_tStatus
IoCardWrite
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
return
IO__RELEASEBUILD
;}
#endif
/* Every method should be registred here. */
pwr_dExport
pwr_BindIoMethods
(
PiFace_Digital
)
=
{
pwr_BindIoMethod
(
IoCardInit
),
pwr_BindIoMethod
(
IoCardClose
),
pwr_BindIoMethod
(
IoCardRead
),
pwr_BindIoMethod
(
IoCardWrite
),
pwr_NullMethod
};
otherio/lib/rt/src/rt_io_otherio.meth
View file @
9bace7cb
...
...
@@ -32,4 +32,5 @@ Epl_MN
Epl_Module
Epl_CNServer
Epl_CNServerModule
PiFace_Digital
#endif
\ No newline at end of file
otherio/wbl/mcomp/src/otherio.wb_load
View file @
9bace7cb
Volume OtherIO $ClassVolume 0.0.250.10
Body SysBody 01-JAN-1970 01:00:00.00
Attr NextOix = "_X6
09
"
Attr NextCix = "_X4
5
"
Attr NextOix = "_X6
20
"
Attr NextCix = "_X4
6
"
Attr NextTix[0] = "_X17"
EndBody
Object Type $TypeHier 1 15-NOV-2007 14:35:37.90
...
...
@@ -9874,5 +9874,126 @@ Volume OtherIO $ClassVolume 0.0.250.10
EndBody
EndObject
EndObject
Object PiFace_Digital $ClassDef 45 22-FEB-2014 13:36:57.56
Body SysBody 22-FEB-2014 12:13:41.82
Attr Editor = 0
Attr Method = 0
Attr Flags = 18512
EndBody
Object RtBody $ObjBodyDef 1 22-FEB-2014 12:13:13.58
Body SysBody 22-FEB-2014 13:37:10.90
Attr StructName = "PiFace_Digital"
Attr NextAix = "_X22"
EndBody
Object Description $Attribute 15 22-FEB-2014 12:13:13.58
Body SysBody 22-FEB-2014 12:13:13.58
Attr PgmName = "Description"
Attr Size = 80
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
Object Process $Attribute 16 22-FEB-2014 12:13:13.58
Body SysBody 22-FEB-2014 12:13:13.58
Attr PgmName = "Process"
Attr Size = 4
Attr TypeRef = "pwrb:Type-IoProcessMask"
EndBody
EndObject
Object ThreadObject $Attribute 17 22-FEB-2014 12:13:13.58
Body SysBody 22-FEB-2014 12:13:13.58
Attr PgmName = "ThreadObject"
Attr Size = 8
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
Object Status $Attribute 18 22-FEB-2014 12:13:13.58
Body SysBody 22-FEB-2014 12:13:13.58
Attr PgmName = "Status"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Status"
EndBody
EndObject
Object ScanInterval $Attribute 19 22-FEB-2014 12:13:13.58
Body SysBody 22-FEB-2014 12:13:13.58
Attr PgmName = "ScanInterval"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ChDi $Attribute 20 22-FEB-2014 12:17:16.33
Body SysBody 22-FEB-2014 12:17:47.35
Attr PgmName = "ChDi"
Attr Size = 1280
Attr Flags = 131074
Attr Elements = 8
Attr TypeRef = "pwrb:Class-ChanDi"
EndBody
EndObject
Object ChDo $Attribute 21 22-FEB-2014 12:18:02.37
Body SysBody 22-FEB-2014 12:18:10.93
Attr PgmName = "ChDo"
Attr Size = 1344
Attr Flags = 131074
Attr Elements = 8
Attr TypeRef = "pwrb:Class-ChanDo"
EndBody
EndObject
EndObject
Object ConfiguratorPoson $Menu 617 22-FEB-2014 16:16:47.72
Object Pointed $Menu 618 22-FEB-2014 16:16:47.72
Object Connect $MenuButton 619 22-FEB-2014 16:16:47.72
Body SysBody 22-FEB-2014 16:16:47.72
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 620 22-FEB-2014 17:37:35.19
Body SysBody 22-FEB-2014 17:37:35.19
Attr MethodName = "BaseIOCard-PostCreate"
EndBody
EndObject
Object IoMethods $RtMethod 610 22-FEB-2014 12:13:13.58
Object IoCardInit $Method 611 22-FEB-2014 12:13:13.58
Body SysBody 22-FEB-2014 13:37:20.15
Attr MethodName = "PiFace_Digital-IoCardInit"
EndBody
EndObject
Object IoCardClose $Method 612 22-FEB-2014 12:13:13.58
Body SysBody 22-FEB-2014 13:37:27.40
Attr MethodName = "PiFace_Digital-IoCardClose"
EndBody
EndObject
Object IoCardRead $Method 613 22-FEB-2014 12:13:13.58
Body SysBody 22-FEB-2014 13:37:33.94
Attr MethodName = "PiFace_Digital-IoCardRead"
EndBody
EndObject
Object IoCardWrite $Method 614 22-FEB-2014 12:13:13.58
Body SysBody 22-FEB-2014 13:37:41.49
Attr MethodName = "PiFace_Digital-IoCardWrite"
EndBody
EndObject
EndObject
Object Template PiFace_Digital 2159509504 01-JAN-1970 00:00:00.00
Body RtBody 22-FEB-2014 12:19:11.93
Attr Process = 2
Attr ChDi[0].ConversionOn = 1
Attr ChDi[1].ConversionOn = 1
Attr ChDi[2].ConversionOn = 1
Attr ChDi[3].ConversionOn = 1
Attr ChDi[4].ConversionOn = 1
Attr ChDi[5].ConversionOn = 1
Attr ChDi[6].ConversionOn = 1
Attr ChDi[7].ConversionOn = 1
EndBody
EndObject
EndObject
EndObject
EndVolume
src/tools/pwre/src/os_linux/pwre_configure.sh
View file @
9bace7cb
...
...
@@ -167,6 +167,8 @@ pwre_config_check_lib()
conf_libpnak
=
$conf_libpnak
" -l
${
lib
%.*
}
"
elif
test
$4
==
"libusb"
;
then
conf_lib
=
$conf_lib
" -lusb-1.0"
elif
test
$4
==
"libpiface"
;
then
conf_lib
=
$conf_lib
" -lpiface-1.0"
elif
test
$4
==
"powerlink"
;
then
conf_libpowerlink
=
$conf_libpowerlink
" -L
$lib_path
-l
${
lib
%.*
}
"
elif
test
$4
==
"powerlinkcn"
;
then
...
...
@@ -458,6 +460,10 @@ else
pwre_config_check_lib powerlinkcn POWERLINKCN lib powerlinkcn 1
"
$epl
/buildcn/Examples/X86/Generic/powerlink_user_lib/libpowerlink.a"
pwre_config_check_lib libpcap LIBPCAP lib libpcap 1
"/usr/lib/libpcap.so:/usr/lib/
$hwpl
-linux-
$gnu
/libpcap.so"
pwre_config_check_lib librsvg LIBRSVG lib librsvg 1
"/usr/lib/librsvg-2.so:/usr/lib/
$hwpl
-linux-
$gnu
/librsvg-2.so"
if [
$pwre_hw
==
"hw_arm"
]; then
pwre_config_check_lib libpiface LIBPIFACE lib libpiface 1
"/usr/local/lib/libpiface-1.0.a"
pwre_config_check_include piface PIFACE 1
"/usr/local/include/libpiface-1.0/pfio.h"
fi
pwre_config_check_include mq MQ 0
"/usr/local/dmq/include/p_entry.h"
pwre_config_check_include wmq WMQ 1
"/opt/mqm/inc/cmqc.h"
...
...
wb/exp/com/src/os_linux/hw_arm/wb_gcg.sh
View file @
9bace7cb
...
...
@@ -184,7 +184,7 @@ CompileRtNode()
ld_opt_tmp
=
"
`
cat
$pwrp_exe
/
$FileName
.opt
`
"
ld_opt
=
"
`
eval echo
$ld_opt_tmp
`
"
else
ld_opt
=
"
`
eval echo
$pwrobj
/rt_io_user.o
-lpwr_rt
-lpwr_usbio_dummy
-lpwr_usb_dummy
-lpwr_pnak_dummy
-lpwr_cifx_dummy
`
"
ld_opt
=
"
`
eval echo
$pwrobj
/rt_io_user.o
-lpwr_rt
-lpwr_usbio_dummy
-lpwr_usb_dummy
-lpwr_pnak_dummy
-lpwr_cifx_dummy
-lpwr_piface_dummy
`
"
fi
if
$ldxx
$link_debug
-L
/lib/thread
-L
$pwrp_lib
-L
$pwrp_cmn
/arm_linux/lib
-L
$pwrlib
\
...
...
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