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
c1b0bc4c
Commit
c1b0bc4c
authored
Feb 27, 2012
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of pwrcvs:/data1/git/pwr
parents
2df1813b
ba39cfbd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
225 additions
and
68 deletions
+225
-68
otherio/lib/rt/src/rt_io_m_arduino_uno.c
otherio/lib/rt/src/rt_io_m_arduino_uno.c
+166
-60
otherio/wbl/mcomp/src/otherio.wb_load
otherio/wbl/mcomp/src/otherio.wb_load
+59
-8
No files found.
otherio/lib/rt/src/rt_io_m_arduino_uno.c
View file @
c1b0bc4c
...
@@ -34,7 +34,18 @@
...
@@ -34,7 +34,18 @@
* General Public License plus this exception.
* General Public License plus this exception.
*/
*/
/* rt_io_m_motioncontrol_usbio.c -- I/O methods for class MotionControl_USBIO. */
/* rt_io_m_arduino_uno.c -- I/O methods for class Arduino_Uno. */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <float.h>
#include <termios.h>
#include "pwr.h"
#include "pwr.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_basecomponentclasses.h"
...
@@ -83,21 +94,13 @@ typedef struct {
...
@@ -83,21 +94,13 @@ typedef struct {
ard_eMsgType
PendingMsgType
;
ard_eMsgType
PendingMsgType
;
int
AiIntervalCnt
;
int
AiIntervalCnt
;
int
AoIntervalCnt
;
int
AoIntervalCnt
;
int
Reconnect
;
int
ReconnectCnt
;
io_sChannel
*
DChanList
[
D_MAX_SIZE
*
8
];
io_sChannel
*
DChanList
[
D_MAX_SIZE
*
8
];
io_sChannel
*
AiChanList
[
AI_MAX_SIZE
*
8
];
io_sChannel
*
AiChanList
[
AI_MAX_SIZE
*
8
];
io_sChannel
*
AoChanList
[
AO_MAX_SIZE
*
8
];
io_sChannel
*
AoChanList
[
AO_MAX_SIZE
*
8
];
}
io_sLocal
;
}
io_sLocal
;
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <termios.h>
// static FILE *fp;
// static FILE *fp;
#if 0
#if 0
...
@@ -130,16 +133,41 @@ typedef struct {
...
@@ -130,16 +133,41 @@ typedef struct {
unsigned
char
data
[
100
]
__attribute__
((
aligned
(
1
)));
unsigned
char
data
[
100
]
__attribute__
((
aligned
(
1
)));
}
ard_sMsg
;
}
ard_sMsg
;
static
int
receive
(
int
fd
,
int
id
,
ard_sMsg
*
rmsg
,
int
size
)
static
unsigned
char
checksum
(
unsigned
char
*
buf
,
int
len
)
{
int
i
;
unsigned
char
sum
=
0
;
for
(
i
=
0
;
i
<
len
;
i
++
)
sum
^=
buf
[
i
];
return
sum
;
}
static
void
get_tv
(
struct
timeval
*
tv
,
float
t
)
{
if
(
t
<
FLT_EPSILON
)
{
tv
->
tv_sec
=
1
;
tv
->
tv_usec
=
0
;
}
else
{
tv
->
tv_sec
=
t
;
tv
->
tv_usec
=
(
t
-
(
float
)
tv
->
tv_sec
)
*
1000000
;
}
}
static
int
receive
(
int
fd
,
int
id
,
ard_sMsg
*
rmsg
,
int
size
,
float
tmo
)
{
{
fd_set
rfd
;
fd_set
rfd
;
struct
timeval
tv
=
{
1
,
0
}
;
struct
timeval
tv
;
int
sts
;
int
sts
;
int
msize
;
int
msize
;
int
ret
;
FD_ZERO
(
&
rfd
);
FD_ZERO
(
&
rfd
);
FD_SET
(
fd
,
&
rfd
);
FD_SET
(
fd
,
&
rfd
);
while
(
1
)
{
while
(
1
)
{
get_tv
(
&
tv
,
tmo
);
sts
=
select
(
fd
+
1
,
&
rfd
,
NULL
,
NULL
,
&
tv
);
sts
=
select
(
fd
+
1
,
&
rfd
,
NULL
,
NULL
,
&
tv
);
if
(
sts
==
0
)
return
ARD__NOMSG
;
if
(
sts
==
0
)
return
ARD__NOMSG
;
...
@@ -147,12 +175,17 @@ static int receive( int fd, int id, ard_sMsg *rmsg, int size)
...
@@ -147,12 +175,17 @@ static int receive( int fd, int id, ard_sMsg *rmsg, int size)
msize
+=
read
(
fd
,
rmsg
,
1
);
msize
+=
read
(
fd
,
rmsg
,
1
);
// logg( "Receive read");
// logg( "Receive read");
if
(
msize
==
0
)
return
ARD__NOMSG
;
while
(
msize
<
rmsg
->
size
)
{
while
(
msize
<
rmsg
->
size
)
{
get_tv
(
&
tv
,
tmo
);
sts
=
select
(
fd
+
1
,
&
rfd
,
NULL
,
NULL
,
&
tv
);
sts
=
select
(
fd
+
1
,
&
rfd
,
NULL
,
NULL
,
&
tv
);
if
(
sts
==
0
)
return
ARD__NOMSG
;
if
(
sts
==
0
)
return
ARD__NOMSG
;
msize
+=
read
(
fd
,
(
char
*
)
rmsg
+
msize
,
rmsg
->
size
-
msize
);
ret
=
read
(
fd
,
(
char
*
)
rmsg
+
msize
,
rmsg
->
size
-
msize
);
if
(
ret
==
0
)
return
ARD__NOMSG
;
msize
+=
ret
;
// logg( "Receive read ++");
// logg( "Receive read ++");
...
@@ -373,6 +406,12 @@ static pwr_tStatus IoCardInit( io_tCtx ctx,
...
@@ -373,6 +406,12 @@ static pwr_tStatus IoCardInit( io_tCtx ctx,
break
;
break
;
}
}
tty_attributes
.
c_iflag
&=
~
(
BRKINT
|
ICRNL
|
IMAXBEL
);
tty_attributes
.
c_oflag
&=
~
(
OPOST
|
ONLCR
);
tty_attributes
.
c_lflag
&=
~
(
ISIG
|
ICANON
|
IEXTEN
|
ECHO
|
ECHOE
|
ECHOK
|
ECHOCTL
|
ECHOKE
);
tty_attributes
.
c_cc
[
VMIN
]
=
1
;
tty_attributes
.
c_cc
[
VTIME
]
=
0
;
tty_attributes
.
c_cc
[
VEOF
]
=
1
;
sts
=
tcsetattr
(
local
->
fd
,
TCSANOW
,
&
tty_attributes
);
sts
=
tcsetattr
(
local
->
fd
,
TCSANOW
,
&
tty_attributes
);
if
(
sts
<
0
)
{
if
(
sts
<
0
)
{
errh_Error
(
"IO Init Card '%s', unable to set baud rate on device %s"
,
cp
->
Name
,
op
->
Device
);
errh_Error
(
"IO Init Card '%s', unable to set baud rate on device %s"
,
cp
->
Name
,
op
->
Device
);
...
@@ -419,7 +458,7 @@ static pwr_tStatus IoCardInit( io_tCtx ctx,
...
@@ -419,7 +458,7 @@ static pwr_tStatus IoCardInit( io_tCtx ctx,
sts
=
write
(
local
->
fd
,
&
msg
,
msg
.
size
);
sts
=
write
(
local
->
fd
,
&
msg
,
msg
.
size
);
sts
=
receive
(
local
->
fd
,
msg
.
id
,
&
rmsg
,
1
);
sts
=
receive
(
local
->
fd
,
msg
.
id
,
&
rmsg
,
1
,
op
->
Timeout
);
if
(
sts
&
1
)
{
if
(
sts
&
1
)
{
op
->
Status
=
rmsg
.
data
[
0
];
op
->
Status
=
rmsg
.
data
[
0
];
}
}
...
@@ -466,6 +505,10 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
...
@@ -466,6 +505,10 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
int
skip_ai
;
int
skip_ai
;
ard_eMsgType
mtype
;
ard_eMsgType
mtype
;
ard_sMsg
msg
;
ard_sMsg
msg
;
io_sChannel
*
chanp
;
if
(
local
->
Reconnect
)
return
IO__SUCCESS
;
if
(
local
->
AiSize
)
{
if
(
local
->
AiSize
)
{
skip_ai
=
0
;
skip_ai
=
0
;
...
@@ -508,7 +551,8 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
...
@@ -508,7 +551,8 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
pwr_tFloat32
actvalue
;
pwr_tFloat32
actvalue
;
sts
=
receive
(
local
->
fd
,
local
->
DiPollId
,
&
rmsg
,
local
->
DiSize
+
local
->
AiNum
*
2
);
sts
=
receive
(
local
->
fd
,
local
->
DiPollId
,
&
rmsg
,
local
->
DiSize
+
local
->
AiNum
*
2
,
op
->
Timeout
);
op
->
Status
=
sts
;
op
->
Status
=
sts
;
if
(
EVEN
(
sts
))
{
if
(
EVEN
(
sts
))
{
op
->
ErrorCount
++
;
op
->
ErrorCount
++
;
...
@@ -519,8 +563,13 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
...
@@ -519,8 +563,13 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
for
(
i
=
0
;
i
<
local
->
DiSize
;
i
++
)
{
for
(
i
=
0
;
i
<
local
->
DiSize
;
i
++
)
{
for
(
j
=
0
;
j
<
8
;
j
++
)
{
for
(
j
=
0
;
j
<
8
;
j
++
)
{
m
=
1
<<
j
;
m
=
1
<<
j
;
if
(
local
->
DiMask
[
i
]
&
m
)
if
(
local
->
DiMask
[
i
]
&
m
)
{
*
(
pwr_tBoolean
*
)
local
->
DChanList
[
i
*
8
+
j
]
->
vbp
=
((
rmsg
.
data
[
i
]
&
m
)
!=
0
);
chanp
=
local
->
DChanList
[
i
*
8
+
j
];
pwr_sClass_ChanDi
*
cop
=
(
pwr_sClass_ChanDi
*
)
chanp
->
cop
;
if
(
cop
->
ConversionOn
)
*
(
pwr_tBoolean
*
)
chanp
->
vbp
=
((
rmsg
.
data
[
i
]
&
m
)
!=
0
);
}
}
}
}
}
}
}
...
@@ -534,6 +583,7 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
...
@@ -534,6 +583,7 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
pwr_sClass_ChanAi
*
cop
=
(
pwr_sClass_ChanAi
*
)
chanp
->
cop
;
pwr_sClass_ChanAi
*
cop
=
(
pwr_sClass_ChanAi
*
)
chanp
->
cop
;
pwr_sClass_Ai
*
sop
=
(
pwr_sClass_Ai
*
)
chanp
->
sop
;
pwr_sClass_Ai
*
sop
=
(
pwr_sClass_Ai
*
)
chanp
->
sop
;
if
(
cop
->
ConversionOn
)
{
if
(
cop
->
CalculateNewCoef
)
if
(
cop
->
CalculateNewCoef
)
// Request to calculate new coefficients
// Request to calculate new coefficients
io_AiRangeToCoef
(
chanp
);
io_AiRangeToCoef
(
chanp
);
...
@@ -553,6 +603,7 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
...
@@ -553,6 +603,7 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
*
(
pwr_tFloat32
*
)
chanp
->
vbp
=
actvalue
;
*
(
pwr_tFloat32
*
)
chanp
->
vbp
=
actvalue
;
sop
->
SigValue
=
cop
->
SigValPolyCoef1
*
ivalue
+
cop
->
SigValPolyCoef0
;
sop
->
SigValue
=
cop
->
SigValPolyCoef1
*
ivalue
+
cop
->
SigValPolyCoef0
;
sop
->
RawValue
=
ivalue
;
sop
->
RawValue
=
ivalue
;
}
ai_cnt
++
;
ai_cnt
++
;
}
}
}
}
...
@@ -566,7 +617,7 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
...
@@ -566,7 +617,7 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
int
i
,
j
;
int
i
,
j
;
unsigned
char
m
;
unsigned
char
m
;
sts
=
receive
(
local
->
fd
,
local
->
DiPollId
,
&
rmsg
,
local
->
DiSize
);
sts
=
receive
(
local
->
fd
,
local
->
DiPollId
,
&
rmsg
,
local
->
DiSize
,
op
->
Timeout
);
op
->
Status
=
sts
;
op
->
Status
=
sts
;
if
(
EVEN
(
sts
))
{
if
(
EVEN
(
sts
))
{
op
->
ErrorCount
++
;
op
->
ErrorCount
++
;
...
@@ -577,8 +628,13 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
...
@@ -577,8 +628,13 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
for
(
i
=
0
;
i
<
local
->
DiSize
;
i
++
)
{
for
(
i
=
0
;
i
<
local
->
DiSize
;
i
++
)
{
for
(
j
=
0
;
j
<
8
;
j
++
)
{
for
(
j
=
0
;
j
<
8
;
j
++
)
{
m
=
1
<<
j
;
m
=
1
<<
j
;
if
(
local
->
DiMask
[
i
]
&
m
)
if
(
local
->
DiMask
[
i
]
&
m
)
{
*
(
pwr_tBoolean
*
)
local
->
DChanList
[
i
*
8
+
j
]
->
vbp
=
((
rmsg
.
data
[
i
]
&
m
)
!=
0
);
chanp
=
local
->
DChanList
[
i
*
8
+
j
];
pwr_sClass_ChanDi
*
cop
=
(
pwr_sClass_ChanDi
*
)
chanp
->
cop
;
if
(
cop
->
ConversionOn
)
*
(
pwr_tBoolean
*
)
chanp
->
vbp
=
((
rmsg
.
data
[
i
]
&
m
)
!=
0
);
}
}
}
}
}
}
}
...
@@ -591,7 +647,7 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
...
@@ -591,7 +647,7 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
pwr_tInt32
ivalue
;
pwr_tInt32
ivalue
;
pwr_tFloat32
actvalue
;
pwr_tFloat32
actvalue
;
sts
=
receive
(
local
->
fd
,
local
->
DiPollId
,
&
rmsg
,
local
->
AiNum
*
2
);
sts
=
receive
(
local
->
fd
,
local
->
DiPollId
,
&
rmsg
,
local
->
AiNum
*
2
,
op
->
Timeout
);
if
(
EVEN
(
sts
))
{
if
(
EVEN
(
sts
))
{
}
}
else
{
else
{
...
@@ -604,6 +660,7 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
...
@@ -604,6 +660,7 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
pwr_sClass_ChanAi
*
cop
=
(
pwr_sClass_ChanAi
*
)
chanp
->
cop
;
pwr_sClass_ChanAi
*
cop
=
(
pwr_sClass_ChanAi
*
)
chanp
->
cop
;
pwr_sClass_Ai
*
sop
=
(
pwr_sClass_Ai
*
)
chanp
->
sop
;
pwr_sClass_Ai
*
sop
=
(
pwr_sClass_Ai
*
)
chanp
->
sop
;
if
(
cop
->
ConversionOn
)
{
if
(
cop
->
CalculateNewCoef
)
if
(
cop
->
CalculateNewCoef
)
// Request to calculate new coefficients
// Request to calculate new coefficients
io_AiRangeToCoef
(
chanp
);
io_AiRangeToCoef
(
chanp
);
...
@@ -622,6 +679,7 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
...
@@ -622,6 +679,7 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
*
(
pwr_tFloat32
*
)
chanp
->
vbp
=
actvalue
;
*
(
pwr_tFloat32
*
)
chanp
->
vbp
=
actvalue
;
sop
->
SigValue
=
cop
->
SigValPolyCoef1
*
ivalue
+
cop
->
SigValPolyCoef0
;
sop
->
SigValue
=
cop
->
SigValPolyCoef1
*
ivalue
+
cop
->
SigValPolyCoef0
;
sop
->
RawValue
=
ivalue
;
sop
->
RawValue
=
ivalue
;
}
ai_cnt
++
;
ai_cnt
++
;
}
}
}
}
...
@@ -656,6 +714,20 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx,
...
@@ -656,6 +714,20 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx,
ard_sMsg
msg
;
ard_sMsg
msg
;
int
sts
;
int
sts
;
int
skip_ao
;
int
skip_ao
;
io_sChannel
*
chanp
;
if
(
local
->
Reconnect
)
{
local
->
ReconnectCnt
++
;
if
(
local
->
ReconnectCnt
*
ctx
->
ScanTime
>
5
.
0
)
{
sts
=
IoCardClose
(
ctx
,
ap
,
rp
,
cp
);
sts
=
IoCardInit
(
ctx
,
ap
,
rp
,
cp
);
local
=
cp
->
Local
;
if
(
EVEN
(
sts
))
{
local
->
Reconnect
=
1
;
}
}
return
IO__SUCCESS
;
}
if
(
local
->
AoSize
)
{
if
(
local
->
AoSize
)
{
skip_ao
=
0
;
skip_ao
=
0
;
...
@@ -682,7 +754,16 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx,
...
@@ -682,7 +754,16 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx,
for
(
j
=
0
;
j
<
8
;
j
++
)
{
for
(
j
=
0
;
j
<
8
;
j
++
)
{
m
=
1
<<
j
;
m
=
1
<<
j
;
if
(
local
->
DoMask
[
i
]
&
m
)
{
if
(
local
->
DoMask
[
i
]
&
m
)
{
if
(
*
(
pwr_tBoolean
*
)
local
->
DChanList
[
i
*
8
+
j
]
->
vbp
)
chanp
=
local
->
DChanList
[
i
*
8
+
j
];
pwr_sClass_ChanDo
*
cop
=
(
pwr_sClass_ChanDo
*
)
chanp
->
cop
;
pwr_tInt32
do_actval
;
if
(
cop
->
TestOn
!=
0
)
do_actval
=
cop
->
TestValue
;
else
do_actval
=
*
(
pwr_tInt32
*
)
chanp
->
vbp
;
if
(
do_actval
)
msg
.
data
[
i
]
|=
m
;
msg
.
data
[
i
]
|=
m
;
}
}
}
}
...
@@ -717,8 +798,13 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx,
...
@@ -717,8 +798,13 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx,
io_AoRangeToCoef
(
chanp
);
io_AoRangeToCoef
(
chanp
);
if
(
cop
->
TestOn
)
value
=
cop
->
TestValue
*
cop
->
OutPolyCoef1
+
cop
->
OutPolyCoef0
+
0
.
49
;
else
value
=
*
(
pwr_tFloat32
*
)
chanp
->
vbp
*
cop
->
OutPolyCoef1
+
value
=
*
(
pwr_tFloat32
*
)
chanp
->
vbp
*
cop
->
OutPolyCoef1
+
cop
->
OutPolyCoef0
+
0
.
49
;
cop
->
OutPolyCoef0
+
0
.
49
;
if
(
value
<
0
)
if
(
value
<
0
)
value
=
0
;
value
=
0
;
else
if
(
value
>
255
)
else
if
(
value
>
255
)
...
@@ -747,7 +833,16 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx,
...
@@ -747,7 +833,16 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx,
for
(
j
=
0
;
j
<
8
;
j
++
)
{
for
(
j
=
0
;
j
<
8
;
j
++
)
{
m
=
1
<<
j
;
m
=
1
<<
j
;
if
(
local
->
DoMask
[
i
]
&
m
)
{
if
(
local
->
DoMask
[
i
]
&
m
)
{
if
(
*
(
pwr_tBoolean
*
)
local
->
DChanList
[
i
*
8
+
j
]
->
vbp
)
chanp
=
local
->
DChanList
[
i
*
8
+
j
];
pwr_sClass_ChanDo
*
cop
=
(
pwr_sClass_ChanDo
*
)
chanp
->
cop
;
pwr_tInt32
do_actval
;
if
(
cop
->
TestOn
!=
0
)
do_actval
=
cop
->
TestValue
;
else
do_actval
=
*
(
pwr_tInt32
*
)
chanp
->
vbp
;
if
(
do_actval
)
msg
.
data
[
i
]
|=
m
;
msg
.
data
[
i
]
|=
m
;
}
}
}
}
...
@@ -770,8 +865,13 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx,
...
@@ -770,8 +865,13 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx,
io_AoRangeToCoef
(
chanp
);
io_AoRangeToCoef
(
chanp
);
if
(
cop
->
TestOn
)
value
=
cop
->
TestValue
*
cop
->
OutPolyCoef1
+
cop
->
OutPolyCoef0
+
0
.
49
;
else
value
=
*
(
pwr_tFloat32
*
)
chanp
->
vbp
*
cop
->
OutPolyCoef1
+
value
=
*
(
pwr_tFloat32
*
)
chanp
->
vbp
*
cop
->
OutPolyCoef1
+
cop
->
OutPolyCoef0
+
0
.
49
;
cop
->
OutPolyCoef0
+
0
.
49
;
if
(
value
<
0
)
if
(
value
<
0
)
value
=
0
;
value
=
0
;
else
if
(
value
>
255
)
else
if
(
value
>
255
)
...
@@ -790,6 +890,12 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx,
...
@@ -790,6 +890,12 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx,
sts
=
write
(
local
->
fd
,
&
msg
,
msg
.
size
);
sts
=
write
(
local
->
fd
,
&
msg
,
msg
.
size
);
}
}
if
(
sts
<
0
)
{
/* Connection lost, open device again */
local
->
Reconnect
=
1
;
local
->
ReconnectCnt
=
0
;
return
IO__SUCCESS
;
}
if
(
op
->
ErrorCount
>=
op
->
ErrorSoftLimit
&&
if
(
op
->
ErrorCount
>=
op
->
ErrorSoftLimit
&&
error_count
<
op
->
ErrorSoftLimit
)
{
error_count
<
op
->
ErrorSoftLimit
)
{
...
...
otherio/wbl/mcomp/src/otherio.wb_load
View file @
c1b0bc4c
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 = "_X30
4
"
Attr NextOix = "_X30
8
"
Attr NextCix = "_X36"
Attr NextCix = "_X36"
Attr NextTix[0] = "_X11"
Attr NextTix[0] = "_X11"
EndBody
EndBody
...
@@ -456,13 +456,34 @@ Volume OtherIO $ClassVolume 0.0.250.10
...
@@ -456,13 +456,34 @@ Volume OtherIO $ClassVolume 0.0.250.10
Attr TypeRef = "pwrs:Type-$Mask"
Attr TypeRef = "pwrs:Type-$Mask"
Attr Elements = 1
Attr Elements = 1
EndBody
EndBody
Object OptimizedDiPoll $Bit
169 06-JAN-2011 15:49:48.79
Object OptimizedDiPoll $Bit
308 05-FEB-2012 18:28:28.45
Body SysBody 0
6-JAN-2011 15:49:55.0
5
Body SysBody 0
5-FEB-2012 18:28:28.4
5
Attr Text = "OptimizedDiPoll"
Attr Text = "OptimizedDiPoll"
Attr PgmName = "OptimizedDiPoll"
Attr PgmName = "OptimizedDiPoll"
Attr Value = 1
Attr Value = 1
EndBody
EndBody
EndObject
EndObject
Object ConnectionRequest $Bit 305 05-FEB-2012 16:29:04.97
Body SysBody 05-FEB-2012 16:29:08.51
Attr Text = "ConnectionRequest"
Attr PgmName = "ConnectionRequest"
Attr Value = 2
EndBody
EndObject
Object Ao16Bit $Bit 306 05-FEB-2012 16:29:52.15
Body SysBody 05-FEB-2012 16:29:55.69
Attr Text = "Ao16Bit"
Attr PgmName = "Ao16Bit"
Attr Value = 4
EndBody
EndObject
Object Checksum $Bit 307 05-FEB-2012 18:27:48.23
Body SysBody 05-FEB-2012 18:27:51.71
Attr Text = "Checksum"
Attr PgmName = "Checksum"
Attr Value = 8
EndBody
EndObject
EndObject
EndObject
Object Hilscher_cifX_CommStateEnum $TypeDef 8 11-MAR-2011 09:57:02.13
Object Hilscher_cifX_CommStateEnum $TypeDef 8 11-MAR-2011 09:57:02.13
Body SysBody 11-MAR-2011 09:57:13.54
Body SysBody 11-MAR-2011 09:57:13.54
...
@@ -4079,7 +4100,7 @@ Volume OtherIO $ClassVolume 0.0.250.10
...
@@ -4079,7 +4100,7 @@ Volume OtherIO $ClassVolume 0.0.250.10
Object RtBody $ObjBodyDef 1 13-DEC-2010 21:36:40.01
Object RtBody $ObjBodyDef 1 13-DEC-2010 21:36:40.01
Body SysBody 13-DEC-2010 21:39:07.38
Body SysBody 13-DEC-2010 21:39:07.38
Attr StructName = "Arduino_Uno"
Attr StructName = "Arduino_Uno"
Attr NextAix = "_X2
5
"
Attr NextAix = "_X2
8
"
EndBody
EndBody
!/**
!/**
! Optional description.
! Optional description.
...
@@ -4242,6 +4263,25 @@ Volume OtherIO $ClassVolume 0.0.250.10
...
@@ -4242,6 +4263,25 @@ Volume OtherIO $ClassVolume 0.0.250.10
Attr TypeRef = "pwrs:Type-$UInt32"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndBody
EndObject
EndObject
Object StallAction $Attribute 25 05-FEB-2012 16:31:41.97
Body SysBody 05-FEB-2012 16:31:41.97
Attr PgmName = "StallAction"
Attr TypeRef = "pwrb:Type-StallActionEnum"
EndBody
EndObject
Object Timeout $Attribute 26 05-FEB-2012 18:33:56.70
Body SysBody 05-FEB-2012 18:33:53.26
Attr PgmName = "Timeout"
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object FirmwareVersion $Attribute 27 05-FEB-2012 16:33:33.69
Body SysBody 05-FEB-2012 16:33:52.27
Attr PgmName = "FirmwareVersion"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
EndObject
EndObject
Object IoMethods $RtMethod 144 13-DEC-2010 21:36:40.01
Object IoMethods $RtMethod 144 13-DEC-2010 21:36:40.01
Object IoCardInit $Method 145 13-DEC-2010 21:36:40.01
Object IoCardInit $Method 145 13-DEC-2010 21:36:40.01
...
@@ -4286,12 +4326,13 @@ Volume OtherIO $ClassVolume 0.0.250.10
...
@@ -4286,12 +4326,13 @@ Volume OtherIO $ClassVolume 0.0.250.10
EndBody
EndBody
EndObject
EndObject
Object Template Arduino_Uno 2151907328 01-JAN-1970 01:00:00.00
Object Template Arduino_Uno 2151907328 01-JAN-1970 01:00:00.00
Body RtBody 0
9-MAR-2011 15:42:29.56
Body RtBody 0
5-FEB-2012 16:34:14.13
Attr Process = 1
Attr Process = 1
Attr ErrorSoftLimit = 25
Attr ErrorSoftLimit = 25
Attr ErrorHardLimit = 50
Attr ErrorHardLimit = 50
Attr WatchdogTime = 5.000000e+00
Attr WatchdogTime = 5.000000e+00
Attr BaudRate = 9600
Attr BaudRate = 9600
Attr Timeout = 1.000000e+00
EndBody
EndBody
EndObject
EndObject
EndObject
EndObject
...
@@ -6008,7 +6049,9 @@ Volume OtherIO $ClassVolume 0.0.250.10
...
@@ -6008,7 +6049,9 @@ Volume OtherIO $ClassVolume 0.0.250.10
!*/
!*/
Object SPI_Master $ClassDef 35 15-JAN-2012 10:38:09.98
Object SPI_Master $ClassDef 35 15-JAN-2012 10:38:09.98
Body SysBody 15-JAN-2012 10:38:18.39
Body SysBody 15-JAN-2012 10:38:18.39
Attr Flags = 10240
Attr Editor = 0
Attr Method = 0
Attr Flags = 10256
EndBody
EndBody
Object RtBody $ObjBodyDef 1 15-JAN-2012 10:38:27.11
Object RtBody $ObjBodyDef 1 15-JAN-2012 10:38:27.11
Body SysBody 15-JAN-2012 10:38:27.11
Body SysBody 15-JAN-2012 10:38:27.11
...
@@ -6017,11 +6060,19 @@ Volume OtherIO $ClassVolume 0.0.250.10
...
@@ -6017,11 +6060,19 @@ Volume OtherIO $ClassVolume 0.0.250.10
EndBody
EndBody
Object Super $Attribute 1 15-JAN-2012 10:38:35.30
Object Super $Attribute 1 15-JAN-2012 10:38:35.30
Body SysBody 15-JAN-2012 10:40:19.18
Body SysBody 15-JAN-2012 10:40:19.18
Attr Flags = 17170432
Attr PgmName = "Super"
Attr Flags = 393216
Attr TypeRef = "BaseComponent:Class-BaseIORack"
Attr TypeRef = "BaseComponent:Class-BaseIORack"
EndBody
EndBody
EndObject
EndObject
EndObject
EndObject
Object Template SPI_Master 2156888064 01-JAN-1970 01:00:00.00
Body RtBody 01-JAN-1970 01:00:00.00
Attr Super.Process = 1
Attr Super.ErrorSoftLimit = 50
Attr Super.ErrorHardLimit = 100
EndBody
EndObject
EndObject
EndObject
!/**
!/**
! @Version 1.0
! @Version 1.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