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
bfcd89ac
Commit
bfcd89ac
authored
Jun 20, 2019
by
shaxuezheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注释 自动控制
parent
5c95addb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
14 deletions
+9
-14
Form1.cs
ModbusDemo/windows/Form1.cs
+9
-14
No files found.
ModbusDemo/windows/Form1.cs
View file @
bfcd89ac
...
...
@@ -289,11 +289,11 @@ namespace ModbusDemo
//Reconnecting
if
(
isReconnect
)
{
Invoke
((
new
Action
(()
=>
Invoke
((
new
Action
(
async
()
=>
{
txtReceiveMessage
.
AppendText
(
"正在尝试重新连接"
+
Environment
.
NewLine
);
totxt
.
Log
(
"正在尝试重新连接"
+
Environment
.
NewLine
);
await
Subscribe
();
//Console.WriteLine("正在尝试重新连接" + Environment.NewLine);
})));
...
...
@@ -1061,17 +1061,12 @@ namespace ModbusDemo
ModbusComm
.
Modbus
.
Transport
.
ReadTimeout
=
1000
;
ModbusComm
.
Modbus
.
Transport
.
WriteTimeout
=
1000
;
ModbusComm
.
Modbus
.
Transport
.
WaitToRetryMilliseconds
=
0
;
<<<<<<<
HEAD
//t_AutoControl = new Thread(T_AutoControl);
//t_AutoControl.IsBackground = true;
//t_AutoControl.Start();
=======
//t_AutoControl = new Thread(T_AutoControl
)
//
{
//
IsBackground = true
//
};
//
t_AutoControl.Start();
t_AutoControl
=
new
Thread
(
AtuoControl_run
)
{
IsBackground
=
true
};
t_AutoControl
.
Start
();
modbus_Timer
.
Enabled
=
true
;
btOpenCOM
.
Enabled
=
false
;
...
...
@@ -1110,7 +1105,7 @@ namespace ModbusDemo
}
private
async
void
run
()
{
comPort
.
PortName
=
"COM
6
"
;
comPort
.
PortName
=
"COM
1
"
;
comPort
.
BaudRate
=
9600
;
comPort
.
Parity
=
Parity
.
None
;
comPort
.
StopBits
=
StopBits
.
One
;
...
...
@@ -1130,7 +1125,7 @@ namespace ModbusDemo
ModbusComm
.
Modbus
.
Transport
.
WriteTimeout
=
1000
;
ModbusComm
.
Modbus
.
Transport
.
WaitToRetryMilliseconds
=
0
;
//t_AutoControl = new Thread(
T_AutoControl
)
//t_AutoControl = new Thread(
AtuoControl_run
)
//{
// IsBackground = true
//};
...
...
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