Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
68709612
Commit
68709612
authored
Dec 19, 2011
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавил обработку поля "precision" для датчиков которые "пишутся"
(передаются во внешние системы). Это обратное преобразование, относительно тех которые "читаются"
parent
7e4bf858
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
7 deletions
+11
-7
libuniset.spec
conf/libuniset.spec
+4
-1
test.xml
conf/test.xml
+1
-1
start_fg_mbrtu.sh
extensions/ModbusMaster/start_fg_mbrtu.sh
+3
-1
IOBase.cc
extensions/lib/IOBase.cc
+3
-4
No files found.
conf/libuniset.spec
View file @
68709612
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
Name: libuniset
Name: libuniset
Version: 1.0
Version: 1.0
Release: alt5
8
Release: alt5
9
Summary: UniSet - library for building distributed industrial control systems
Summary: UniSet - library for building distributed industrial control systems
License: GPL
License: GPL
Group: Development/C++
Group: Development/C++
...
@@ -213,6 +213,9 @@ rm -f %buildroot%_libdir/*.la
...
@@ -213,6 +213,9 @@ rm -f %buildroot%_libdir/*.la
%changelog
%changelog
* Mon Dec 19 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt59
- add precision for output variables
* Wed Nov 30 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt58
* Wed Nov 30 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt58
- fixed bug in ModbusSlave::readInputStatus(0x02)
- fixed bug in ModbusSlave::readInputStatus(0x02)
...
...
conf/test.xml
View file @
68709612
...
@@ -115,7 +115,7 @@
...
@@ -115,7 +115,7 @@
</item>
</item>
<item
id=
"7"
iotype=
"DO"
name=
"DO_C"
priority=
"Medium"
textname=
"Digital output"
/>
<item
id=
"7"
iotype=
"DO"
name=
"DO_C"
priority=
"Medium"
textname=
"Digital output"
/>
<item
id=
"8"
iotype=
"DO"
name=
"DO1_C"
priority=
"Medium"
textname=
"Digital output"
/>
<item
id=
"8"
iotype=
"DO"
name=
"DO1_C"
priority=
"Medium"
textname=
"Digital output"
/>
<item
id=
"9"
default=
"10
"
iotype=
"AO"
mbaddr=
"0x01"
mbfunc=
"0x06"
mbreg=
"0x02"
mbtype=
"rtu"
name=
"AO_AS"
priority=
"Medium"
rs=
"2"
textname=
"Analog output"
/>
<item
id=
"9"
default=
"10
00"
iotype=
"AO"
rs_mbaddr=
"0x01"
rs_mbfunc=
"0x06"
rs_mbreg=
"0x02"
precision=
"2"
rs_
mbtype=
"rtu"
name=
"AO_AS"
priority=
"Medium"
rs=
"2"
textname=
"Analog output"
/>
<item
id=
"10"
default=
"378"
iotype=
"AI"
mbaddr=
"0x01"
mbfunc=
"0x04"
mbreg=
"0x01"
mbtype=
"rtu"
name=
"AI_AS"
precision=
"45"
priority=
"Medium"
rs=
"1"
textname=
"Analog input"
vtype=
"F2"
>
<item
id=
"10"
default=
"378"
iotype=
"AI"
mbaddr=
"0x01"
mbfunc=
"0x04"
mbreg=
"0x01"
mbtype=
"rtu"
name=
"AI_AS"
precision=
"45"
priority=
"Medium"
rs=
"1"
textname=
"Analog input"
vtype=
"F2"
>
<consumers>
<consumers>
<consumer
cfilter=
"test1"
name=
"TestProc"
type=
"objects"
/>
<consumer
cfilter=
"test1"
name=
"TestProc"
type=
"objects"
/>
...
...
extensions/ModbusMaster/start_fg_mbrtu.sh
View file @
68709612
...
@@ -6,10 +6,12 @@ uniset-start.sh -f ./uniset-rtuexchange --confile test.xml \
...
@@ -6,10 +6,12 @@ uniset-start.sh -f ./uniset-rtuexchange --confile test.xml \
--rs-name
RTUExchange
\
--rs-name
RTUExchange
\
--rs-speed
38400
\
--rs-speed
38400
\
--rs-filter-field
rs
\
--rs-filter-field
rs
\
--rs-filter-value
1
\
--rs-filter-value
2
\
--dlog-add-levels
info,crit,warn,level4,level3
\
--dlog-add-levels
info,crit,warn,level4,level3
\
--rs-force
0
\
--rs-force
0
\
--rs-force-out
0
\
--rs-force-out
0
\
--rs-polltime
3000
\
--rs-polltime
3000
\
--rs-set-prop-prefix
rs_
\
#,level3
#,level3
# --rs-force 1 \
# --rs-force 1 \
extensions/lib/IOBase.cc
View file @
68709612
...
@@ -286,9 +286,8 @@ long IOBase::processingAsAO( IOBase* it, SMInterface* shm, bool force )
...
@@ -286,9 +286,8 @@ long IOBase::processingAsAO( IOBase* it, SMInterface* shm, bool force )
else
else
val
=
it
->
value
;
val
=
it
->
value
;
/*! \todo Разобратся, нужно ли здесь учитывать Precision! */
if
(
!
it
->
noprecision
&&
it
->
cal
.
precision
>
0
)
// if( it->cal.precision > 0 )
return
lroundf
(
(
float
)
it
->
value
/
pow10
(
it
->
cal
.
precision
)
);
// val = it->value / lround(pow10(it->cal.precision));
}
}
}
}
...
@@ -349,7 +348,7 @@ float IOBase::processingFasAO( IOBase* it, SMInterface* shm, bool force )
...
@@ -349,7 +348,7 @@ float IOBase::processingFasAO( IOBase* it, SMInterface* shm, bool force )
cal
->
minCal
,
cal
->
maxCal
,
cal
->
minRaw
,
cal
->
maxRaw
,
true
);
cal
->
minCal
,
cal
->
maxCal
,
cal
->
minRaw
,
cal
->
maxRaw
,
true
);
}
}
if
(
it
->
cal
.
precision
>
0
)
if
(
!
it
->
noprecision
&&
it
->
cal
.
precision
>
0
)
return
(
fval
/
pow10
(
it
->
cal
.
precision
)
);
return
(
fval
/
pow10
(
it
->
cal
.
precision
)
);
}
}
}
}
...
...
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