Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
HuichuanLibrary
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 8566b42c
由
LN
编写于
2021-02-19 15:22:53 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加模拟量查询代码
1 个父辈
1c0fb29d
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
404 行增加
和
4 行删除
DemoTest/DemoTest.csproj
DemoTest/packages.config
HuichuanLibrary/FrmHuiChuanTest.Designer.cs
HuichuanLibrary/FrmHuiChuanTest.cs
HuichuanLibrary/HCBoardManager.cs
DemoTest/DemoTest.csproj
查看文件 @
8566b42
...
@@ -37,12 +37,13 @@
...
@@ -37,12 +37,13 @@
<ApplicationIcon>DfIcon.ico</ApplicationIcon>
<ApplicationIcon>DfIcon.ico</ApplicationIcon>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<Reference Include="log4net">
<Reference Include="log4net
, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL
">
<HintPath>..\
dll
\log4net.dll</HintPath>
<HintPath>..\
packages\log4net.2.0.12\lib\net45
\log4net.dll</HintPath>
</Reference>
</Reference>
<Reference Include="System" />
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data.DataSetExtensions" />
...
@@ -66,6 +67,7 @@
...
@@ -66,6 +67,7 @@
<AutoGen>True</AutoGen>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
...
...
DemoTest/packages.config
0 → 100644
查看文件 @
8566b42
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
package
id
=
"log4net"
version
=
"2.0.12"
targetFramework
=
"net461"
/>
</
packages
>
\ No newline at end of file
\ No newline at end of file
HuichuanLibrary/FrmHuiChuanTest.Designer.cs
查看文件 @
8566b42
...
@@ -183,6 +183,26 @@
...
@@ -183,6 +183,26 @@
this
.
lblDI3
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblDI3
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblDI2
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblDI2
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblDI1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblDI1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
tabPage3
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
groupBox5
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
lblAdSts
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
txtAdSts4
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label11
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
txtAd4
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label12
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
txtAdSts3
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label9
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
txtAd3
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label10
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
txtAdSts2
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label5
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
txtAd2
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label8
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnAdGet
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
txtAdSts1
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label7
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
txtAd1
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label6
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnCloseBoard
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnCloseBoard
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnInitBoard
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnInitBoard
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
groupBoard
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
groupBoard
=
new
System
.
Windows
.
Forms
.
GroupBox
();
...
@@ -206,6 +226,8 @@
...
@@ -206,6 +226,8 @@
this
.
groupBox10
.
SuspendLayout
();
this
.
groupBox10
.
SuspendLayout
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numBitIndex
)).
BeginInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numBitIndex
)).
BeginInit
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
this
.
tabPage3
.
SuspendLayout
();
this
.
groupBox5
.
SuspendLayout
();
this
.
groupBoard
.
SuspendLayout
();
this
.
groupBoard
.
SuspendLayout
();
this
.
SuspendLayout
();
this
.
SuspendLayout
();
//
//
...
@@ -292,6 +314,7 @@
...
@@ -292,6 +314,7 @@
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)));
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)));
this
.
tabControl1
.
Controls
.
Add
(
this
.
tabPage1
);
this
.
tabControl1
.
Controls
.
Add
(
this
.
tabPage1
);
this
.
tabControl1
.
Controls
.
Add
(
this
.
tabPage2
);
this
.
tabControl1
.
Controls
.
Add
(
this
.
tabPage2
);
this
.
tabControl1
.
Controls
.
Add
(
this
.
tabPage3
);
this
.
tabControl1
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
113
);
this
.
tabControl1
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
113
);
this
.
tabControl1
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
tabControl1
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
tabControl1
.
Name
=
"tabControl1"
;
this
.
tabControl1
.
Name
=
"tabControl1"
;
...
@@ -1305,7 +1328,7 @@
...
@@ -1305,7 +1328,7 @@
this
.
tabPage2
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
tabPage2
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
tabPage2
.
Size
=
new
System
.
Drawing
.
Size
(
750
,
562
);
this
.
tabPage2
.
Size
=
new
System
.
Drawing
.
Size
(
750
,
562
);
this
.
tabPage2
.
TabIndex
=
1
;
this
.
tabPage2
.
TabIndex
=
1
;
this
.
tabPage2
.
Text
=
"
IO控制测试
"
;
this
.
tabPage2
.
Text
=
"
数字量IO
"
;
//
//
// groupBox9
// groupBox9
//
//
...
@@ -2014,6 +2037,217 @@
...
@@ -2014,6 +2037,217 @@
this
.
lblDI1
.
Text
=
"DI"
;
this
.
lblDI1
.
Text
=
"DI"
;
this
.
lblDI1
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
this
.
lblDI1
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
//
//
// tabPage3
//
this
.
tabPage3
.
Controls
.
Add
(
this
.
groupBox5
);
this
.
tabPage3
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
26
);
this
.
tabPage3
.
Name
=
"tabPage3"
;
this
.
tabPage3
.
Size
=
new
System
.
Drawing
.
Size
(
750
,
558
);
this
.
tabPage3
.
TabIndex
=
2
;
this
.
tabPage3
.
Text
=
" 模拟量AIO "
;
this
.
tabPage3
.
UseVisualStyleBackColor
=
true
;
//
// groupBox5
//
this
.
groupBox5
.
Controls
.
Add
(
this
.
lblAdSts
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
txtAdSts4
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
label11
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
txtAd4
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
label12
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
txtAdSts3
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
label9
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
txtAd3
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
label10
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
txtAdSts2
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
label5
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
txtAd2
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
label8
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
btnAdGet
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
txtAdSts1
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
label7
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
txtAd1
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
label6
);
this
.
groupBox5
.
Location
=
new
System
.
Drawing
.
Point
(
7
,
3
);
this
.
groupBox5
.
Name
=
"groupBox5"
;
this
.
groupBox5
.
Size
=
new
System
.
Drawing
.
Size
(
735
,
277
);
this
.
groupBox5
.
TabIndex
=
3
;
this
.
groupBox5
.
TabStop
=
false
;
this
.
groupBox5
.
Text
=
"读取测试"
;
//
// lblAdSts
//
this
.
lblAdSts
.
ForeColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
192
)))),
((
int
)(((
byte
)(
0
)))),
((
int
)(((
byte
)(
0
)))));
this
.
lblAdSts
.
Location
=
new
System
.
Drawing
.
Point
(
372
,
29
);
this
.
lblAdSts
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
,
0
,
2
,
0
);
this
.
lblAdSts
.
Name
=
"lblAdSts"
;
this
.
lblAdSts
.
Size
=
new
System
.
Drawing
.
Size
(
354
,
202
);
this
.
lblAdSts
.
TabIndex
=
31
;
this
.
lblAdSts
.
Text
=
"通道1值:"
;
//
// txtAdSts4
//
this
.
txtAdSts4
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
txtAdSts4
.
Location
=
new
System
.
Drawing
.
Point
(
259
,
159
);
this
.
txtAdSts4
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
txtAdSts4
.
Name
=
"txtAdSts4"
;
this
.
txtAdSts4
.
Size
=
new
System
.
Drawing
.
Size
(
85
,
26
);
this
.
txtAdSts4
.
TabIndex
=
30
;
//
// label11
//
this
.
label11
.
AutoSize
=
true
;
this
.
label11
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
164
);
this
.
label11
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
,
0
,
2
,
0
);
this
.
label11
.
Name
=
"label11"
;
this
.
label11
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
17
);
this
.
label11
.
TabIndex
=
29
;
this
.
label11
.
Text
=
"通道1状态:"
;
//
// txtAd4
//
this
.
txtAd4
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
txtAd4
.
Location
=
new
System
.
Drawing
.
Point
(
82
,
159
);
this
.
txtAd4
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
txtAd4
.
Name
=
"txtAd4"
;
this
.
txtAd4
.
Size
=
new
System
.
Drawing
.
Size
(
85
,
26
);
this
.
txtAd4
.
TabIndex
=
28
;
//
// label12
//
this
.
label12
.
AutoSize
=
true
;
this
.
label12
.
Location
=
new
System
.
Drawing
.
Point
(
11
,
164
);
this
.
label12
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
,
0
,
2
,
0
);
this
.
label12
.
Name
=
"label12"
;
this
.
label12
.
Size
=
new
System
.
Drawing
.
Size
(
63
,
17
);
this
.
label12
.
TabIndex
=
27
;
this
.
label12
.
Text
=
"通道1值:"
;
//
// txtAdSts3
//
this
.
txtAdSts3
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
txtAdSts3
.
Location
=
new
System
.
Drawing
.
Point
(
259
,
117
);
this
.
txtAdSts3
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
txtAdSts3
.
Name
=
"txtAdSts3"
;
this
.
txtAdSts3
.
Size
=
new
System
.
Drawing
.
Size
(
85
,
26
);
this
.
txtAdSts3
.
TabIndex
=
26
;
//
// label9
//
this
.
label9
.
AutoSize
=
true
;
this
.
label9
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
122
);
this
.
label9
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
,
0
,
2
,
0
);
this
.
label9
.
Name
=
"label9"
;
this
.
label9
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
17
);
this
.
label9
.
TabIndex
=
25
;
this
.
label9
.
Text
=
"通道1状态:"
;
//
// txtAd3
//
this
.
txtAd3
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
txtAd3
.
Location
=
new
System
.
Drawing
.
Point
(
82
,
117
);
this
.
txtAd3
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
txtAd3
.
Name
=
"txtAd3"
;
this
.
txtAd3
.
Size
=
new
System
.
Drawing
.
Size
(
85
,
26
);
this
.
txtAd3
.
TabIndex
=
24
;
//
// label10
//
this
.
label10
.
AutoSize
=
true
;
this
.
label10
.
Location
=
new
System
.
Drawing
.
Point
(
11
,
122
);
this
.
label10
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
,
0
,
2
,
0
);
this
.
label10
.
Name
=
"label10"
;
this
.
label10
.
Size
=
new
System
.
Drawing
.
Size
(
63
,
17
);
this
.
label10
.
TabIndex
=
23
;
this
.
label10
.
Text
=
"通道1值:"
;
//
// txtAdSts2
//
this
.
txtAdSts2
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
txtAdSts2
.
Location
=
new
System
.
Drawing
.
Point
(
259
,
74
);
this
.
txtAdSts2
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
txtAdSts2
.
Name
=
"txtAdSts2"
;
this
.
txtAdSts2
.
Size
=
new
System
.
Drawing
.
Size
(
85
,
26
);
this
.
txtAdSts2
.
TabIndex
=
22
;
//
// label5
//
this
.
label5
.
AutoSize
=
true
;
this
.
label5
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
79
);
this
.
label5
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
,
0
,
2
,
0
);
this
.
label5
.
Name
=
"label5"
;
this
.
label5
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
17
);
this
.
label5
.
TabIndex
=
21
;
this
.
label5
.
Text
=
"通道1状态:"
;
//
// txtAd2
//
this
.
txtAd2
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
txtAd2
.
Location
=
new
System
.
Drawing
.
Point
(
82
,
74
);
this
.
txtAd2
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
txtAd2
.
Name
=
"txtAd2"
;
this
.
txtAd2
.
Size
=
new
System
.
Drawing
.
Size
(
85
,
26
);
this
.
txtAd2
.
TabIndex
=
20
;
//
// label8
//
this
.
label8
.
AutoSize
=
true
;
this
.
label8
.
Location
=
new
System
.
Drawing
.
Point
(
11
,
79
);
this
.
label8
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
,
0
,
2
,
0
);
this
.
label8
.
Name
=
"label8"
;
this
.
label8
.
Size
=
new
System
.
Drawing
.
Size
(
63
,
17
);
this
.
label8
.
TabIndex
=
19
;
this
.
label8
.
Text
=
"通道1值:"
;
//
// btnAdGet
//
this
.
btnAdGet
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnAdGet
.
Location
=
new
System
.
Drawing
.
Point
(
179
,
226
);
this
.
btnAdGet
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
btnAdGet
.
Name
=
"btnAdGet"
;
this
.
btnAdGet
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
35
);
this
.
btnAdGet
.
TabIndex
=
18
;
this
.
btnAdGet
.
Text
=
"查询"
;
this
.
btnAdGet
.
UseVisualStyleBackColor
=
true
;
this
.
btnAdGet
.
Click
+=
new
System
.
EventHandler
(
this
.
btnAdGet_Click
);
//
// txtAdSts1
//
this
.
txtAdSts1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
txtAdSts1
.
Location
=
new
System
.
Drawing
.
Point
(
259
,
32
);
this
.
txtAdSts1
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
txtAdSts1
.
Name
=
"txtAdSts1"
;
this
.
txtAdSts1
.
Size
=
new
System
.
Drawing
.
Size
(
85
,
26
);
this
.
txtAdSts1
.
TabIndex
=
17
;
//
// label7
//
this
.
label7
.
AutoSize
=
true
;
this
.
label7
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
37
);
this
.
label7
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
,
0
,
2
,
0
);
this
.
label7
.
Name
=
"label7"
;
this
.
label7
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
17
);
this
.
label7
.
TabIndex
=
16
;
this
.
label7
.
Text
=
"通道1状态:"
;
//
// txtAd1
//
this
.
txtAd1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
txtAd1
.
Location
=
new
System
.
Drawing
.
Point
(
82
,
32
);
this
.
txtAd1
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
txtAd1
.
Name
=
"txtAd1"
;
this
.
txtAd1
.
Size
=
new
System
.
Drawing
.
Size
(
85
,
26
);
this
.
txtAd1
.
TabIndex
=
13
;
//
// label6
//
this
.
label6
.
AutoSize
=
true
;
this
.
label6
.
Location
=
new
System
.
Drawing
.
Point
(
11
,
37
);
this
.
label6
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
,
0
,
2
,
0
);
this
.
label6
.
Name
=
"label6"
;
this
.
label6
.
Size
=
new
System
.
Drawing
.
Size
(
63
,
17
);
this
.
label6
.
TabIndex
=
1
;
this
.
label6
.
Text
=
"通道1值:"
;
//
// btnCloseBoard
// btnCloseBoard
//
//
this
.
btnCloseBoard
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnCloseBoard
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
...
@@ -2149,6 +2383,9 @@
...
@@ -2149,6 +2383,9 @@
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numBitIndex
)).
EndInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numBitIndex
)).
EndInit
();
this
.
groupBox1
.
ResumeLayout
(
false
);
this
.
groupBox1
.
ResumeLayout
(
false
);
this
.
groupBox1
.
PerformLayout
();
this
.
groupBox1
.
PerformLayout
();
this
.
tabPage3
.
ResumeLayout
(
false
);
this
.
groupBox5
.
ResumeLayout
(
false
);
this
.
groupBox5
.
PerformLayout
();
this
.
groupBoard
.
ResumeLayout
(
false
);
this
.
groupBoard
.
ResumeLayout
(
false
);
this
.
groupBoard
.
PerformLayout
();
this
.
groupBoard
.
PerformLayout
();
this
.
ResumeLayout
(
false
);
this
.
ResumeLayout
(
false
);
...
@@ -2318,5 +2555,25 @@
...
@@ -2318,5 +2555,25 @@
private
System
.
Windows
.
Forms
.
Timer
timerMain
;
private
System
.
Windows
.
Forms
.
Timer
timerMain
;
private
System
.
Windows
.
Forms
.
RadioButton
radioButton2
;
private
System
.
Windows
.
Forms
.
RadioButton
radioButton2
;
private
System
.
Windows
.
Forms
.
RadioButton
radioButton1
;
private
System
.
Windows
.
Forms
.
RadioButton
radioButton1
;
private
System
.
Windows
.
Forms
.
TabPage
tabPage3
;
private
System
.
Windows
.
Forms
.
GroupBox
groupBox5
;
private
System
.
Windows
.
Forms
.
TextBox
txtAdSts4
;
private
System
.
Windows
.
Forms
.
Label
label11
;
private
System
.
Windows
.
Forms
.
TextBox
txtAd4
;
private
System
.
Windows
.
Forms
.
Label
label12
;
private
System
.
Windows
.
Forms
.
TextBox
txtAdSts3
;
private
System
.
Windows
.
Forms
.
Label
label9
;
private
System
.
Windows
.
Forms
.
TextBox
txtAd3
;
private
System
.
Windows
.
Forms
.
Label
label10
;
private
System
.
Windows
.
Forms
.
TextBox
txtAdSts2
;
private
System
.
Windows
.
Forms
.
Label
label5
;
private
System
.
Windows
.
Forms
.
TextBox
txtAd2
;
private
System
.
Windows
.
Forms
.
Label
label8
;
private
System
.
Windows
.
Forms
.
Button
btnAdGet
;
private
System
.
Windows
.
Forms
.
TextBox
txtAdSts1
;
private
System
.
Windows
.
Forms
.
Label
label7
;
private
System
.
Windows
.
Forms
.
TextBox
txtAd1
;
private
System
.
Windows
.
Forms
.
Label
label6
;
private
System
.
Windows
.
Forms
.
Label
lblAdSts
;
}
}
}
}
\ No newline at end of file
\ No newline at end of file
HuichuanLibrary/FrmHuiChuanTest.cs
查看文件 @
8566b42
...
@@ -87,7 +87,18 @@ namespace HuichuanLibrary
...
@@ -87,7 +87,18 @@ namespace HuichuanLibrary
FormStatus
(
false
);
FormStatus
(
false
);
timerIO
.
Start
();
timerIO
.
Start
();
timerMain
.
Start
();
timerMain
.
Start
();
HCLogUtil
.
logBox
=
richTextBox1
;
lblAdSts
.
Text
=
"状态说明:\r\n"
+
"Bit0 ,负载电压故障,0:正常,1:未接入外部电源\r\n"
+
"Bit1 ,模拟芯片连接错误,0:正常,1:数字版与模拟板通讯错误\r\n"
+
"Bit2:通道故障\r\n"
+
"Bit3:通道上溢\r\n"
+
"Bit4:通道下溢\r\n"
+
"Bit5:通道超上限\r\n"
+
"Bit6:通道超下限\r\n"
+
"Bit7:通道断线\r\n"
;
HCLogUtil
.
logBox
=
richTextBox1
;
}
}
private
void
btnInitBoard_Click
(
object
sender
,
EventArgs
e
)
private
void
btnInitBoard_Click
(
object
sender
,
EventArgs
e
)
{
{
...
@@ -611,6 +622,31 @@ namespace HuichuanLibrary
...
@@ -611,6 +622,31 @@ namespace HuichuanLibrary
timerIO
.
Enabled
=
isOk
;
timerIO
.
Enabled
=
isOk
;
axStsMonitor_timer
.
Enabled
=
isOk
;
axStsMonitor_timer
.
Enabled
=
isOk
;
groupBox5
.
Enabled
=
isOk
;
}
private
void
btnAdGet_Click
(
object
sender
,
EventArgs
e
)
{
if
(!
HCBoardManager
.
CardInitOk
())
{
MessageBox
.
Show
(
"板卡未初始化完成!"
);
return
;
}
txtAd1
.
Text
=
HCBoardManager
.
GetAdVal
(
0
).
ToString
();
txtAd2
.
Text
=
HCBoardManager
.
GetAdVal
(
1
).
ToString
();
txtAd3
.
Text
=
HCBoardManager
.
GetAdVal
(
2
).
ToString
();
txtAd4
.
Text
=
HCBoardManager
.
GetAdVal
(
3
).
ToString
();
txtAdSts1
.
Text
=
ConSts
(
HCBoardManager
.
GetAdSts
(
0
));
txtAdSts2
.
Text
=
ConSts
(
HCBoardManager
.
GetAdSts
(
1
));
txtAdSts3
.
Text
=
ConSts
(
HCBoardManager
.
GetAdSts
(
2
));
txtAdSts4
.
Text
=
ConSts
(
HCBoardManager
.
GetAdSts
(
3
));
}
private
string
ConSts
(
short
input
)
{
string
output
=
Convert
.
ToString
(
input
,
2
).
ToString
().
PadLeft
(
8
,
'0'
);
return
output
;
}
}
}
}
}
}
HuichuanLibrary/HCBoardManager.cs
查看文件 @
8566b42
...
@@ -544,6 +544,65 @@ namespace HuichuanLibrary
...
@@ -544,6 +544,65 @@ namespace HuichuanLibrary
#
endregion
#
endregion
#
region
AD
/
DA
控制
/// <summary>
/// 获取EtherCAT 第 adNo号的ad值
/// </summary>
/// <param name="adNo">ad的通道:0~配置个数</param>
/// <returns>获取AD的输入值</returns>
public
static
short
GetAdVal
(
short
adNo
)
{
if
(!
CardInitOk
())
{
return
0
;
}
Int16
adVal
=
0
;
UInt32
ret
=
ImcApi
.
IMC_GetEcatAdVal
(
nCardHandle
,
adNo
,
ref
adVal
);
if
(
ret
!=
0
)
{
ShowErrorLog
(
" adNo["
+
adNo
+
"] IMC_GetEcatAdVal FAIL, ErrorCode=0x"
+
ret
.
ToString
(
"x8"
));
return
0
;
}
return
adVal
;
}
/// <summary>
/// 获取EtherCAT 第 adNo号的状态
/// </summary>
/// <param name="adNo">ad的通道:0~配置个数</param>
/// <returns>获取AD的状态值</returns>
public
static
short
GetAdSts
(
short
adNo
)
{
if
(!
CardInitOk
())
{
return
0
;
}
Int16
adSts
=
0
;
UInt32
ret
=
ImcApi
.
IMC_GetEcatAdSts
(
nCardHandle
,
adNo
,
ref
adSts
);
if
(
ret
!=
0
)
{
ShowErrorLog
(
" adNo["
+
adNo
+
"] IMC_GetEcatAdSts FAIL, ErrorCode=0x"
+
ret
.
ToString
(
"x8"
));
return
0
;
}
return
adSts
;
}
public
static
AdStsInfo
GetAdStsInfo
(
short
sts
)
{
//【3】更新界面显示
AdStsInfo
stsInfo
=
new
AdStsInfo
();
stsInfo
.
VoltageSts
=
((
sts
&
0x01
)
==
0x01
)
?
1
:
0
;
//负载电压故障
stsInfo
.
ConnectSts
=
((
sts
&
0x02
)
==
0x02
)
?
1
:
0
;
//模拟芯片连接错误
stsInfo
.
NoSts
=
((
sts
&
0x04
)
==
0x04
)
?
1
:
0
;
//通道故障
stsInfo
.
Overflow
=
((
sts
&
0x08
)
==
0x08
)
?
1
:
0
;
//通道上溢
stsInfo
.
Underflow
=
((
sts
&
0x10
)
==
0x10
)
?
1
:
0
;
//通道下溢
stsInfo
.
PEL
=
((
sts
&
0x20
)
==
0x20
)
?
1
:
0
;
//通道超上限
stsInfo
.
NEL
=
((
sts
&
0x40
)
==
0x40
)
?
1
:
0
;
//通道超下限
stsInfo
.
OffLine
=
((
sts
&
0x80
)
==
0x80
)
?
1
:
0
;
//通道断线
return
stsInfo
;
}
#
endregion
private
static
void
ShowErrorLog
(
string
msg
)
private
static
void
ShowErrorLog
(
string
msg
)
{
{
CardMsg
=
BoardName
()
+
msg
;
CardMsg
=
BoardName
()
+
msg
;
...
@@ -562,6 +621,48 @@ namespace HuichuanLibrary
...
@@ -562,6 +621,48 @@ namespace HuichuanLibrary
HCLogUtil
.
debug
(
BoardName
()
+
msg
);
HCLogUtil
.
debug
(
BoardName
()
+
msg
);
}
}
}
}
public
class
AdStsInfo
{
/// <summary>
/// Bit0 ,负载电压故障,0:接入外部电源,1:未接入外部电源
/// </summary>
public
int
VoltageSts
=
-
1
;
/// <summary>
/// Bit1 ,模拟芯片连接错误,0:数字版与模拟板通讯正常,1:数字版与模拟板通讯错误
/// </summary>
public
int
ConnectSts
=
-
1
;
/// <summary>
/// Bit2:通道故障
/// </summary>
public
int
NoSts
=
-
1
;
/// <summary>
/// Bit3:通道上溢
/// </summary>
public
int
Overflow
=
-
1
;
/// <summary>
/// Bit4:通道下溢
/// </summary>
public
int
Underflow
=
-
1
;
/// <summary>
/// Bit5:通道超上限
/// </summary>
public
int
PEL
=
-
1
;
/// <summary>
/// Bit6:通道超下限
/// </summary>
public
int
NEL
=
-
1
;
/// <summary>
/// Bit7:通道断线
/// </summary>
public
int
OffLine
=
-
1
;
public
string
ToStr
()
{
return
"VoltageSts="
+
VoltageSts
+
",ConnectSts="
+
ConnectSts
+
",NoSts="
+
NoSts
+
",Overflow="
+
Overflow
+
",Underflow="
+
Underflow
+
",PEL="
+
PEL
+
",NEL="
+
NEL
+
",OffLine="
+
OffLine
;
}
}
public
class
AxisSts
public
class
AxisSts
{
{
/// <summary>
/// <summary>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论