chore: initial commit
This commit is contained in:
15
MisDataFunction/Function1054/DataAccess/DataAccess.cs
Normal file
15
MisDataFunction/Function1054/DataAccess/DataAccess.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class Function1052
|
||||
{
|
||||
//针对“MIS.BizFacade.Dll”中没有的存储过程,在此类中新建
|
||||
//新建原则:所有的函数用private,只允许在内部使用
|
||||
//针对单个工艺特殊,需要新建存储过程,但是存储过程不能被加入到“MIS.BizFacade.Dll”中
|
||||
|
||||
private void aa()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
MisDataFunction/Function1054/DataAccess/vssver2.scc
Normal file
BIN
MisDataFunction/Function1054/DataAccess/vssver2.scc
Normal file
Binary file not shown.
15
MisDataFunction/Function1054/Db.cs
Normal file
15
MisDataFunction/Function1054/Db.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
public class Db
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
10
MisDataFunction/Function1054/Function02.csproj.vspscc
Normal file
10
MisDataFunction/Function1054/Function02.csproj.vspscc
Normal file
@@ -0,0 +1,10 @@
|
||||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = "relative:MesServer.Function\\Function02"
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
||||
182
MisDataFunction/Function1054/Function1054.csproj
Normal file
182
MisDataFunction/Function1054/Function1054.csproj
Normal file
@@ -0,0 +1,182 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{CC45D613-11B9-48AF-B073-6523D6273525}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Function1054</RootNamespace>
|
||||
<AssemblyName>Function1054</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
<TargetFrameworkProfile />
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\dll_fun\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="MesWork.DeviceDriver">
|
||||
<HintPath>..\..\dll_common\MesWork.DeviceDriver.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MQTTnet">
|
||||
<HintPath>..\..\..\Common\dll\MQTTnet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MQTTnet.Extensions.ManagedClient">
|
||||
<HintPath>..\..\..\Common\dll\MQTTnet.Extensions.ManagedClient.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\dll_common\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http">
|
||||
<HintPath>..\..\DLL\System.Net.Http.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Security, Version=4.0.1.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\System.Net.Security.4.3.2\lib\net46\System.Net.Security.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.WebSockets, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\System.Net.WebSockets.4.3.0\lib\net46\System.Net.WebSockets.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.WebSockets.Client, Version=4.0.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\System.Net.WebSockets.Client.4.3.2\lib\net46\System.Net.WebSockets.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Db.cs" />
|
||||
<Compile Include="MesServerFunction\Fun_1054.cs" />
|
||||
<Compile Include="OpcServer\AllowAGVEnter.cs" />
|
||||
<Compile Include="OpcServer\AllowAGVLeave.cs" />
|
||||
<Compile Include="OpcServer\AllowAGVLower.cs" />
|
||||
<Compile Include="OpcServer\AllowAGVRaise.cs" />
|
||||
<Compile Include="OpcServer\CallMaterials.cs" />
|
||||
<Compile Include="Methods\EngineGetOverBaseWork.cs" />
|
||||
<Compile Include="OpcServer\LoadEmptyTray.cs" />
|
||||
<Compile Include="OpcServer\PointToPoint.cs" />
|
||||
<Compile Include="OpcServer\RequestReturnMaterial.cs" />
|
||||
<Compile Include="OpcServer\RequestReturns.cs" />
|
||||
<Compile Include="OpcServer\ReturnAndRedispatch.cs" />
|
||||
<Compile Include="DataAccess\DataAccess.cs" />
|
||||
<Compile Include="OpcServer\ToolCodeScanOver.cs" />
|
||||
<Compile Include="OpcServer\TransferSequence.cs" />
|
||||
<Compile Include="OpcServer\UnloadEmptyTray.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Common\00MesWorkMqtt\MesWorkMqtt\00MesWorkMqtt.csproj">
|
||||
<Project>{f55da1a0-a982-4479-8c47-0d9a5aaf3e18}</Project>
|
||||
<Name>00MesWorkMqtt</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Common\01DoWhatPlc\01_01DoWhatPlc.csproj">
|
||||
<Project>{0d1af432-439a-4920-8692-43ae139f5530}</Project>
|
||||
<Name>01_01DoWhatPlc</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Common\02WebApiCall\02_02WebApiCallPLC.csproj">
|
||||
<Project>{3e6d1dd5-01c9-435f-9941-61f906ce35bb}</Project>
|
||||
<Name>02_02WebApiCallPLC</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Common\04DataBaseAccess\DataBaseAccess\04-DataBaseAccess.csproj">
|
||||
<Project>{f434e066-4c59-47c8-aa82-6f48cc84501a}</Project>
|
||||
<Name>04-DataBaseAccess</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Common\07WebBusinessFacade\BusinessFacade\07BusinessFacade.csproj">
|
||||
<Project>{f0a0c525-03fd-428a-9b17-7f54aa0e4475}</Project>
|
||||
<Name>07BusinessFacade</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Common\08WebFun_base\WebFun_base\08-WebFun_base.csproj">
|
||||
<Project>{d98be764-adeb-488d-9714-61e308aa8201}</Project>
|
||||
<Name>08-WebFun_base</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Common\09MesDataFunction\MesDataFunction\01-MesDataFunction.csproj">
|
||||
<Project>{90e76fb4-646d-45e2-95db-0b8ab4e465d6}</Project>
|
||||
<Name>09-MesDataFunction</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Common\MyLog4Net\00_MyLog4Net.csproj">
|
||||
<Project>{1dc48c83-1842-4de8-acaf-26e1e7f7c58f}</Project>
|
||||
<Name>00_MyLog4Net</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Interface_WebAPI\SlMesDbIterface\ExternalDataSync.csproj">
|
||||
<Project>{2f33d79d-1dff-4cda-b357-fcd5221cab9a}</Project>
|
||||
<Name>ExternalDataSync</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\MisDataFun\SendMessageToWebMqtt\12SendMessageToWeb.csproj">
|
||||
<Project>{e4eb6420-906d-4672-947a-ca33ddcdadfc}</Project>
|
||||
<Name>12SendMessageToWeb</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\MIS_FuntionSaveData\MIS_FuntionSaveData\13.3MIS_FuntionSaveData.csproj">
|
||||
<Project>{55b510c1-59e9-4bfd-ae84-d76d46f6e365}</Project>
|
||||
<Name>02-13.3MIS_FuntionSaveData</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\packages\NETStandard.Library.2.0.0\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\..\packages\NETStandard.Library.2.0.0\build\netstandard2.0\NETStandard.Library.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\NETStandard.Library.2.0.0\build\netstandard2.0\NETStandard.Library.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NETStandard.Library.2.0.0\build\netstandard2.0\NETStandard.Library.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
328
MisDataFunction/Function1054/MesServerFunction/Fun_1054.cs
Normal file
328
MisDataFunction/Function1054/MesServerFunction/Fun_1054.cs
Normal file
@@ -0,0 +1,328 @@
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
public partial class FunctionMES
|
||||
{
|
||||
object lockFunWork;
|
||||
//public void FunWork(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
public void FunWork(string recData)
|
||||
{
|
||||
|
||||
|
||||
lockFunWork = new object();
|
||||
lock (lockFunWork)
|
||||
{
|
||||
List<string> dataArray = MisDataFun.GetCmdStringList(recData);
|
||||
//string[] dataArray = recData.Split('|');
|
||||
//if (dataArray.Count != 4)
|
||||
//return;
|
||||
//消息来源
|
||||
string m_Source = dataArray[0].ToString();
|
||||
//消息类型 Barcode
|
||||
string m_Command = dataArray[1].ToString();
|
||||
//工位号
|
||||
string m_OpName = dataArray[2].ToString();
|
||||
//消息参数
|
||||
string m_Value = dataArray[3].ToString();
|
||||
|
||||
DeviceDriver_BasicData.CustomeEvetnArgs e = new DeviceDriver_BasicData.CustomeEvetnArgs();// = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceDriver_BasicData.CustomeEvetnArgs>(m_Value);
|
||||
string tagValue;
|
||||
string OpName = m_OpName;
|
||||
switch (m_Source)
|
||||
{
|
||||
case "PLC":
|
||||
e = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceDriver_BasicData.CustomeEvetnArgs>(m_Value);
|
||||
switch (e.TagValue.ToString().ToLower())
|
||||
{
|
||||
case "false":
|
||||
tagValue = "0";
|
||||
break;
|
||||
case "true":
|
||||
tagValue = "1";
|
||||
break;
|
||||
default:
|
||||
tagValue = e.TagValue.ToString();
|
||||
break;
|
||||
}
|
||||
e.TagValue = tagValue;
|
||||
switch (e.TagTypeCodeID.ToString())
|
||||
{
|
||||
// AGV相关变量类型代码处理说明:
|
||||
// 301:AGV请求进入
|
||||
// 302:AGV器具放置完毕
|
||||
// 303:AGV退出光栅
|
||||
// 304:送料信息验证完成
|
||||
// 305:送料信息验证结果
|
||||
// 305:任务发送状态 0 没有 1 发送 2 失败
|
||||
// 311:请求叫料
|
||||
// 312:请求退空
|
||||
// 313:请求退料
|
||||
// 314:允许AGV进入
|
||||
// 315:允许AGV离开
|
||||
// 316:器具码扫描完毕
|
||||
// 317:退回并重新配送
|
||||
// 318:器具号
|
||||
// 319:请求上料机型
|
||||
// 320:收到状态反馈点
|
||||
// 321:转序
|
||||
// 322:下空托盘
|
||||
// 323:上空托盘
|
||||
// 324:点对点
|
||||
// 500:AGV请求下降
|
||||
// 501:AGV请求举升
|
||||
// 550:允许AGV下降
|
||||
// 551:允许AGV举升
|
||||
|
||||
// 请求叫料
|
||||
case "311":
|
||||
fun_CallMaterials(e);
|
||||
break;
|
||||
// 请求退空
|
||||
case "312":
|
||||
fun_RequestReturns(e);
|
||||
break;
|
||||
// 请求退料
|
||||
case "313":
|
||||
fun_RequestReturnMaterial(e);
|
||||
break;
|
||||
// 允许AGV进入
|
||||
case "314":
|
||||
fun_AllowAGVEnter(e);
|
||||
break;
|
||||
// 允许AGV离开
|
||||
case "315":
|
||||
fun_AllowAGVLeave(e);
|
||||
break;
|
||||
// 器具码扫描完毕
|
||||
case "316":
|
||||
fun_ToolCodeScanOver(e);
|
||||
break;
|
||||
// 退回并重新配送
|
||||
case "317":
|
||||
fun_ReturnAndRedispatch(e);
|
||||
break;
|
||||
// 收到任务状态握手
|
||||
case "320":
|
||||
//MIS_BASE.WritePLC(306, m_OpName, 0);
|
||||
break;
|
||||
// 转序
|
||||
case "321":
|
||||
fun_TransferSequence(e);
|
||||
break;
|
||||
// 下空托盘
|
||||
case "322":
|
||||
fun_UnloadEmptyTray(e);
|
||||
break;
|
||||
// 上空托盘
|
||||
case "323":
|
||||
fun_LoadEmptyTray(e);
|
||||
break;
|
||||
// 允许AGV下降
|
||||
case "550":
|
||||
fun_AllowAGVLower(e);
|
||||
break;
|
||||
// 允许AGV举升
|
||||
case "551":
|
||||
fun_AllowAGVRaise(e);
|
||||
break;
|
||||
// AGV插头完成
|
||||
case "400":
|
||||
break;
|
||||
// AGV拔插头完成
|
||||
case "401":
|
||||
break;
|
||||
// MES允许开始磨合
|
||||
case "402":
|
||||
break;
|
||||
// MES反馈磨合结束
|
||||
case "403":
|
||||
break;
|
||||
// 托盘压紧气缸压紧
|
||||
case "404":
|
||||
if (tagValue == "1") MIS_BASE.WritePLC(405, OpName, false);
|
||||
break;
|
||||
// 托盘压紧气缸松开
|
||||
case "405":
|
||||
if (tagValue == "1") MIS_BASE.WritePLC(404, OpName, false);
|
||||
break;
|
||||
// 插头推靠气缸推靠
|
||||
case "406":
|
||||
if (tagValue == "1") MIS_BASE.WritePLC(407, OpName, false);
|
||||
break;
|
||||
// 插头推靠气缸退回
|
||||
case "407":
|
||||
if (tagValue == "1") MIS_BASE.WritePLC(406, OpName, false);
|
||||
break;
|
||||
// 自动模式
|
||||
case "408":
|
||||
if (tagValue == "1") MIS_BASE.WritePLC(409, OpName, false); // 自动掉手动模式
|
||||
break;
|
||||
// 手动模式
|
||||
case "409":
|
||||
if (tagValue == "1") MIS_BASE.WritePLC(408, OpName, false); // 自动掉自动模式
|
||||
break;
|
||||
// 请求上线
|
||||
case "450":
|
||||
MisDataFun.Rrunning_UpdateOpCallStatus(OpName, Convert.ToInt32(tagValue)); // 更新至数据库库位状态
|
||||
break;
|
||||
// 请求下线
|
||||
case "451":
|
||||
break;
|
||||
// 请求插插头
|
||||
case "452":
|
||||
// 需要调用AGV插插头接口 去插
|
||||
break;
|
||||
// 请求拔插头
|
||||
case "453":
|
||||
break;
|
||||
// 开始磨合
|
||||
case "454":
|
||||
break;
|
||||
// 磨合完成
|
||||
case "455":
|
||||
break;
|
||||
// 推靠气缸原位
|
||||
case "456":
|
||||
break;
|
||||
// 推靠气缸到位
|
||||
case "457":
|
||||
break;
|
||||
// 压紧气缸原位
|
||||
case "458":
|
||||
break;
|
||||
// 压紧气缸到位
|
||||
case "459":
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 叫料流程
|
||||
// 1.请求叫料 收到请求叫料后 调用叫料接口 后续收到AGV的
|
||||
// 2.收到工厂 请求进入接口(工厂未开发 跳过) 发给PLC AGV请求进入
|
||||
// 3.收到允许AGV进入 调用接口(未开发 跳过) 允许进入
|
||||
// 4.收到 器具码扫码完成 根据318器具号 调用器具号查询接口 得出校验结果
|
||||
// 5.若器具码校验通过 调用 确认物料配送接口 调用成功后 给PLC发送 送料信息验证结果(1 合格 2 不合格) 和 送料信息验证完成
|
||||
// 6.收到AGV请求离开接口后(未开发 跳过) 发送给PLC请求离开点位
|
||||
// 7.收到PLC允许离开信号后 调用AGV允许离开接口(未开发 跳过)
|
||||
|
||||
// 退空托流程
|
||||
// 1.收到请求退空 调用退空托接口
|
||||
// 2.如叫料AGV请求进入 请求离开。。。。 只不过不需要扫描器具码部分
|
||||
|
||||
|
||||
// AGV相关方法声明(PLC触发的信号)
|
||||
/// <summary>
|
||||
/// 请求叫料
|
||||
/// </summary>
|
||||
public void fun_CallMaterials(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(CallMaterials, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 请求退空
|
||||
/// </summary>
|
||||
public void fun_RequestReturns(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(RequestReturns, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 请求退料
|
||||
/// </summary>
|
||||
public void fun_RequestReturnMaterial(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(RequestReturnMaterial, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 允许AGV进入
|
||||
/// </summary>
|
||||
public void fun_AllowAGVEnter(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(AllowAGVEnter, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 允许AGV离开
|
||||
/// </summary>
|
||||
public void fun_AllowAGVLeave(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(AllowAGVLeave, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 允许AGV下降
|
||||
/// </summary>
|
||||
public void fun_AllowAGVLower(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(AllowAGVLower, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 允许AGV举升
|
||||
/// </summary>
|
||||
public void fun_AllowAGVRaise(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(AllowAGVRaise, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 器具码扫描完毕
|
||||
/// </summary>
|
||||
public void fun_ToolCodeScanOver(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(ToolCodeScanOver, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 退回并重新配送
|
||||
/// </summary>
|
||||
public void fun_ReturnAndRedispatch(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(ReturnAndRedispatch, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 转序
|
||||
/// </summary>
|
||||
public void fun_TransferSequence(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(TransferSequence, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下空托盘
|
||||
/// </summary>
|
||||
public void fun_UnloadEmptyTray(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(UnloadEmptyTray, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上空托盘
|
||||
/// </summary>
|
||||
public void fun_LoadEmptyTray(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(LoadEmptyTray, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 点对点
|
||||
/// </summary>
|
||||
public void fun_PointToPoint(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(PointToPoint, e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
BIN
MisDataFunction/Function1054/MesServerFunction/vssver2.scc
Normal file
BIN
MisDataFunction/Function1054/MesServerFunction/vssver2.scc
Normal file
Binary file not shown.
177
MisDataFunction/Function1054/Methods/EngineGetOverBaseWork.cs
Normal file
177
MisDataFunction/Function1054/Methods/EngineGetOverBaseWork.cs
Normal file
@@ -0,0 +1,177 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 正常逻辑工作(传递机型)
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="EngineTypeID"></param>
|
||||
/// <param name="EngineType"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="PartPallet_Code"></param>
|
||||
private void EngineTypeGetOver_PLC_Work(string OpName, int EngineTypeID, string EngineType, string EngineID, int PartPallet_Code, string OrderForm)
|
||||
{
|
||||
//int IsAllowWork;
|
||||
//int RepairPartStatusPLC = 0;
|
||||
//int MES_QualityMask = 1;
|
||||
|
||||
|
||||
|
||||
////电子看板_装配零件_临时表_增加_北汽
|
||||
////第二步,将零件信息转移到零件_临时表中
|
||||
//BaseDataSystemMES.MesServer_Process_EngineTypeOverBQ(OpName);
|
||||
|
||||
////通知web显示
|
||||
//SendMessageFun.SendMessage("123", "111", OpName);
|
||||
////MIS_BASE.Read_PalletInfo(OpName, out MES_QualityMask);//合格标志 合格标志暂时改为即时响应式的
|
||||
////MIS_BASE.Read_RepairStatus_PLC(OpName, out RepairPartStatusPLC);//返修标志
|
||||
////SendMessageFun.SendInfomation("QualityMask", Convert.ToString(MES_QualityMask), OpName);//显示合格标志
|
||||
////SendMessageFun.SendInfomation("RepairPartStatusPLC", Convert.ToString(RepairPartStatusPLC), OpName);//显示返修标志
|
||||
//MIS_BASE.Read_TagTypeID(201, OpName, out string EngineTypeID_QiaoKe);
|
||||
|
||||
//Db.OP50_OPA90_MatchResult(EngineTypeID, Convert.ToInt32(EngineTypeID_QiaoKe), EngineID, OrderForm, out int MatchResult, out string MatchResultStr);
|
||||
//if (MatchResult == 1)
|
||||
//{
|
||||
// // 轮毂线
|
||||
// MIS_BASE.Write_Match(OpName, true);// 匹配结果
|
||||
// MIS_BASE.Write_MatchingCompleted(OpName, true);// 匹配完成
|
||||
// MIS_BASE.Write_FixAllow(OpName, true); // 允许工作
|
||||
// return;
|
||||
//}
|
||||
//else if (MatchResult == 2) // 分等待状态 与 报警状态 等待的话就等A60 工作完成时判断清除等待 写入A90 的匹配结果 匹配完成 允许工作
|
||||
//{
|
||||
// MIS_BASE.WritePLC(29, OpName, true); // 开始等待 通知A60 保存完成时更新下等待状态与匹配状态
|
||||
// return;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// // 将根据轮毂号 工位号 时间 报错内容 存储到数据库中供查询
|
||||
// BaseDataSystemMES.HeLi_OoNameAlarmRecord_Add(OpName, EngineID, MatchResultStr);
|
||||
// // 匹配结果不成功
|
||||
// MIS_BASE.Write_Match(OpName, false);// 匹配结果
|
||||
// MIS_BASE.Write_MatchingCompleted(OpName, true);// 匹配完成
|
||||
// return;
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//// 判断分线是否 传递机型
|
||||
//if (EngineGetOver_SubLine)
|
||||
//{
|
||||
// string EngineTypeID_MainLine;
|
||||
// int EngineTypeID_MainLineQiaoKe;
|
||||
// // 读取主线桥壳机型
|
||||
// MIS_BASE.Read_EngineTypeID(OpName_MainLine, out EngineTypeID_MainLineQiaoKe);
|
||||
// // 读取分线存储的桥壳机型
|
||||
// MIS_BASE.Read_TagTypeID(38, OpName_SubLine, out EngineTypeID_MainLine);
|
||||
|
||||
// if (Convert.ToInt32(EngineTypeID_MainLine) == EngineTypeID)
|
||||
// {
|
||||
// Db.OP50_OPA90_MatchResult(EngineTypeID, Convert.ToInt32(EngineTypeID_MainLine), EngineTypeID_MainLineQiaoKe, out int MatchResult);
|
||||
|
||||
// if (MatchResult == 0) // 不匹配
|
||||
// {
|
||||
// // 主线
|
||||
// MIS_BASE.Write_Match(OpName_MainLine, false);// 匹配结果
|
||||
// MIS_BASE.Write_MatchingCompleted(OpName_MainLine, false);// 匹配完成
|
||||
// MIS_BASE.Write_FixAllow(OpName_MainLine, false); // 允许工作
|
||||
// // 分线
|
||||
// MIS_BASE.Write_Match(OpName_SubLine, false);// 匹配结果
|
||||
// MIS_BASE.Write_MatchingCompleted(OpName_SubLine, false);// 匹配完成
|
||||
// MIS_BASE.Write_FixAllow(OpName_SubLine, false); // 允许工作
|
||||
|
||||
// // 写入分线 等待 0
|
||||
// MIS_BASE.WritePLC(29, OpName_SubLine, "0");
|
||||
// }
|
||||
// if (MatchResult == 1) // 允许抓
|
||||
// {
|
||||
// // 主线
|
||||
// MIS_BASE.Write_Match(OpName_MainLine, true);// 匹配结果
|
||||
// MIS_BASE.Write_MatchingCompleted(OpName_MainLine, true);// 匹配完成
|
||||
// // 分线
|
||||
// MIS_BASE.Write_Match(OpName_SubLine, true);// 匹配结果
|
||||
// MIS_BASE.Write_MatchingCompleted(OpName_SubLine, true);// 匹配完成
|
||||
// MIS_BASE.Write_FixAllow(OpName_MainLine, true); // 允许工作
|
||||
|
||||
// // 写入分线 等待 0
|
||||
// MIS_BASE.WritePLC(29, OpName_SubLine, "0");
|
||||
// }
|
||||
// if (MatchResult == 2) // 等待
|
||||
// {
|
||||
// // 写入分线 等待 1
|
||||
// MIS_BASE.WritePLC(29, OpName_SubLine, "1");
|
||||
// }
|
||||
// }
|
||||
// else // 不匹配
|
||||
// {
|
||||
// // 主线
|
||||
// MIS_BASE.Write_Match(OpName_MainLine, false);// 匹配结果
|
||||
// MIS_BASE.Write_MatchingCompleted(OpName_MainLine, false);// 匹配完成
|
||||
// MIS_BASE.Write_FixAllow(OpName_MainLine, false); // 允许工作
|
||||
// // 分线
|
||||
// MIS_BASE.Write_Match(OpName_SubLine, false);// 匹配结果
|
||||
// MIS_BASE.Write_MatchingCompleted(OpName_SubLine, false);// 匹配完成
|
||||
// MIS_BASE.Write_FixAllow(OpName_SubLine, false); // 允许工作
|
||||
|
||||
// // 写入分线 等待 0
|
||||
// MIS_BASE.WritePLC(29, OpName_SubLine, "0");
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 二次工作
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
private void EngineTypeGetOver_PLC_Work_two(string OpName)
|
||||
{
|
||||
int EngineTypeID;//机型代码
|
||||
int PartPallet_Code;//托盘编号
|
||||
|
||||
string EngineType;//机型
|
||||
string EngineID;//工件编号
|
||||
string OrderForm;
|
||||
MIS_BASE.GetEngineTypeFromPLC(OpName, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out OrderForm);
|
||||
EngineTypeGetOver_PLC_Work(OpName, EngineTypeID, EngineType, EngineID, Convert.ToInt32(PartPallet_Code), OrderForm);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 跳过二次工作
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
private void EngineTypeGetOver_PLC_Work_Skip(string OpName)
|
||||
{
|
||||
MIS_BASE.Write_MesReadOver(OpName, true);
|
||||
MIS_BASE.Write_MaterialVerifyOver(OpName, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返修件需要工作
|
||||
/// </summary>
|
||||
/// <param name="OpName">工位号</param>
|
||||
private void IsNeedRepaire_OK(string OpName)
|
||||
{
|
||||
string orderForm = "";
|
||||
int engineTypeID;
|
||||
string engineType = "";
|
||||
string engineID = "";
|
||||
string palletCode = "";
|
||||
int isRepair;
|
||||
string repairCode = "";
|
||||
//从监控系统中查询出本工位信息
|
||||
//MisDataFun.OpName_MIS_Moby_Select(OpName,
|
||||
//out orderForm, out engineTypeID, out engineType,
|
||||
//out engineID, out palletCode, out isRepair, out repairCode);
|
||||
|
||||
//EngineTypeGetOver_PLC_Work(OpName, engineTypeID, engineType, engineID, Convert.ToInt32(palletCode), orderForm);
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
MisDataFunction/Function1054/Methods/vssver2.scc
Normal file
BIN
MisDataFunction/Function1054/Methods/vssver2.scc
Normal file
Binary file not shown.
51
MisDataFunction/Function1054/OpcServer/AllowAGVEnter.cs
Normal file
51
MisDataFunction/Function1054/OpcServer/AllowAGVEnter.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using System;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 允许AGV进入
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
private void AllowAGVEnter(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
if (tagValue == 1)
|
||||
{
|
||||
string msg;
|
||||
|
||||
// PLC允许AGV离开信号被置位后,应调用AGV允许进入接口
|
||||
MIS_BASE.Read_EngineID(OpName, out string EngineID);
|
||||
bool isOk = MisDataSaveDate.AGV_BusinessLogic.PassAgvInOut(OpName, EngineID, "apply");
|
||||
|
||||
if (isOk)
|
||||
{
|
||||
msg = $"【{OpName}】允许AGV进入成功!";
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = $"【{OpName}】允许AGV进入失败!请注意!";
|
||||
}
|
||||
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
MyLog4Net.MyLogHelper.Info("AllowAGVLeave", msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "AllowAGVEnter", "0");
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
MisDataSaveDate.FuntionMesRead.Alarm_SaveFileLog4Error(System.Reflection.MethodBase.GetCurrentMethod().Name, e, "Fun1054", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
55
MisDataFunction/Function1054/OpcServer/AllowAGVLeave.cs
Normal file
55
MisDataFunction/Function1054/OpcServer/AllowAGVLeave.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using System;
|
||||
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 允许AGV离开
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
private void AllowAGVLeave(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
string msg = $"【{OpName}】允许AGV离开";
|
||||
if (tagValue == 1)
|
||||
{
|
||||
|
||||
|
||||
// PLC允许AGV离开信号被置位后,应调用AGV允许离开接口
|
||||
MIS_BASE.Read_EngineID(OpName,out string EngineID);
|
||||
bool isOk = MisDataSaveDate.AGV_BusinessLogic.PassAgvInOut(OpName, EngineID, "release");
|
||||
|
||||
if (isOk) {
|
||||
msg = $"【{OpName}】允许AGV离开失败!请注意!";
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = $"【{OpName}】允许AGV离开成功!";
|
||||
}
|
||||
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
MyLog4Net.MyLogHelper.Info("AllowAGVLeave", msg);
|
||||
|
||||
// 记录允许AGV离开状态
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "AllowAGVLeave", "1");
|
||||
}
|
||||
else
|
||||
{
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "AllowAGVLeave", "0");
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
MisDataSaveDate.FuntionMesRead.Alarm_SaveFileLog4Error(System.Reflection.MethodBase.GetCurrentMethod().Name, e, "Fun1054", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
51
MisDataFunction/Function1054/OpcServer/AllowAGVLower.cs
Normal file
51
MisDataFunction/Function1054/OpcServer/AllowAGVLower.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using System;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 允许AGV下降
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
private void AllowAGVLower(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
if (tagValue == 1)
|
||||
{
|
||||
string msg;
|
||||
|
||||
// PLC允许AGV下降信号被置位后,应调用AGV允许下降接口
|
||||
MIS_BASE.Read_EngineID(OpName, out string EngineID);
|
||||
bool isOk = MisDataSaveDate.AGV_BusinessLogic.PassAgvInOut(OpName, EngineID, "lower");
|
||||
|
||||
if (isOk)
|
||||
{
|
||||
msg = $"【{OpName}】允许AGV下降成功!";
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = $"【{OpName}】允许AGV下降失败!请注意!";
|
||||
}
|
||||
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
MyLog4Net.MyLogHelper.Info("AllowAGVLower", msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "AllowAGVLower", "0");
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
MisDataSaveDate.FuntionMesRead.Alarm_SaveFileLog4Error(System.Reflection.MethodBase.GetCurrentMethod().Name, e, "Fun1054", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
51
MisDataFunction/Function1054/OpcServer/AllowAGVRaise.cs
Normal file
51
MisDataFunction/Function1054/OpcServer/AllowAGVRaise.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using System;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 允许AGV举升
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
private void AllowAGVRaise(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
if (tagValue == 1)
|
||||
{
|
||||
string msg;
|
||||
|
||||
// PLC允许AGV举升信号被置位后,应调用AGV允许举升接口
|
||||
MIS_BASE.Read_EngineID(OpName, out string EngineID);
|
||||
bool isOk = MisDataSaveDate.AGV_BusinessLogic.PassAgvInOut(OpName, EngineID, "raise");
|
||||
|
||||
if (isOk)
|
||||
{
|
||||
msg = $"【{OpName}】允许AGV举升成功!";
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = $"【{OpName}】允许AGV举升失败!请注意!";
|
||||
}
|
||||
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
MyLog4Net.MyLogHelper.Info("AllowAGVRaise", msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "AllowAGVRaise", "0");
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
MisDataSaveDate.FuntionMesRead.Alarm_SaveFileLog4Error(System.Reflection.MethodBase.GetCurrentMethod().Name, e, "Fun1054", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
68
MisDataFunction/Function1054/OpcServer/CallMaterials.cs
Normal file
68
MisDataFunction/Function1054/OpcServer/CallMaterials.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using System;
|
||||
using System.Data;
|
||||
using WebApi;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 请求叫料
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
private void CallMaterials(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
string msg;
|
||||
if (tagValue == 1)
|
||||
{
|
||||
|
||||
// 记录叫料请求状态
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "CallMaterials", "1");
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "配送类型", "2");
|
||||
// 调用叫料接口
|
||||
// deliveryType: 1退托盘,2叫料,3送料,4转序
|
||||
DataTable outType = MisDataFun.GetRequestReturnMaterials_Type(OpName, "2");
|
||||
string sendType = outType.Rows[0]["type"].ToString();
|
||||
bool isOk = CALL_Inerface_DataHandle.CALL_Inerface_CallMaterial(OpName, sendType);
|
||||
if (isOk)
|
||||
{
|
||||
// 发送消息通知
|
||||
msg = $"【{OpName}】请求叫料成功";
|
||||
MIS_BASE.WritePLC(306, OpName, 1); // 任务状态反馈
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = $"【{OpName}】请求叫料失败";
|
||||
MIS_BASE.WritePLC(306, OpName, 2); // 任务状态反馈
|
||||
}
|
||||
|
||||
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
MyLog4Net.MyLogHelper.Info("CallMaterials", msg);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "CallMaterials", "0");
|
||||
MIS_BASE.WritePLC(301, OpName, false); // 请求进入
|
||||
MIS_BASE.WritePLC(302, OpName, false); // 托盘到位
|
||||
MIS_BASE.WritePLC(303, OpName, false); // AGV已离开
|
||||
MIS_BASE.WritePLC(305, OpName, "0"); // 比对结果
|
||||
MIS_BASE.WritePLC(304, OpName, false); // 比对完成
|
||||
MIS_BASE.WritePLC(306, OpName, 0); // 任务状态反馈
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
MisDataSaveDate.FuntionMesRead.Alarm_SaveFileLog4Error(System.Reflection.MethodBase.GetCurrentMethod().Name, e, "Fun1054", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
63
MisDataFunction/Function1054/OpcServer/LoadEmptyTray.cs
Normal file
63
MisDataFunction/Function1054/OpcServer/LoadEmptyTray.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using System;
|
||||
using WebApi;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 上空托盘操作
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
private void LoadEmptyTray(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
string msg;
|
||||
|
||||
if (tagValue == 1)
|
||||
{
|
||||
// 记录上空托盘请求状态
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "LoadEmptyTray", "1");
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "配送类型", "6");
|
||||
|
||||
// 调用上空托盘接口
|
||||
// deliveryType: 1退托盘,2叫料,3送料,4转序,5下空,6上空,7点对点
|
||||
bool isOk = CALL_Inerface_DataHandle.CALL_Inerface_CallMaterial(OpName, "6");
|
||||
if (isOk)
|
||||
{
|
||||
msg = $"【{OpName}】上空托盘操作成功";
|
||||
MIS_BASE.WritePLC(306, OpName, 1); // 任务状态反馈
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = $"【{OpName}】上空托盘操作失败";
|
||||
MIS_BASE.WritePLC(306, OpName, 2); // 任务状态反馈
|
||||
}
|
||||
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
MyLog4Net.MyLogHelper.Info("LoadEmptyTray", msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "LoadEmptyTray", "0");
|
||||
MIS_BASE.WritePLC(301, OpName, false); // 请求进入
|
||||
MIS_BASE.WritePLC(302, OpName, false); // 托盘到位
|
||||
MIS_BASE.WritePLC(303, OpName, false); // AGV已离开
|
||||
MIS_BASE.WritePLC(305, OpName, "0"); // 比对结果
|
||||
MIS_BASE.WritePLC(304, OpName, false); // 比对完成
|
||||
MIS_BASE.WritePLC(306, OpName, 0); // 任务状态反馈
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
MisDataSaveDate.FuntionMesRead.Alarm_SaveFileLog4Error(System.Reflection.MethodBase.GetCurrentMethod().Name, e, "Fun1054", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
64
MisDataFunction/Function1054/OpcServer/PointToPoint.cs
Normal file
64
MisDataFunction/Function1054/OpcServer/PointToPoint.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using System;
|
||||
using WebApi;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 点对点操作
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
private void PointToPoint(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
string msg;
|
||||
|
||||
if (tagValue == 1)
|
||||
{
|
||||
// 记录点对点请求状态
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "PointToPoint", "1");
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "配送类型", "7");
|
||||
|
||||
// 调用点对点接口
|
||||
// deliveryType: 1退托盘,2叫料,3送料,4转序,5下空,6上空,7点对点
|
||||
// 注意:终点位置暂时为空,等业务明确后再补充
|
||||
bool isOk = CALL_Inerface_DataHandle.CALL_Inerface_CallMaterial(OpName, "7");
|
||||
if (isOk)
|
||||
{
|
||||
msg = $"【{OpName}】点对点操作成功";
|
||||
MIS_BASE.WritePLC(306, OpName, 1); // 任务状态反馈
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = $"【{OpName}】点对点操作失败";
|
||||
MIS_BASE.WritePLC(306, OpName, 2); // 任务状态反馈
|
||||
}
|
||||
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
MyLog4Net.MyLogHelper.Info("PointToPoint", msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "PointToPoint", "0");
|
||||
MIS_BASE.WritePLC(301, OpName, false); // 请求进入
|
||||
MIS_BASE.WritePLC(302, OpName, false); // 托盘到位
|
||||
MIS_BASE.WritePLC(303, OpName, false); // AGV已离开
|
||||
MIS_BASE.WritePLC(305, OpName, "0"); // 比对结果
|
||||
MIS_BASE.WritePLC(304, OpName, false); // 比对完成
|
||||
MIS_BASE.WritePLC(306, OpName, 0); // 任务状态反馈
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
MisDataSaveDate.FuntionMesRead.Alarm_SaveFileLog4Error(System.Reflection.MethodBase.GetCurrentMethod().Name, e, "Fun1054", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
121
MisDataFunction/Function1054/OpcServer/RequestReturnMaterial.cs
Normal file
121
MisDataFunction/Function1054/OpcServer/RequestReturnMaterial.cs
Normal file
@@ -0,0 +1,121 @@
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using System;
|
||||
using System.Data;
|
||||
using WebApi;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 请求退料
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
private void RequestReturnMaterial(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
string msg;
|
||||
|
||||
if (tagValue == 1)
|
||||
{
|
||||
// 记录退料请求状态
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "RequestReturnMaterial", "1");
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "配送类型", "3");
|
||||
|
||||
// 调用退料接口
|
||||
// deliveryType: 1退托盘,2叫料,3送料,4转序
|
||||
DataTable outType = MisDataFun.GetRequestReturnMaterials_Type(OpName, "3");
|
||||
string sendType = outType.Rows[0]["type"].ToString();
|
||||
bool isOk;
|
||||
if (sendType == "4")
|
||||
{
|
||||
// 调用转序接口 走转序流程
|
||||
string EngineID = DateTime.Now.ToString("yyyyMMddHHmm");
|
||||
string EngineType = "NONE";
|
||||
DataTable nextDT = MisDataFun.Rrunning_GetNextStoreData(OpName, EngineID, EngineType);
|
||||
string targetStoreCode = nextDT.Rows[0]["目标库位号"].ToString();
|
||||
string targetProcessCode = nextDT.Rows[0]["目标工序号"].ToString();
|
||||
string targetProcess = nextDT.Rows[0]["目标工序"].ToString();
|
||||
|
||||
|
||||
// 1. 调用AGV转序接口
|
||||
var agvResult = CALL_Inerface_DataHandle.CALL_Inerface_MaterialTransfer(OpName, targetStoreCode);
|
||||
int agvCode = 500;
|
||||
int.TryParse(agvResult["code"]?.ToString() ?? "500", out agvCode);
|
||||
|
||||
if (agvCode != 200)
|
||||
{
|
||||
// AGV调度失败
|
||||
isOk = false;
|
||||
msg = $"【{OpName}】AGV调度失败:{agvResult["message"]?.ToString() ?? "未知错误"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
// 2. AGV调度成功,执行转序存储过程
|
||||
var param = new System.Data.SqlClient.SqlParameter[] {
|
||||
new System.Data.SqlClient.SqlParameter("@库位号", OpName),
|
||||
new System.Data.SqlClient.SqlParameter("@产品编号", EngineID),
|
||||
new System.Data.SqlClient.SqlParameter("@产品型号", EngineType),
|
||||
new System.Data.SqlClient.SqlParameter("@目标库位号", targetStoreCode),
|
||||
new System.Data.SqlClient.SqlParameter("@目标工序", targetProcess),
|
||||
new System.Data.SqlClient.SqlParameter("@目标工序号", targetProcessCode)
|
||||
};
|
||||
|
||||
DataLinkMesWork2.DataAccess2.ExecuteStoredProcedure("XD_磨合_开始下一序", ref param, out string errMessage);
|
||||
|
||||
if (!string.IsNullOrEmpty(errMessage))
|
||||
{
|
||||
isOk = false;
|
||||
msg = $"【{OpName}】AGV调度成功,但XD_磨合_开始下一序存储过程执行失败:{errMessage}";
|
||||
}
|
||||
else
|
||||
{
|
||||
isOk = true;
|
||||
msg = $"【{OpName}】转序操作成功";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
isOk = CALL_Inerface_DataHandle.CALL_Inerface_CallMaterial(OpName, sendType);
|
||||
|
||||
}
|
||||
if (isOk)
|
||||
{
|
||||
// 发送消息通知
|
||||
msg = $"【{OpName}】请求退料成功";
|
||||
MIS_BASE.WritePLC(306, OpName, 1); // 任务状态反馈
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = $"【{OpName}】请求退料失败";
|
||||
MIS_BASE.WritePLC(306, OpName, 2); // 任务状态反馈
|
||||
}
|
||||
|
||||
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
MyLog4Net.MyLogHelper.Info("RequestReturnMaterial", msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "RequestReturnMaterial", "0");
|
||||
MIS_BASE.WritePLC(301, OpName, false); // 请求进入
|
||||
MIS_BASE.WritePLC(302, OpName, false); // 托盘到位 器具放置完毕
|
||||
MIS_BASE.WritePLC(303, OpName, false); // AGV已离开
|
||||
MIS_BASE.WritePLC(305, OpName, "0"); // 比对结果
|
||||
MIS_BASE.WritePLC(304, OpName, false); // 比对完成
|
||||
MIS_BASE.WritePLC(306, OpName, 0); // 任务状态反馈
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
MisDataSaveDate.FuntionMesRead.Alarm_SaveFileLog4Error(System.Reflection.MethodBase.GetCurrentMethod().Name, e, "Fun1054", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
68
MisDataFunction/Function1054/OpcServer/RequestReturns.cs
Normal file
68
MisDataFunction/Function1054/OpcServer/RequestReturns.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using System;
|
||||
using System.Data;
|
||||
using WebApi;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 请求退空
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
private void RequestReturns(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
string msg;
|
||||
|
||||
if (tagValue == 1)
|
||||
{
|
||||
// 记录退空请求状态
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "RequestReturns", "1");
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "配送类型", "1");
|
||||
|
||||
// 调用退料接口
|
||||
// deliveryType: 1退托盘,2叫料,3送料,4转序
|
||||
DataTable outType = MisDataFun.GetRequestReturnMaterials_Type(OpName, "1");
|
||||
string sendType = outType.Rows[0]["type"].ToString();
|
||||
bool isOk = CALL_Inerface_DataHandle.CALL_Inerface_CallMaterial(OpName, sendType);
|
||||
if (isOk)
|
||||
{
|
||||
// 发送消息通知
|
||||
msg = $"【{OpName}】请求退空托成功";
|
||||
MIS_BASE.WritePLC(306, OpName, 1); // 任务状态反馈
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = $"【{OpName}】请求退空托失败";
|
||||
MIS_BASE.WritePLC(306, OpName, 2); // 任务状态反馈
|
||||
}
|
||||
|
||||
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
MyLog4Net.MyLogHelper.Info("RequestReturns", msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "RequestReturns", "0");
|
||||
MIS_BASE.WritePLC(301, OpName, false); // 请求进入
|
||||
MIS_BASE.WritePLC(302, OpName, false); // 托盘到位 器具放置完毕
|
||||
MIS_BASE.WritePLC(303, OpName, false); // AGV已离开
|
||||
MIS_BASE.WritePLC(305, OpName, "0"); // 比对结果
|
||||
MIS_BASE.WritePLC(304, OpName, false); // 比对完成
|
||||
MIS_BASE.WritePLC(306, OpName, 0); // 任务状态反馈
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
MisDataSaveDate.FuntionMesRead.Alarm_SaveFileLog4Error(System.Reflection.MethodBase.GetCurrentMethod().Name, e, "Fun1054", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using WebApi;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 退回并重新配送
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
private void ReturnAndRedispatch(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
//DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
//string OpName = Convert.ToString(msgEvent.OpName);
|
||||
//int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
|
||||
//if (tagValue == 1)
|
||||
//{
|
||||
// // 这个流程不太对 具体流程待二次确认
|
||||
// // 记录退回并重新配送状态
|
||||
// MisDataFun.Location_MIS_MOBY_Insert(OpName, "ReturnAndRedispatch", "1");
|
||||
|
||||
// // 当器具码校验不通过时,PLC会置位此信号
|
||||
// // 需要通知AGV退回当前器具并重新配送正确的物料
|
||||
// // 调用工厂叫料接口,类型为送料(3)
|
||||
// MisDataFun.Location_MIS_MOBY_Insert(OpName, "配送类型", "3");
|
||||
// CALL_Inerface_DataHandle.CALL_Inerface_CallMaterial(OpName, "3");
|
||||
|
||||
// // 发送消息通知
|
||||
// string msg = $"【{OpName}】请求退回物料,退回并重新配送";
|
||||
// SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
// MyLog4Net.MyLogHelper.Info("ReturnAndRedispatch", msg);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// MisDataFun.Location_MIS_MOBY_Insert(OpName, "ReturnAndRedispatch", "0");
|
||||
// MIS_BASE.WritePLC(301, OpName, false); // 请求进入
|
||||
// MIS_BASE.WritePLC(302, OpName, false); // 托盘到位
|
||||
// MIS_BASE.WritePLC(303, OpName, false); // AGV已离开
|
||||
// MIS_BASE.WritePLC(305, OpName, "0"); // 比对结果
|
||||
// MIS_BASE.WritePLC(304, OpName, false); // 比对完成
|
||||
//}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
MisDataSaveDate.FuntionMesRead.Alarm_SaveFileLog4Error(System.Reflection.MethodBase.GetCurrentMethod().Name, e, "Fun1054", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
102
MisDataFunction/Function1054/OpcServer/ToolCodeScanOver.cs
Normal file
102
MisDataFunction/Function1054/OpcServer/ToolCodeScanOver.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using MesServerWork;
|
||||
using WebApi;
|
||||
using MisDataSaveDate.MOM;
|
||||
using System.Linq;
|
||||
using MisDataFunDll;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 器具码扫描完毕
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
private void ToolCodeScanOver(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
|
||||
if (tagValue == 1)
|
||||
{
|
||||
// 记录器具码扫描完毕状态
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "ToolCodeScanOver", "1");
|
||||
|
||||
// 获取器具号(318)
|
||||
string containerNo = MIS_BASE.ReadPLC(318, OpName).ToString();
|
||||
|
||||
// 记录器具号
|
||||
if (!string.IsNullOrEmpty(containerNo))
|
||||
{
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "器具号", containerNo);
|
||||
}
|
||||
|
||||
// 调用器具信息查询接口
|
||||
DeviceInfoResponse deviceInfoResult = CALL_Inerface_DataHandle.CALL_Inerface_DeviceInfoQuery(OpName, containerNo);
|
||||
|
||||
// 处理器具信息查询结果
|
||||
bool isValid = true;
|
||||
string validationMsg = "";
|
||||
|
||||
//if (deviceInfoResult != null && deviceInfoResult.code == 200 && deviceInfoResult.data != null)
|
||||
//{
|
||||
// isValid = true;
|
||||
|
||||
// if (deviceInfoResult.data.businessdata != null && deviceInfoResult.data.businessdata.Count > 0)
|
||||
// {
|
||||
// var firstMaterial = deviceInfoResult.data.businessdata.First();
|
||||
// MisDataFun.Location_MIS_MOBY_Insert(OpName, "物料编号", firstMaterial.sku);
|
||||
// MisDataFun.Location_MIS_MOBY_Insert(OpName, "批次号", firstMaterial.batchno);
|
||||
// MisDataFun.Location_MIS_MOBY_Insert(OpName, "数量", firstMaterial.qty);
|
||||
|
||||
// validationMsg = $"器具验证成功,物料编号:{firstMaterial.sku}";
|
||||
// }
|
||||
|
||||
// // 调用物料配送确认接口
|
||||
// CALL_Inerface_DataHandle.CALL_Inerface_MaterialConfirm(OpName, containerNo);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// // 器具信息查询失败
|
||||
// isValid = false;
|
||||
// validationMsg = deviceInfoResult?.message ?? "器具信息查询失败";
|
||||
//}
|
||||
bool isOk = CALL_Inerface_DataHandle.CALL_Inerface_MaterialConfirm(OpName, containerNo);
|
||||
|
||||
// 根据校验结果写入验证结果
|
||||
// 送料信息验证结果(305):1 合格 2 不合格
|
||||
MIS_BASE.WritePLC(305, OpName, isOk ? "1" : "2");
|
||||
|
||||
// 送料信息验证完成(304)
|
||||
MIS_BASE.WritePLC(304, OpName, true);
|
||||
|
||||
// 更新验证状态
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "送料验证结果", isOk ? "1" : "2");
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "当前状态", validationMsg);
|
||||
|
||||
// 发送消息通知
|
||||
string msg = $"【{OpName}】器具码扫描完毕,器具号:{containerNo},{validationMsg} 验证结果{isOk.ToString()}";
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
MyLog4Net.MyLogHelper.Info("ToolCodeScanOver", msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 清除验证完成信号
|
||||
MIS_BASE.WritePLC(305, OpName, "0");
|
||||
MIS_BASE.WritePLC(304, OpName, false);
|
||||
|
||||
// 记录器具码扫描完毕状态
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "ToolCodeScanOver", "0");
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
MisDataSaveDate.FuntionMesRead.Alarm_SaveFileLog4Error(System.Reflection.MethodBase.GetCurrentMethod().Name, e, "Fun1054", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
63
MisDataFunction/Function1054/OpcServer/TransferSequence.cs
Normal file
63
MisDataFunction/Function1054/OpcServer/TransferSequence.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using System;
|
||||
using WebApi;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 转序操作
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
private void TransferSequence(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
string msg;
|
||||
|
||||
if (tagValue == 1)
|
||||
{
|
||||
//// 记录转序请求状态
|
||||
//MisDataFun.Location_MIS_MOBY_Insert(OpName, "TransferSequence", "1");
|
||||
//MisDataFun.Location_MIS_MOBY_Insert(OpName, "配送类型", "4");
|
||||
|
||||
//// 调用转序接口
|
||||
//// deliveryType: 1退托盘,2叫料,3送料,4转序,5下空,6上空,7点对点
|
||||
//bool isOk = CALL_Inerface_DataHandle.CALL_Inerface_CallMaterial(OpName, "4");
|
||||
//if (isOk)
|
||||
//{
|
||||
// msg = $"【{OpName}】转序操作成功";
|
||||
// MIS_BASE.WritePLC(306, OpName, 1); // 任务状态反馈
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// msg = $"【{OpName}】转序操作失败";
|
||||
// MIS_BASE.WritePLC(306, OpName, 2); // 任务状态反馈
|
||||
//}
|
||||
|
||||
//SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
//MyLog4Net.MyLogHelper.Info("TransferSequence", msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "TransferSequence", "0");
|
||||
MIS_BASE.WritePLC(301, OpName, false); // 请求进入
|
||||
MIS_BASE.WritePLC(302, OpName, false); // 托盘到位 器具放置完毕
|
||||
MIS_BASE.WritePLC(303, OpName, false); // AGV已离开
|
||||
MIS_BASE.WritePLC(305, OpName, "0"); // 比对结果
|
||||
MIS_BASE.WritePLC(304, OpName, false); // 比对完成
|
||||
MIS_BASE.WritePLC(306, OpName, 0); // 任务状态反馈
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
MisDataSaveDate.FuntionMesRead.Alarm_SaveFileLog4Error(System.Reflection.MethodBase.GetCurrentMethod().Name, e, "Fun1054", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
63
MisDataFunction/Function1054/OpcServer/UnloadEmptyTray.cs
Normal file
63
MisDataFunction/Function1054/OpcServer/UnloadEmptyTray.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using System;
|
||||
using WebApi;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 下空托盘操作
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
private void UnloadEmptyTray(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
string msg;
|
||||
|
||||
if (tagValue == 1)
|
||||
{
|
||||
// 记录下空托盘请求状态
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "UnloadEmptyTray", "1");
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "配送类型", "5");
|
||||
|
||||
// 调用下空托盘接口
|
||||
// deliveryType: 1退托盘,2叫料,3送料,4转序,5下空,6上空,7点对点
|
||||
bool isOk = CALL_Inerface_DataHandle.CALL_Inerface_CallMaterial(OpName, "5");
|
||||
if (isOk)
|
||||
{
|
||||
msg = $"【{OpName}】下空托盘操作成功";
|
||||
MIS_BASE.WritePLC(306, OpName, 1); // 任务状态反馈
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = $"【{OpName}】下空托盘操作失败";
|
||||
MIS_BASE.WritePLC(306, OpName, 2); // 任务状态反馈
|
||||
}
|
||||
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
MyLog4Net.MyLogHelper.Info("UnloadEmptyTray", msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
MisDataFun.Location_MIS_MOBY_Insert(OpName, "UnloadEmptyTray", "0");
|
||||
MIS_BASE.WritePLC(301, OpName, false); // 请求进入
|
||||
MIS_BASE.WritePLC(302, OpName, false); // 托盘到位
|
||||
MIS_BASE.WritePLC(303, OpName, false); // AGV已离开
|
||||
MIS_BASE.WritePLC(305, OpName, "0"); // 比对结果
|
||||
MIS_BASE.WritePLC(304, OpName, false); // 比对完成
|
||||
MIS_BASE.WritePLC(306, OpName, 0); // 任务状态反馈
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
MisDataSaveDate.FuntionMesRead.Alarm_SaveFileLog4Error(System.Reflection.MethodBase.GetCurrentMethod().Name, e, "Fun1054", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
MisDataFunction/Function1054/OpcServer/vssver2.scc
Normal file
BIN
MisDataFunction/Function1054/OpcServer/vssver2.scc
Normal file
Binary file not shown.
36
MisDataFunction/Function1054/Properties/AssemblyInfo.cs
Normal file
36
MisDataFunction/Function1054/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的常规信息通过以下
|
||||
// 特性集控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("Function02")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("苏州宏软信息技术有限公司")]
|
||||
[assembly: AssemblyProduct("Function02")]
|
||||
[assembly: AssemblyCopyright("Copyright © 苏州宏软信息技术有限公司 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 使此程序集中的类型
|
||||
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
|
||||
// 则将该类型上的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("47710f2c-e141-4252-8d13-701bf4c1c027")]
|
||||
|
||||
// 程序集的版本信息由下面四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 内部版本号
|
||||
// 修订号
|
||||
//
|
||||
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
BIN
MisDataFunction/Function1054/Properties/vssver2.scc
Normal file
BIN
MisDataFunction/Function1054/Properties/vssver2.scc
Normal file
Binary file not shown.
27
MisDataFunction/Function1054/app.config
Normal file
27
MisDataFunction/Function1054/app.config
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="MQTTnet" publicKeyToken="b69712f52770c0a7" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.0.13.0" newVersion="3.0.13.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.2.0" newVersion="4.2.2.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /></startup></configuration>
|
||||
5
MisDataFunction/Function1054/mssccprj.scc
Normal file
5
MisDataFunction/Function1054/mssccprj.scc
Normal file
@@ -0,0 +1,5 @@
|
||||
SCC = This is a Source Code Control file
|
||||
|
||||
[Function02.csproj]
|
||||
SCC_Aux_Path = "\\192.168.0.100\vss\MES4.0"
|
||||
SCC_Project_Name = "$/MisData/MisData/MisData/MesServer.Function/Function02", ILHAAAAA
|
||||
15
MisDataFunction/Function1054/packages.config
Normal file
15
MisDataFunction/Function1054/packages.config
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net461" />
|
||||
<package id="MQTTnet" version="3.0.13" targetFramework="net461" />
|
||||
<package id="MQTTnet.Extensions.ManagedClient" version="3.0.13" targetFramework="net461" />
|
||||
<package id="NETStandard.Library" version="2.0.0" targetFramework="net461" />
|
||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net461" />
|
||||
<package id="System.Net.Security" version="4.3.2" targetFramework="net461" />
|
||||
<package id="System.Net.WebSockets" version="4.3.0" targetFramework="net461" />
|
||||
<package id="System.Net.WebSockets.Client" version="4.3.2" targetFramework="net461" />
|
||||
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net461" requireReinstallation="true" />
|
||||
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" />
|
||||
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461" />
|
||||
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net461" />
|
||||
</packages>
|
||||
BIN
MisDataFunction/Function1054/vssver2.scc
Normal file
BIN
MisDataFunction/Function1054/vssver2.scc
Normal file
Binary file not shown.
Reference in New Issue
Block a user