Dreamine.PLC.Omron.Fins 1.0.1
Dreamine.PLC.Omron.Fins 산업 자동화 및 I/O 기능을 제공합니다.
로딩중...
검색중...
일치하는것 없음
OmronFinsMemoryAreaMapper.cs
이 파일의 문서화 페이지로 가기
1using Dreamine.PLC.Abstractions.Devices;
3
5
14public static class OmronFinsMemoryAreaMapper
15{
56 public static byte Map(PlcAddress address, bool bitAccess)
57 {
58 return address.DeviceType switch
59 {
60 PlcDeviceType.D => bitAccess ? OmronFinsMemoryAreaCode.DmBit : OmronFinsMemoryAreaCode.DmWord,
63 PlcDeviceType.M => bitAccess ? OmronFinsMemoryAreaCode.CioBit : OmronFinsMemoryAreaCode.CioWord,
64 PlcDeviceType.X => bitAccess ? OmronFinsMemoryAreaCode.CioBit : OmronFinsMemoryAreaCode.CioWord,
65 PlcDeviceType.Y => bitAccess ? OmronFinsMemoryAreaCode.CioBit : OmronFinsMemoryAreaCode.CioWord,
66 _ => throw new NotSupportedException($"Unsupported FINS device type: {address.DeviceType}.")
67 };
68 }
69
94 public static PlcDeviceType ToDeviceType(byte areaCode)
95 {
96 return areaCode switch
97 {
102 _ => PlcDeviceType.Unknown
103 };
104 }
105
130 public static bool IsBitArea(byte areaCode)
131 {
132 return areaCode is OmronFinsMemoryAreaCode.CioBit
136 }
137}
static byte Map(PlcAddress address, bool bitAccess)