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
12161cc9
Commit
12161cc9
authored
Sep 12, 2018
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ssab IO ao, write every scan
parent
68dcd0c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
116 additions
and
132 deletions
+116
-132
ssabox/lib/rt/src/os_linux/rt_io_m_ao_hvao4.c
ssabox/lib/rt/src/os_linux/rt_io_m_ao_hvao4.c
+54
-62
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_aoup.c
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_aoup.c
+62
-70
No files found.
ssabox/lib/rt/src/os_linux/rt_io_m_ao_hvao4.c
View file @
12161cc9
...
...
@@ -70,7 +70,6 @@ typedef struct {
int
Qbus_fp
;
pwr_tFloat32
OldValue
[
IO_MAXCHAN
];
pwr_tBoolean
OldTestOn
[
IO_MAXCHAN
];
int
WriteFirst
;
unsigned
int
ErrReset
;
unsigned
int
ErrScanCnt
;
}
io_sLocal
;
...
...
@@ -136,8 +135,6 @@ static pwr_tStatus IoCardInit(
errh_Info
(
"Init of ao card '%s'"
,
cp
->
Name
);
/* Write the first 50 loops */
local
->
WriteFirst
=
50
;
cp
->
Local
=
local
;
/* Caluclate polycoeff */
...
...
@@ -205,70 +202,65 @@ static pwr_tStatus IoCardWrite(
cop
=
(
pwr_sClass_ChanAo
*
)
chanp
->
cop
;
sop
=
(
pwr_sClass_Ao
*
)
chanp
->
sop
;
if
(
!
feqf
(
*
(
pwr_tFloat32
*
)
chanp
->
vbp
,
local
->
OldValue
[
i
])
||
local
->
WriteFirst
>
0
||
cop
->
CalculateNewCoef
||
fixout
||
cop
->
TestOn
||
local
->
OldTestOn
[
i
]
!=
cop
->
TestOn
)
{
if
(
fixout
)
value
=
cop
->
FixedOutValue
;
else
if
(
cop
->
TestOn
)
value
=
cop
->
TestValue
;
else
value
=
*
(
pwr_tFloat32
*
)
chanp
->
vbp
;
if
(
cop
->
CalculateNewCoef
)
AoRangeToCoef
(
chanp
);
/* Convert to rawvalue */
if
(
value
>
cop
->
ActValRangeHigh
)
value
=
cop
->
ActValRangeHigh
;
else
if
(
value
<
cop
->
ActValRangeLow
)
value
=
cop
->
ActValRangeLow
;
rawvalue
=
cop
->
OutPolyCoef1
*
value
+
cop
->
OutPolyCoef0
;
if
(
rawvalue
>
0
)
sop
->
RawValue
=
rawvalue
+
0
.
5
;
else
sop
->
RawValue
=
rawvalue
-
0
.
5
;
data
=
sop
->
RawValue
;
if
(
r_local
->
Qbus_fp
!=
0
&&
r_local
->
s
==
0
)
{
wb
.
Data
=
data
;
wb
.
Address
=
local
->
Address
+
2
*
i
;
sts
=
write
(
local
->
Qbus_fp
,
&
wb
,
sizeof
(
wb
));
}
else
{
/* Ethernet I/O, Request a write to current address */
bfbeth_set_write_req
(
r_local
,
(
pwr_tUInt16
)(
local
->
Address
+
2
*
i
),
data
);
sts
=
1
;
if
(
fixout
)
value
=
cop
->
FixedOutValue
;
else
if
(
cop
->
TestOn
)
value
=
cop
->
TestValue
;
else
value
=
*
(
pwr_tFloat32
*
)
chanp
->
vbp
;
if
(
cop
->
CalculateNewCoef
)
AoRangeToCoef
(
chanp
);
/* Convert to rawvalue */
if
(
value
>
cop
->
ActValRangeHigh
)
value
=
cop
->
ActValRangeHigh
;
else
if
(
value
<
cop
->
ActValRangeLow
)
value
=
cop
->
ActValRangeLow
;
rawvalue
=
cop
->
OutPolyCoef1
*
value
+
cop
->
OutPolyCoef0
;
if
(
rawvalue
>
0
)
sop
->
RawValue
=
rawvalue
+
0
.
5
;
else
sop
->
RawValue
=
rawvalue
-
0
.
5
;
data
=
sop
->
RawValue
;
if
(
r_local
->
Qbus_fp
!=
0
&&
r_local
->
s
==
0
)
{
wb
.
Data
=
data
;
wb
.
Address
=
local
->
Address
+
2
*
i
;
sts
=
write
(
local
->
Qbus_fp
,
&
wb
,
sizeof
(
wb
));
}
else
{
/* Ethernet I/O, Request a write to current address */
bfbeth_set_write_req
(
r_local
,
(
pwr_tUInt16
)(
local
->
Address
+
2
*
i
),
data
);
sts
=
1
;
}
if
(
sts
==
-
1
)
{
/* Increase error count and check error limits */
op
->
ErrorCount
++
;
if
(
op
->
ErrorCount
==
op
->
ErrorSoftLimit
)
{
errh_Error
(
"IO Error soft limit reached on card '%s'"
,
cp
->
Name
);
ctx
->
IOHandler
->
CardErrorSoftLimit
=
1
;
ctx
->
IOHandler
->
ErrorSoftLimitObject
=
cdh_ObjidToAref
(
cp
->
Objid
);
}
if
(
op
->
ErrorCount
>=
op
->
ErrorHardLimit
)
{
errh_Error
(
"IO Error hard limit reached on card '%s', IO stopped"
,
cp
->
Name
);
ctx
->
Node
->
EmergBreakTrue
=
1
;
ctx
->
IOHandler
->
CardErrorHardLimit
=
1
;
ctx
->
IOHandler
->
ErrorHardLimitObject
=
cdh_ObjidToAref
(
cp
->
Objid
);
return
IO__ERRDEVICE
;
}
chanp
++
;
continue
;
}
else
local
->
OldValue
[
i
]
=
value
;
if
(
sts
==
-
1
)
{
/* Increase error count and check error limits */
op
->
ErrorCount
++
;
if
(
op
->
ErrorCount
==
op
->
ErrorSoftLimit
)
{
errh_Error
(
"IO Error soft limit reached on card '%s'"
,
cp
->
Name
);
ctx
->
IOHandler
->
CardErrorSoftLimit
=
1
;
ctx
->
IOHandler
->
ErrorSoftLimitObject
=
cdh_ObjidToAref
(
cp
->
Objid
);
}
if
(
op
->
ErrorCount
>=
op
->
ErrorHardLimit
)
{
errh_Error
(
"IO Error hard limit reached on card '%s', IO stopped"
,
cp
->
Name
);
ctx
->
Node
->
EmergBreakTrue
=
1
;
ctx
->
IOHandler
->
CardErrorHardLimit
=
1
;
ctx
->
IOHandler
->
ErrorHardLimitObject
=
cdh_ObjidToAref
(
cp
->
Objid
);
return
IO__ERRDEVICE
;
}
chanp
++
;
continue
;
}
else
local
->
OldValue
[
i
]
=
value
;
}
local
->
OldTestOn
[
i
]
=
cop
->
TestOn
;
chanp
++
;
}
if
(
local
->
WriteFirst
)
local
->
WriteFirst
--
;
/* Fix for qbus errors */
local
->
ErrScanCnt
++
;
...
...
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_aoup.c
View file @
12161cc9
...
...
@@ -69,7 +69,6 @@ typedef struct {
unsigned
int
bfb_item
;
pwr_tFloat32
OldValue
[
IO_MAXCHAN
];
pwr_tBoolean
OldTestOn
[
IO_MAXCHAN
];
int
WriteFirst
;
unsigned
int
ErrReset
;
unsigned
int
ErrScanCnt
;
int
FirstScan
;
...
...
@@ -139,8 +138,6 @@ static pwr_tStatus IoCardInit(
errh_Info
(
"Init of ao card '%s'"
,
cp
->
Name
);
/* Write the first 50 loops */
local
->
WriteFirst
=
50
;
cp
->
Local
=
local
;
/* Caluclate polycoeff */
...
...
@@ -254,79 +251,74 @@ static pwr_tStatus IoCardWrite(
}
/* Convert and write */
if
(
!
feqf
(
*
(
pwr_tFloat32
*
)
chanp
->
vbp
,
local
->
OldValue
[
i
])
||
local
->
WriteFirst
>
0
||
cop
->
CalculateNewCoef
||
fixout
||
cop
->
TestOn
||
local
->
OldTestOn
[
i
]
!=
cop
->
TestOn
)
{
if
(
fixout
)
value
=
cop
->
FixedOutValue
;
else
if
(
cop
->
TestOn
)
value
=
cop
->
TestValue
;
else
value
=
*
(
pwr_tFloat32
*
)
chanp
->
vbp
;
if
(
cop
->
CalculateNewCoef
)
AoRangeToCoef
(
chanp
);
/* Convert to rawvalue */
if
(
value
>
cop
->
ActValRangeHigh
)
value
=
cop
->
ActValRangeHigh
;
else
if
(
value
<
cop
->
ActValRangeLow
)
value
=
cop
->
ActValRangeLow
;
rawvalue
=
cop
->
OutPolyCoef1
*
value
+
cop
->
OutPolyCoef0
;
if
(
rawvalue
>
0
)
sop
->
RawValue
=
rawvalue
+
0
.
5
;
else
sop
->
RawValue
=
rawvalue
-
0
.
5
;
data
=
sop
->
RawValue
;
if
(
!
remote
)
{
wb
.
Data
=
data
;
wb
.
Address
=
local
->
Address
+
2
*
i
;
sts
=
write
(
local
->
Qbus_fp
,
&
wb
,
sizeof
(
wb
));
}
else
{
/* Ethernet I/O, Request a write to current address */
bfbeth_set_write_req
(
r_local
,
(
pwr_tUInt16
)(
local
->
Address
+
2
*
i
),
data
);
local
->
CheckWrite
[
i
]
=
1
;
if
(
sts
==
1
)
{
op
->
ErrorCount
=
0
;
local
->
OldValue
[
i
]
=
value
;
local
->
OldTestOn
[
i
]
=
cop
->
TestOn
;
}
chanp
++
;
continue
;
if
(
fixout
)
value
=
cop
->
FixedOutValue
;
else
if
(
cop
->
TestOn
)
value
=
cop
->
TestValue
;
else
value
=
*
(
pwr_tFloat32
*
)
chanp
->
vbp
;
if
(
cop
->
CalculateNewCoef
)
AoRangeToCoef
(
chanp
);
/* Convert to rawvalue */
if
(
value
>
cop
->
ActValRangeHigh
)
value
=
cop
->
ActValRangeHigh
;
else
if
(
value
<
cop
->
ActValRangeLow
)
value
=
cop
->
ActValRangeLow
;
rawvalue
=
cop
->
OutPolyCoef1
*
value
+
cop
->
OutPolyCoef0
;
if
(
rawvalue
>
0
)
sop
->
RawValue
=
rawvalue
+
0
.
5
;
else
sop
->
RawValue
=
rawvalue
-
0
.
5
;
data
=
sop
->
RawValue
;
if
(
!
remote
)
{
wb
.
Data
=
data
;
wb
.
Address
=
local
->
Address
+
2
*
i
;
sts
=
write
(
local
->
Qbus_fp
,
&
wb
,
sizeof
(
wb
));
}
else
{
/* Ethernet I/O, Request a write to current address */
bfbeth_set_write_req
(
r_local
,
(
pwr_tUInt16
)(
local
->
Address
+
2
*
i
),
data
);
local
->
CheckWrite
[
i
]
=
1
;
if
(
sts
==
1
)
{
op
->
ErrorCount
=
0
;
local
->
OldValue
[
i
]
=
value
;
local
->
OldTestOn
[
i
]
=
cop
->
TestOn
;
}
chanp
++
;
continue
;
}
/* Error handling for local rack */
if
(
sts
==
-
1
)
{
/* Increase error count and check error limits */
op
->
ErrorCount
++
;
/* Error handling for local rack */
if
(
sts
==
-
1
)
{
/* Increase error count and check error limits */
op
->
ErrorCount
++
;
if
(
op
->
ErrorCount
==
op
->
ErrorSoftLimit
)
{
errh_Error
(
"IO Error soft limit reached on card '%s'"
,
cp
->
Name
);
ctx
->
IOHandler
->
CardErrorSoftLimit
=
1
;
ctx
->
IOHandler
->
ErrorSoftLimitObject
=
cdh_ObjidToAref
(
cp
->
Objid
);
}
if
(
op
->
ErrorCount
>=
op
->
ErrorHardLimit
)
{
errh_Error
(
"IO Error hard limit reached on card '%s', IO stopped"
,
cp
->
Name
);
ctx
->
Node
->
EmergBreakTrue
=
1
;
ctx
->
IOHandler
->
CardErrorHardLimit
=
1
;
ctx
->
IOHandler
->
ErrorHardLimitObject
=
cdh_ObjidToAref
(
cp
->
Objid
);
return
IO__ERRDEVICE
;
}
chanp
++
;
continue
;
}
else
local
->
OldValue
[
i
]
=
value
;
if
(
op
->
ErrorCount
==
op
->
ErrorSoftLimit
)
{
errh_Error
(
"IO Error soft limit reached on card '%s'"
,
cp
->
Name
);
ctx
->
IOHandler
->
CardErrorSoftLimit
=
1
;
ctx
->
IOHandler
->
ErrorSoftLimitObject
=
cdh_ObjidToAref
(
cp
->
Objid
);
}
if
(
op
->
ErrorCount
>=
op
->
ErrorHardLimit
)
{
errh_Error
(
"IO Error hard limit reached on card '%s', IO stopped"
,
cp
->
Name
);
ctx
->
Node
->
EmergBreakTrue
=
1
;
ctx
->
IOHandler
->
CardErrorHardLimit
=
1
;
ctx
->
IOHandler
->
ErrorHardLimitObject
=
cdh_ObjidToAref
(
cp
->
Objid
);
return
IO__ERRDEVICE
;
}
chanp
++
;
continue
;
}
else
local
->
OldValue
[
i
]
=
value
;
}
local
->
OldTestOn
[
i
]
=
cop
->
TestOn
;
chanp
++
;
}
if
(
local
->
WriteFirst
)
local
->
WriteFirst
--
;
if
(
local
->
FirstScan
)
local
->
FirstScan
=
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