Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC30-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit af805274
由
几米阳光
编写于
2019-04-12 17:02:32 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加新AIO模块的切换
1 个父辈
dad2eb04
隐藏空白字符变更
内嵌
并排
正在显示
22 个修改的文件
包含
1274 行增加
和
293 行删除
RC30-AutoInOutStore.sln → AutoInOutStore.sln
dll/AIOBOX.dll
dll/AIOBOX.xml
source/ACSingleStore/App.config
source/ACSingleStore/AutoInOutStore.csproj
source/ACSingleStore/FrmIOStatus.cs
source/ACSingleStore/FrmStoreBox.cs
source/ACSingleStore/Properties/Resources.Designer.cs
source/ACSingleStore/Properties/Settings.Designer.cs
source/Common/Setting_Init.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/IO/AIOBOX/AIOBOXManager.cs
source/DeviceLibrary/IO/IOManager.cs
source/DeviceLibrary/KangNaiDe/KNDManager.cs → source/DeviceLibrary/IO/KangNaiDe/KNDManager.cs
source/DeviceLibrary/KangNaiDe/MasterTcpClient.cs → source/DeviceLibrary/IO/KangNaiDe/MasterTcpClient.cs
source/DeviceLibrary/PanasonicServo/BatchAxisController.cs
source/DeviceLibrary/ShuoKe/MeteringSignalBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
source/LoadCVSLibrary/storeConfig/ConfigItemBase.cs
RC30-
AutoInOutStore.sln
→
AutoInOutStore.sln
查看文件 @
af80527
文件被删除
dll/AIOBOX.dll
0 → 100644
查看文件 @
af80527
此文件类型无法预览
dll/AIOBOX.xml
0 → 100644
查看文件 @
af80527
<?xml version="1.0"?>
<doc>
<assembly>
<name>
AIOBOX
</name>
</assembly>
<members>
<member
name=
"T:Asa.AIOBOX.AIOBOX_32"
>
<summary>
AIOBOX-32
</summary>
</member>
<member
name=
"T:Asa.AIOBOX.AIOBOX_32.DI_Changed"
>
<summary>
自动读取DI委托
</summary>
<param
name=
"box"
>
AIOBOX
</param>
<param
name=
"sta"
>
所有DI状态
</param>
</member>
<member
name=
"E:Asa.AIOBOX.AIOBOX_32.DI_Changed_Event"
>
<summary>
自动读取DI事件触发
</summary>
</member>
<member
name=
"T:Asa.AIOBOX.AIOBOX_32.DO_Changed"
>
<summary>
自动读取DO委托
</summary>
<param
name=
"box"
>
AIOBOX
</param>
<param
name=
"sta"
>
所有DO状态
</param>
</member>
<member
name=
"E:Asa.AIOBOX.AIOBOX_32.DO_Changed_Event"
>
<summary>
自动读取DO事件触发
</summary>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.#ctor"
>
<summary>
AIOBOX-32
</summary>
</member>
<member
name=
"P:Asa.AIOBOX.AIOBOX_32.IP"
>
<summary>
IP地址
</summary>
</member>
<member
name=
"P:Asa.AIOBOX.AIOBOX_32.Mask"
>
<summary>
子网掩码
</summary>
</member>
<member
name=
"P:Asa.AIOBOX.AIOBOX_32.Gateway"
>
<summary>
子网网关
</summary>
</member>
<member
name=
"P:Asa.AIOBOX.AIOBOX_32.Port"
>
<summary>
ModBus端口
</summary>
</member>
<member
name=
"P:Asa.AIOBOX.AIOBOX_32.IsConn"
>
<summary>
是否连接
</summary>
</member>
<member
name=
"P:Asa.AIOBOX.AIOBOX_32.ErrInfo"
>
<summary>
错误信息
</summary>
</member>
<member
name=
"P:Asa.AIOBOX.AIOBOX_32.AutoReadDI"
>
<summary>
自动读取DI状态,触发DI_Changed_Event
</summary>
</member>
<member
name=
"P:Asa.AIOBOX.AIOBOX_32.AutoReadDO"
>
<summary>
自动读取DO状态,触发DO_Changed_Event
</summary>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.Connect"
>
<summary>
连接
</summary>
<returns></returns>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.Close"
>
<summary>
关闭连接
</summary>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.ReverseStatus(Asa.AIOBOX.Status)"
>
<summary>
相反状态
</summary>
<param
name=
"sta"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.WriteDO(Asa.AIOBOX.Addr,Asa.AIOBOX.Status)"
>
<summary>
写入单个DO
</summary>
<param
name=
"add"
></param>
<param
name=
"sta"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.WriteDO_Reverse(Asa.AIOBOX.Addr,Asa.AIOBOX.Status@)"
>
<summary>
先把状态取反,然后写入单个DO
</summary>
<param
name=
"add"
></param>
<param
name=
"sta"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.WriteDO(Asa.AIOBOX.Addr,Asa.AIOBOX.Status[])"
>
<summary>
写入多个DO
</summary>
<param
name=
"add"
></param>
<param
name=
"sta"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.ReadDO(Asa.AIOBOX.Addr,Asa.AIOBOX.Status@)"
>
<summary>
读取单个DO
</summary>
<param
name=
"add"
></param>
<param
name=
"sta"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.ReadDO(Asa.AIOBOX.Addr,System.UInt32,Asa.AIOBOX.Status[]@)"
>
<summary>
读取多个DO
</summary>
<param
name=
"add"
>
起始地址
</param>
<param
name=
"count"
>
数量
</param>
<param
name=
"sta"
>
状态
</param>
<returns></returns>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.ReadDI(Asa.AIOBOX.Addr,Asa.AIOBOX.Status@)"
>
<summary>
读取单个DI
</summary>
<param
name=
"add"
></param>
<param
name=
"sta"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.ReadDI(Asa.AIOBOX.Addr,System.UInt32,Asa.AIOBOX.Status[]@)"
>
<summary>
读取多个DI
</summary>
<param
name=
"add"
></param>
<param
name=
"count"
></param>
<param
name=
"sta"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.Command(System.Byte[]@)"
>
<summary>
命令,前7个字节
</summary>
<param
name=
"data"
></param>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.Target(System.IAsyncResult)"
>
<summary>
回调函数,开启监听线程
</summary>
<param
name=
"args"
></param>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.Listen"
>
<summary>
监听结果线程,把读取到的数据保存到buff
</summary>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.Auto_Read_DIO"
>
<summary>
自动读取DIO线程
</summary>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.Trigger_DIO"
>
<summary>
触发DIO改变事件
</summary>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.ReadDI"
>
<summary>
读取所有DI状态
</summary>
<returns></returns>
</member>
<member
name=
"M:Asa.AIOBOX.AIOBOX_32.ReadDO"
>
<summary>
读取所有DO状态
</summary>
<returns></returns>
</member>
<member
name=
"T:Asa.AIOBOX.Reg"
>
<summary>
寄存器
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Reg.ID"
>
<summary>
标识
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Reg.Text"
>
<summary>
显示文本
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Reg.Addr"
>
<summary>
寄存器地址
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Reg.Status"
>
<summary>
当前的状态
</summary>
</member>
<member
name=
"M:Asa.AIOBOX.Reg.#ctor(Asa.AIOBOX.Addr)"
>
<summary>
寄存器,文本空,状态OFF
</summary>
<param
name=
"address"
>
地址
</param>
</member>
<member
name=
"M:Asa.AIOBOX.Reg.#ctor(System.String,Asa.AIOBOX.Addr)"
>
<summary>
寄存器,状态OFF
</summary>
<param
name=
"text"
>
文本
</param>
<param
name=
"addr"
>
地址
</param>
</member>
<member
name=
"M:Asa.AIOBOX.Reg.#ctor(System.Int32,System.String,Asa.AIOBOX.Addr)"
>
<summary>
寄存器,状态OFF
</summary>
<param
name=
"id"
>
标志
</param>
<param
name=
"text"
>
文本
</param>
<param
name=
"addr"
>
地址
</param>
</member>
<member
name=
"M:Asa.AIOBOX.Reg.#ctor(System.String,Asa.AIOBOX.Addr,Asa.AIOBOX.Status)"
>
<summary>
寄存器
</summary>
<param
name=
"text"
>
文本
</param>
<param
name=
"addr"
>
地址
</param>
<param
name=
"status"
>
状态
</param>
</member>
<member
name=
"M:Asa.AIOBOX.Reg.#ctor(System.Int32,System.String,Asa.AIOBOX.Addr,Asa.AIOBOX.Status)"
>
<summary>
寄存器
</summary>
<param
name=
"id"
>
标志
</param>
<param
name=
"text"
>
文本
</param>
<param
name=
"address"
>
地址
</param>
<param
name=
"status"
>
状态
</param>
</member>
<member
name=
"T:Asa.AIOBOX.Addr"
>
<summary>
寄存器地址
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DI_1"
>
<summary>
输入点,A1
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DI_2"
>
<summary>
输入点,A2
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DI_3"
>
<summary>
输入点,A3
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DI_4"
>
<summary>
输入点,A4
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DI_5"
>
<summary>
输入点,A5
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DI_6"
>
<summary>
输入点,A6
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DI_7"
>
<summary>
输入点,A7
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DI_8"
>
<summary>
输入点,A8
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DI_9"
>
<summary>
输入点,A9
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DI_10"
>
<summary>
输入点,A10
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DI_11"
>
<summary>
输入点,A11
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DI_12"
>
<summary>
输入点,A12
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DI_13"
>
<summary>
输入点,A13
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DI_14"
>
<summary>
输入点,A14
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DI_15"
>
<summary>
输入点,A15
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DI_16"
>
<summary>
输入点,A16
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DO_1"
>
<summary>
输出点,B1
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DO_2"
>
<summary>
输出点,B2
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DO_3"
>
<summary>
输出点,B3
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DO_4"
>
<summary>
输出点,B4
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DO_5"
>
<summary>
输出点,B5
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DO_6"
>
<summary>
输出点,B6
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DO_7"
>
<summary>
输出点,B7
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DO_8"
>
<summary>
输出点,B8
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DO_9"
>
<summary>
输出点,B9
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DO_10"
>
<summary>
输出点,B10
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DO_11"
>
<summary>
输出点,B11
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DO_12"
>
<summary>
输出点,B12
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DO_13"
>
<summary>
输出点,B13
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DO_14"
>
<summary>
输出点,B14
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DO_15"
>
<summary>
输出点,B15
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.DO_16"
>
<summary>
输出点,B16
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Addr.NONE"
>
<summary>
无
</summary>
</member>
<member
name=
"T:Asa.AIOBOX.Status"
>
<summary>
寄存器状态
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Status.Off"
>
<summary>
断开,关闭,低电平
</summary>
</member>
<member
name=
"F:Asa.AIOBOX.Status.On"
>
<summary>
闭合,打开,高电平
</summary>
</member>
</members>
</doc>
source/ACSingleStore/App.config
查看文件 @
af80527
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
<
add
key
=
"HasDisableDoorControl"
value
=
"1"
/>
<
add
key
=
"HasDisableDoorControl"
value
=
"1"
/>
<
add
key
=
"ACBaudRate"
value
=
"9600"
/>
<
add
key
=
"ACBaudRate"
value
=
"9600"
/>
<
add
key
=
"Default_Language"
value
=
"zh-CN"
/>
<
add
key
=
"Default_Language"
value
=
"zh-CN"
/>
<
add
key
=
"UseAIOBOX"
value
=
"1"
/>
</
appSettings
>
</
appSettings
>
<
log4net
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
...
...
source/ACSingleStore/AutoInOutStore.csproj
查看文件 @
af80527
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.AutoInOutStore</RootNamespace>
<RootNamespace>OnlineStore.AutoInOutStore</RootNamespace>
<AssemblyName>AutoInOutStore</AssemblyName>
<AssemblyName>AutoInOutStore</AssemblyName>
<TargetFrameworkVersion>v4.
0
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<TargetFrameworkProfile />
</PropertyGroup>
</PropertyGroup>
...
...
source/ACSingleStore/FrmIOStatus.cs
查看文件 @
af80527
...
@@ -117,11 +117,11 @@ namespace OnlineStore.AutoInOutStore
...
@@ -117,11 +117,11 @@ namespace OnlineStore.AutoInOutStore
int
slaveId
=
FormUtil
.
GetIntValue
(
txtSlaveId
);
int
slaveId
=
FormUtil
.
GetIntValue
(
txtSlaveId
);
if
(
time
>
0
)
if
(
time
>
0
)
{
{
KNDManager
.
WriteSingleDO
(
deviceName
,
(
byte
)
slaveId
,
(
ushort
)
index
,
(
IO_VALUE
)
value
,
time
);
IOManager
.
instance
.
WriteSingleDO
(
deviceName
,
(
byte
)
slaveId
,
(
ushort
)
index
,
(
IO_VALUE
)
value
,
time
);
}
}
else
else
{
{
KNDManager
.
WriteSingleDO
(
deviceName
,
(
byte
)
slaveId
,
(
ushort
)
index
,
(
IO_VALUE
)
value
);
IOManager
.
instance
.
WriteSingleDO
(
deviceName
,
(
byte
)
slaveId
,
(
ushort
)
index
,
(
IO_VALUE
)
value
);
}
}
}
}
...
@@ -198,7 +198,7 @@ namespace OnlineStore.AutoInOutStore
...
@@ -198,7 +198,7 @@ namespace OnlineStore.AutoInOutStore
foreach
(
string
key
in
DIControlList
.
Keys
)
foreach
(
string
key
in
DIControlList
.
Keys
)
{
{
IOTextControl
control
=
DIControlList
[
key
];
IOTextControl
control
=
DIControlList
[
key
];
int
iov
=
(
int
)
KNDManager
.
GetIOValue
(
boxBean
.
Config
.
StoreDIList
[
key
]);
int
iov
=
(
int
)
IOManager
.
instance
.
GetIOValue
(
boxBean
.
Config
.
StoreDIList
[
key
]);
if
(
iov
!=
control
.
IOValue
)
if
(
iov
!=
control
.
IOValue
)
{
{
control
.
IOValue
=
iov
;
control
.
IOValue
=
iov
;
...
@@ -207,7 +207,7 @@ namespace OnlineStore.AutoInOutStore
...
@@ -207,7 +207,7 @@ namespace OnlineStore.AutoInOutStore
}
foreach
(
string
key
in
this
.
DOControlList
.
Keys
)
}
foreach
(
string
key
in
this
.
DOControlList
.
Keys
)
{
{
IOTextControl
control
=
DOControlList
[
key
];
IOTextControl
control
=
DOControlList
[
key
];
int
iov
=
(
int
)
KNDManager
.
GetIOValue
(
boxBean
.
Config
.
StoreDOList
[
key
]);
int
iov
=
(
int
)
IOManager
.
instance
.
GetIOValue
(
boxBean
.
Config
.
StoreDOList
[
key
]);
if
(
iov
!=
control
.
IOValue
)
if
(
iov
!=
control
.
IOValue
)
{
{
control
.
IOValue
=
iov
;
control
.
IOValue
=
iov
;
...
@@ -236,25 +236,25 @@ namespace OnlineStore.AutoInOutStore
...
@@ -236,25 +236,25 @@ namespace OnlineStore.AutoInOutStore
}
}
private
void
btnOpenDoor_Click
(
object
sender
,
EventArgs
e
)
private
void
btnOpenDoor_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
}
}
private
void
btnCloseDoor_Click
(
object
sender
,
EventArgs
e
)
private
void
btnCloseDoor_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
}
}
private
void
btnLocationUp_Click
(
object
sender
,
EventArgs
e
)
private
void
btnLocationUp_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
HIGH
);
}
}
private
void
btnLocationDown_Click
(
object
sender
,
EventArgs
e
)
private
void
btnLocationDown_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
LOW
);
}
}
private
void
FrmIOStatus_Shown
(
object
sender
,
EventArgs
e
)
private
void
FrmIOStatus_Shown
(
object
sender
,
EventArgs
e
)
...
@@ -264,12 +264,12 @@ namespace OnlineStore.AutoInOutStore
...
@@ -264,12 +264,12 @@ namespace OnlineStore.AutoInOutStore
private
void
btnOpenAxisBreak_Click
(
object
sender
,
EventArgs
e
)
private
void
btnOpenAxisBreak_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
HIGH
);
}
}
private
void
btnCloseAxisBreak_Click
(
object
sender
,
EventArgs
e
)
private
void
btnCloseAxisBreak_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
}
}
private
void
button1_Click
(
object
sender
,
EventArgs
e
)
private
void
button1_Click
(
object
sender
,
EventArgs
e
)
...
@@ -279,24 +279,24 @@ namespace OnlineStore.AutoInOutStore
...
@@ -279,24 +279,24 @@ namespace OnlineStore.AutoInOutStore
private
void
btnOpenLed_Click
(
object
sender
,
EventArgs
e
)
private
void
btnOpenLed_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
}
}
private
void
btnCloseLed_Click
(
object
sender
,
EventArgs
e
)
private
void
btnCloseLed_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
}
}
private
void
btnSuckingDiscUp_Click
(
object
sender
,
EventArgs
e
)
private
void
btnSuckingDiscUp_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Down
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
SuckingDisc_Down
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Up
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
SuckingDisc_Up
,
IO_VALUE
.
HIGH
);
}
}
private
void
btnSuckingDiscDown_Click
(
object
sender
,
EventArgs
e
)
private
void
btnSuckingDiscDown_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Up
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
SuckingDisc_Up
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Down
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
SuckingDisc_Down
,
IO_VALUE
.
HIGH
);
}
}
private
void
btnDOpen_Click
(
object
sender
,
EventArgs
e
)
private
void
btnDOpen_Click
(
object
sender
,
EventArgs
e
)
...
@@ -317,42 +317,42 @@ namespace OnlineStore.AutoInOutStore
...
@@ -317,42 +317,42 @@ namespace OnlineStore.AutoInOutStore
private
void
btnSXi_Click
(
object
sender
,
EventArgs
e
)
private
void
btnSXi_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
HIGH
);
}
}
private
void
btnSXil_Click
(
object
sender
,
EventArgs
e
)
private
void
btnSXil_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
}
}
private
void
button3_Click
(
object
sender
,
EventArgs
e
)
private
void
button3_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
HIGH
);
}
}
private
void
button2_Click
(
object
sender
,
EventArgs
e
)
private
void
button2_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
LOW
);
}
}
private
void
button5_Click
(
object
sender
,
EventArgs
e
)
private
void
button5_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
HIGH
);
}
}
private
void
button4_Click
(
object
sender
,
EventArgs
e
)
private
void
button4_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
}
}
private
void
btnDisDoorOpen_Click
(
object
sender
,
EventArgs
e
)
private
void
btnDisDoorOpen_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
DisableDoorControl
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
DisableDoorControl
,
IO_VALUE
.
HIGH
);
}
}
private
void
btnDisDoorClose_Click
(
object
sender
,
EventArgs
e
)
private
void
btnDisDoorClose_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
DisableDoorControl
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
DisableDoorControl
,
IO_VALUE
.
LOW
);
}
}
}
}
}
}
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
af80527
...
@@ -318,7 +318,7 @@ namespace OnlineStore.AutoInOutStore
...
@@ -318,7 +318,7 @@ namespace OnlineStore.AutoInOutStore
}
}
//string deviceMsg = "叉子上有料盘,请打开仓门检查";
//string deviceMsg = "叉子上有料盘,请打开仓门检查";
if
(
store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
)
&&
store
.
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
None
)
&&
KND
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
)
&&
store
.
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
None
)
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
lblWarnMsg
.
Text
=
lblWarnMsg
.
Text
+
HasWare
;
lblWarnMsg
.
Text
=
lblWarnMsg
.
Text
+
HasWare
;
}
}
...
@@ -1098,7 +1098,7 @@ namespace OnlineStore.AutoInOutStore
...
@@ -1098,7 +1098,7 @@ namespace OnlineStore.AutoInOutStore
private
void
扫码测试
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
扫码测试
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
string
message
=
""
;
string
message
=
""
;
string
outMsg
=
""
;
string
outMsg
=
""
;
//List<string> codeList = HDevelopExport.CameraScan(out outMsg);
//List<string> codeList = HDevelopExport.CameraScan(out outMsg);
...
@@ -1113,13 +1113,13 @@ namespace OnlineStore.AutoInOutStore
...
@@ -1113,13 +1113,13 @@ namespace OnlineStore.AutoInOutStore
message
=
message
+
str
+
"##"
;
message
=
message
+
str
+
"##"
;
}
}
LogUtil
.
info
(
"扫码测试收到二维码【"
+
outMsg
+
"】:"
+
message
);
LogUtil
.
info
(
"扫码测试收到二维码【"
+
outMsg
+
"】:"
+
message
);
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
}
}
private
void
打开舱门
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
打开舱门
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
}
}
private
void
料仓运转
OFFToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
料仓运转
OFFToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
...
@@ -1130,8 +1130,8 @@ namespace OnlineStore.AutoInOutStore
...
@@ -1130,8 +1130,8 @@ namespace OnlineStore.AutoInOutStore
private
void
关闭仓门
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
关闭仓门
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
}
}
private
void
回待机点
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
回待机点
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
...
@@ -1318,9 +1318,9 @@ namespace OnlineStore.AutoInOutStore
...
@@ -1318,9 +1318,9 @@ namespace OnlineStore.AutoInOutStore
stop_button_Click
(
null
,
null
);
stop_button_Click
(
null
,
null
);
}
}
store
.
Exit
();
store
.
Exit
();
KNDManager
.
CloseAllDO
();
IOManager
.
instance
.
CloseAllDO
();
StoreOpenStatus
(
false
);
StoreOpenStatus
(
false
);
KNDManager
.
CloseAllConnection
();
IOManager
.
instance
.
CloseAllConnection
();
//KNDAIManager.CloseAllConnection();
//KNDAIManager.CloseAllConnection();
//WCFControl.CloseWCF();
//WCFControl.CloseWCF();
ResourceCulture
.
LogDefaultMap
();
ResourceCulture
.
LogDefaultMap
();
...
@@ -1366,21 +1366,21 @@ namespace OnlineStore.AutoInOutStore
...
@@ -1366,21 +1366,21 @@ namespace OnlineStore.AutoInOutStore
private
void
摄像机调试
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
摄像机调试
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
CodeLibrary
.
FrmCodeDecode
frm
=
new
FrmCodeDecode
();
CodeLibrary
.
FrmCodeDecode
frm
=
new
FrmCodeDecode
();
frm
.
ShowDialog
();
frm
.
ShowDialog
();
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
}
}
private
void
学习二维码
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
学习二维码
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
string
nameStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CameraName
);
string
nameStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CameraName
);
string
codeStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CodeType
);
string
codeStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CodeType
);
HDCodeLearnHelper
.
LoadConfig
(
nameStr
,
codeStr
);
HDCodeLearnHelper
.
LoadConfig
(
nameStr
,
codeStr
);
FrmCodeLearn
learn
=
new
FrmCodeLearn
();
FrmCodeLearn
learn
=
new
FrmCodeLearn
();
learn
.
ShowDialog
();
learn
.
ShowDialog
();
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
}
}
private
void
btnReadHomeSingle_Click
(
object
sender
,
EventArgs
e
)
private
void
btnReadHomeSingle_Click
(
object
sender
,
EventArgs
e
)
...
@@ -1498,7 +1498,7 @@ namespace OnlineStore.AutoInOutStore
...
@@ -1498,7 +1498,7 @@ namespace OnlineStore.AutoInOutStore
private
void
批量上下轴
ONToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
批量上下轴
ONToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
HIGH
);
Thread
.
Sleep
(
1000
);
Thread
.
Sleep
(
1000
);
string
portName
=
store
.
Config
.
Batch_Axis
.
DeviceName
;
string
portName
=
store
.
Config
.
Batch_Axis
.
DeviceName
;
int
slvAddr
=
store
.
Config
.
Batch_Axis
.
GetAxisValue
();
int
slvAddr
=
store
.
Config
.
Batch_Axis
.
GetAxisValue
();
...
@@ -1520,7 +1520,7 @@ namespace OnlineStore.AutoInOutStore
...
@@ -1520,7 +1520,7 @@ namespace OnlineStore.AutoInOutStore
ACServerManager
.
ColsePort
(
store
.
Config
.
Batch_Axis
.
DeviceName
);
ACServerManager
.
ColsePort
(
store
.
Config
.
Batch_Axis
.
DeviceName
);
Thread
.
Sleep
(
100
);
Thread
.
Sleep
(
100
);
KND
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
LOW
);
}
}
private
void
btnWaitTrgGo_Click
(
object
sender
,
EventArgs
e
)
private
void
btnWaitTrgGo_Click
(
object
sender
,
EventArgs
e
)
...
@@ -1644,13 +1644,13 @@ namespace OnlineStore.AutoInOutStore
...
@@ -1644,13 +1644,13 @@ namespace OnlineStore.AutoInOutStore
private
void
toolStripMenuItem2_Click
(
object
sender
,
EventArgs
e
)
private
void
toolStripMenuItem2_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
}
}
private
void
toolStripMenuItem3_Click
(
object
sender
,
EventArgs
e
)
private
void
toolStripMenuItem3_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
}
}
private
void
btnSave_Click
(
object
sender
,
EventArgs
e
)
private
void
btnSave_Click
(
object
sender
,
EventArgs
e
)
...
@@ -1664,12 +1664,12 @@ namespace OnlineStore.AutoInOutStore
...
@@ -1664,12 +1664,12 @@ namespace OnlineStore.AutoInOutStore
private
void
toolStripMenuItem4_Click
(
object
sender
,
EventArgs
e
)
private
void
toolStripMenuItem4_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
DisableDoorControl
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
DisableDoorControl
,
IO_VALUE
.
HIGH
);
}
}
private
void
toolStripMenuItem5_Click
(
object
sender
,
EventArgs
e
)
private
void
toolStripMenuItem5_Click
(
object
sender
,
EventArgs
e
)
{
{
KND
.
IOMove
(
IO_Type
.
DisableDoorControl
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
DisableDoorControl
,
IO_VALUE
.
LOW
);
}
}
private
void
出入库调试
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
出入库调试
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
...
...
source/ACSingleStore/Properties/Resources.Designer.cs
查看文件 @
af80527
...
@@ -47,7 +47,7 @@ namespace OnlineStore.AutoInOutStore.Properties {
...
@@ -47,7 +47,7 @@ namespace OnlineStore.AutoInOutStore.Properties {
}
}
/// <summary>
/// <summary>
///
使用此强类型资源类,为所有资源查找
///
重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
/// </summary>
[
global
::
System
.
ComponentModel
.
EditorBrowsableAttribute
(
global
::
System
.
ComponentModel
.
EditorBrowsableState
.
Advanced
)]
[
global
::
System
.
ComponentModel
.
EditorBrowsableAttribute
(
global
::
System
.
ComponentModel
.
EditorBrowsableState
.
Advanced
)]
...
...
source/ACSingleStore/Properties/Settings.Designer.cs
查看文件 @
af80527
...
@@ -12,7 +12,7 @@ namespace OnlineStore.AutoInOutStore.Properties {
...
@@ -12,7 +12,7 @@ namespace OnlineStore.AutoInOutStore.Properties {
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,
"15.
6
.0.0"
)]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,
"15.
9
.0.0"
)]
internal
sealed
partial
class
Settings
:
global
::
System
.
Configuration
.
ApplicationSettingsBase
{
internal
sealed
partial
class
Settings
:
global
::
System
.
Configuration
.
ApplicationSettingsBase
{
private
static
Settings
defaultInstance
=
((
Settings
)(
global
::
System
.
Configuration
.
ApplicationSettingsBase
.
Synchronized
(
new
Settings
())));
private
static
Settings
defaultInstance
=
((
Settings
)(
global
::
System
.
Configuration
.
ApplicationSettingsBase
.
Synchronized
(
new
Settings
())));
...
...
source/Common/Setting_Init.cs
查看文件 @
af80527
...
@@ -87,5 +87,7 @@ namespace OnlineStore.Common
...
@@ -87,5 +87,7 @@ namespace OnlineStore.Common
/// </summary>
/// </summary>
public
static
string
ACBaudRate
=
"ACBaudRate"
;
public
static
string
ACBaudRate
=
"ACBaudRate"
;
public
static
string
Default_Language
=
"Default_Language"
;
public
static
string
Default_Language
=
"Default_Language"
;
public
static
string
UseAIOBOX
=
"UseAIOBOX"
;
}
}
}
}
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
af80527
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.DeviceLibrary</RootNamespace>
<RootNamespace>OnlineStore.DeviceLibrary</RootNamespace>
<AssemblyName>DeviceLibrary</AssemblyName>
<AssemblyName>DeviceLibrary</AssemblyName>
<TargetFrameworkVersion>v4.
0
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<TargetFrameworkProfile />
</PropertyGroup>
</PropertyGroup>
...
@@ -36,6 +36,9 @@
...
@@ -36,6 +36,9 @@
<Prefer32Bit>false</Prefer32Bit>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<Reference Include="AIOBOX">
<HintPath>..\..\dll\AIOBOX.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary">
<Reference Include="CodeLibrary">
<HintPath>..\..\dll\CodeLibrary.dll</HintPath>
<HintPath>..\..\dll\CodeLibrary.dll</HintPath>
</Reference>
</Reference>
...
@@ -62,8 +65,10 @@
...
@@ -62,8 +65,10 @@
<Compile Include="acSingleStore\StoreManager.cs" />
<Compile Include="acSingleStore\StoreManager.cs" />
<Compile Include="acSingleStore\AutomaticBaiting.cs" />
<Compile Include="acSingleStore\AutomaticBaiting.cs" />
<Compile Include="halcon\CodeManager.cs" />
<Compile Include="halcon\CodeManager.cs" />
<Compile Include="KangNaiDe\KNDManager.cs" />
<Compile Include="IO\AIOBOX\AIOBOXManager.cs" />
<Compile Include="KangNaiDe\MasterTcpClient.cs" />
<Compile Include="IO\IOManager.cs" />
<Compile Include="IO\KangNaiDe\KNDManager.cs" />
<Compile Include="IO\KangNaiDe\MasterTcpClient.cs" />
<Compile Include="PanasonicServo\ACCMDManager.cs" />
<Compile Include="PanasonicServo\ACCMDManager.cs" />
<Compile Include="PanasonicServo\ACServerManager.cs" />
<Compile Include="PanasonicServo\ACServerManager.cs" />
<Compile Include="PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="PanasonicServo\ACServerManager_Partial.cs" />
...
...
source/DeviceLibrary/IO/AIOBOX/AIOBOXManager.cs
0 → 100644
查看文件 @
af80527
using
log4net
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Reflection
;
using
System.Text
;
using
Asa.AIOBOX
;
using
System.Threading
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
{
public
class
AIOBOXManager
:
IOManager
{
//public static uint DefaultDICount = 16;
//public static uint DefaultDOCount = 16;
public
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
public
Dictionary
<
string
,
AIOBOX_32
>
AIOMap
=
new
Dictionary
<
string
,
AIOBOX_32
>();
public
string
DefaultIP
=
""
;
public
Dictionary
<
string
,
List
<
Status
>>
DIValueMap
=
new
Dictionary
<
string
,
List
<
Status
>>();
public
Dictionary
<
string
,
List
<
Status
>>
DOValueMap
=
new
Dictionary
<
string
,
List
<
Status
>>();
private
object
DIMapLock
=
""
;
private
object
DOMapLock
=
""
;
public
System
.
Timers
.
Timer
timer
=
null
;
private
object
DILock
=
""
;
private
object
DOLock
=
""
;
public
void
ConnectionIP
(
string
ioIp
)
{
AIOBOX_32
aioBox
=
null
;
if
(
AIOMap
.
ContainsKey
(
ioIp
))
{
aioBox
=
AIOMap
[
ioIp
];
if
(
null
!=
aioBox
)
{
aioBox
.
Close
();
aioBox
=
null
;
}
AIOMap
.
Remove
(
ioIp
);
}
if
(
DIValueMap
.
ContainsKey
(
ioIp
))
{
DIValueMap
.
Remove
(
ioIp
);
}
if
(
DOValueMap
.
ContainsKey
(
ioIp
))
{
DOValueMap
.
Remove
(
ioIp
);
}
try
{
// Create new modbus master and add event functions
aioBox
=
new
AIOBOX_32
();
aioBox
.
IP
=
ioIp
;
DefaultIP
=
ioIp
;
aioBox
.
AutoReadDI
=
true
;
aioBox
.
AutoReadDO
=
true
;
aioBox
.
DI_Changed_Event
+=
AioBox_DI_Changed_Event
;
;
aioBox
.
DO_Changed_Event
+=
AioBox_DO_Changed_Event
;
LogUtil
.
info
(
"开始连接IO模块【"
+
ioIp
+
"】,尝试重连三次"
);
for
(
int
i
=
1
;
i
<=
3
;
i
++)
{
bool
result
=
aioBox
.
Connect
();
if
(
result
)
{
AIOMap
.
Add
(
ioIp
,
aioBox
);
LogUtil
.
info
(
"第【"
+
i
+
"】次连接IO模块【"
+
ioIp
+
"】成功:"
+
aioBox
.
ErrInfo
);
Thread
.
Sleep
(
10
);
//读取所有的DO
ReadAllDI
(
ioIp
,
0
);
break
;
}
else
{
LogUtil
.
error
(
"第【"
+
i
+
"】次连接IO模块【"
+
ioIp
+
"】失败:"
+
aioBox
.
ErrInfo
+
""
);
}
Thread
.
Sleep
(
10
);
}
}
catch
(
Exception
error
)
{
LogUtil
.
error
(
LOGGER
,
"连接IO模块["
+
ioIp
+
"]出错:"
+
error
.
ToString
());
}
}
private
void
AioBox_DI_Changed_Event
(
AIOBOX_32
box
,
Status
[]
sta
)
{
try
{
UpdateAllDI
(
box
.
IP
,
sta
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"AioBox_DI_Changed_Event出错:"
+
ex
.
ToString
());
}
}
private
void
AioBox_DO_Changed_Event
(
AIOBOX_32
box
,
Status
[]
sta
)
{
try
{
UpdateAllDO
(
box
.
IP
,
sta
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"AioBox_DO_Changed_Event出错:"
+
ex
.
ToString
());
}
}
private
void
UpdateAllDI
(
string
ip
,
Status
[]
sta
)
{
if
(
sta
!=
null
&&
sta
.
Length
>=
StoreManager
.
Config
.
GetDILength
(
ip
))
{
bool
needUpdate
=
false
;
List
<
Status
>
newList
=
new
List
<
Status
>();
newList
.
AddRange
(
sta
);
List
<
Status
>
oldList
=
null
;
DIValueMap
.
TryGetValue
(
ip
,
out
oldList
);
if
(
oldList
==
null
||
oldList
.
Count
.
Equals
(
newList
.
Count
).
Equals
(
false
))
{
needUpdate
=
true
;
}
else
{
for
(
int
i
=
0
;
i
<
newList
.
Count
;
i
++)
{
if
(!(
oldList
[
i
].
Equals
(
newList
[
i
])))
{
needUpdate
=
true
;
break
;
}
}
}
if
(
needUpdate
)
{
lock
(
DILock
)
{
if
(
DIValueMap
.
ContainsKey
(
ip
))
{
DIValueMap
.
Remove
(
ip
);
}
DIValueMap
.
Add
(
ip
,
newList
);
}
}
}
}
private
void
UpdateAllDO
(
string
ip
,
Status
[]
sta
)
{
if
(
sta
!=
null
&&
sta
.
Length
>=
StoreManager
.
Config
.
GetDOLength
(
ip
))
{
bool
needUpdate
=
false
;
List
<
Status
>
newList
=
new
List
<
Status
>();
newList
.
AddRange
(
sta
);
List
<
Status
>
oldList
=
null
;
DOValueMap
.
TryGetValue
(
ip
,
out
oldList
);
if
(
oldList
==
null
||
oldList
.
Count
.
Equals
(
newList
.
Count
).
Equals
(
false
))
{
needUpdate
=
true
;
}
else
{
for
(
int
i
=
0
;
i
<
newList
.
Count
;
i
++)
{
if
(!(
oldList
[
i
].
Equals
(
newList
[
i
])))
{
needUpdate
=
true
;
break
;
}
}
}
if
(
needUpdate
)
{
lock
(
DOLock
)
{
if
(
DOValueMap
.
ContainsKey
(
ip
))
{
DOValueMap
.
Remove
(
ip
);
}
DOValueMap
.
Add
(
ip
,
newList
);
}
}
}
}
private
void
timer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
try
{
List
<
string
>
list
=
new
List
<
string
>(
AIOMap
.
Keys
);
foreach
(
string
io
in
list
)
{
//判断是否连接,如果没有连接自动重连
AIOBOX_32
clinet
=
AIOMap
[
io
];
if
(!
clinet
.
IsConn
)
{
LogUtil
.
error
(
LOGGER
,
io
+
"当前没有连上:"
+
clinet
.
ErrInfo
);
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
LOGGER
,
"出错啦:"
+
ex
.
ToString
());
}
Thread
.
Sleep
(
1
);
}
public
override
void
ConnectionIOList
(
List
<
string
>
DIONameList
)
{
foreach
(
string
ip
in
DIONameList
)
{
ConnectionIP
(
ip
);
}
}
//关闭所有的DO
public
override
void
CloseAllDO
()
{
foreach
(
AIOBOX_32
aio
in
AIOMap
.
Values
)
{
Status
[]
statuses
=
new
Status
[
16
];
for
(
int
i
=
0
;
i
<
16
;
i
++)
{
statuses
[
i
]
=
Status
.
Off
;
}
aio
.
WriteDO
(
Addr
.
DI_1
,
statuses
);
}
}
public
override
void
CloseAllConnection
()
{
foreach
(
AIOBOX_32
aio
in
AIOMap
.
Values
)
{
aio
.
Close
();
}
AIOMap
.
Clear
();
}
public
override
void
WriteSingleDO
(
string
ioIp
,
byte
slaveId
,
ushort
StartAddress
,
IO_VALUE
onOff
)
{
try
{
AIOBOX_32
aioBox
=
getAIO
(
ioIp
);
if
(
aioBox
!=
null
)
{
Addr
add
=
GetAddr
(
StartAddress
);
for
(
int
i
=
1
;
i
<=
3
;
i
++)
{
bool
result
=
aioBox
.
WriteDO
(
GetAddr
(
StartAddress
),
GetStatus
(
onOff
));
if
(!
result
)
{
LogUtil
.
error
(
"AIO WriteSingleDO ["
+
StartAddress
+
"] 第"
+
i
+
"次失败:"
+
aioBox
.
ErrInfo
);
}
else
{
break
;
}
}
}
else
{
LogUtil
.
error
(
LOGGER
,
"ReadSingleDO出错没有连接IO模块:"
+
ioIp
);
}
}
catch
(
Exception
ex
)
{
LOGGER
.
Error
(
"出错啦:"
+
ex
.
ToString
());
}
}
public
override
void
WriteSingleDO
(
string
ioIp
,
byte
slaveId
,
ushort
StartAddress
,
IO_VALUE
onOff
,
int
mSeconds
)
{
try
{
AIOBOX_32
aioBox
=
getAIO
(
ioIp
);
Status
currStatus
=
GetStatus
(
onOff
);
if
(
aioBox
!=
null
)
{
Addr
add
=
GetAddr
(
StartAddress
);
aioBox
.
WriteDO
(
GetAddr
(
StartAddress
),
currStatus
);
//写入之后,等待指定间隔后回写
System
.
Timers
.
Timer
mytimer
=
new
System
.
Timers
.
Timer
(
mSeconds
);
mytimer
.
Elapsed
+=
(
o1
,
e1
)
=>
{
try
{
aioBox
.
WriteDO
(
GetAddr
(
StartAddress
),
aioBox
.
ReverseStatus
(
currStatus
));
LogUtil
.
debug
(
LOGGER
,
"**********定时回写入 IO【"
+
ioIp
+
","
+
StartAddress
+
",值"
+
aioBox
.
ReverseStatus
(
currStatus
)
+
"】:"
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
LOGGER
,
"**********定时回写入 出错:"
+
ex
.
StackTrace
);
}
};
mytimer
.
AutoReset
=
false
;
//设置是否自动重启,即自动执行多次;
mytimer
.
Enabled
=
true
;
//是否执行System.Timers.Timer.Elapsed事件mytask;
}
else
{
LogUtil
.
error
(
LOGGER
,
"WriteSingleDO出错没有连接IO模块:"
+
ioIp
);
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"WriteSingleDO出错:"
+
ioIp
);
}
}
public
override
void
ReadAllDI
(
string
ioIp
,
byte
slaveId
)
{
try
{
AIOBOX_32
aioBox
=
getAIO
(
ioIp
);
if
(
aioBox
!=
null
)
{
Status
[]
allDi
;
if
(
aioBox
.
ReadDI
(
Addr
.
DI_1
,
StoreManager
.
Config
.
GetDILength
(
ioIp
),
out
allDi
))
{
UpdateAllDI
(
ioIp
,
allDi
);
}
else
{
LogUtil
.
error
(
"读取所有DI出错:"
+
aioBox
.
ErrInfo
);
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"ReadAllDI出错:"
+
ioIp
);
}
}
public
override
void
ReadAllDO
(
string
ioIp
,
byte
slaveId
)
{
try
{
AIOBOX_32
aioBox
=
getAIO
(
ioIp
);
if
(
aioBox
!=
null
)
{
Status
[]
allDO
;
if
(
aioBox
.
ReadDO
(
Addr
.
DO_1
,
StoreManager
.
Config
.
GetDOLength
(
ioIp
),
out
allDO
))
{
UpdateAllDO
(
ioIp
,
allDO
);
}
else
{
LogUtil
.
error
(
"读取所有DO出错:"
+
aioBox
.
ErrInfo
);
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"ReadAllDO出错:"
+
ioIp
);
}
}
public
override
IO_VALUE
GetDOValue
(
string
ioIP
,
byte
slaveId
,
ushort
StartAddress
)
{
IO_VALUE
value
=
IO_VALUE
.
LOW
;
try
{
AIOBOX_32
aioBox
=
getAIO
(
ioIP
);
if
(
aioBox
!=
null
)
{
Status
status
=
Status
.
Off
;
Addr
addr
=
GetAddr
(
StartAddress
);
int
index
=(
int
)
StartAddress
-
(
int
)
StoreManager
.
Config
.
GetDILength
(
ioIP
);
if
(
DOValueMap
.
ContainsKey
(
ioIP
)
&&
DOValueMap
[
ioIP
].
Count
>
index
)
{
status
=
DOValueMap
[
ioIP
][
index
];
}
else
{
aioBox
.
ReadDO
(
addr
,
out
status
);
}
if
(
status
.
Equals
(
Status
.
On
))
{
value
=
IO_VALUE
.
HIGH
;
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"ReadDI 出错:"
+
ex
.
ToString
());
}
return
value
;
}
public
override
IO_VALUE
GetDIValue
(
string
ioIP
,
byte
slaveId
,
ushort
StartAddress
)
{
IO_VALUE
value
=
IO_VALUE
.
LOW
;
try
{
AIOBOX_32
aioBox
=
getAIO
(
ioIP
);
if
(
aioBox
!=
null
)
{
Status
status
=
Status
.
Off
;
Addr
addr
=
GetAddr
(
StartAddress
);
int
index
=
StartAddress
;
if
(
DIValueMap
.
ContainsKey
(
ioIP
)
&&
DIValueMap
[
ioIP
].
Count
>
index
)
{
status
=
DIValueMap
[
ioIP
][
index
];
}
else
{
aioBox
.
ReadDI
(
addr
,
out
status
);
}
if
(
status
.
Equals
(
Status
.
On
))
{
value
=
IO_VALUE
.
HIGH
;
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"ReadDI 出错:"
+
ex
.
ToString
());
}
return
value
;
}
public
override
IO_VALUE
GetIOValue
(
ConfigIO
configIO
)
{
IO_VALUE
value
=
IO_VALUE
.
LOW
;
try
{
if
(
configIO
.
ProType
.
Equals
(
ConfigItemType
.
DI
))
{
return
GetDIValue
(
configIO
.
DeviceName
,
configIO
.
SlaveID
,
configIO
.
GetIOAddr
());
}
else
if
(
configIO
.
ProType
.
Equals
(
ConfigItemType
.
DO
))
{
return
GetDOValue
(
configIO
.
DeviceName
,
configIO
.
SlaveID
,
configIO
.
GetIOAddr
());
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
LOGGER
,
"获取数据出错:"
+
ex
.
ToString
());
}
return
value
;
}
private
Addr
GetAddr
(
ushort
StartAddress
)
{
return
(
Addr
)(
StartAddress
);
}
private
Status
GetStatus
(
IO_VALUE
onOff
)
{
if
(
onOff
.
Equals
(
IO_VALUE
.
HIGH
))
{
return
Status
.
On
;
}
else
{
return
Status
.
Off
;
}
}
private
AIOBOX_32
getAIO
(
string
ioIp
)
{
AIOBOX_32
aioBox
=
null
;
if
(
AIOMap
.
ContainsKey
(
ioIp
))
{
aioBox
=
AIOMap
[
ioIp
];
}
return
aioBox
;
}
}
}
source/DeviceLibrary/IO/IOManager.cs
0 → 100644
查看文件 @
af80527
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
namespace
OnlineStore.DeviceLibrary
{
public
abstract
class
IOManager
{
public
static
IOManager
instance
=
null
;
public
abstract
void
ConnectionIOList
(
List
<
string
>
dIODeviceNameList
);
#
region
KNDIO
public
static
void
IOMove
(
string
ioType
,
IO_VALUE
ioValue
)
{
if
(
StoreManager
.
Config
.
StoreDOList
.
ContainsKey
(
ioType
))
{
ConfigIO
configIo
=
StoreManager
.
Config
.
StoreDOList
[
ioType
];
instance
.
WriteSingleDO
(
configIo
.
DeviceName
,
configIo
.
SlaveID
,
configIo
.
GetIOAddr
(),
ioValue
);
Thread
.
Sleep
(
60
);
}
else
{
LogUtil
.
error
(
"没有DO="
+
ioType
);
}
}
public
static
IO_VALUE
IOValue
(
string
ioType
)
{
IO_VALUE
ioValue
=
IO_VALUE
.
LOW
;
if
(
StoreManager
.
Config
.
StoreDIList
.
ContainsKey
(
ioType
))
{
ConfigIO
configIo
=
StoreManager
.
Config
.
StoreDIList
[
ioType
];
ioValue
=
instance
.
GetDIValue
(
configIo
.
DeviceName
,
configIo
.
SlaveID
,
configIo
.
GetIOAddr
());
//UpdateDoValue(ioType, ioValue);
}
else
if
(
StoreManager
.
Config
.
StoreDOList
.
ContainsKey
(
ioType
))
{
ConfigIO
configIo
=
StoreManager
.
Config
.
StoreDOList
[
ioType
];
ioValue
=
instance
.
GetDOValue
(
configIo
.
DeviceName
,
configIo
.
SlaveID
,
configIo
.
GetIOAddr
());
}
else
{
LogUtil
.
error
(
"没有DO="
+
ioType
);
}
return
ioValue
;
}
#
endregion
public
static
void
Init
()
{
bool
isAIOBox
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
UseAIOBOX
).
Equals
(
1
);
if
(
isAIOBox
)
{
instance
=
new
AIOBOXManager
();
}
else
{
instance
=
new
KNDManager
();
}
}
public
abstract
void
ReadAllDI
(
string
deviceName
,
byte
slaveId
);
public
abstract
void
ReadAllDO
(
string
deviceName
,
byte
slaveId
);
public
abstract
void
WriteSingleDO
(
string
deviceName
,
byte
slaveId
,
ushort
index
,
IO_VALUE
value
,
int
time
);
public
abstract
void
WriteSingleDO
(
string
deviceName
,
byte
slaveId
,
ushort
index
,
IO_VALUE
value
);
public
abstract
IO_VALUE
GetDIValue
(
string
deviceName
,
byte
slaveID
,
ushort
v
);
public
abstract
IO_VALUE
GetDOValue
(
string
deviceName
,
byte
slaveID
,
ushort
v
);
public
abstract
IO_VALUE
GetIOValue
(
ConfigIO
configIO
);
public
abstract
void
CloseAllDO
();
public
abstract
void
CloseAllConnection
();
}
}
source/DeviceLibrary/KangNaiDe/KNDManager.cs
→
source/DeviceLibrary/
IO/
KangNaiDe/KNDManager.cs
查看文件 @
af80527
...
@@ -13,52 +13,52 @@ using System.Threading;
...
@@ -13,52 +13,52 @@ using System.Threading;
namespace
OnlineStore.DeviceLibrary
namespace
OnlineStore.DeviceLibrary
{
{
public
class
KND
//
public class KND
{
//
{
#
region
KNDIO
//
#region KNDIO
public
static
void
IOMove
(
string
ioType
,
IO_VALUE
ioValue
)
//
public static void IOMove(string ioType, IO_VALUE ioValue)
{
//
{
if
(
StoreManager
.
Config
.
StoreDOList
.
ContainsKey
(
ioType
))
//
if (StoreManager.Config.StoreDOList.ContainsKey(ioType))
{
//
{
ConfigIO
configIo
=
StoreManager
.
Config
.
StoreDOList
[
ioType
];
//
ConfigIO configIo = StoreManager.Config.StoreDOList[ioType];
KNDManager
.
WriteSingleDO
(
configIo
.
DeviceName
,
configIo
.
SlaveID
,
configIo
.
GetIOAddr
(),
ioValue
);
//
KNDManager.WriteSingleDO(configIo.DeviceName, configIo.SlaveID, configIo.GetIOAddr(), ioValue);
Thread
.
Sleep
(
60
);
//
Thread.Sleep(60);
}
//
}
else
//
else
{
//
{
LogUtil
.
error
(
"没有DO="
+
ioType
);
//
LogUtil.error( "没有DO=" + ioType);
}
//
}
}
//
}
public
static
IO_VALUE
IOValue
(
string
ioType
)
//
public static IO_VALUE IOValue(string ioType)
{
//
{
IO_VALUE
ioValue
=
IO_VALUE
.
LOW
;
//
IO_VALUE ioValue = IO_VALUE.LOW;
if
(
StoreManager
.
Config
.
StoreDIList
.
ContainsKey
(
ioType
))
//
if (StoreManager.Config.StoreDIList.ContainsKey(ioType))
{
//
{
ConfigIO
configIo
=
StoreManager
.
Config
.
StoreDIList
[
ioType
];
//
ConfigIO configIo = StoreManager.Config.StoreDIList[ioType];
ioValue
=
KNDManager
.
GetDIValue
(
configIo
.
DeviceName
,
configIo
.
SlaveID
,
configIo
.
GetIOAddr
());
//
ioValue = KNDManager.GetDIValue(configIo.DeviceName, configIo.SlaveID, configIo.GetIOAddr());
//UpdateDoValue(ioType, ioValue);
//
//UpdateDoValue(ioType, ioValue);
}
//
}
else
if
(
StoreManager
.
Config
.
StoreDOList
.
ContainsKey
(
ioType
))
//
else if (StoreManager.Config.StoreDOList.ContainsKey(ioType))
{
//
{
ConfigIO
configIo
=
StoreManager
.
Config
.
StoreDOList
[
ioType
];
//
ConfigIO configIo = StoreManager.Config.StoreDOList[ioType];
ioValue
=
KNDManager
.
GetDOValue
(
configIo
.
DeviceName
,
configIo
.
SlaveID
,
configIo
.
GetIOAddr
());
//
ioValue = KNDManager.GetDOValue(configIo.DeviceName, configIo.SlaveID, configIo.GetIOAddr());
}
//
}
else
//
else
{
//
{
LogUtil
.
error
(
"没有DO="
+
ioType
);
//
LogUtil.error( "没有DO=" + ioType);
}
//
}
return
ioValue
;
//
return ioValue;
}
//
}
#
endregion
//
#endregion
}
//
}
/// <summary>
/// <summary>
/// 康奈德IO控制模块
/// 康奈德IO控制模块
/// </summary>
/// </summary>
public
class
KNDManager
public
class
KNDManager
:
IOManager
{
{
public
static
ushort
DIStartAddress
=
200
;
public
static
ushort
DIStartAddress
=
200
;
public
static
ushort
DoStartAddress
=
100
;
public
static
ushort
DoStartAddress
=
100
;
...
@@ -133,6 +133,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -133,6 +133,14 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
LOGGER
,
"连接IO模块["
+
ioIp
+
"]出错:"
+
error
.
ToString
());
LogUtil
.
error
(
LOGGER
,
"连接IO模块["
+
ioIp
+
"]出错:"
+
error
.
ToString
());
}
}
}
}
public
override
void
ReadAllDI
(
string
ioIp
,
byte
slaveId
)
{
ReadMultipleDI
(
ioIp
,
(
byte
)
slaveId
,
(
ushort
)
DIStartAddress
,
16
);
}
public
override
void
ReadAllDO
(
string
ioIp
,
byte
slaveId
)
{
ReadMultipleDO
(
ioIp
,
(
byte
)
slaveId
,
(
ushort
)
DoStartAddress
,
16
);
}
/// <summary>
/// <summary>
/// 判断Io模块是否连接
/// 判断Io模块是否连接
/// </summary>
/// </summary>
...
@@ -191,7 +199,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -191,7 +199,7 @@ namespace OnlineStore.DeviceLibrary
Thread
.
Sleep
(
1
);
Thread
.
Sleep
(
1
);
}
}
public
static
void
ConnectionKND
(
List
<
string
>
DIONameList
)
public
override
void
ConnectionIOList
(
List
<
string
>
DIONameList
)
{
{
foreach
(
string
ip
in
DIONameList
)
foreach
(
string
ip
in
DIONameList
)
{
{
...
@@ -232,7 +240,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -232,7 +240,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
//关闭所有的DO
//关闭所有的DO
public
static
void
CloseAllDO
()
public
override
void
CloseAllDO
()
{
{
foreach
(
string
key
in
mastMap
.
Keys
)
foreach
(
string
key
in
mastMap
.
Keys
)
{
{
...
@@ -241,7 +249,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -241,7 +249,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
public
static
void
CloseAllConnection
()
public
override
void
CloseAllConnection
()
{
{
foreach
(
MasterTcpClient
tcp
in
mastMap
.
Values
)
foreach
(
MasterTcpClient
tcp
in
mastMap
.
Values
)
...
@@ -276,7 +284,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -276,7 +284,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
LOGGER
,
"ReadSingleDO出错没有连接IO模块:"
+
ioIp
);
LogUtil
.
error
(
LOGGER
,
"ReadSingleDO出错没有连接IO模块:"
+
ioIp
);
}
}
}
}
public
static
void
WriteSingleDO
(
string
ioIp
,
byte
slaveId
,
ushort
StartAddress
,
IO_VALUE
onOff
)
public
override
void
WriteSingleDO
(
string
ioIp
,
byte
slaveId
,
ushort
StartAddress
,
IO_VALUE
onOff
)
{
{
ushort
ID
=
5
;
ushort
ID
=
5
;
MasterTcpClient
MBmaster
=
null
;
MasterTcpClient
MBmaster
=
null
;
...
@@ -294,7 +302,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -294,7 +302,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
public
static
void
WriteSingleDO
(
string
ioIp
,
byte
slaveId
,
ushort
StartAddress
,
IO_VALUE
onOff
,
int
mSeconds
)
public
override
void
WriteSingleDO
(
string
ioIp
,
byte
slaveId
,
ushort
StartAddress
,
IO_VALUE
onOff
,
int
mSeconds
)
{
{
ushort
ID
=
5
;
ushort
ID
=
5
;
MasterTcpClient
MBmaster
=
null
;
MasterTcpClient
MBmaster
=
null
;
...
@@ -368,7 +376,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -368,7 +376,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
LOGGER
,
"SaveDOValue出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
LOGGER
,
"SaveDOValue出错:"
+
ex
.
ToString
());
}
}
}
}
public
static
IO_VALUE
GetDOValue
(
string
ioIP
,
byte
slaveId
,
ushort
StartAddress
)
public
override
IO_VALUE
GetDOValue
(
string
ioIP
,
byte
slaveId
,
ushort
StartAddress
)
{
{
IO_VALUE
value
=
IO_VALUE
.
LOW
;
IO_VALUE
value
=
IO_VALUE
.
LOW
;
...
@@ -384,7 +392,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -384,7 +392,7 @@ namespace OnlineStore.DeviceLibrary
return
value
;
return
value
;
}
}
public
static
IO_VALUE
GetDIValue
(
string
ioIP
,
byte
slaveId
,
ushort
StartAddress
)
public
override
IO_VALUE
GetDIValue
(
string
ioIP
,
byte
slaveId
,
ushort
StartAddress
)
{
{
IO_VALUE
value
=
IO_VALUE
.
LOW
;
IO_VALUE
value
=
IO_VALUE
.
LOW
;
if
(
DIValueMap
.
ContainsKey
(
ioIP
))
if
(
DIValueMap
.
ContainsKey
(
ioIP
))
...
@@ -398,7 +406,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -398,7 +406,7 @@ namespace OnlineStore.DeviceLibrary
}
}
return
value
;
return
value
;
}
}
public
static
IO_VALUE
GetIOValue
(
ConfigIO
configIO
)
public
override
IO_VALUE
GetIOValue
(
ConfigIO
configIO
)
{
{
IO_VALUE
value
=
IO_VALUE
.
LOW
;
IO_VALUE
value
=
IO_VALUE
.
LOW
;
try
try
...
...
source/DeviceLibrary/KangNaiDe/MasterTcpClient.cs
→
source/DeviceLibrary/
IO/
KangNaiDe/MasterTcpClient.cs
查看文件 @
af80527
...
@@ -106,10 +106,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -106,10 +106,11 @@ namespace OnlineStore.DeviceLibrary
public
MasterTcpClient
()
public
MasterTcpClient
()
{
{
}
}
private
string
IP
=
""
;
public
int
TimeOutTime
=
0
;
public
int
TimeOutTime
=
0
;
public
MasterTcpClient
(
string
ip
,
ushort
port
)
public
MasterTcpClient
(
string
ip
,
ushort
port
)
{
{
this
.
IP
=
ip
;
TimeOutTime
=
2000
;
TimeOutTime
=
2000
;
connect
(
ip
,
port
);
connect
(
ip
,
port
);
}
}
...
@@ -118,7 +119,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -118,7 +119,6 @@ namespace OnlineStore.DeviceLibrary
{
{
try
try
{
{
OnResponseData
=
null
;
// Connect asynchronous client
// Connect asynchronous client
socketClient
=
new
Socket
(
IPAddress
.
Parse
(
ip
).
AddressFamily
,
SocketType
.
Stream
,
ProtocolType
.
Tcp
);
socketClient
=
new
Socket
(
IPAddress
.
Parse
(
ip
).
AddressFamily
,
SocketType
.
Stream
,
ProtocolType
.
Tcp
);
if
(
TimeOutTime
<=
0
)
if
(
TimeOutTime
<=
0
)
...
@@ -127,7 +127,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -127,7 +127,6 @@ namespace OnlineStore.DeviceLibrary
socketClient
.
SetSocketOption
(
SocketOptionLevel
.
Socket
,
SocketOptionName
.
SendTimeout
,
_timeout
);
socketClient
.
SetSocketOption
(
SocketOptionLevel
.
Socket
,
SocketOptionName
.
SendTimeout
,
_timeout
);
socketClient
.
SetSocketOption
(
SocketOptionLevel
.
Socket
,
SocketOptionName
.
ReceiveTimeout
,
_timeout
);
socketClient
.
SetSocketOption
(
SocketOptionLevel
.
Socket
,
SocketOptionName
.
ReceiveTimeout
,
_timeout
);
socketClient
.
SetSocketOption
(
SocketOptionLevel
.
Socket
,
SocketOptionName
.
NoDelay
,
1
);
socketClient
.
SetSocketOption
(
SocketOptionLevel
.
Socket
,
SocketOptionName
.
NoDelay
,
1
);
}
}
else
else
{
{
...
@@ -154,10 +153,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -154,10 +153,11 @@ namespace OnlineStore.DeviceLibrary
reviceTimer
.
Enabled
=
true
;
reviceTimer
.
Enabled
=
true
;
_connected
=
true
;
_connected
=
true
;
}
}
catch
(
Exception
error
)
catch
(
System
.
IO
.
IO
Exception
error
)
{
{
LogUtil
.
info
(
LOGGER
,
"Connect to "
+
ip
+
":"
+
port
+
" fail!"
);
LogUtil
.
info
(
LOGGER
,
"Connect to "
+
ip
+
":"
+
port
+
" fail!"
);
_connected
=
false
;
_connected
=
false
;
throw
(
error
);
}
}
}
}
...
@@ -171,7 +171,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -171,7 +171,7 @@ namespace OnlineStore.DeviceLibrary
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LOGGER
.
Error
(
"出错:"
+
ex
.
ToString
());
LOGGER
.
Error
(
"
IO模块["
+
IP
+
"]
出错:"
+
ex
.
ToString
());
}
}
}
}
...
@@ -295,6 +295,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -295,6 +295,7 @@ namespace OnlineStore.DeviceLibrary
}
}
catch
(
SocketException
e
)
catch
(
SocketException
e
)
{
{
LogUtil
.
error
(
LOGGER
,
"IO模块["
+
IP
+
"]接收数据出现错误:"
+
e
.
ToString
());
if
(
socketClient
!=
null
)
if
(
socketClient
!=
null
)
{
{
socketClient
.
Close
();
socketClient
.
Close
();
...
@@ -328,8 +329,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -328,8 +329,14 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(
socketClient
.
Connected
)
if
(
socketClient
.
Connected
)
{
{
try
{
socketClient
.
Shutdown
(
SocketShutdown
.
Both
);
}
try
catch
{
}
{
socketClient
.
Shutdown
(
SocketShutdown
.
Both
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
LOGGER
,
"IO模块["
+
IP
+
"]dispose出错:"
+
ex
.
ToString
());
}
socketClient
.
Close
();
socketClient
.
Close
();
}
}
socketClient
=
null
;
socketClient
=
null
;
...
@@ -504,43 +511,37 @@ namespace OnlineStore.DeviceLibrary
...
@@ -504,43 +511,37 @@ namespace OnlineStore.DeviceLibrary
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// Write asynchronous data
// Write asynchronous data
p
ublic
void
WriteAsyncData
(
byte
[]
write_data
,
ushort
id
)
p
rivate
void
WriteAsyncData
(
byte
[]
write_data
,
ushort
id
)
{
{
try
if
(
socketClient
==
null
)
{
{
if
(
socketClient
==
null
)
LOGGER
.
Error
(
"发送数据时发现socketClient=null"
);
{
return
;
LOGGER
.
Error
(
"发送数据时发现socketClient=null"
);
}
return
;
IPEndPoint
clientipe
=
(
IPEndPoint
)
socketClient
.
RemoteEndPoint
;
}
if
((
socketClient
!=
null
)
&&
(
socketClient
.
Connected
))
IPEndPoint
clientipe
=
(
IPEndPoint
)
socketClient
.
RemoteEndPoint
;
{
if
((
socketClient
!=
null
)
&&
(
socketClient
.
Connected
))
try
{
{
try
//发送的数据打印出来
string
str
=
""
;
foreach
(
byte
by
in
write_data
)
{
{
//发送的数据打印出来
str
=
str
+
" "
+
by
;
string
str
=
""
;
foreach
(
byte
by
in
write_data
)
{
str
=
str
+
" "
+
by
;
}
//LogUtil.info( clientipe.ToString()+"发送数据:" + str);
socketClient
.
BeginSend
(
write_data
,
0
,
write_data
.
Length
,
SocketFlags
.
None
,
new
AsyncCallback
(
OnSend
),
null
);
//socketClient.BeginReceive(tcpSocketReviceBuffer, 0, tcpSocketReviceBuffer.Length, SocketFlags.None, new AsyncCallback(OnReceive), socketClient);
ReviceDataProcess
();
}
catch
(
SystemException
error
)
{
CallException
(
id
,
write_data
[
7
],
excExceptionConnectionLost
,
tcpSocketReviceBuffer
);
}
}
//LogUtil.info( clientipe.ToString()+"发送数据:" + str);
socketClient
.
BeginSend
(
write_data
,
0
,
write_data
.
Length
,
SocketFlags
.
None
,
new
AsyncCallback
(
OnSend
),
null
);
//socketClient.BeginReceive(tcpSocketReviceBuffer, 0, tcpSocketReviceBuffer.Length, SocketFlags.None, new AsyncCallback(OnReceive), socketClient);
ReviceDataProcess
();
}
catch
(
SystemException
error
)
{
LogUtil
.
error
(
LOGGER
,
"IO模块 WriteAsyncData出错:"
+
error
.
ToString
());
CallException
(
id
,
write_data
[
7
],
excExceptionConnectionLost
,
tcpSocketReviceBuffer
);
}
}
else
CallException
(
id
,
write_data
[
7
],
excExceptionConnectionLost
,
tcpSocketReviceBuffer
);
}
catch
(
Exception
ex
)
{
LOGGER
.
Error
(
"出错:"
+
ex
.
ToString
());
}
}
else
CallException
(
id
,
write_data
[
7
],
excExceptionConnectionLost
,
tcpSocketReviceBuffer
);
}
}
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
...
...
source/DeviceLibrary/PanasonicServo/BatchAxisController.cs
查看文件 @
af80527
...
@@ -45,7 +45,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -45,7 +45,7 @@ namespace OnlineStore.DeviceLibrary
if
(
IsInProcess
)
{
return
;
}
if
(
IsInProcess
)
{
return
;
}
IsInProcess
=
true
;
IsInProcess
=
true
;
bool
result
=
false
;
bool
result
=
false
;
if
(
KND
.
IOValue
(
TargetIoType
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
TargetIoType
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
LogUtil
.
info
(
"批量上料轴,检测到【"
+
TargetIoType
+
"】信号,可以停止运动"
);
LogUtil
.
info
(
"批量上料轴,检测到【"
+
TargetIoType
+
"】信号,可以停止运动"
);
result
=
true
;
result
=
true
;
...
...
source/DeviceLibrary/ShuoKe/MeteringSignalBean.cs
查看文件 @
af80527
...
@@ -63,7 +63,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -63,7 +63,7 @@ namespace OnlineStore.DeviceLibrary
IsInProcess
=
true
;
IsInProcess
=
true
;
IO_VALUE
value
=
KND
.
IOValue
(
IO_Type
.
CompressAxis_Check
);
IO_VALUE
value
=
IOManager
.
IOValue
(
IO_Type
.
CompressAxis_Check
);
if
(
value
.
Equals
(
IO_VALUE
.
HIGH
)
&&
PreSignalValue
.
Equals
(
IO_VALUE
.
LOW
))
if
(
value
.
Equals
(
IO_VALUE
.
HIGH
)
&&
PreSignalValue
.
Equals
(
IO_VALUE
.
LOW
))
{
{
SignalChangeCount
++;
SignalChangeCount
++;
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
af80527
...
@@ -73,21 +73,21 @@ namespace OnlineStore.DeviceLibrary
...
@@ -73,21 +73,21 @@ namespace OnlineStore.DeviceLibrary
string
codeStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CodeType
);
string
codeStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CodeType
);
CodeManager
.
LoadConfig
(
nameStr
,
codeStr
);
CodeManager
.
LoadConfig
(
nameStr
,
codeStr
);
AutomaticBaiting
.
Init
();
AutomaticBaiting
.
Init
();
IOManager
.
Init
();
//初始化 //连接设备
//初始化 //连接设备
if
(
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
CodeRun
).
Equals
(
1
))
{
}
if
(
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
CodeRun
).
Equals
(
1
))
{
}
else
else
{
{
KNDManager
.
ConnectionKND
(
Config
.
DIODeviceNameList
);
IOManager
.
instance
.
ConnectionIOList
(
Config
.
DIODeviceNameList
);
int
isAuto
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
);
int
isAuto
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
);
mainTimer
.
Enabled
=
(
isAuto
==
1
);
mainTimer
.
Enabled
=
(
isAuto
==
1
);
Task
.
Factory
.
StartNew
(
delegate
Task
.
Factory
.
StartNew
(
delegate
{
{
Thread
.
Sleep
(
300
);
Thread
.
Sleep
(
300
);
//默认三个灯都亮
//默认三个灯都亮
KND
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
});
});
}
}
}
}
...
@@ -108,13 +108,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -108,13 +108,13 @@ namespace OnlineStore.DeviceLibrary
//判断急停
//判断急停
if
(
storeRunStatus
>=
StoreRunStatus
.
HomeMoving
)
if
(
storeRunStatus
>=
StoreRunStatus
.
HomeMoving
)
{
{
if
(
KND
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOManager
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
{
if
(
isInSuddenDown
.
Equals
(
false
))
if
(
isInSuddenDown
.
Equals
(
false
))
{
{
//LogUtil.error(LOGGER, StoreName + "收到急停信号,等待200后再次判断");
//LogUtil.error(LOGGER, StoreName + "收到急停信号,等待200后再次判断");
//Thread.Sleep(200);
//Thread.Sleep(200);
//if (
KND
.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
//if (
IOManager
.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
//{
//{
isInSuddenDown
=
true
;
isInSuddenDown
=
true
;
LogUtil
.
error
(
LOGGER
,
StoreName
+
"收到急停信号,报警急停"
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
"收到急停信号,报警急停"
);
...
@@ -136,7 +136,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -136,7 +136,7 @@ namespace OnlineStore.DeviceLibrary
}
}
private
void
AirCheckProcess
()
private
void
AirCheckProcess
()
{
{
IO_VALUE
currAirValue
=
KND
.
IOValue
(
IO_Type
.
Airpressure_Check
);
IO_VALUE
currAirValue
=
IOManager
.
IOValue
(
IO_Type
.
Airpressure_Check
);
if
(
isInSuddenDown
)
if
(
isInSuddenDown
)
{
{
return
;
return
;
...
@@ -200,7 +200,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -200,7 +200,7 @@ namespace OnlineStore.DeviceLibrary
{
{
runTimeWatch
.
Restart
();
runTimeWatch
.
Restart
();
LogUtil
.
info
(
LOGGER
,
StoreName
+
"开始启动,启动时间:"
+
DateTime
.
Now
.
ToLongTimeString
());
LogUtil
.
info
(
LOGGER
,
StoreName
+
"开始启动,启动时间:"
+
DateTime
.
Now
.
ToLongTimeString
());
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
if
(
IsHasCompress_Axis
)
if
(
IsHasCompress_Axis
)
{
{
if
(
ShuoKeControls
.
isRun
==
false
&&
(!
StoreManager
.
OpenShuoKe
(
this
)))
if
(
ShuoKeControls
.
isRun
==
false
&&
(!
StoreManager
.
OpenShuoKe
(
this
)))
...
@@ -222,8 +222,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -222,8 +222,8 @@ namespace OnlineStore.DeviceLibrary
alarmType
=
StoreAlarmType
.
None
;
alarmType
=
StoreAlarmType
.
None
;
//急停按钮和气压检测需要一起判断
//急停按钮和气压检测需要一起判断
IO_VALUE
suddenBtn
=
KND
.
IOValue
(
IO_Type
.
SuddenStop_BTN
);
IO_VALUE
suddenBtn
=
IOManager
.
IOValue
(
IO_Type
.
SuddenStop_BTN
);
IO_VALUE
airCheck
=
KND
.
IOValue
(
IO_Type
.
Airpressure_Check
);
IO_VALUE
airCheck
=
IOManager
.
IOValue
(
IO_Type
.
Airpressure_Check
);
//if (suddenBtn == IO_VALUE.HIGH)
//if (suddenBtn == IO_VALUE.HIGH)
if
(
suddenBtn
==
IO_VALUE
.
HIGH
&&
airCheck
==
IO_VALUE
.
HIGH
)
if
(
suddenBtn
==
IO_VALUE
.
HIGH
&&
airCheck
==
IO_VALUE
.
HIGH
)
...
@@ -276,9 +276,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -276,9 +276,9 @@ namespace OnlineStore.DeviceLibrary
WarnMsg
=
""
;
WarnMsg
=
""
;
CurrInOutACount
=
0
;
CurrInOutACount
=
0
;
CurrInOutCount
=
0
;
CurrInOutCount
=
0
;
KND
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
storeRunStatus
=
StoreRunStatus
.
HomeMoving
;
storeRunStatus
=
StoreRunStatus
.
HomeMoving
;
StoreMove
.
NewMove
(
StoreMoveType
.
ReturnHome
);
StoreMove
.
NewMove
(
StoreMoveType
.
ReturnHome
);
...
@@ -314,9 +314,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -314,9 +314,9 @@ namespace OnlineStore.DeviceLibrary
CurrInOutCount
=
0
;
CurrInOutCount
=
0
;
CurrInOutACount
=
0
;
CurrInOutACount
=
0
;
KND
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
//复位之前先停止运行
//复位之前先停止运行
if
(
isNeedClearAuto
)
if
(
isNeedClearAuto
)
{
{
...
@@ -516,8 +516,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -516,8 +516,8 @@ namespace OnlineStore.DeviceLibrary
}
}
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Up
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Up
,
IO_VALUE
.
HIGH
));
KND
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
HIGH
);
}
}
private
void
CloseDoorAndWait
()
private
void
CloseDoorAndWait
()
{
{
...
@@ -535,22 +535,22 @@ namespace OnlineStore.DeviceLibrary
...
@@ -535,22 +535,22 @@ namespace OnlineStore.DeviceLibrary
}
}
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
));
KND
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
}
}
private
void
ResetCloseDoor
()
private
void
ResetCloseDoor
()
{
{
if
(
KND
.
IOValue
(
IO_Type
.
Door_Down
).
Equals
(
IO_VALUE
.
HIGH
)
&&
KND
.
IOValue
(
IO_Type
.
Door_Up
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOManager
.
IOValue
(
IO_Type
.
Door_Down
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
Door_Up
).
Equals
(
IO_VALUE
.
LOW
))
{
{
return
;
return
;
}
}
if
(
KND
.
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
));
KND
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
}
}
}
}
...
@@ -628,7 +628,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -628,7 +628,7 @@ namespace OnlineStore.DeviceLibrary
public
bool
RunAxis
(
bool
isCheck
)
public
bool
RunAxis
(
bool
isCheck
)
{
{
KND
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
HIGH
);
Thread
.
Sleep
(
1000
);
Thread
.
Sleep
(
1000
);
//打开所有轴
//打开所有轴
foreach
(
ConfigMoveAxis
moveAxis
in
moveAxisList
)
foreach
(
ConfigMoveAxis
moveAxis
in
moveAxisList
)
...
@@ -660,7 +660,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -660,7 +660,7 @@ namespace OnlineStore.DeviceLibrary
IsIntSlvBlock
=
true
;
IsIntSlvBlock
=
true
;
if
(
ACServerManager
.
ServerOnStatus
(
Config
.
UpDown_Axis
.
DeviceName
,
Config
.
UpDown_Axis
.
GetAxisValue
()))
if
(
ACServerManager
.
ServerOnStatus
(
Config
.
UpDown_Axis
.
DeviceName
,
Config
.
UpDown_Axis
.
GetAxisValue
()))
{
{
KND
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
HIGH
);
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
@@ -707,7 +707,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -707,7 +707,7 @@ namespace OnlineStore.DeviceLibrary
public
void
CloseAllAxis
()
public
void
CloseAllAxis
()
{
{
LogUtil
.
info
(
StoreName
+
"关闭刹车,关闭伺服"
);
LogUtil
.
info
(
StoreName
+
"关闭刹车,关闭伺服"
);
KND
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
foreach
(
ConfigMoveAxis
axis
in
moveAxisList
)
foreach
(
ConfigMoveAxis
axis
in
moveAxisList
)
{
{
ACServerManager
.
ServoOff
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
ACServerManager
.
ServoOff
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
...
@@ -715,7 +715,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -715,7 +715,7 @@ namespace OnlineStore.DeviceLibrary
ACServerManager
.
ColsePort
(
axis
.
DeviceName
);
ACServerManager
.
ColsePort
(
axis
.
DeviceName
);
}
}
Thread
.
Sleep
(
100
);
Thread
.
Sleep
(
100
);
KND
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
LOW
);
}
}
public
int
GetAlarmCodeByAxis
(
ConfigMoveAxis
axis
)
public
int
GetAlarmCodeByAxis
(
ConfigMoveAxis
axis
)
...
@@ -762,7 +762,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -762,7 +762,7 @@ namespace OnlineStore.DeviceLibrary
storeStatus
=
StoreStatus
.
ResetMove
;
storeStatus
=
StoreStatus
.
ResetMove
;
//mainTimer.Enabled = false;
//mainTimer.Enabled = false;
AutomaticBaiting
.
StopRun
();
AutomaticBaiting
.
StopRun
();
KNDManager
.
CloseAllDO
();
IOManager
.
instance
.
CloseAllDO
();
if
(
IsHasCompress_Axis
)
if
(
IsHasCompress_Axis
)
{
{
ShuoKeControls
.
ClosePort
();
ShuoKeControls
.
ClosePort
();
...
@@ -783,7 +783,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -783,7 +783,7 @@ namespace OnlineStore.DeviceLibrary
{
{
SaveAlarmInfo
(
alarmType
,
alarmDetial
,
alarmMsg
,
storeMoveType
);
SaveAlarmInfo
(
alarmType
,
alarmDetial
,
alarmMsg
,
storeMoveType
);
autoNext
=
false
;
autoNext
=
false
;
KND
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
HIGH
);
if
(
this
.
alarmType
.
Equals
(
alarmType
)
&&
alarmType
!=
StoreAlarmType
.
SuddenStop
&&
alarmType
!=
StoreAlarmType
.
NoAirCheck
)
if
(
this
.
alarmType
.
Equals
(
alarmType
)
&&
alarmType
!=
StoreAlarmType
.
SuddenStop
&&
alarmType
!=
StoreAlarmType
.
NoAirCheck
)
{
{
return
;
return
;
...
@@ -794,14 +794,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -794,14 +794,14 @@ namespace OnlineStore.DeviceLibrary
if
(
alarmType
.
Equals
(
StoreAlarmType
.
AxisAlarm
)
|
alarmType
.
Equals
(
StoreAlarmType
.
AxisMoveError
))
if
(
alarmType
.
Equals
(
StoreAlarmType
.
AxisAlarm
)
|
alarmType
.
Equals
(
StoreAlarmType
.
AxisMoveError
))
{
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
"轴报警,关闭刹车,停止运动,关闭轴,打开报警灯"
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
"轴报警,关闭刹车,停止运动,关闭轴,打开报警灯"
);
KND
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
StopMove
(
true
);
StopMove
(
true
);
}
}
else
if
(
alarmType
==
StoreAlarmType
.
SuddenStop
)
else
if
(
alarmType
==
StoreAlarmType
.
SuddenStop
)
{
{
isInSuddenDown
=
true
;
isInSuddenDown
=
true
;
LogUtil
.
error
(
LOGGER
,
StoreName
+
"收到急停信号,关闭刹车,停止运动,关闭轴,打开报警灯 "
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
"收到急停信号,关闭刹车,停止运动,关闭轴,打开报警灯 "
);
KND
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
StoreMove
.
EndMove
();
StoreMove
.
EndMove
();
StopMove
(
true
);
StopMove
(
true
);
storeStatus
=
StoreStatus
.
SuddenStop
;
storeStatus
=
StoreStatus
.
SuddenStop
;
...
@@ -810,7 +810,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -810,7 +810,7 @@ namespace OnlineStore.DeviceLibrary
{
{
isNoAirCheck
=
true
;
isNoAirCheck
=
true
;
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 未检测到气压信号 ,打开刹车,停止运动,关闭轴,打开报警灯 "
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 未检测到气压信号 ,打开刹车,停止运动,关闭轴,打开报警灯 "
);
KND
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
StoreMove
.
EndMove
();
StoreMove
.
EndMove
();
StopMove
(
true
);
StopMove
(
true
);
storeStatus
=
StoreStatus
.
SuddenStop
;
storeStatus
=
StoreStatus
.
SuddenStop
;
...
@@ -905,47 +905,47 @@ namespace OnlineStore.DeviceLibrary
...
@@ -905,47 +905,47 @@ namespace OnlineStore.DeviceLibrary
{
{
isNeedAlarmLed
=
true
;
isNeedAlarmLed
=
true
;
}
}
if
(
isNeedAlarmLed
&&
KND
.
IOValue
(
IO_Type
.
Alarm_HddLed
).
Equals
(
IO_VALUE
.
LOW
))
if
(
isNeedAlarmLed
&&
IOManager
.
IOValue
(
IO_Type
.
Alarm_HddLed
).
Equals
(
IO_VALUE
.
LOW
))
{
{
KND
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
HIGH
);
}
}
else
else
{
{
if
(
KND
.
IOValue
(
IO_Type
.
Alarm_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
Alarm_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
KND
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
}
}
}
}
//绿灯闪
//绿灯闪
if
((
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
)
||
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
OutStore
)
if
((
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
)
||
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
OutStore
)
||
storeRunStatus
.
Equals
(
StoreRunStatus
.
HomeMoving
)
||
storeRunStatus
.
Equals
(
StoreRunStatus
.
Reset
))
||
storeRunStatus
.
Equals
(
StoreRunStatus
.
HomeMoving
)
||
storeRunStatus
.
Equals
(
StoreRunStatus
.
Reset
))
&&
KND
.
IOValue
(
IO_Type
.
AutoRun_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
&&
IOManager
.
IOValue
(
IO_Type
.
AutoRun_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
KND
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
LOW
);
}
}
else
else
{
{
//绿灯亮
//绿灯亮
KND
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
HIGH
);
}
}
//黄灯
//黄灯
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
)
||
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
OutStore
)
||
TempOrHumidityIsAlarm
||
isTemp30M
)
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
)
||
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
OutStore
)
||
TempOrHumidityIsAlarm
||
isTemp30M
)
{
{
if
(
KND
.
IOValue
(
IO_Type
.
RunSign_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
RunSign_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
KND
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
}
}
else
else
{
{
KND
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
HIGH
);
}
}
}
}
else
else
{
{
if
(
KND
.
IOValue
(
IO_Type
.
RunSign_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
RunSign_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
KND
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
}
}
}
}
}
}
...
@@ -962,7 +962,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -962,7 +962,7 @@ namespace OnlineStore.DeviceLibrary
if
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
))
if
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
))
{
{
//取新的Io状态
//取新的Io状态
IO_VALUE
autoSingle
=
KND
.
IOValue
(
IO_Type
.
AutoRun_Single
);
IO_VALUE
autoSingle
=
IOManager
.
IOValue
(
IO_Type
.
AutoRun_Single
);
if
(
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
).
Equals
(
1
))
if
(
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
).
Equals
(
1
))
{
{
if
(
autoSingle
.
Equals
(
IO_VALUE
.
HIGH
)
&&
lastAutoRun
.
Equals
(
IO_VALUE
.
LOW
))
if
(
autoSingle
.
Equals
(
IO_VALUE
.
HIGH
)
&&
lastAutoRun
.
Equals
(
IO_VALUE
.
LOW
))
...
@@ -985,8 +985,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -985,8 +985,8 @@ namespace OnlineStore.DeviceLibrary
else
if
(
storeRunStatus
>=
StoreRunStatus
.
HomeMoving
)
else
if
(
storeRunStatus
>=
StoreRunStatus
.
HomeMoving
)
{
{
//取新的Io状态
//取新的Io状态
IO_VALUE
suddenBtn
=
KND
.
IOValue
(
IO_Type
.
SuddenStop_BTN
);
IO_VALUE
suddenBtn
=
IOManager
.
IOValue
(
IO_Type
.
SuddenStop_BTN
);
IO_VALUE
resetBtn
=
KND
.
IOValue
(
IO_Type
.
Reset_BTN
);
IO_VALUE
resetBtn
=
IOManager
.
IOValue
(
IO_Type
.
Reset_BTN
);
//急停按钮
//急停按钮
if
(
suddenBtn
.
Equals
(
IO_VALUE
.
LOW
))
if
(
suddenBtn
.
Equals
(
IO_VALUE
.
LOW
))
...
@@ -1274,8 +1274,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1274,8 +1274,8 @@ namespace OnlineStore.DeviceLibrary
if
(
Config
.
IsHasLocationCylinder
>=
1
)
if
(
Config
.
IsHasLocationCylinder
>=
1
)
{
{
//定位气缸停止
//定位气缸停止
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
LOW
);
}
}
}
}
if
(
IsCloseAxis
)
if
(
IsCloseAxis
)
...
@@ -1283,8 +1283,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1283,8 +1283,8 @@ namespace OnlineStore.DeviceLibrary
CloseAllAxis
();
CloseAllAxis
();
}
}
LogUtil
.
info
(
LOGGER
,
StoreName
+
"StopMove"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"StopMove"
);
KND
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
AutomaticBaiting
.
StopMove
();
AutomaticBaiting
.
StopMove
();
MeteringSignal
.
StopCheck
();
MeteringSignal
.
StopCheck
();
...
@@ -1371,7 +1371,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1371,7 +1371,7 @@ namespace OnlineStore.DeviceLibrary
LOGGER
.
Info
(
"当前最大湿度:"
+
currMaxHumidity
.
ToString
()
+
",开始吹气湿度:"
+
startBlowHumidity
+
",当前不在吹气中,且间隔超过"
+
Config
.
BlowAir_Interval
+
"分钟,开始吹气!"
);
LOGGER
.
Info
(
"当前最大湿度:"
+
currMaxHumidity
.
ToString
()
+
",开始吹气湿度:"
+
startBlowHumidity
+
",当前不在吹气中,且间隔超过"
+
Config
.
BlowAir_Interval
+
"分钟,开始吹气!"
);
IsInBlowing
=
true
;
IsInBlowing
=
true
;
//Thread.Sleep(100);
//Thread.Sleep(100);
KND
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
HIGH
);
LastBeginBlowTime
=
DateTime
.
Now
;
LastBeginBlowTime
=
DateTime
.
Now
;
LastEndBlowTime
=
DateTime
.
Now
;
LastEndBlowTime
=
DateTime
.
Now
;
}
}
...
@@ -1382,7 +1382,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1382,7 +1382,7 @@ namespace OnlineStore.DeviceLibrary
LOGGER
.
Info
(
"当前最大湿度:"
+
currMaxHumidity
.
ToString
()
+
",停止吹气湿度:"
+
stopBlowHumidity
+
",停止吹气!"
);
LOGGER
.
Info
(
"当前最大湿度:"
+
currMaxHumidity
.
ToString
()
+
",停止吹气湿度:"
+
stopBlowHumidity
+
",停止吹气!"
);
IsInBlowing
=
false
;
IsInBlowing
=
false
;
//Thread.Sleep(100);
//Thread.Sleep(100);
KND
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
LastEndBlowTime
=
DateTime
.
Now
;
LastEndBlowTime
=
DateTime
.
Now
;
}
}
if
(
IsInBlowing
)
if
(
IsInBlowing
)
...
@@ -1394,7 +1394,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1394,7 +1394,7 @@ namespace OnlineStore.DeviceLibrary
LOGGER
.
Info
(
"已经吹气"
+
span
.
TotalMinutes
+
"分钟,超过配置的吹气时间"
+
Config
.
BlowAir_Time
+
"分钟,停止吹气!"
);
LOGGER
.
Info
(
"已经吹气"
+
span
.
TotalMinutes
+
"分钟,超过配置的吹气时间"
+
Config
.
BlowAir_Time
+
"分钟,停止吹气!"
);
IsInBlowing
=
false
;
IsInBlowing
=
false
;
//Thread.Sleep(100);
//Thread.Sleep(100);
KND
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
LastEndBlowTime
=
DateTime
.
Now
;
LastEndBlowTime
=
DateTime
.
Now
;
}
}
}
}
...
@@ -1417,7 +1417,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1417,7 +1417,7 @@ namespace OnlineStore.DeviceLibrary
TempAlarmTime
=
DateTime
.
Now
;
TempAlarmTime
=
DateTime
.
Now
;
TempOrHumidityIsAlarm
=
true
;
TempOrHumidityIsAlarm
=
true
;
//Thread.Sleep(100);
//Thread.Sleep(100);
KND
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
}
}
else
if
(
temp
<
Max_Temperature
)
else
if
(
temp
<
Max_Temperature
)
{
{
...
@@ -1426,7 +1426,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1426,7 +1426,7 @@ namespace OnlineStore.DeviceLibrary
LOGGER
.
Info
(
"不在吹气中,且当前温度【"
+
param
.
Temperate
+
"】低于【"
+
Max_Temperature
+
"】,关闭报警!"
);
LOGGER
.
Info
(
"不在吹气中,且当前温度【"
+
param
.
Temperate
+
"】低于【"
+
Max_Temperature
+
"】,关闭报警!"
);
TempOrHumidityIsAlarm
=
false
;
TempOrHumidityIsAlarm
=
false
;
//Thread.Sleep(100);
//Thread.Sleep(100);
KND
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
}
}
}
}
}
}
...
@@ -1510,7 +1510,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1510,7 +1510,7 @@ namespace OnlineStore.DeviceLibrary
if
(
CodeOrInoutMsg
.
Equals
(
""
))
if
(
CodeOrInoutMsg
.
Equals
(
""
))
{
{
if
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
)&&
AutomaticBaiting
.
AutoBaitingStatus
.
Equals
(
StoreRunStatus
.
Runing
)
if
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
)&&
AutomaticBaiting
.
AutoBaitingStatus
.
Equals
(
StoreRunStatus
.
Runing
)
&&
KND
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
boxStatus
.
msg
=
"叉子料盘检测有料,请检查"
;
boxStatus
.
msg
=
"叉子料盘检测有料,请检查"
;
lineOperation
.
msg
=
"叉子料盘检测有料,请检查"
;
lineOperation
.
msg
=
"叉子料盘检测有料,请检查"
;
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
af80527
...
@@ -150,7 +150,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -150,7 +150,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
IOMove_2
)
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
IOMove_2
)
{
{
wait
.
IsEnd
=
KND
.
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
wait
.
IsEnd
=
IOManager
.
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
int
timeOutMs
=
Config
.
IOSingle_TimerOut
;
int
timeOutMs
=
Config
.
IOSingle_TimerOut
;
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_14_WaitTake
)
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_14_WaitTake
)
{
{
...
@@ -298,7 +298,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -298,7 +298,7 @@ namespace OnlineStore.DeviceLibrary
//LogUtil.error(LOGGER, StoreName + logMsg + " 出错,找不到库位信息");
//LogUtil.error(LOGGER, StoreName + logMsg + " 出错,找不到库位信息");
return
false
;
return
false
;
}
}
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
UpdateInOutMsg
(
logMsg
+
"失败,叉子料盘检测有料"
);
UpdateInOutMsg
(
logMsg
+
"失败,叉子料盘检测有料"
);
//LogUtil.error(LOGGER, StoreName + logMsg + " 出错,叉子料盘检测有料");
//LogUtil.error(LOGGER, StoreName + logMsg + " 出错,叉子料盘检测有料");
...
@@ -368,8 +368,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -368,8 +368,8 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P1
,
Config
.
UpDownAxis_P1_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P1
,
Config
.
UpDownAxis_P1_Speed
);
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P1
,
Config
.
MiddleAxis_P1_Speed
);
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P1
,
Config
.
MiddleAxis_P1_Speed
);
//此处需要等待吸盘在上升位置
//此处需要等待吸盘在上升位置
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Up
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
SuckingDisc_Up
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Down
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
SuckingDisc_Down
,
IO_VALUE
.
LOW
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SuckingDisc_Up
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SuckingDisc_Up
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SuckingDisc_Down
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SuckingDisc_Down
,
IO_VALUE
.
LOW
));
}
}
...
@@ -381,7 +381,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -381,7 +381,7 @@ namespace OnlineStore.DeviceLibrary
{
{
InStoreLog
(
"入库:SI_05 等待吸盘放下物品"
);
InStoreLog
(
"入库:SI_05 等待吸盘放下物品"
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_05_DoorWarToDevice
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_05_DoorWarToDevice
);
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SuckingDisc_Air
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SuckingDisc_Air
,
IO_VALUE
.
LOW
));
}
}
...
@@ -464,7 +464,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -464,7 +464,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_10_LocationCylinder_Down
)
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_10_LocationCylinder_Down
)
{
{
//
KND
.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
//
IOManager
.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
InStoreLog
(
"入库:SI_11 叉子进入库位中,进出轴至P3(库位取放料点) "
);
InStoreLog
(
"入库:SI_11 叉子进入库位中,进出轴至P3(库位取放料点) "
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_11_DeviceToBag
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_11_DeviceToBag
);
ACAxisMove
(
Config
.
InOut_Axis
,
moveP
.
InOut_P3
,
Config
.
InOutAxis_P3_Speed
);
ACAxisMove
(
Config
.
InOut_Axis
,
moveP
.
InOut_P3
,
Config
.
InOutAxis_P3_Speed
);
...
@@ -522,7 +522,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -522,7 +522,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SI_22_InoutToDoor
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SI_22_InoutToDoor
))
{
{
if
(
KND
.
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
InStoreLog
(
"送出料盘:SI_22 ,需要操作人员拿走料盘,打开仓门 "
);
InStoreLog
(
"送出料盘:SI_22 ,需要操作人员拿走料盘,打开仓门 "
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_23_OpenDoor
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_23_OpenDoor
);
...
@@ -541,7 +541,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -541,7 +541,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_24_WaitTrayGo
)
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_24_WaitTrayGo
)
{
{
if
(
KND
.
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
InStoreLog
(
"送出料盘:SI_13 叉子从库位中返回,进出轴动作至P1(待机点) "
);
InStoreLog
(
"送出料盘:SI_13 叉子从库位中返回,进出轴动作至P1(待机点) "
);
// 5= 入仓位完成(料仓Box把料盘放入对应的库位中,装置还未恢复原始状态)
// 5= 入仓位完成(料仓Box把料盘放入对应的库位中,装置还未恢复原始状态)
...
@@ -587,7 +587,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -587,7 +587,7 @@ namespace OnlineStore.DeviceLibrary
//LogUtil.error(LOGGER, StoreName + logMsg + " 出错,找不到库位信息");
//LogUtil.error(LOGGER, StoreName + logMsg + " 出错,找不到库位信息");
return
false
;
return
false
;
}
}
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
UpdateInOutMsg
(
logMsg
+
"失败,叉子料盘检测有料"
);
UpdateInOutMsg
(
logMsg
+
"失败,叉子料盘检测有料"
);
//LogUtil.error(LOGGER, StoreName + logMsg + " 出错,叉子料盘检测有料");
//LogUtil.error(LOGGER, StoreName + logMsg + " 出错,叉子料盘检测有料");
...
@@ -601,7 +601,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -601,7 +601,7 @@ namespace OnlineStore.DeviceLibrary
return
false
;
return
false
;
}
}
//判断批量上下料机构是否已经满
//判断批量上下料机构是否已经满
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
)&&
IsBatchWork
)
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
)&&
IsBatchWork
)
{
{
int
currBatchValue
=
ACServerManager
.
GetActualtPosition
(
Config
.
Batch_Axis
.
DeviceName
,
Config
.
Batch_Axis
.
GetAxisValue
());
int
currBatchValue
=
ACServerManager
.
GetActualtPosition
(
Config
.
Batch_Axis
.
DeviceName
,
Config
.
Batch_Axis
.
GetAxisValue
());
if
(
currBatchValue
-
param
.
MoveP
.
BatchAxis_DownValue
<
1000
)
if
(
currBatchValue
-
param
.
MoveP
.
BatchAxis_DownValue
<
1000
)
...
@@ -725,7 +725,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -725,7 +725,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_06_BagDeviceBack
)
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_06_BagDeviceBack
)
{
{
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
LOW
))
{
{
string
posId
=
StoreMove
.
MoveParam
!=
null
?
StoreMove
.
MoveParam
.
PositionNum
:
""
;
string
posId
=
StoreMove
.
MoveParam
!=
null
?
StoreMove
.
MoveParam
.
PositionNum
:
""
;
LogUtil
.
error
(
"出库【"
+
posId
+
"】过程中叉子已从库位退出,未检测到叉子料盘信号 "
);
LogUtil
.
error
(
"出库【"
+
posId
+
"】过程中叉子已从库位退出,未检测到叉子料盘信号 "
);
...
@@ -774,7 +774,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -774,7 +774,7 @@ namespace OnlineStore.DeviceLibrary
AutomaticBaiting
.
BatchOutStoreHeight
+=
StoreMove
.
MoveParam
.
PlateH
;
AutomaticBaiting
.
BatchOutStoreHeight
+=
StoreMove
.
MoveParam
.
PlateH
;
AutomaticBaiting
.
BatchOutStoreCount
++;
AutomaticBaiting
.
BatchOutStoreCount
++;
}
}
else
if
(
KND
.
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
HIGH
))
else
if
(
IOManager
.
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_21_OpenDoor
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_21_OpenDoor
);
OutStoreLog
(
"出库:SO_21打开仓门,压紧轴至P3(压紧前点),定位气缸下降"
);
OutStoreLog
(
"出库:SO_21打开仓门,压紧轴至P3(压紧前点),定位气缸下降"
);
...
@@ -794,7 +794,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -794,7 +794,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SO_22_WaitTrayGo
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SO_22_WaitTrayGo
))
{
{
if
(
KND
.
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
SO_13_InoutBack
();
SO_13_InoutBack
();
CloseDoorAndWait
();
CloseDoorAndWait
();
...
@@ -826,7 +826,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -826,7 +826,7 @@ namespace OnlineStore.DeviceLibrary
if
(
StoreMove
.
IsBatchInOutStore
)
if
(
StoreMove
.
IsBatchInOutStore
)
{
{
//如果批量能未检测到料盘,需要把批量轴走到能检测到料盘的位置
//如果批量能未检测到料盘,需要把批量轴走到能检测到料盘的位置
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
LOW
))
{
{
StoreMove
.
TimeOutSeconds
=
120
;
StoreMove
.
TimeOutSeconds
=
120
;
//ACAxisMove(Config.Batch_Axis, Config.BatchAxis_P1, Config.BatchAxis_P1_Speed);
//ACAxisMove(Config.Batch_Axis, Config.BatchAxis_P1, Config.BatchAxis_P1_Speed);
...
@@ -902,8 +902,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -902,8 +902,8 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P1
,
Config
.
MiddleAxis_P1_Speed
);
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P1
,
Config
.
MiddleAxis_P1_Speed
);
}
}
//此处需要等待吸盘在上升位置
//此处需要等待吸盘在上升位置
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Up
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
SuckingDisc_Up
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Down
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
SuckingDisc_Down
,
IO_VALUE
.
LOW
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SuckingDisc_Up
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SuckingDisc_Up
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SuckingDisc_Down
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SuckingDisc_Down
,
IO_VALUE
.
LOW
));
}
}
...
@@ -937,10 +937,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -937,10 +937,10 @@ namespace OnlineStore.DeviceLibrary
return
true
;
return
true
;
}
}
if
(
KND
.
IOValue
(
IO_Type
.
LocationCylinder_Down
).
Equals
(
IO_VALUE
.
HIGH
)
if
(
IOManager
.
IOValue
(
IO_Type
.
LocationCylinder_Down
).
Equals
(
IO_VALUE
.
HIGH
)
&&
KND
.
IOValue
(
IO_Type
.
LocationCylinder_Up
).
Equals
(
IO_VALUE
.
LOW
)
&&
IOManager
.
IOValue
(
IO_Type
.
LocationCylinder_Up
).
Equals
(
IO_VALUE
.
LOW
)
&&
KND
.
IOValue
(
IO_Type
.
LocationCylinder2_Down
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
LocationCylinder2_Down
).
Equals
(
IO_VALUE
.
HIGH
)
&&
KND
.
IOValue
(
IO_Type
.
LocationCylinder2_Up
).
Equals
(
IO_VALUE
.
LOW
))
&&
IOManager
.
IOValue
(
IO_Type
.
LocationCylinder2_Up
).
Equals
(
IO_VALUE
.
LOW
))
{
{
return
true
;
return
true
;
}
}
...
@@ -954,8 +954,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -954,8 +954,8 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder2_Up
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder2_Up
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder2_Down
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder2_Down
,
IO_VALUE
.
LOW
));
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
LOW
);
}
}
}
}
private
void
LocationDownAndWait
()
private
void
LocationDownAndWait
()
...
@@ -966,8 +966,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -966,8 +966,8 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder2_Down
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder2_Down
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder2_Up
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder2_Up
,
IO_VALUE
.
LOW
));
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
LOW
);
}
}
}
}
public
List
<
FixtureCodeInfo
>
waitOutStoreList
=
new
List
<
FixtureCodeInfo
>();
public
List
<
FixtureCodeInfo
>
waitOutStoreList
=
new
List
<
FixtureCodeInfo
>();
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
查看文件 @
af80527
...
@@ -110,7 +110,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -110,7 +110,7 @@ namespace OnlineStore.DeviceLibrary
public
static
void
StopRun
()
public
static
void
StopRun
()
{
{
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
ClearInStoreInfo
();
ClearInStoreInfo
();
ClearOutStoreInfo
();
ClearOutStoreInfo
();
}
}
...
@@ -119,7 +119,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -119,7 +119,7 @@ namespace OnlineStore.DeviceLibrary
BatchAxisController
.
StopCheck
();
BatchAxisController
.
StopCheck
();
StoreMove
.
EndMove
();
StoreMove
.
EndMove
();
ClearInStoreInfo
();
ClearInStoreInfo
();
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
CylinderMove
(
IO_Type
.
SuckingDisc_Up
,
IO_Type
.
SuckingDisc_Down
,
false
);
CylinderMove
(
IO_Type
.
SuckingDisc_Up
,
IO_Type
.
SuckingDisc_Down
,
false
);
BatchDoorClose
(
false
);
BatchDoorClose
(
false
);
}
}
...
@@ -180,7 +180,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -180,7 +180,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_R01_CloseDoor
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_R01_CloseDoor
);
//关闭门,轴回原点,检测
//关闭门,轴回原点,检测
BatchDoorClose
(
true
);
BatchDoorClose
(
true
);
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
CylinderMove
(
IO_Type
.
SuckingDisc_Up
,
IO_Type
.
SuckingDisc_Down
,
true
);
CylinderMove
(
IO_Type
.
SuckingDisc_Up
,
IO_Type
.
SuckingDisc_Down
,
true
);
LogUtil
.
info
(
Name
+
"复位中:关闭门锁"
);
LogUtil
.
info
(
Name
+
"复位中:关闭门锁"
);
break
;
break
;
...
@@ -213,7 +213,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -213,7 +213,7 @@ namespace OnlineStore.DeviceLibrary
case
StoreMoveStep
.
AUTO_R03_AutoAxisHome
:
case
StoreMoveStep
.
AUTO_R03_AutoAxisHome
:
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
LOW
))
//if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(1))
//if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(1))
{
{
LogUtil
.
info
(
Name
+
"复位中: 没有料盘,不需要上料,上料轴回0点"
);
LogUtil
.
info
(
Name
+
"复位中: 没有料盘,不需要上料,上料轴回0点"
);
...
@@ -299,7 +299,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -299,7 +299,7 @@ namespace OnlineStore.DeviceLibrary
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I01_Wait
))
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I01_Wait
))
{
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I02_MoveToUp
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I02_MoveToUp
);
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
LogUtil
.
info
(
Name
+
" 入料 ,已检测到料盘,轴不需要上升"
);
LogUtil
.
info
(
Name
+
" 入料 ,已检测到料盘,轴不需要上升"
);
}
}
...
@@ -325,7 +325,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -325,7 +325,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I05_SuckingDisc_Work
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I05_SuckingDisc_Work
))
{
{
if
(
KND
.
IOValue
(
IO_Type
.
SuckingDisc_Air
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
SuckingDisc_Air
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I06_SuckingDisc_Up
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I06_SuckingDisc_Up
);
...
@@ -348,7 +348,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -348,7 +348,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I06_SuckingDisc_Up
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I06_SuckingDisc_Up
))
{
{
if
(
KND
.
IOValue
(
IO_Type
.
SuckingDisc_Air
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
SuckingDisc_Air
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I07_BatchAxisUp
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I07_BatchAxisUp
);
LogUtil
.
info
(
Name
+
"入料: 批量上下料轴上升速度【"
+
StoreManager
.
Config
.
BatchAxis_SlowSpeed
+
"】"
);
LogUtil
.
info
(
Name
+
"入料: 批量上下料轴上升速度【"
+
StoreManager
.
Config
.
BatchAxis_SlowSpeed
+
"】"
);
...
@@ -387,7 +387,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -387,7 +387,7 @@ namespace OnlineStore.DeviceLibrary
if
(
LastWidth
.
Equals
(
0
))
if
(
LastWidth
.
Equals
(
0
))
{
{
//料盘检测2亮为13寸盘,其他都认为是7寸盘
//料盘检测2亮为13寸盘,其他都认为是7寸盘
if
(
KND
.
IOValue
(
IO_Type
.
WidthCheck2
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
WidthCheck2
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
LastWidth
=
13
;
LastWidth
=
13
;
}
}
...
@@ -478,7 +478,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -478,7 +478,7 @@ namespace OnlineStore.DeviceLibrary
LastHeight
=
(
int
)
Math
.
Ceiling
(
1F
*
(
EndMovePosition
-
StartMovePosition
)
/
AxisChangeValue
);
LastHeight
=
(
int
)
Math
.
Ceiling
(
1F
*
(
EndMovePosition
-
StartMovePosition
)
/
AxisChangeValue
);
int
addHeight
=
0
;
int
addHeight
=
0
;
//如果检测信号未亮,极限亮了,需要补充高
//如果检测信号未亮,极限亮了,需要补充高
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
LOW
))
{
{
addHeight
=
StoreManager
.
Config
.
LastTrayAddHeight
;
addHeight
=
StoreManager
.
Config
.
LastTrayAddHeight
;
}
}
...
@@ -541,11 +541,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -541,11 +541,11 @@ namespace OnlineStore.DeviceLibrary
private
static
void
SuckingDiscWork
()
private
static
void
SuckingDiscWork
()
{
{
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I05_SuckingDisc_Work
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I05_SuckingDisc_Work
);
SuckingDisc_WorkCount
++;
SuckingDisc_WorkCount
++;
LogUtil
.
info
(
Name
+
"入料: 吸盘开始第"
+
SuckingDisc_WorkCount
+
"次工作"
);
LogUtil
.
info
(
Name
+
"入料: 吸盘开始第"
+
SuckingDisc_WorkCount
+
"次工作"
);
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
HIGH
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SuckingDisc_Air
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SuckingDisc_Air
,
IO_VALUE
.
HIGH
));
StoreMove
.
OneWaitCanEndStep
=
true
;
StoreMove
.
OneWaitCanEndStep
=
true
;
...
@@ -574,7 +574,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -574,7 +574,7 @@ namespace OnlineStore.DeviceLibrary
ClearTimeOut
();
ClearTimeOut
();
}
}
// if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(0))
// if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(0))
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I03_ScanCode
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I03_ScanCode
);
LogUtil
.
info
(
Name
+
"入料: 开始扫码,最多等待6000 "
);
LogUtil
.
info
(
Name
+
"入料: 开始扫码,最多等待6000 "
);
...
@@ -640,7 +640,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -640,7 +640,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_O01_WaitDoorOpen
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_O01_WaitDoorOpen
))
{
{
if
(
KND
.
IOValue
(
IO_Type
.
OutCheck
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
OutCheck
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_O02_WaitOutSingleLow
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_O02_WaitOutSingleLow
);
LogUtil
.
info
(
Name
+
" 出料 ,等待出料检测信号关闭"
);
LogUtil
.
info
(
Name
+
" 出料 ,等待出料检测信号关闭"
);
...
@@ -705,7 +705,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -705,7 +705,7 @@ namespace OnlineStore.DeviceLibrary
public
static
bool
DoorIsClose
()
public
static
bool
DoorIsClose
()
{
{
if
(
KND
.
IOValue
(
IO_Type
.
DoorClose_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
DoorClose_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
return
true
;
return
true
;
}
}
...
@@ -716,7 +716,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -716,7 +716,7 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(
DoorIsClose
())
if
(
DoorIsClose
())
{
{
if
(
KND
.
IOValue
(
IO_Type
.
BatchDoor_Close
).
Equals
(
IO_VALUE
.
HIGH
)
&&
KND
.
IOValue
(
IO_Type
.
BatchDoor_Open
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOManager
.
IOValue
(
IO_Type
.
BatchDoor_Close
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
BatchDoor_Open
).
Equals
(
IO_VALUE
.
LOW
))
{
{
return
true
;
return
true
;
}
}
...
@@ -747,8 +747,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -747,8 +747,8 @@ namespace OnlineStore.DeviceLibrary
ClearInStoreInfo
();
ClearInStoreInfo
();
ClearOutStoreInfo
();
ClearOutStoreInfo
();
DoorStatus
=
1
;
DoorStatus
=
1
;
KND
.
IOMove
(
IO_Type
.
BatchDoor_Close
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
BatchDoor_Close
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
BatchDoor_Open
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
BatchDoor_Open
,
IO_VALUE
.
HIGH
);
if
(
isWait
)
if
(
isWait
)
{
{
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
BatchDoor_Close
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
BatchDoor_Close
,
IO_VALUE
.
LOW
));
...
@@ -766,8 +766,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -766,8 +766,8 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
BatchDoor_Open
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
BatchDoor_Open
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
BatchDoor_Close
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
BatchDoor_Close
,
IO_VALUE
.
HIGH
));
}
}
KND
.
IOMove
(
IO_Type
.
BatchDoor_Open
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
BatchDoor_Open
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
BatchDoor_Close
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
BatchDoor_Close
,
IO_VALUE
.
HIGH
);
}
}
}
}
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
查看文件 @
af80527
...
@@ -94,7 +94,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -94,7 +94,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
IOMove_2
)
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
IOMove_2
)
{
{
wait
.
IsEnd
=
KND
.
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
wait
.
IsEnd
=
IOManager
.
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
//int timeOutMs = StoreManager.Config.IOSingle_TimerOut;
//int timeOutMs = StoreManager.Config.IOSingle_TimerOut;
//timeOutMs = 20;
//timeOutMs = 20;
//if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs)
//if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs)
...
@@ -227,7 +227,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -227,7 +227,7 @@ namespace OnlineStore.DeviceLibrary
public
static
bool
BatchAxisIsEnd
(
WaitResultInfo
wait
)
public
static
bool
BatchAxisIsEnd
(
WaitResultInfo
wait
)
{
{
bool
result
=
false
;
bool
result
=
false
;
if
(
KND
.
IOValue
(
wait
.
IoType
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
wait
.
IoType
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
LogUtil
.
info
(
wait
.
ToStr
()
+
" 检测到【"
+
wait
.
IoType
+
"】信号,可以停止运动"
);
LogUtil
.
info
(
wait
.
ToStr
()
+
" 检测到【"
+
wait
.
IoType
+
"】信号,可以停止运动"
);
result
=
true
;
result
=
true
;
...
@@ -255,7 +255,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -255,7 +255,7 @@ namespace OnlineStore.DeviceLibrary
{
{
Task
.
Factory
.
StartNew
(
delegate
()
Task
.
Factory
.
StartNew
(
delegate
()
{
{
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
string
message
=
""
;
string
message
=
""
;
List
<
string
>
codeList
=
CodeManager
.
CameraScan
();
List
<
string
>
codeList
=
CodeManager
.
CameraScan
();
if
(
codeList
.
Count
<=
0
)
if
(
codeList
.
Count
<=
0
)
...
@@ -288,7 +288,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -288,7 +288,7 @@ namespace OnlineStore.DeviceLibrary
{
{
LogUtil
.
info
(
"扫到二维码:"
+
LastCode
);
LogUtil
.
info
(
"扫到二维码:"
+
LastCode
);
}
}
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
// StoreManager.Store.onCodeReceived(message);
// StoreManager.Store.onCodeReceived(message);
});
});
}
}
...
@@ -301,8 +301,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -301,8 +301,8 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
lowType
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
lowType
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
highType
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
highType
,
IO_VALUE
.
HIGH
));
}
}
KND
.
IOMove
(
lowType
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
lowType
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
highType
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
highType
,
IO_VALUE
.
HIGH
);
}
}
private
static
string
ProcessMsg
()
private
static
string
ProcessMsg
()
...
@@ -520,7 +520,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -520,7 +520,7 @@ namespace OnlineStore.DeviceLibrary
{
{
return
ResourceControl
.
GetString
(
ResourceControl
.
batchInError
,
"Batch storing Error: Close feeding device"
);
return
ResourceControl
.
GetString
(
ResourceControl
.
batchInError
,
"Batch storing Error: Close feeding device"
);
}
}
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
return
ResourceControl
.
GetString
(
ResourceControl
.
batchInError2
,
"Batch storing Error: gripper full, check before restoring"
);
return
ResourceControl
.
GetString
(
ResourceControl
.
batchInError2
,
"Batch storing Error: gripper full, check before restoring"
);
...
...
source/LoadCVSLibrary/storeConfig/ConfigItemBase.cs
查看文件 @
af80527
...
@@ -262,51 +262,15 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -262,51 +262,15 @@ namespace OnlineStore.LoadCSVLibrary
{
{
}
}
}
}
/// <summary>
/// 若是KNDIO,DI从200-215,DO从100-115
/// 若是AOIBOX,DI从0-15,DO从16-31
/// </summary>
/// <returns></returns>
public
override
int
GetValue
()
public
override
int
GetValue
()
{
{
return
GetValue
();
return
GetValue
();
}
}
//public int GetIOValue()
//{
// if (IoValue >= -1)
// {
// return IoValue;
// }
// try
// {
// if (ProVale.Equals("") || ProVale.Equals("-1"))
// {
// IoValue = -1;
// }
// else if (ProType.Equals(ConfigItemType.DI))
// {
// IoValue = Convert.ToInt32(ProVale, 8);
// }
// else if (ProType.Equals(ConfigItemType.DO))
// {
// if (ProVale.Length == 2)
// {
// int a = Convert.ToInt32(ProVale.Substring(0, 1), 16) - 8;
// string str =a+ProVale.Substring(1,1);
// IoValue = Convert.ToInt32( str, 8);
// //IoValue = a + b;
// }
// else
// {
// IoValue = Convert.ToInt32(ProVale, 16) - Convert.ToInt32("80", 16);
// }
// }
// //LOGGER.Info("IO转换:(" + ElectricalDefinition + ")" + ProVale + "=" + IoValue);
// }
// catch (Exception ex)
// {
// LOGGER.Error("出错了["+ ProVale + "]["+ToString()+"]:" +ex.Message);
// return -1;
// }
// return IoValue;
//}
public
override
string
ToString
()
public
override
string
ToString
()
{
{
return
"ConfigIO。"
+
ProType
+
","
+
Explain
+
","
+
ProName
+
",属性值:"
+
ProVale
+
",设备名称:"
+
DeviceName
+
",描述:"
+
Describe
+
",电器定义:"
+
ElectricalDefinition
+
",代码定义:"
+
CodeDefinition
+
""
;
return
"ConfigIO。"
+
ProType
+
","
+
Explain
+
","
+
ProName
+
",属性值:"
+
ProVale
+
",设备名称:"
+
DeviceName
+
",描述:"
+
Describe
+
",电器定义:"
+
ElectricalDefinition
+
",代码定义:"
+
CodeDefinition
+
""
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论