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
23d54b9c
Commit
23d54b9c
authored
Jun 05, 2019
by
shaxuezheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit tempe modify
parent
e70d8cea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
33 deletions
+2
-33
Form1.cs
ModbusDemo/windows/Form1.cs
+2
-33
No files found.
ModbusDemo/windows/Form1.cs
View file @
23d54b9c
...
@@ -466,7 +466,7 @@ namespace ModbusDemo
...
@@ -466,7 +466,7 @@ namespace ModbusDemo
}
}
ID
=
ctrl
.
ss
[
0
].
getAddr
();
ID
=
ctrl
.
ss
[
0
].
getAddr
();
Modbus_polling
();
ctrl_Back
.
taskId
=
ctrl
.
taskId
.
ToString
();
ctrl_Back
.
taskId
=
ctrl
.
taskId
.
ToString
();
ctrl_Back_ss
[
0
]
=
ctrl
.
ss
[
0
];
ctrl_Back_ss
[
0
]
=
ctrl
.
ss
[
0
];
...
@@ -488,6 +488,7 @@ namespace ModbusDemo
...
@@ -488,6 +488,7 @@ namespace ModbusDemo
{
{
control
(
ctrl
.
ss
[
0
].
getAddr
(),
address
,
on_off
);
//根据下发确定控制通道
control
(
ctrl
.
ss
[
0
].
getAddr
(),
address
,
on_off
);
//根据下发确定控制通道
mqttData_Back
=
JsonConvert
.
SerializeObject
(
ctrl2
);
mqttData_Back
=
JsonConvert
.
SerializeObject
(
ctrl2
);
Modbus_polling
();
await
Publish
();
await
Publish
();
await
Back
();
await
Back
();
}
}
...
@@ -1723,38 +1724,6 @@ namespace ModbusDemo
...
@@ -1723,38 +1724,6 @@ namespace ModbusDemo
comPort
.
Close
();
comPort
.
Close
();
totxt
.
Log
(
DateTime
.
Now
.
ToString
()
+
" =>Disconnect "
+
comPort
.
PortName
);
totxt
.
Log
(
DateTime
.
Now
.
ToString
()
+
" =>Disconnect "
+
comPort
.
PortName
);
}
}
public
class
ThreadDemoClass
{
public
void
Run1
(
object
obj
)
{
#
region
注释部分
//string name = obj as string;
//Console.WriteLine();
//Console.WriteLine("Child thread working...");
//Console.WriteLine("My name is " + name);
//Console.WriteLine("Child thread ID is:" + Thread.CurrentThread.ManagedThreadId.ToString());
#
endregion
}
public
void
Run2
(
object
obj
)
{
#
region
注释部分
//UserInfo userInfo = (UserInfo)obj;
//Console.WriteLine();
//Console.WriteLine("Child thread working...");
//Console.WriteLine("My name is " + userInfo.Name);
//Console.WriteLine("I'm " + userInfo.Age + " years old this year");
//Console.WriteLine("Child thread ID is:" + Thread.CurrentThread.ManagedThreadId.ToString());
#
endregion
}
}
}
}
...
...
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