Dreamine.PLC.Omron.Fins
1.0.1
Dreamine.PLC.Omron.Fins 산업 자동화 및 I/O 기능을 제공합니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
OmronFinsEndian.cs
이 파일의 문서화 페이지로 가기
1
namespace
Dreamine.PLC.Omron.Fins.Protocol
;
2
11
public
static
class
OmronFinsEndian
12
{
53
public
static
ushort
ReadUInt16
(ReadOnlySpan<byte> buffer,
int
offset)
54
{
55
return
(ushort)((buffer[offset] << 8) | buffer[offset + 1]);
56
}
57
98
public
static
short
ReadInt16
(ReadOnlySpan<byte> buffer,
int
offset)
99
{
100
return
unchecked((
short
)
ReadUInt16
(buffer, offset));
101
}
102
143
public
static
int
ReadInt32
(ReadOnlySpan<byte> buffer,
int
offset)
144
{
145
return
(buffer[offset] << 24) | (buffer[offset + 1] << 16) | (buffer[offset + 2] << 8) | buffer[offset + 3];
146
}
147
188
public
static
void
WriteUInt16
(Span<byte> buffer,
int
offset, ushort value)
189
{
190
buffer[offset] = (byte)((value >> 8) & 0xFF);
191
buffer[offset + 1] = (byte)(value & 0xFF);
192
}
193
234
public
static
void
WriteInt16
(Span<byte> buffer,
int
offset,
short
value)
235
{
236
WriteUInt16
(buffer, offset, unchecked((ushort)value));
237
}
238
279
public
static
void
WriteInt32
(Span<byte> buffer,
int
offset,
int
value)
280
{
281
buffer[offset] = (byte)((value >> 24) & 0xFF);
282
buffer[offset + 1] = (byte)((value >> 16) & 0xFF);
283
buffer[offset + 2] = (byte)((value >> 8) & 0xFF);
284
buffer[offset + 3] = (byte)(value & 0xFF);
285
}
286
}
Dreamine.PLC.Omron.Fins.Protocol
Definition
OmronFinsCommand.cs:1
Dreamine.PLC.Omron.Fins.Protocol.OmronFinsEndian
Definition
OmronFinsEndian.cs:12
Dreamine.PLC.Omron.Fins.Protocol.OmronFinsEndian.WriteInt32
static void WriteInt32(Span< byte > buffer, int offset, int value)
Definition
OmronFinsEndian.cs:279
Dreamine.PLC.Omron.Fins.Protocol.OmronFinsEndian.WriteUInt16
static void WriteUInt16(Span< byte > buffer, int offset, ushort value)
Definition
OmronFinsEndian.cs:188
Dreamine.PLC.Omron.Fins.Protocol.OmronFinsEndian.ReadInt16
static short ReadInt16(ReadOnlySpan< byte > buffer, int offset)
Definition
OmronFinsEndian.cs:98
Dreamine.PLC.Omron.Fins.Protocol.OmronFinsEndian.WriteInt16
static void WriteInt16(Span< byte > buffer, int offset, short value)
Definition
OmronFinsEndian.cs:234
Dreamine.PLC.Omron.Fins.Protocol.OmronFinsEndian.ReadUInt16
static ushort ReadUInt16(ReadOnlySpan< byte > buffer, int offset)
Definition
OmronFinsEndian.cs:53
Dreamine.PLC.Omron.Fins.Protocol.OmronFinsEndian.ReadInt32
static int ReadInt32(ReadOnlySpan< byte > buffer, int offset)
Definition
OmronFinsEndian.cs:143
Protocol
OmronFinsEndian.cs
다음에 의해 생성됨 :
1.17.0