Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hemei
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
潘栩锋
hemei
Commits
990c4363
Commit
990c4363
authored
Apr 27, 2024
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加倍加德旋转模拟
parent
4775ef6f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
0 deletions
+79
-0
BeiJiaDePlc.cs
...ct.BlowingSimulator/FLY.Simulation.Blowing/BeiJiaDePlc.cs
+78
-0
FLY.Simulation.Blowing.csproj
...ator/FLY.Simulation.Blowing/FLY.Simulation.Blowing.csproj
+1
-0
No files found.
Project.FLY.Thick.BlowingScan/Project.BlowingSimulator/FLY.Simulation.Blowing/BeiJiaDePlc.cs
0 → 100644
View file @
990c4363
using
HslCommunication.Profinet.FATEK
;
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Linq
;
using
System.Net
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Threading
;
namespace
FLY.Simulation.Blowing
{
public
class
BeiJiaDePlc
:
INotifyPropertyChanged
{
public
event
PropertyChangedEventHandler
PropertyChanged
;
/// <summary>
/// int16 角度 x10
/// </summary>
const
string
ADDR_Angle
=
"D98"
;
/// <summary>
/// PLC 地址 及 端口
/// </summary>
public
int
Port
{
get
;
set
;
}
=
500
;
/// <summary>
/// 方向反转
/// </summary>
public
bool
IsReversed
{
get
;
set
;
}
=
true
;
/// <summary>
/// 站号
/// </summary>
public
byte
Station
{
get
;
set
;
}
=
2
;
public
Int16
Angle
{
get
;
set
;
}
FatekProgramServer
fatekProgramServer
;
Blowing
blowing
;
Blowing
.
AirRing
airRing
;
DispatcherTimer
timer
;
public
BeiJiaDePlc
()
{
}
//11.0.2 版本后,都是下面的激活码
public
void
Init
(
Blowing
blowing
)
{
this
.
blowing
=
blowing
;
// 授权示例 Authorization example
//11.0.2 版本后,都是下面的激活码
if
(!
HslCommunication
.
Authorization
.
SetAuthorizationCode
(
"e30dcfe8-f4e1-45d3-9aca-9ac8fa0787b1"
))
{
throw
new
Exception
(
"激活失败! 当前程序只能连续运行8个小时!"
);
}
fatekProgramServer
=
new
FatekProgramServer
()
{
Port
=
Port
,
Station
=
Station
};
fatekProgramServer
.
ServerStart
();
Misc
.
BindingOperations
.
SetBinding
(
this
,
nameof
(
Angle
),
()
=>
{
fatekProgramServer
.
Write
(
ADDR_Angle
,
Angle
);
});
Misc
.
BindingOperations
.
SetBinding
(
blowing
,
nameof
(
blowing
.
CurrAngle
),
updateAngle
);
}
private
void
updateAngle
()
{
Angle
=
(
Int16
)(
blowing
.
CurrAngle
*
10
);
}
}
}
Project.FLY.Thick.BlowingScan/Project.BlowingSimulator/FLY.Simulation.Blowing/FLY.Simulation.Blowing.csproj
View file @
990c4363
...
...
@@ -44,6 +44,7 @@
<Reference
Include=
"WindowsBase"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"BeiJiaDePlc.cs"
/>
<Compile
Include=
"Blowing.cs"
/>
<Compile
Include=
"FilmLength3D.cs"
/>
<Compile
Include=
"GageAD.cs"
/>
...
...
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