Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
PastureGateway
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
steven.sha
PastureGateway
Commits
8f1fbb7e
Commit
8f1fbb7e
authored
Jun 23, 2019
by
leon.huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify North and south water repel each other function
parent
6de5408f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
ModualControl.cs
ModbusDemo/MessageFormat/ModualControl.cs
+18
-9
No files found.
ModbusDemo/MessageFormat/ModualControl.cs
View file @
8f1fbb7e
...
...
@@ -195,7 +195,7 @@ namespace ModbusDemo.MessageFormat
cModualCntrol
.
bStartControl
=
true
;
for
(
int
j
=
0
;
j
<
cModualCntrol
.
strOperationChannelName
.
Count
();
j
++)
{
if
(
bNorth_South_Water_Mutual_Check
(
cModualCntrol
.
sbModbusID
,
cModualCntrol
.
strOperationChannelName
[
j
])
&&
ControlMap
.
bControl_Map
(
cModualCntrol
.
bOpenMachine
,
cModualCntrol
.
sbModbusID
,
cModualCntrol
.
bControlData
,
cModualCntrol
.
strOperationChannelName
[
j
]))
if
(
bNorth_South_Water_Mutual_Check
(
cModualCntrol
.
sbModbusID
,
cModualCntrol
.
strOperationChannelName
[
j
])
&&
ControlMap
.
bControl_Map
(
cModualCntrol
.
bOpenMachine
,
cModualCntrol
.
sbModbusID
,
cModualCntrol
.
bControlData
,
cModualCntrol
.
strOperationChannelName
[
j
]))
{
bOperationStatus
[
j
]
=
ControlMap
.
bDelege_Operation
(
cModualCntrol
.
bControlData
);
cModualCntrol
.
bControlStatus
=
bOperationStatus
[
j
];
...
...
@@ -255,7 +255,7 @@ namespace ModbusDemo.MessageFormat
liModuualControl
[
i
].
bStartControl
=
true
;
bool
[]
bControlData
;
liModuualControl
[
i
].
bControlStatus
=
ModualPoll
.
bGet_channel_Value
<
bool
>(
liModuualControl
[
i
].
sbModbusID
,
out
bControlData
,
"d0"
,
"d1"
,
"d2"
,
"d3"
,
"d4"
,
"d5"
,
"d6"
,
"d7"
);
if
(
ControlMap
.
bControl_Map
(
liModuualControl
[
i
].
bOpenMachine
,
liModuualControl
[
i
].
sbModbusID
,
liModuualControl
[
i
].
bControlData
,
liModuualControl
[
i
].
strOperationChannelName
[
0
]))
if
(
bNorth_South_Water_Mutual_Check
(
liModuualControl
[
i
].
sbModbusID
,
liModuualControl
[
i
].
strOperationChannelName
[
0
])
&&
ControlMap
.
bControl_Map
(
liModuualControl
[
i
].
bOpenMachine
,
liModuualControl
[
i
].
sbModbusID
,
liModuualControl
[
i
].
bControlData
,
liModuualControl
[
i
].
strOperationChannelName
[
0
]))
{
liModuualControl
[
i
].
bControlStatus
=
ControlMap
.
bDelege_Operation
(
bControlData
);
}
...
...
@@ -276,7 +276,7 @@ namespace ModbusDemo.MessageFormat
// liModuualControl[i].bControlData[j] = !liModuualControl[i].bControlData[j];
// }
//}
if
(
ControlMap
.
bControl_Map
(!
liModuualControl
[
i
].
bOpenMachine
,
liModuualControl
[
i
].
sbModbusID
,
liModuualControl
[
i
].
bControlData
,
liModuualControl
[
i
].
strOperationChannelName
[
0
]))
if
(
bNorth_South_Water_Mutual_Check
(
liModuualControl
[
i
].
sbModbusID
,
liModuualControl
[
i
].
strOperationChannelName
[
0
])
&&
ControlMap
.
bControl_Map
(!
liModuualControl
[
i
].
bOpenMachine
,
liModuualControl
[
i
].
sbModbusID
,
liModuualControl
[
i
].
bControlData
,
liModuualControl
[
i
].
strOperationChannelName
[
0
]))
{
liModuualControl
[
i
].
bControlStatus
=
ControlMap
.
bDelege_Operation
(
bControlData
);
}
...
...
@@ -515,8 +515,15 @@ namespace ModbusDemo.MessageFormat
}
public
static
bool
bOperation_Machine
(
bool
bOpenMachine
,
byte
sbModbusID
,
bool
[]
bControlData
,
bool
[]
bControlBit
,
out
bool
bHadOpenMachine
,
byte
byResModualID
,
string
stResChannel
)
{
bHadOpenMachine
=
true
;
bool
bControlStatus
=
true
;
if
(
bOpenMachine
==
true
)
{
bHadOpenMachine
=
false
;
}
else
{
bHadOpenMachine
=
true
;
}
if
(
ModualPoll
.
bSet_All_Channel_Value
(
sbModbusID
,
bControlData
)
==
true
)
{
if
(
bOpenMachine
==
true
&&
stResChannel
!=
null
)
...
...
@@ -556,7 +563,7 @@ namespace ModbusDemo.MessageFormat
}
else
{
bControlStatus
=
false
;
bControlStatus
=
false
;
}
for
(
int
i
=
0
;
i
<
bControlBit
.
Count
();
i
++)
{
...
...
@@ -566,7 +573,7 @@ namespace ModbusDemo.MessageFormat
if
(
bControlStatus
==
true
)
ModualAlarm
.
vSet_Modual_Alarm
(
sbModbusID
,
(
ushort
)
ModualAlarm
.
eAlarmCode
.
ChannelControlError
,
false
,
1
,
str
);
else
ModualAlarm
.
vSet_Modual_Alarm
(
sbModbusID
,(
ushort
)
ModualAlarm
.
eAlarmCode
.
ChannelControlError
,
true
,
1
,
str
);
ModualAlarm
.
vSet_Modual_Alarm
(
sbModbusID
,
(
ushort
)
ModualAlarm
.
eAlarmCode
.
ChannelControlError
,
true
,
1
,
str
);
}
}
ModualPoll
.
vSend_Actual_Data
(
sbModbusID
);
...
...
@@ -704,7 +711,7 @@ namespace ModbusDemo.MessageFormat
AllPond
.
cDischargePool
.
vSetMinLevel
=
pcConfig
.
ReadConfig
<
double
>(
"出料池配置"
,
"报警最低液位"
);
}
}
public
static
bool
bNorth_South_Water_Mutual_Check
(
byte
byModbusID
,
string
strOperationChannelsName
)
public
static
bool
bNorth_South_Water_Mutual_Check
(
byte
byModbusID
,
string
strOperationChannelsName
)
{
bool
bCheckStatus
=
true
;
if
(
byModbusID
==
AllPond
.
cEastTransitPool
.
cSouthWater
.
byModbusID
&&
strOperationChannelsName
==
AllPond
.
cEastTransitPool
.
cSouthWater
.
strOperationNumber
)
...
...
@@ -739,9 +746,11 @@ namespace ModbusDemo.MessageFormat
bCheckStatus
=
true
;
}
}
if
(
bCheckStatus
==
false
)
else
bCheckStatus
=
true
;
if
(
bCheckStatus
==
false
)
{
ModualPoll
.
vSend_Actual_Data
(
byModbusID
);
ModualPoll
.
vSend_Actual_Data
(
byModbusID
);
}
return
bCheckStatus
;
}
...
...
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