Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
GC_Branch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周磊
GC_Branch
Commits
4fa9a9cb
Commit
4fa9a9cb
authored
Aug 14, 2018
by
wangjunqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加自动校准进度反馈地址
parent
9de2ecab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
5 deletions
+44
-5
GCModbusSlave.cs
GcDevicePc/Common/GCModbusSlave.cs
+44
-5
No files found.
GcDevicePc/Common/GCModbusSlave.cs
View file @
4fa9a9cb
...
@@ -100,7 +100,8 @@ namespace GcDevicePc.Common
...
@@ -100,7 +100,8 @@ namespace GcDevicePc.Common
{
{
ushort
[]
s
=
new
ushort
[
2
];
ushort
[]
s
=
new
ushort
[
2
];
float
[]
f
=
new
float
[
2
];
float
[]
f
=
new
float
[
2
];
if
(
address
>=
17
&&
address
<=
22
)
if
(
address
>=
17
&&
address
<=
22
)
//信号输出
{
{
if
(
address
==
17
||
address
==
18
)
if
(
address
==
17
||
address
==
18
)
f
[
0
]
=
float
.
Parse
(
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
fDetValue
.
ToString
(
"0.000"
));
f
[
0
]
=
float
.
Parse
(
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
fDetValue
.
ToString
(
"0.000"
));
...
@@ -112,7 +113,7 @@ namespace GcDevicePc.Common
...
@@ -112,7 +113,7 @@ namespace GcDevicePc.Common
Buffer
.
BlockCopy
(
f
,
0
,
s
,
2
,
2
);
Buffer
.
BlockCopy
(
f
,
0
,
s
,
2
,
2
);
value
=
s
[(
address
-
signalddress
)
%
2
];
value
=
s
[(
address
-
signalddress
)
%
2
];
}
}
else
if
(
address
>=
23
&&
listnum
>
0
)
else
if
(
address
>=
23
&&
listnum
>
0
)
//组分输出
{
{
int
readnum
=
(
address
-
baseaddress
)
/
2
;
int
readnum
=
(
address
-
baseaddress
)
/
2
;
if
(
readnum
<=
listnum
-
1
)
if
(
readnum
<=
listnum
-
1
)
...
@@ -134,13 +135,51 @@ namespace GcDevicePc.Common
...
@@ -134,13 +135,51 @@ namespace GcDevicePc.Common
}
}
}
}
if
(
address
>=
2
&&
address
<
20
)
//分析仪状态
if
(
address
>=
0
&&
address
<
20
)
{
{
switch
(
address
)
switch
(
address
)
{
{
case
2
:
case
0
:
//进度数目
{
if
((
ushort
)
SharedSpace
.
Data
.
typesint
==
2
||
(
ushort
)
SharedSpace
.
Data
.
typesint
==
3
)
{
value
=
globaldata
.
m_hmibuffer
.
gcinfo
.
batno
;
}
else
{
value
=
0
;
}
}
break
;
case
1
:
//进度
{
if
((
ushort
)
SharedSpace
.
Data
.
typesint
==
2
||
(
ushort
)
SharedSpace
.
Data
.
typesint
==
3
)
{
value
=
(
ushort
)(
SharedSpace
.
MControl
.
dateend
/
SharedSpace
.
MControl
.
zhouqi
);
}
else
{
value
=
0
;
}
}
break
;
case
2
:
// 0-正在采样(默认) 1-手动 2-定时 3-校准成功 4-校准失败 5-校准成功(正在采样) 6-校准失败(正在采样)
{
{
value
=
(
ushort
)
SharedSpace
.
Data
.
typesint
;
if
(!
SharedSpace
.
MControl
.
SetOut
&&
!
SharedSpace
.
MControl
.
SetRun
)
{
if
((
ushort
)
SharedSpace
.
Data
.
typesint
==
3
)
value
=
5
;
else
if
((
ushort
)
SharedSpace
.
Data
.
typesint
==
4
)
value
=
6
;
else
value
=
(
ushort
)
SharedSpace
.
Data
.
typesint
;
}
else
{
value
=
(
ushort
)
SharedSpace
.
Data
.
typesint
;
}
}
}
break
;
break
;
case
3
:
case
3
:
...
...
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