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
1dfb305f
Commit
1dfb305f
authored
May 31, 2019
by
leon.huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add modbus poll all modual
parent
0b293b14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
425 additions
and
157 deletions
+425
-157
Modbuslib.cs
ModbusDemo/Common/Modbuslib.cs
+0
-2
ModbusComm.cs
ModbusDemo/MessageFormat/ModbusComm.cs
+95
-80
ModbusDemo.csproj
ModbusDemo/ModbusDemo.csproj
+2
-0
ModualPoll.cs
ModbusDemo/Modular/ModualPoll.cs
+90
-0
modual.cs
ModbusDemo/Modular/modual.cs
+87
-0
Pond.cs
ModbusDemo/application/Pond.cs
+16
-16
PoolModbusSet.cs
ModbusDemo/application/PoolModbusSet.cs
+18
-28
Form1.Designer.cs
ModbusDemo/windows/Form1.Designer.cs
+26
-2
Form1.cs
ModbusDemo/windows/Form1.cs
+91
-29
No files found.
ModbusDemo/Common/Modbuslib.cs
View file @
1dfb305f
...
...
@@ -233,7 +233,6 @@ namespace ModbusDemo.windows
public
String
GetVersion
(
Byte
slaveid
)
{
int
ret
;
String
version
=
"0.0"
;
String
ip
=
"127.0.0.1"
;
UInt16
[]
buf
=
new
ushort
[
2
];
...
...
@@ -247,6 +246,5 @@ namespace ModbusDemo.windows
}
return
version
;
}
}
}
ModbusDemo/MessageFormat/ModbusComm.cs
View file @
1dfb305f
This diff is collapsed.
Click to expand it.
ModbusDemo/ModbusDemo.csproj
View file @
1dfb305f
...
...
@@ -98,6 +98,8 @@
<Compile
Include=
"Modular\478C.cs"
/>
<Compile
Include=
"Modular\418X.cs"
/>
<Compile
Include=
"Common\Modbuslib.cs"
/>
<Compile
Include=
"Modular\ModualPoll.cs"
/>
<Compile
Include=
"Modular\modual.cs"
/>
<Compile
Include=
"windows\Form1.cs"
>
<SubType>
Form
</SubType>
</Compile>
...
...
ModbusDemo/Modular/ModualPoll.cs
0 → 100644
View file @
1dfb305f
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
ModbusDemo.MessageFormat
;
namespace
ModbusDemo.Modular
{
class
ModualPoll
{
const
byte
byX14pNumber
=
3
;
const
byte
byX14pReadDataStartAddress
=
0
;
const
byte
byX14pReadDataNumber
=
4
;
const
byte
byX14pReadTypeStartAddress
=
10
;
const
byte
byX14pReadTypeNumber
=
4
;
static
byte
[]
byX14pIdlist
=
{
17
,
28
,
29
};
modual
.
pcx14P
cx14P
=
new
modual
.
pcx14P
(
byX14pIdlist
);
_414P
c14formulasormual
=
new
_414P
();
const
byte
byX18xNumber
=
6
;
const
byte
byX18xReadDataStartAddress
=
0
;
const
byte
byX18xReadDataNumber
=
8
;
const
byte
byX18xReadTypeStartAddress
=
10
;
const
byte
byX18xReadTypeNumber
=
8
;
static
byte
[]
byX18xIdlist
=
{
12
,
13
,
21
,
25
,
45
,
53
};
static
modual
.
eX18xSensorChannelType
[,]
sX18xChannelType
=
new
modual
.
eX18xSensorChannelType
[
byX18xNumber
,
byX18xReadDataNumber
]{{
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
},
{
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
},
{
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
},
{
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
},
{
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
},
{
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
,
modual
.
eX18xSensorChannelType
.
Normal
}};
modual
.
pcx18X
cx18x
=
new
modual
.
pcx18X
(
byX18xIdlist
,
sX18xChannelType
);
_418X
c18xformulasormual
=
new
_418X
();
const
byte
byX78cNumber
=
6
;
const
byte
byX78cInputRegStartAddress
=
0
;
const
byte
byX78cInputRegNumber
=
8
;
const
byte
byX78cOutputRegStartAddress
=
16
;
const
byte
byX78cOutputRegNumber
=
8
;
static
byte
[]
byX78cIdlist
=
{
11
,
20
,
33
,
34
,
55
,
56
};
modual
.
pcx78C
cx78c
=
new
modual
.
pcx78C
(
byX78cIdlist
);
const
byte
byX66cNumber
=
32
;
const
byte
byX66cRelayRegStartAddress
=
16
;
const
byte
byX66cRelayRegNumber
=
6
;
static
byte
[]
byX66cIdlist
=
{
9
,
10
,
14
,
15
,
16
,
19
,
22
,
23
,
24
,
26
,
30
,
31
,
32
,
35
,
36
,
37
,
38
,
39
,
40
,
41
,
42
,
43
,
44
,
46
,
47
,
48
,
49
,
50
,
51
,
52
,
54
,
57
};
modual
.
pcx66C
cx66c
=
new
modual
.
pcx66C
(
byX66cIdlist
);
void
vAllNodePoll
()
{
for
(
byte
i
=
0
;
i
<
byX14pNumber
;
i
++)
{
string
[][]
sTempString
=
new
string
[
byX14pNumber
][];
ModbusComm
.
Modbus_ReadHoldingRegistersTask
(
out
cx14P
.
sX14pDataStruct
[
i
].
usX14pRegData
,
cx14P
.
byModbusID
[
i
],
byX14pReadDataStartAddress
,
byX14pReadDataNumber
,
out
cx14P
.
ModbusErrorCode
[
i
]);
ModbusComm
.
Modbus_ReadHoldingRegistersTask
(
out
cx14P
.
sX14pDataStruct
[
i
].
usX14pRegType
,
cx14P
.
byModbusID
[
i
],
byX14pReadTypeStartAddress
,
byX14pReadTypeNumber
,
out
cx14P
.
ModbusErrorCode
[
i
]);
sTempString
[
i
]
=
c14formulasormual
.
RtdValue
(
cx14P
.
sX14pDataStruct
[
i
].
usX14pRegData
,
cx14P
.
sX14pDataStruct
[
i
].
usX14pRegType
);
for
(
byte
j
=
0
;
j
<
byX14pReadTypeNumber
;
j
++)
{
cx14P
.
sX14pDataStruct
[
i
].
dX14pConvertData
[
j
]
=
double
.
Parse
(
sTempString
[
i
][
j
]);
}
}
for
(
byte
i
=
0
;
i
<
byX18xNumber
;
i
++)
{
string
[][]
sTempString
=
new
string
[
byX18xNumber
][];
ModbusComm
.
Modbus_ReadHoldingRegistersTask
(
out
cx18x
.
sX18xDataStruct
[
i
].
usRegData
,
cx18x
.
byModbusID
[
i
],
byX18xReadDataStartAddress
,
byX18xReadDataNumber
,
out
cx18x
.
ModbusErrorCode
[
i
]);
ModbusComm
.
Modbus_ReadHoldingRegistersTask
(
out
cx18x
.
sX18xDataStruct
[
i
].
usTypeData
,
cx18x
.
byModbusID
[
i
],
byX18xReadTypeStartAddress
,
byX18xReadTypeNumber
,
out
cx18x
.
ModbusErrorCode
[
i
]);
sTempString
[
i
]
=
c18xformulasormual
.
Value
(
cx14P
.
sX14pDataStruct
[
i
].
usX14pRegData
,
cx14P
.
sX14pDataStruct
[
i
].
usX14pRegType
);
for
(
byte
j
=
0
;
j
<
byX18xReadTypeNumber
;
j
++)
{
if
(
cx18x
.
sX18xDataStruct
[
i
].
eChannelType
[
j
]
==
modual
.
eX18xSensorChannelType
.
Normal
)
cx18x
.
sX18xDataStruct
[
i
].
dConvertData
[
j
]
=
(
double
.
Parse
(
sTempString
[
i
][
j
])-
4
)/
16
*
6
;
}
}
for
(
byte
i
=
0
;
i
<
byX78cNumber
;
i
++)
{
ModbusComm
.
Modbus_ReadCoilsTask
(
out
cx78c
.
sx78CRegDataStructStatus
[
i
].
bInputRegStatus
,
cx78c
.
byModbusID
[
i
],
byX78cInputRegStartAddress
,
byX78cInputRegNumber
,
out
cx78c
.
ModbusErrorCode
[
i
]);
ModbusComm
.
Modbus_ReadCoilsTask
(
out
cx78c
.
sx78CRegDataStructStatus
[
i
].
bOutPutRegStatus
,
cx78c
.
byModbusID
[
i
],
byX78cOutputRegStartAddress
,
byX78cOutputRegNumber
,
out
cx78c
.
ModbusErrorCode
[
i
]);
}
for
(
byte
i
=
0
;
i
<
byX66cNumber
;
i
++)
{
ModbusComm
.
Modbus_ReadCoilsTask
(
out
cx66c
.
sx78CDatastructStatus
[
i
].
bOutPutRegStatus
,
cx66c
.
byModbusID
[
i
],
byX66cRelayRegStartAddress
,
byX66cRelayRegNumber
,
out
cx66c
.
ModbusErrorCode
[
i
]);
}
}
}
}
ModbusDemo/Modular/modual.cs
0 → 100644
View file @
1dfb305f
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
ModbusDemo.MessageFormat
;
namespace
ModbusDemo.Modular
{
class
modual
{
public
struct
psx14p
{
public
ushort
[]
usX14pRegData
;
public
ushort
[]
usX14pRegType
;
public
double
[]
dX14pConvertData
;
}
public
class
pcx14P
{
public
byte
[]
byModbusID
;
public
psx14p
[]
sX14pDataStruct
;
public
ModbusComm
.
eModbusErrorCode
[]
ModbusErrorCode
;
public
pcx14P
(
byte
[]
InitIDlist
)
{
this
.
byModbusID
=
InitIDlist
;
}
}
public
enum
eX18xSensorChannelType
:
byte
{
Normal
=
0
,
Level
,
}
public
struct
psX18x
{
public
ushort
[]
usRegData
;
public
ushort
[]
usTypeData
;
public
eX18xSensorChannelType
[]
eChannelType
;
public
double
[]
dConvertData
;
}
public
class
pcx18X
{
public
byte
[]
byModbusID
;
public
psX18x
[]
sX18xDataStruct
;
public
ModbusComm
.
eModbusErrorCode
[]
ModbusErrorCode
;
public
pcx18X
(
byte
[]
InitIDlist
,
eX18xSensorChannelType
[,]
eChannnelType
)
{
this
.
byModbusID
=
InitIDlist
;
for
(
ushort
i
=
0
;
i
<
eChannnelType
.
GetLength
(
0
);
i
++)
{
for
(
ushort
j
=
0
;
j
<
eChannnelType
.
GetLength
(
1
);
j
++)
{
this
.
sX18xDataStruct
[
i
].
eChannelType
[
j
]
=
eChannnelType
[
i
,
j
];
}
}
}
}
public
struct
psx78C
{
public
bool
[]
bInputRegStatus
;
public
bool
[]
bOutPutRegStatus
;
}
public
class
pcx78C
{
public
byte
[]
byModbusID
;
public
psx78C
[]
sx78CRegDataStructStatus
;
public
ModbusComm
.
eModbusErrorCode
[]
ModbusErrorCode
;
public
pcx78C
(
byte
[]
InitIDlist
)
{
this
.
byModbusID
=
InitIDlist
;
}
}
public
struct
psx66C
{
public
bool
[]
bRegRelayStatus
;
}
public
class
pcx66C
{
public
byte
[]
byModbusID
;
public
psx78C
[]
sx78CDatastructStatus
;
public
ModbusComm
.
eModbusErrorCode
[]
ModbusErrorCode
;
public
pcx66C
(
byte
[]
InitIDlist
)
{
this
.
byModbusID
=
InitIDlist
;
}
}
}
}
ModbusDemo/application/Pond.cs
View file @
1dfb305f
...
...
@@ -77,26 +77,26 @@ namespace ModbusDemo.application
// }
//}
public
class
pcPump
{
public
double
dPumpCurrent
;
public
double
dPumpVoltage
;
public
bool
bPumpStatus
;
public
bool
bPumpHasOpen
;
public
void
vOpen_Pump
()
{
//
public class pcPump
//
{
//
public double dPumpCurrent;
//
public double dPumpVoltage;
//
public bool bPumpStatus;
//
public bool bPumpHasOpen;
//
public void vOpen_Pump()
//
{
}
public
void
vClose_Pump
()
{
//
}
//
public void vClose_Pump()
//
{
}
public
void
vGet_Pump_Status
()
{
//
}
//
public void vGet_Pump_Status()
//
{
}
//
}
}
//
}
public
class
pcTemperatureData
...
...
ModbusDemo/application/PoolModbusSet.cs
View file @
1dfb305f
...
...
@@ -18,7 +18,6 @@ namespace ModbusDemo.application
this
.
usTypeRegAddress
=
usSetRegAddress
;
}
}
public
struct
psLevelData
{
public
byte
byModbusID
;
...
...
@@ -31,7 +30,6 @@ namespace ModbusDemo.application
this
.
usTypeAddressList
=
usDataTypeRegAddress
;
}
}
public
struct
psBumpOperation
{
public
byte
byModbusID
;
...
...
@@ -44,7 +42,6 @@ namespace ModbusDemo.application
this
.
bOpenStatus
=
bInitOPen
;
}
}
public
struct
psPumbData
{
public
byte
byModbusID
;
...
...
@@ -55,7 +52,6 @@ namespace ModbusDemo.application
this
.
usRegAddList
=
usInitRegAddressInit
;
}
}
public
struct
psAgitatorOperation
{
public
byte
byModbusID
;
...
...
@@ -68,7 +64,6 @@ namespace ModbusDemo.application
this
.
bOpenStatus
=
bInitOPen
;
}
}
public
struct
psAgitatorData
{
public
byte
byModbusID
;
...
...
@@ -147,10 +142,10 @@ namespace ModbusDemo.application
}
public
class
pcBump
{
private
double
[]
dBumpCurrent
=
new
double
[
pcPoolInit
.
PoolBumpCurrentNumber
]
{
pcPoolInit
.
cPumbCurrent
[
0
].
vRead_Pumb_Data
()};
public
double
[]
dBumpVoltage
=
new
double
[
pcPoolInit
.
PoolBumpVoltageNumber
]
{
pcPoolInit
.
cPumbVoltage
[
0
].
vRead_Pumb_Data
()}
;
public
bool
[]
bBumpStatus
=
new
bool
[
pcPoolInit
.
PoolBumpOperatNumber
];
public
bool
[]
bpcBumpHasOpen
=
new
bool
[
pcPoolInit
.
PoolBumpOperatNumber
];
private
double
[]
dBumpCurrent
=
new
double
[
pcPoolInit
.
PoolBumpCurrentNumber
]
{
pcPoolInit
.
cPumbCurrent
[
0
].
vRead_Pumb_Data
()};
public
double
[]
dBumpVoltage
=
new
double
[
pcPoolInit
.
PoolBumpVoltageNumber
]
{
pcPoolInit
.
cPumbVoltage
[
0
].
vRead_Pumb_Data
()}
;
public
bool
[]
bBumpStatus
=
new
bool
[
pcPoolInit
.
PoolBumpOperatNumber
];
public
bool
[]
bpcBumpHasOpen
=
new
bool
[
pcPoolInit
.
PoolBumpOperatNumber
];
public
void
vOpen_Bump
(
ushort
usPumbNumber
)
...
...
@@ -164,7 +159,7 @@ namespace ModbusDemo.application
}
catch
(
Exception
exception
)
{
Form1
.
totxt
.
Log
(
"Bump Open Operation Error"
);
Form1
.
totxt
.
Log
(
exception
+
"Bump Open Operation Error"
);
throw
;
}
}
...
...
@@ -182,7 +177,7 @@ namespace ModbusDemo.application
}
catch
(
Exception
exception
)
{
Form1
.
totxt
.
Log
(
"Bump Close Operation Error"
);
Form1
.
totxt
.
Log
(
exception
+
"Bump Close Operation Error"
);
throw
;
}
}
...
...
@@ -195,21 +190,19 @@ namespace ModbusDemo.application
}
catch
(
Exception
exception
)
{
Form1
.
totxt
.
Log
(
"Bump Read Status Error"
);
Form1
.
totxt
.
Log
(
exception
+
"Bump Read Status Error"
);
throw
;
}
}
}
public
class
pcAgitator
{
private
double
[]
dAgitatorCurrent
=
new
double
[
pcPoolInit
.
PoolAgitatorCurrentNumber
]
{
pcPoolInit
.
cAgitatorCurrent
[
0
].
vRead_Agitator_Data
()
};
public
double
[]
dAgitatorVoltage
=
new
double
[
pcPoolInit
.
PoolAgitatorVoltageNumber
]
{
pcPoolInit
.
cAgitatorVoltage
[
0
].
vRead_Agitator_Data
()
};
public
bool
[]
bAgitatorStatus
=
new
bool
[
pcPoolInit
.
PoolBumpOperatNumber
];
public
bool
[]
bAgitatorHasOpen
=
new
bool
[
pcPoolInit
.
PoolBumpOperatNumber
];
private
double
[]
dAgitatorCurrent
=
new
double
[
pcPoolInit
.
PoolAgitatorCurrentNumber
]
{
pcPoolInit
.
cAgitatorCurrent
[
0
].
vRead_Agitator_Data
()
};
public
double
[]
dAgitatorVoltage
=
new
double
[
pcPoolInit
.
PoolAgitatorVoltageNumber
]
{
pcPoolInit
.
cAgitatorVoltage
[
0
].
vRead_Agitator_Data
()
};
public
bool
[]
bAgitatorStatus
=
new
bool
[
pcPoolInit
.
PoolBumpOperatNumber
];
public
bool
[]
bAgitatorHasOpen
=
new
bool
[
pcPoolInit
.
PoolBumpOperatNumber
];
public
void
vOpen_
Bump
(
ushort
usAgitatorNumber
)
public
void
vOpen_
Agitator
(
ushort
usAgitatorNumber
)
{
try
{
...
...
@@ -220,11 +213,11 @@ namespace ModbusDemo.application
}
catch
(
Exception
exception
)
{
Form1
.
totxt
.
Log
(
"Agitator Open Operation Error"
);
Form1
.
totxt
.
Log
(
exception
+
"Agitator Open Operation Error"
);
throw
;
}
}
public
void
vClose_
Bump
(
ushort
usAgitatorNumber
)
public
void
vClose_
Agitator
(
ushort
usAgitatorNumber
)
{
try
{
...
...
@@ -238,12 +231,12 @@ namespace ModbusDemo.application
}
catch
(
Exception
exception
)
{
Form1
.
totxt
.
Log
(
"Agitator Close Operation Error"
);
Form1
.
totxt
.
Log
(
exception
+
"Agitator Close Operation Error"
);
throw
;
}
}
public
bool
[]
vGet_
Pumb
_Status
(
ushort
usAgitatorNumber
)
public
bool
[]
vGet_
Agitator
_Status
(
ushort
usAgitatorNumber
)
{
try
{
...
...
@@ -251,13 +244,11 @@ namespace ModbusDemo.application
}
catch
(
Exception
exception
)
{
Form1
.
totxt
.
Log
(
"Agitator Read Status Error"
);
Form1
.
totxt
.
Log
(
exception
+
"Agitator Read Status Error"
);
throw
;
}
}
}
public
class
pcPool
{
public
string
ePondName
;
...
...
@@ -268,14 +259,13 @@ namespace ModbusDemo.application
public
double
dMaxTemper
;
public
double
dMinTemper
;
public
pc
Pump
cP
ump
;
public
pc
Bump
cB
ump
;
public
pcAgitator
cAgitator
;
public
double
dPondCurrentLevel
{
get
=>
pcPoolInit
.
Get_Current_Level
();
}
public
double
dPondCurentTemper
{
get
=>
pcPoolInit
.
Get_Current_temper
();
}
public
pcPool
(
string
eInitPondName
)
{
this
.
ePondName
=
eInitPondName
;
}
}
}
ModbusDemo/windows/Form1.Designer.cs
View file @
1dfb305f
...
...
@@ -59,6 +59,8 @@
this
.
label4
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
button2
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
SubscribeBut
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
label5
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label6
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
updateops
.
SuspendLayout
();
this
.
SuspendLayout
();
//
...
...
@@ -327,7 +329,7 @@
//
this
.
label2
.
AutoSize
=
true
;
this
.
label2
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
label2
.
Location
=
new
System
.
Drawing
.
Point
(
44
,
4
92
);
this
.
label2
.
Location
=
new
System
.
Drawing
.
Point
(
44
,
4
87
);
this
.
label2
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
4
,
0
,
4
,
0
);
this
.
label2
.
Name
=
"label2"
;
this
.
label2
.
Size
=
new
System
.
Drawing
.
Size
(
69
,
20
);
...
...
@@ -347,7 +349,7 @@
// label4
//
this
.
label4
.
AutoSize
=
true
;
this
.
label4
.
Location
=
new
System
.
Drawing
.
Point
(
108
,
49
8
);
this
.
label4
.
Location
=
new
System
.
Drawing
.
Point
(
108
,
49
2
);
this
.
label4
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
4
,
0
,
4
,
0
);
this
.
label4
.
Name
=
"label4"
;
this
.
label4
.
Size
=
new
System
.
Drawing
.
Size
(
55
,
15
);
...
...
@@ -376,11 +378,31 @@
this
.
SubscribeBut
.
UseVisualStyleBackColor
=
true
;
this
.
SubscribeBut
.
Click
+=
new
System
.
EventHandler
(
this
.
SubscribeBut_Click
);
//
// label5
//
this
.
label5
.
AutoSize
=
true
;
this
.
label5
.
Location
=
new
System
.
Drawing
.
Point
(
111
,
528
);
this
.
label5
.
Name
=
"label5"
;
this
.
label5
.
Size
=
new
System
.
Drawing
.
Size
(
55
,
15
);
this
.
label5
.
TabIndex
=
99
;
this
.
label5
.
Text
=
"label5"
;
//
// label6
//
this
.
label6
.
AutoSize
=
true
;
this
.
label6
.
Location
=
new
System
.
Drawing
.
Point
(
23
,
528
);
this
.
label6
.
Name
=
"label6"
;
this
.
label6
.
Size
=
new
System
.
Drawing
.
Size
(
82
,
15
);
this
.
label6
.
TabIndex
=
100
;
this
.
label6
.
Text
=
"超时次数:"
;
//
// Form1
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
8F
,
15F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
1184
,
672
);
this
.
Controls
.
Add
(
this
.
label6
);
this
.
Controls
.
Add
(
this
.
label5
);
this
.
Controls
.
Add
(
this
.
SubscribeBut
);
this
.
Controls
.
Add
(
this
.
button2
);
this
.
Controls
.
Add
(
this
.
label4
);
...
...
@@ -445,5 +467,7 @@
private
System
.
Windows
.
Forms
.
Label
label4
;
private
System
.
Windows
.
Forms
.
Button
button2
;
private
System
.
Windows
.
Forms
.
Button
SubscribeBut
;
private
System
.
Windows
.
Forms
.
Label
label5
;
private
System
.
Windows
.
Forms
.
Label
label6
;
}
}
\ No newline at end of file
ModbusDemo/windows/Form1.cs
View file @
1dfb305f
This diff is collapsed.
Click to expand it.
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