| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using TeamAAS_VP.Core.PLCs;
- namespace TeamAAS_VP.Models
- {
- public class MCToPCInfo
- {
- public string PlcIp { get; set; } = "192.1683.20";
- public int PlcPort { get; set; } = 4998;
- public bool PlcForwardEnabled { get; set; } = true;
- public string PlcPortDevice { get; set; } = "D101";
- public string PlcQualityDevice { get; set; } = "D102";
- public string PlcDataStartDevice { get; set; } = "D110";
- public string PlcReadyBitDevice { get; set; } = "M100";
- /// <summary>读 OK 位,填 0 表示不使用</summary>
- public string PlcOkBitDevice { get; set; } = "0";
- /// <summary>读 NG 位,填 0 表示不使用</summary>
- public string PlcNgBitDevice { get; set; } = "0";
- /// <summary>Receive 位(PC→PLC),填 0 表示不使用</summary>
- public string PlcReceiveBitDevice { get; set; } = "M103";
- /// <summary>PC 心跳地址:M 等位元件翻转,D 等字元件递增;填 0 表示不使用</summary>
- public string PlcHeartbeatDevice { get; set; } = "M200";
- public int PlcHeartbeatIntervalMs { get; set; } = 1000;
- /// <summary>连接自检用的位地址(建议用梯形图未占用的 M,如 M3001)</summary>
- public string PlcBitTestDevice { get; set; } = "M3001";
- public int PlcMaxDataBytes { get; set; } = 32;
- public PlcRfidMapping ToPlcMapping()
- {
- return new PlcRfidMapping
- {
- PortDevice = PlcPortDevice,
- QualityDevice = PlcQualityDevice,
- DataStartDevice = PlcDataStartDevice,
- ReadyBitDevice = PlcReadyBitDevice,
- OkBitDevice = PlcOkBitDevice,
- NgBitDevice = PlcNgBitDevice,
- ReceiveBitDevice = PlcReceiveBitDevice,
- MaxDataBytes = PlcMaxDataBytes
- };
- }
- }
- }
|