Dreamine.PLC.Omron.CxComponent
1.0.1
Dreamine.PLC.Omron.CxComponent 산업 자동화 및 I/O 기능을 제공합니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
OmronCxAddressNameFormatter.cs
이 파일의 문서화 페이지로 가기
1
using
System.Globalization;
2
using
Dreamine.PLC.Abstractions.Devices;
3
4
namespace
Dreamine.PLC.Omron.CxComponent.Devices
;
5
14
public
static
class
OmronCxAddressNameFormatter
15
{
48
public
static
string
Format
(PlcAddress address)
49
{
50
var prefix = address.DeviceType
switch
51
{
52
PlcDeviceType.D =>
"D"
,
53
PlcDeviceType.M =>
"W"
,
54
PlcDeviceType.X =>
"CIO"
,
55
PlcDeviceType.Y =>
"CIO"
,
56
PlcDeviceType.W =>
"W"
,
57
PlcDeviceType.R =>
"H"
,
58
_ =>
throw
new
NotSupportedException($
"Unsupported CX-Compolet device type: {address.DeviceType}"
)
59
};
60
61
var offset = address.Offset.ToString(CultureInfo.InvariantCulture);
62
return
address.BitOffset.HasValue
63
? $
"{prefix}{offset}.{address.BitOffset.Value}"
64
: $
"{prefix}{offset}"
;
65
}
66
107
public
static
string
FormatOffset
(PlcAddress address,
int
delta)
108
{
109
return
Format
(address with { Offset = address.Offset + delta });
110
}
111
}
Dreamine.PLC.Omron.CxComponent.Devices
Definition
OmronCxAddressNameFormatter.cs:4
Dreamine.PLC.Omron.CxComponent.Devices.OmronCxAddressNameFormatter
Definition
OmronCxAddressNameFormatter.cs:15
Dreamine.PLC.Omron.CxComponent.Devices.OmronCxAddressNameFormatter.FormatOffset
static string FormatOffset(PlcAddress address, int delta)
Definition
OmronCxAddressNameFormatter.cs:107
Dreamine.PLC.Omron.CxComponent.Devices.OmronCxAddressNameFormatter.Format
static string Format(PlcAddress address)
Definition
OmronCxAddressNameFormatter.cs:48
Devices
OmronCxAddressNameFormatter.cs
다음에 의해 생성됨 :
1.17.0