TOYOPUC Computerlink .NET API Reference
This page is generated from the PlcComm.Toyopuc assembly public API and XML documentation comments.
Run python scripts/generate_api_reference.py --help from the repository root to regenerate it.
PlcComm.Toyopuc
ClockData
public sealed class ClockData
Members
ClockData
public ClockData(int Second, int Minute, int Hour, int Day, int Month, int Year2Digit, int Weekday)
AsDateTime
public DateTime AsDateTime(int yearBase = 2000)
Second
public int Second { get; set; }
Minute
public int Minute { get; set; }
Hour
public int Hour { get; set; }
Day
public int Day { get; set; }
Month
public int Month { get; set; }
Year2Digit
public int Year2Digit { get; set; }
Weekday
public int Weekday { get; set; }
CpuStatusData
public sealed class CpuStatusData
Members
CpuStatusData
public CpuStatusData(byte data1, byte data2, byte data3, byte data4, byte data5, byte data6, byte data7, byte data8)
RawHex
public string RawHex()
Data1
public byte Data1 { get; }
Data2
public byte Data2 { get; }
Data3
public byte Data3 { get; }
Data4
public byte Data4 { get; }
Data5
public byte Data5 { get; }
Data6
public byte Data6 { get; }
Data7
public byte Data7 { get; }
Data8
public byte Data8 { get; }
RawBytes
public byte[] RawBytes { get; }
RawBytesHex
public string RawBytesHex { get; }
Run
public bool Run { get; }
UnderStop
public bool UnderStop { get; }
UnderStopRequestContinuity
public bool UnderStopRequestContinuity { get; }
UnderPseudoStop
public bool UnderPseudoStop { get; }
DebugMode
public bool DebugMode { get; }
IoMonitorUserMode
public bool IoMonitorUserMode { get; }
Pc3Mode
public bool Pc3Mode { get; }
Pc10Mode
public bool Pc10Mode { get; }
FatalFailure
public bool FatalFailure { get; }
FaintFailure
public bool FaintFailure { get; }
Alarm
public bool Alarm { get; }
IoAllocationParameterAltered
public bool IoAllocationParameterAltered { get; }
WithMemoryCard
public bool WithMemoryCard { get; }
MemoryCardOperation
public bool MemoryCardOperation { get; }
WriteProtectedProgramInfo
public bool WriteProtectedProgramInfo { get; }
ReadProtectedSystemMemory
public bool ReadProtectedSystemMemory { get; }
WriteProtectedSystemMemory
public bool WriteProtectedSystemMemory { get; }
ReadProtectedSystemIo
public bool ReadProtectedSystemIo { get; }
WriteProtectedSystemIo
public bool WriteProtectedSystemIo { get; }
Trace
public bool Trace { get; }
ScanSamplingTrace
public bool ScanSamplingTrace { get; }
PeriodicSamplingTrace
public bool PeriodicSamplingTrace { get; }
EnableDetected
public bool EnableDetected { get; }
TriggerDetected
public bool TriggerDetected { get; }
OneScanStep
public bool OneScanStep { get; }
OneBlockStep
public bool OneBlockStep { get; }
OneInstructionStep
public bool OneInstructionStep { get; }
IoOffline
public bool IoOffline { get; }
RemoteRunSetting
public bool RemoteRunSetting { get; }
StatusLatchSetting
public bool StatusLatchSetting { get; }
WritePriorityLimitedProgramInfo
public bool WritePriorityLimitedProgramInfo { get; }
AbnormalWriteFlashRegister
public bool AbnormalWriteFlashRegister { get; }
UnderWritingFlashRegister
public bool UnderWritingFlashRegister { get; }
AbnormalWriteEquipmentInfo
public bool AbnormalWriteEquipmentInfo { get; }
AbnormalWritingEquipmentInfo
public bool AbnormalWritingEquipmentInfo { get; }
AbnormalWriteDuringRun
public bool AbnormalWriteDuringRun { get; }
UnderWritingDuringRun
public bool UnderWritingDuringRun { get; }
Program3Running
public bool Program3Running { get; }
Program2Running
public bool Program2Running { get; }
Program1Running
public bool Program1Running { get; }
ExNoAddress32
public sealed class ExNoAddress32
Members
ExNoAddress32
public ExNoAddress32(int ExNo, int Address, string Unit)
ExNo
public int ExNo { get; set; }
Address
public int Address { get; set; }
Unit
public string Unit { get; set; }
ExtNoAddress
public sealed class ExtNoAddress
Members
ExtNoAddress
public ExtNoAddress(int No, int Address, string Unit)
No
public int No { get; set; }
Address
public int Address { get; set; }
Unit
public string Unit { get; set; }
ParsedAddress
public sealed class ParsedAddress
Members
ParsedAddress
public ParsedAddress(string Area, int Index, string Unit, bool High = false, bool Packed = false, int? DigitCount = null)
Area
public string Area { get; set; }
Index
public int Index { get; set; }
Unit
public string Unit { get; set; }
High
public bool High { get; set; }
Packed
public bool Packed { get; set; }
DigitCount
public int? DigitCount { get; set; }
QueuedToyopucDeviceClient
public sealed class QueuedToyopucDeviceClient
A wrapper for ToyopucDeviceClient that serializes compound async operations.
Remarks: Use this wrapper when one TOYOPUC transport session must serve multiple high-level reads, writes, poll cycles, or relay operations without overlapping command lifetimes.
Members
QueuedToyopucDeviceClient
public QueuedToyopucDeviceClient(ToyopucDeviceClient client, object relayHops = null)
Initializes a new instance of the QueuedToyopucDeviceClient class.
Parameters:
- client: The underlying TOYOPUC client.
- relayHops: Optional relay hop configuration.
OpenAsync
public Task OpenAsync(CancellationToken cancellationToken = default)
Opens the connection asynchronously with exclusive access.
Remarks: Relay and direct sessions both flow through this gate-protected open path.
ExecuteAsync
public Task<T> ExecuteAsync<T>(Func<ToyopucDeviceClient, Task<T>> operation, CancellationToken cancellationToken = default)
Executes an async operation with exclusive access to the wrapped client.
Returns: The value returned by operation.
Parameters:
- operation: Delegate that receives the wrapped ToyopucDeviceClient.
- cancellationToken: Cancellation token used while waiting for exclusive access.
ExecuteAsync
public Task ExecuteAsync(Func<ToyopucDeviceClient, Task> operation, CancellationToken cancellationToken = default)
Executes an async operation with exclusive access to the wrapped client.
Parameters:
- operation: Delegate that receives the wrapped ToyopucDeviceClient.
- cancellationToken: Cancellation token used while waiting for exclusive access.
Dispose
public void Dispose()
Disposes the wrapper and the underlying client.
DisposeAsync
public ValueTask DisposeAsync()
Disposes the wrapper and the underlying client asynchronously.
InnerClient
public ToyopucDeviceClient InnerClient { get; }
Gets the wrapped low-level client.
Remarks: Use CancellationToken) when you need direct client access while preserving serialized execution.
RelayHops
public IReadOnlyList<ValueTuple<int, int>> RelayHops { get; }
Gets the configured relay hops, if any.
Remarks: The returned sequence is already normalized to link/station tuples.
UsesRelay
public bool UsesRelay { get; }
Gets a value indicating whether relay mode is enabled.
Host
public string Host { get; }
Gets the PLC host.
Port
public int Port { get; }
Gets the PLC port.
Transport
public ToyopucTransportMode Transport { get; }
Gets the selected transport protocol.
Timeout
public TimeSpan Timeout { get; set; }
Gets or sets the operation timeout.
PlcProfile
public string PlcProfile { get; }
Gets the normalized PLC profile name.
AddressingOptions
public ToyopucAddressingOptions AddressingOptions { get; }
Gets the addressing options used by the wrapped client.
CaptureTraceFrames
public bool CaptureTraceFrames { get; set; }
Gets or sets a value indicating whether transport trace frames are captured.
TraceHook
public Action<ToyopucTraceFrame> TraceHook { get; set; }
Gets or sets the raw trace callback.
IsOpen
public bool IsOpen { get; }
Gets a value indicating whether the underlying transport is open.
RelayLayer
public sealed class RelayLayer
Members
RelayLayer
public RelayLayer(int LinkNo, int StationNo, int Ack, byte[] InnerRaw, byte[] Padding = null)
LinkNo
public int LinkNo { get; set; }
StationNo
public int StationNo { get; set; }
Ack
public int Ack { get; set; }
InnerRaw
public byte[] InnerRaw { get; set; }
Padding
public byte[] Padding { get; set; }
ResolvedDevice
public sealed class ResolvedDevice
Members
ResolvedDevice
public ResolvedDevice(string Text, string Scheme, string Unit, string Area, int Index, string Prefix = null, bool High = false, bool Packed = false, int? BasicAddress = null, int? No = null, int? Address = null, int? BitNo = null, int? Address32 = null)
Text
public string Text { get; set; }
Scheme
public string Scheme { get; set; }
Unit
public string Unit { get; set; }
Area
public string Area { get; set; }
Index
public int Index { get; set; }
Prefix
public string Prefix { get; set; }
High
public bool High { get; set; }
Packed
public bool Packed { get; set; }
BasicAddress
public int? BasicAddress { get; set; }
No
public int? No { get; set; }
Address
public int? Address { get; set; }
BitNo
public int? BitNo { get; set; }
Address32
public int? Address32 { get; set; }
ResponseFrame
public sealed class ResponseFrame
Members
ResponseFrame
public ResponseFrame(byte Ft, byte Rc, byte Cmd, byte[] Data)
Ft
public byte Ft { get; set; }
Rc
public byte Rc { get; set; }
Cmd
public byte Cmd { get; set; }
Data
public byte[] Data { get; set; }
ToyopucAddress
public static class ToyopucAddress
Public helpers for TOYOPUC address parsing, formatting, normalization, and low-level encoding.
Remarks: This type serves two audiences: Applications that need canonical address text for generated documentation or UI. Low-level tooling that needs to encode resolved addresses into transport-specific numeric forms. The higher-level parse, format, and normalize methods are the recommended public entry points for most callers.
Members
Parse
public static ResolvedDevice Parse(string text, ToyopucAddressingOptions options = null, string profile = null)
Parses a canonical device string into a resolved device shape.
Returns: The resolved device shape.
Parameters:
- text: Canonical or profile-aware device text such as D0000, P1-D0000, or M0000.
- options: Optional explicit addressing options.
- profile: Optional PLC profile name used to resolve profile-specific address rules.
TryParse
public static bool TryParse(string text, out ResolvedDevice address)
Attempts to parse a canonical device string into a resolved device shape.
Returns: true when parsing succeeds; otherwise false.
Parameters:
- text: Device text to parse.
- address: When this method returns true, receives the resolved device.
TryParse
public static bool TryParse(string text, ToyopucAddressingOptions options, string profile, out ResolvedDevice address)
Attempts to parse a canonical device string into a resolved device shape.
Returns: true when parsing succeeds; otherwise false.
Parameters:
- text: Device text to parse.
- address: When this method returns true, receives the resolved device.
Format
public static string Format(ResolvedDevice address)
Formats a resolved device back to canonical text.
Returns: Canonical uppercase device text.
Parameters:
- address: Resolved device to format.
Format
public static string Format(ResolvedDevice address, string profile)
Formats a resolved device back to canonical text using an explicit PLC profile.
Returns: Canonical uppercase device text.
Parameters:
- address: Resolved device to format.
- profile: Canonical PLC profile name.
Format
public static string Format(ResolvedDevice address, int index)
Formats a resolved device using an explicit index override.
Returns: Canonical uppercase device text for the supplied index.
Parameters:
- address: Resolved device metadata to reuse.
- index: Explicit logical index to format.
Format
public static string Format(ResolvedDevice address, int index, string profile)
Formats a resolved device using an explicit index override and PLC profile.
Returns: Canonical uppercase device text for the supplied index.
Parameters:
- address: Resolved device metadata to reuse.
- index: Explicit logical index to format.
- profile: Canonical PLC profile name.
Normalize
public static string Normalize(string text, ToyopucAddressingOptions options = null, string profile = null)
Normalizes a device string to canonical casing and width.
Returns: The canonical representation returned by ResolvedDevice).
Parameters:
- text: Input device text in any supported spelling.
- options: Optional explicit addressing options.
- profile: Optional profile name used by the resolver.
ParseAddress
public static ParsedAddress ParseAddress(string text, string unit, int radix = 16)
ParsePrefixedAddress
public static ValueTuple<int, ParsedAddress> ParsePrefixedAddress(string text, string unit, int radix = 16)
EncodeWordAddress
public static int EncodeWordAddress(ParsedAddress address)
EncodeByteAddress
public static int EncodeByteAddress(ParsedAddress address)
EncodeBitAddress
public static int EncodeBitAddress(ParsedAddress address)
EncodePc10BitAddress
public static int EncodePc10BitAddress(ParsedAddress address)
EncodeProgramWordAddress
public static int EncodeProgramWordAddress(ParsedAddress address)
EncodeProgramByteAddress
public static int EncodeProgramByteAddress(ParsedAddress address)
EncodeProgramBitAddress
public static ValueTuple<int, int> EncodeProgramBitAddress(ParsedAddress address)
EncodeExNoBitU32
public static int EncodeExNoBitU32(int exNo, int bitAddress)
EncodeExNoByteU32
public static int EncodeExNoByteU32(int exNo, int byteAddress)
SplitU32Words
public static ValueTuple<int, int> SplitU32Words(int value)
FrBlockExNo
public static int FrBlockExNo(int index)
EncodeFrWordAddr32
public static int EncodeFrWordAddr32(int index)
EncodeExtNoAddress
public static ExtNoAddress EncodeExtNoAddress(string area, int index, string unit)
ToyopucAddressingOptions
public sealed class ToyopucAddressingOptions
Members
ToyopucAddressingOptions
public ToyopucAddressingOptions(bool UseUpperUPc10 = true, bool UseEbPc10 = true, bool UseFrPc10 = true, bool UseUpperBitPc10 = true, bool UseUpperMBitPc10 = true)
FromProfile
public static ToyopucAddressingOptions FromProfile(string profile)
UseUpperUPc10
public bool UseUpperUPc10 { get; set; }
UseEbPc10
public bool UseEbPc10 { get; set; }
UseFrPc10
public bool UseFrPc10 { get; set; }
UseUpperBitPc10
public bool UseUpperBitPc10 { get; set; }
UseUpperMBitPc10
public bool UseUpperMBitPc10 { get; set; }
Default
public static ToyopucAddressingOptions Default { get; }
Generic
public static ToyopucAddressingOptions Generic { get; }
ToyopucPlusStandard
public static ToyopucAddressingOptions ToyopucPlusStandard { get; }
ToyopucPlusExtended
public static ToyopucAddressingOptions ToyopucPlusExtended { get; }
Nano10GxMode
public static ToyopucAddressingOptions Nano10GxMode { get; }
Nano10GxCompatible
public static ToyopucAddressingOptions Nano10GxCompatible { get; }
Pc10GStandardPc3Jg
public static ToyopucAddressingOptions Pc10GStandardPc3Jg { get; }
Pc10GMode
public static ToyopucAddressingOptions Pc10GMode { get; }
Pc3JxPc3Separate
public static ToyopucAddressingOptions Pc3JxPc3Separate { get; }
Pc3JxPlusExpansion
public static ToyopucAddressingOptions Pc3JxPlusExpansion { get; }
Pc3JgMode
public static ToyopucAddressingOptions Pc3JgMode { get; }
Pc3JgPc3Separate
public static ToyopucAddressingOptions Pc3JgPc3Separate { get; }
ToyopucAddressRange
public sealed class ToyopucAddressRange
Members
ToyopucAddressRange
public ToyopucAddressRange(int Start, int End)
Contains
public bool Contains(int index)
Start
public int Start { get; set; }
End
public int End { get; set; }
ToyopucAreaDescriptor
public sealed class ToyopucAreaDescriptor
Members
ToyopucAreaDescriptor
public ToyopucAreaDescriptor(string Area, IReadOnlyList<ToyopucAddressRange> DirectRanges, IReadOnlyList<ToyopucAddressRange> PrefixedRanges, bool SupportsPackedWord, int AddressWidth, int SuggestedStartStep, IReadOnlyList<ToyopucAddressRange> PackedDirectRangesOverride = null, IReadOnlyList<ToyopucAddressRange> PackedPrefixedRangesOverride = null)
UsesDerivedAccess
public bool UsesDerivedAccess(string unit, bool packed = false)
GetAddressWidth
public int GetAddressWidth(string unit, bool packed = false)
GetRanges
public IReadOnlyList<ToyopucAddressRange> GetRanges(bool prefixed, bool packed)
GetRanges
public IReadOnlyList<ToyopucAddressRange> GetRanges(bool prefixed, string unit, bool packed = false)
Area
public string Area { get; set; }
DirectRanges
public IReadOnlyList<ToyopucAddressRange> DirectRanges { get; set; }
PrefixedRanges
public IReadOnlyList<ToyopucAddressRange> PrefixedRanges { get; set; }
SupportsPackedWord
public bool SupportsPackedWord { get; set; }
AddressWidth
public int AddressWidth { get; set; }
SuggestedStartStep
public int SuggestedStartStep { get; set; }
PackedDirectRangesOverride
public IReadOnlyList<ToyopucAddressRange> PackedDirectRangesOverride { get; set; }
PackedPrefixedRangesOverride
public IReadOnlyList<ToyopucAddressRange> PackedPrefixedRangesOverride { get; set; }
DirectRange
public ToyopucAddressRange DirectRange { get; }
PrefixedRange
public ToyopucAddressRange PrefixedRange { get; }
PackedAddressWidth
public int PackedAddressWidth { get; }
DerivedAddressWidth
public int DerivedAddressWidth { get; }
PackedDirectRange
public ToyopucAddressRange PackedDirectRange { get; }
PackedPrefixedRange
public ToyopucAddressRange PackedPrefixedRange { get; }
SupportsDirect
public bool SupportsDirect { get; }
SupportsPrefixed
public bool SupportsPrefixed { get; }
ToyopucClient
public class ToyopucClient
Members
UdpReceiveBufferSize
public const int UdpReceiveBufferSize
ReadDWord
public uint ReadDWord(int address)
WriteDWord
public void WriteDWord(int address, uint value)
ReadDWords
public uint[] ReadDWords(int address, int count)
WriteDWords
public void WriteDWords(int address, IEnumerable<uint> values)
ReadFloat32
public float ReadFloat32(int address)
WriteFloat32
public void WriteFloat32(int address, float value)
ReadFloat32s
public float[] ReadFloat32s(int address, int count)
WriteFloat32s
public void WriteFloat32s(int address, IEnumerable<float> values)
OpenAsync
public virtual Task OpenAsync(CancellationToken cancellationToken = default)
CloseAsync
public virtual Task CloseAsync(CancellationToken cancellationToken = default)
DisposeAsync
public virtual ValueTask DisposeAsync()
ClearTraceFramesAsync
public Task ClearTraceFramesAsync(CancellationToken cancellationToken = default)
SendRawAsync
public Task<ResponseFrame> SendRawAsync(int cmd, byte[] data = null, CancellationToken cancellationToken = default)
SendPayloadAsync
public Task<ResponseFrame> SendPayloadAsync(byte[] payload, CancellationToken cancellationToken = default)
ReadWordsAsync
public Task<int[]> ReadWordsAsync(int address, int count, CancellationToken cancellationToken = default)
WriteWordsAsync
public Task WriteWordsAsync(int address, IEnumerable<int> values, CancellationToken cancellationToken = default)
ReadBytesAsync
public Task<byte[]> ReadBytesAsync(int address, int count, CancellationToken cancellationToken = default)
WriteBytesAsync
public Task WriteBytesAsync(int address, IEnumerable<int> values, CancellationToken cancellationToken = default)
ReadBitAsync
public Task<bool> ReadBitAsync(int address, CancellationToken cancellationToken = default)
WriteBitAsync
public Task WriteBitAsync(int address, bool value, CancellationToken cancellationToken = default)
ReadDWordAsync
public Task<uint> ReadDWordAsync(int address, CancellationToken cancellationToken = default)
WriteDWordAsync
public Task WriteDWordAsync(int address, uint value, CancellationToken cancellationToken = default)
ReadDWordsAsync
public Task<uint[]> ReadDWordsAsync(int address, int count, CancellationToken cancellationToken = default)
WriteDWordsAsync
public Task WriteDWordsAsync(int address, IEnumerable<uint> values, CancellationToken cancellationToken = default)
ReadFloat32Async
public Task<float> ReadFloat32Async(int address, CancellationToken cancellationToken = default)
WriteFloat32Async
public Task WriteFloat32Async(int address, float value, CancellationToken cancellationToken = default)
ReadFloat32sAsync
public Task<float[]> ReadFloat32sAsync(int address, int count, CancellationToken cancellationToken = default)
WriteFloat32sAsync
public Task WriteFloat32sAsync(int address, IEnumerable<float> values, CancellationToken cancellationToken = default)
ReadWordsMultiAsync
public Task<int[]> ReadWordsMultiAsync(IEnumerable<int> addresses, CancellationToken cancellationToken = default)
WriteWordsMultiAsync
public Task WriteWordsMultiAsync(IEnumerable<ValueTuple<int, int>> pairs, CancellationToken cancellationToken = default)
ReadBytesMultiAsync
public Task<byte[]> ReadBytesMultiAsync(IEnumerable<int> addresses, CancellationToken cancellationToken = default)
WriteBytesMultiAsync
public Task WriteBytesMultiAsync(IEnumerable<ValueTuple<int, int>> pairs, CancellationToken cancellationToken = default)
ReadExtWordsAsync
public Task<int[]> ReadExtWordsAsync(int number, int address, int count, CancellationToken cancellationToken = default)
WriteExtWordsAsync
public Task WriteExtWordsAsync(int number, int address, IEnumerable<int> values, CancellationToken cancellationToken = default)
ReadExtBytesAsync
public Task<byte[]> ReadExtBytesAsync(int number, int address, int count, CancellationToken cancellationToken = default)
WriteExtBytesAsync
public Task WriteExtBytesAsync(int number, int address, IEnumerable<int> values, CancellationToken cancellationToken = default)
ReadExtMultiAsync
public Task<byte[]> ReadExtMultiAsync(IEnumerable<ValueTuple<int, int, int>> bitPoints, IEnumerable<ValueTuple<int, int>> bytePoints, IEnumerable<ValueTuple<int, int>> wordPoints, CancellationToken cancellationToken = default)
WriteExtMultiAsync
public Task WriteExtMultiAsync(IEnumerable<ValueTuple<int, int, int, int>> bitPoints, IEnumerable<ValueTuple<int, int, int>> bytePoints, IEnumerable<ValueTuple<int, int, int>> wordPoints, CancellationToken cancellationToken = default)
Pc10BlockReadAsync
public Task<byte[]> Pc10BlockReadAsync(int address32, int count, CancellationToken cancellationToken = default)
Pc10BlockWriteAsync
public Task Pc10BlockWriteAsync(int address32, byte[] dataBytes, CancellationToken cancellationToken = default)
Pc10MultiReadAsync
public Task<byte[]> Pc10MultiReadAsync(byte[] payload, CancellationToken cancellationToken = default)
Pc10MultiWriteAsync
public Task Pc10MultiWriteAsync(byte[] payload, CancellationToken cancellationToken = default)
ReadFrWordsAsync
public Task<int[]> ReadFrWordsAsync(int index, int count, CancellationToken cancellationToken = default)
WriteFrWordsAsync
public Task WriteFrWordsAsync(int index, IEnumerable<int> values, bool commit = false, CancellationToken cancellationToken = default)
WriteFrWordsExAsync
public Task WriteFrWordsExAsync(int index, IEnumerable<int> values, bool commit = false, bool wait = false, double timeout = 30, double pollInterval = 0.2, CancellationToken cancellationToken = default)
CommitFrBlockAsync
public Task<CpuStatusData> CommitFrBlockAsync(int index, bool wait = false, double timeout = 30, double pollInterval = 0.2, CancellationToken cancellationToken = default)
CommitFrRangeAsync
public Task<CpuStatusData> CommitFrRangeAsync(int index, int count = 1, bool wait = false, double timeout = 30, double pollInterval = 0.2, CancellationToken cancellationToken = default)
WriteFrWordsCommittedAsync
public Task WriteFrWordsCommittedAsync(int index, IEnumerable<int> values, CancellationToken cancellationToken = default)
FrRegisterAsync
public Task FrRegisterAsync(int exNo, CancellationToken cancellationToken = default)
RelayCommandAsync
public Task<ResponseFrame> RelayCommandAsync(int linkNo, int stationNo, byte[] innerPayload, CancellationToken cancellationToken = default)
RelayNestedAsync
public Task<ResponseFrame> RelayNestedAsync(IEnumerable<ValueTuple<int, int>> hops, byte[] innerPayload, CancellationToken cancellationToken = default)
SendViaRelayAsync
public Task<ResponseFrame> SendViaRelayAsync(object hops, byte[] innerPayload, CancellationToken cancellationToken = default)
RelayReadWordsAsync
public Task<int[]> RelayReadWordsAsync(object hops, int address, int count, CancellationToken cancellationToken = default)
RelayWriteWordsAsync
public Task RelayWriteWordsAsync(object hops, int address, IEnumerable<int> values, CancellationToken cancellationToken = default)
RelayReadClockAsync
public Task<ClockData> RelayReadClockAsync(object hops, CancellationToken cancellationToken = default)
RelayWriteClockAsync
public Task RelayWriteClockAsync(object hops, DateTime value, CancellationToken cancellationToken = default)
RelayResumeScanAsync
public Task RelayResumeScanAsync(object hops, CancellationToken cancellationToken = default)
RelayStopScanAsync
public Task RelayStopScanAsync(object hops, CancellationToken cancellationToken = default)
RelayReleaseScanStopAsync
public Task RelayReleaseScanStopAsync(object hops, CancellationToken cancellationToken = default)
RelayReadCpuStatusAsync
public Task<CpuStatusData> RelayReadCpuStatusAsync(object hops, CancellationToken cancellationToken = default)
RelayReadCpuStatusA0RawAsync
public Task<byte[]> RelayReadCpuStatusA0RawAsync(object hops, CancellationToken cancellationToken = default)
RelayReadCpuStatusA0Async
public Task<CpuStatusData> RelayReadCpuStatusA0Async(object hops, CancellationToken cancellationToken = default)
RelayWriteFrWordsAsync
public Task RelayWriteFrWordsAsync(object hops, int index, IEnumerable<int> values, bool commit = false, CancellationToken cancellationToken = default)
RelayWriteFrWordsExAsync
public Task RelayWriteFrWordsExAsync(object hops, int index, IEnumerable<int> values, bool commit = false, bool wait = false, double timeout = 30, double pollInterval = 0.2, CancellationToken cancellationToken = default)
RelayFrRegisterAsync
public Task RelayFrRegisterAsync(object hops, int exNo, CancellationToken cancellationToken = default)
RelayCommitFrBlockAsync
public Task<CpuStatusData> RelayCommitFrBlockAsync(object hops, int index, bool wait = false, double timeout = 30, double pollInterval = 0.2, CancellationToken cancellationToken = default)
RelayCommitFrRangeAsync
public Task<CpuStatusData> RelayCommitFrRangeAsync(object hops, int index, int count = 1, bool wait = false, double timeout = 30, double pollInterval = 0.2, CancellationToken cancellationToken = default)
RelayWaitFrWriteCompleteAsync
public Task<CpuStatusData> RelayWaitFrWriteCompleteAsync(object hops, double timeout = 30, double pollInterval = 0.2, CancellationToken cancellationToken = default)
ReadClockAsync
public Task<ClockData> ReadClockAsync(CancellationToken cancellationToken = default)
ReadCpuStatusAsync
public Task<CpuStatusData> ReadCpuStatusAsync(CancellationToken cancellationToken = default)
ReadCpuStatusA0RawAsync
public Task<byte[]> ReadCpuStatusA0RawAsync(CancellationToken cancellationToken = default)
ReadCpuStatusA0Async
public Task<CpuStatusData> ReadCpuStatusA0Async(CancellationToken cancellationToken = default)
WaitFrWriteCompleteAsync
public Task<CpuStatusData> WaitFrWriteCompleteAsync(double timeout = 30, double pollInterval = 0.2, CancellationToken cancellationToken = default)
WriteClockAsync
public Task WriteClockAsync(DateTime value, CancellationToken cancellationToken = default)
ResumeScanAsync
public Task ResumeScanAsync(CancellationToken cancellationToken = default)
StopScanAsync
public Task StopScanAsync(CancellationToken cancellationToken = default)
ReleaseScanStopAsync
public Task ReleaseScanStopAsync(CancellationToken cancellationToken = default)
ToyopucClient
public ToyopucClient(string host, int port, int localPort = 0, ToyopucTransportMode transport = Tcp, TimeSpan timeout = default, int retries = 0, TimeSpan retryDelay = default, int recvBufsize = 65535)
Open
public virtual void Open()
Close
public virtual void Close()
Dispose
public void Dispose()
ClearTraceFrames
public void ClearTraceFrames()
SendRaw
public ResponseFrame SendRaw(int cmd, byte[] data = null)
SendPayload
public ResponseFrame SendPayload(byte[] payload)
ReadWords
public int[] ReadWords(int address, int count)
WriteWords
public void WriteWords(int address, IEnumerable<int> values)
ReadBytes
public byte[] ReadBytes(int address, int count)
WriteBytes
public void WriteBytes(int address, IEnumerable<int> values)
ReadBit
public bool ReadBit(int address)
WriteBit
public void WriteBit(int address, bool value)
ReadWordsMulti
public int[] ReadWordsMulti(IEnumerable<int> addresses)
WriteWordsMulti
public void WriteWordsMulti(IEnumerable<ValueTuple<int, int>> pairs)
ReadBytesMulti
public byte[] ReadBytesMulti(IEnumerable<int> addresses)
WriteBytesMulti
public void WriteBytesMulti(IEnumerable<ValueTuple<int, int>> pairs)
ReadExtWords
public int[] ReadExtWords(int number, int address, int count)
WriteExtWords
public void WriteExtWords(int number, int address, IEnumerable<int> values)
ReadExtBytes
public byte[] ReadExtBytes(int number, int address, int count)
WriteExtBytes
public void WriteExtBytes(int number, int address, IEnumerable<int> values)
ReadExtMulti
public byte[] ReadExtMulti(IEnumerable<ValueTuple<int, int, int>> bitPoints, IEnumerable<ValueTuple<int, int>> bytePoints, IEnumerable<ValueTuple<int, int>> wordPoints)
WriteExtMulti
public void WriteExtMulti(IEnumerable<ValueTuple<int, int, int, int>> bitPoints, IEnumerable<ValueTuple<int, int, int>> bytePoints, IEnumerable<ValueTuple<int, int, int>> wordPoints)
Pc10BlockRead
public byte[] Pc10BlockRead(int address32, int count)
Pc10BlockWrite
public void Pc10BlockWrite(int address32, byte[] dataBytes)
Pc10MultiRead
public byte[] Pc10MultiRead(byte[] payload)
Pc10MultiWrite
public void Pc10MultiWrite(byte[] payload)
ReadFrWords
public int[] ReadFrWords(int index, int count)
WriteFrWords
public void WriteFrWords(int index, IEnumerable<int> values, bool commit = false)
WriteFrWordsEx
public void WriteFrWordsEx(int index, IEnumerable<int> values, bool commit = false, bool wait = false, double timeout = 30, double pollInterval = 0.2)
CommitFrBlock
public CpuStatusData CommitFrBlock(int index, bool wait = false, double timeout = 30, double pollInterval = 0.2)
CommitFrRange
public CpuStatusData CommitFrRange(int index, int count = 1, bool wait = false, double timeout = 30, double pollInterval = 0.2)
WriteFrWordsCommitted
public void WriteFrWordsCommitted(int index, IEnumerable<int> values)
FrRegister
public void FrRegister(int exNo)
RelayCommand
public ResponseFrame RelayCommand(int linkNo, int stationNo, byte[] innerPayload)
RelayNested
public ResponseFrame RelayNested(IEnumerable<ValueTuple<int, int>> hops, byte[] innerPayload)
SendViaRelay
public ResponseFrame SendViaRelay(object hops, byte[] innerPayload)
RelayReadWords
public int[] RelayReadWords(object hops, int address, int count)
RelayWriteWords
public void RelayWriteWords(object hops, int address, IEnumerable<int> values)
RelayReadClock
public ClockData RelayReadClock(object hops)
RelayWriteClock
public void RelayWriteClock(object hops, DateTime value)
RelayResumeScan
public void RelayResumeScan(object hops)
RelayStopScan
public void RelayStopScan(object hops)
RelayReleaseScanStop
public void RelayReleaseScanStop(object hops)
RelayReadCpuStatus
public CpuStatusData RelayReadCpuStatus(object hops)
RelayReadCpuStatusA0Raw
public byte[] RelayReadCpuStatusA0Raw(object hops)
RelayReadCpuStatusA0
public CpuStatusData RelayReadCpuStatusA0(object hops)
RelayWriteFrWords
public void RelayWriteFrWords(object hops, int index, IEnumerable<int> values, bool commit = false)
RelayWriteFrWordsEx
public void RelayWriteFrWordsEx(object hops, int index, IEnumerable<int> values, bool commit = false, bool wait = false, double timeout = 30, double pollInterval = 0.2)
RelayFrRegister
public void RelayFrRegister(object hops, int exNo)
RelayCommitFrBlock
public CpuStatusData RelayCommitFrBlock(object hops, int index, bool wait = false, double timeout = 30, double pollInterval = 0.2)
RelayCommitFrRange
public CpuStatusData RelayCommitFrRange(object hops, int index, int count = 1, bool wait = false, double timeout = 30, double pollInterval = 0.2)
RelayWaitFrWriteComplete
public CpuStatusData RelayWaitFrWriteComplete(object hops, double timeout = 30, double pollInterval = 0.2)
ReadClock
public ClockData ReadClock()
ReadCpuStatus
public CpuStatusData ReadCpuStatus()
ReadCpuStatusA0Raw
public byte[] ReadCpuStatusA0Raw()
ReadCpuStatusA0
public CpuStatusData ReadCpuStatusA0()
WaitFrWriteComplete
public CpuStatusData WaitFrWriteComplete(double timeout = 30, double pollInterval = 0.2)
WriteClock
public void WriteClock(DateTime value)
ResumeScan
public void ResumeScan()
StopScan
public void StopScan()
ReleaseScanStop
public void ReleaseScanStop()
Host
public string Host { get; }
Port
public int Port { get; }
LocalPort
public int LocalPort { get; }
Transport
public ToyopucTransportMode Transport { get; }
Timeout
public TimeSpan Timeout { get; set; }
Retries
public int Retries { get; }
RetryDelay
public TimeSpan RetryDelay { get; }
RecvBufsize
public int RecvBufsize { get; }
IsOpen
public bool IsOpen { get; }
CaptureTraceFrames
public bool CaptureTraceFrames { get; set; }
TraceHook
public Action<ToyopucTraceFrame> TraceHook { get; set; }
LastTx
public byte[] LastTx { get; }
LastRx
public byte[] LastRx { get; }
TraceFrames
public IReadOnlyList<TransportTraceFrame> TraceFrames { get; }
ToyopucConnectionOptions
public sealed class ToyopucConnectionOptions
Explicit connection options for a stable TOYOPUC device session.
Remarks: This type keeps transport, profile, retry, and relay settings explicit for the unified high-level connection flow and generated API documentation.
Members
ToyopucConnectionOptions
public ToyopucConnectionOptions(string Host)
Explicit connection options for a stable TOYOPUC device session.
Remarks: This type keeps transport, profile, retry, and relay settings explicit for the unified high-level connection flow and generated API documentation.
Parameters:
- Host: PLC IP address or hostname.
Host
public string Host { get; set; }
PLC IP address or hostname.
Port
public int Port { get; set; }
Gets or sets the PLC port number.
Remarks: The default TOYOPUC communication port is 1025.
Timeout
public TimeSpan Timeout { get; set; }
Gets or sets the communication timeout.
Remarks: A zero value falls back to EffectiveTimeout.
Transport
public ToyopucTransportMode Transport { get; set; }
Gets or sets the transport protocol.
PlcProfile
public string PlcProfile { get; set; }
Gets or sets the optional PLC profile name.
Remarks: Supply a known profile name when you want documented profile-based address resolution instead of a fully generic session.
RelayHops
public string RelayHops { get; set; }
Gets or sets the optional relay hop chain text.
Remarks: Leave this empty for direct connections; provide relay hops for routed sessions.
LocalPort
public int LocalPort { get; set; }
Gets or sets the local UDP port. Ignored for TCP.
Retries
public int Retries { get; set; }
Gets or sets the retry count for transport operations.
RetryDelay
public TimeSpan RetryDelay { get; set; }
Gets or sets the retry delay.
RecvBufsize
public int RecvBufsize { get; set; }
Gets or sets the receive buffer size.
EffectiveTimeout
public TimeSpan EffectiveTimeout { get; }
Gets the effective timeout used for a new client instance.
EffectiveRetryDelay
public TimeSpan EffectiveRetryDelay { get; }
Gets the effective retry delay used for a new client instance.
ToyopucDeviceCatalog
public static class ToyopucDeviceCatalog
Members
GetAreaDescriptors
public static IReadOnlyList<ToyopucAreaDescriptor> GetAreaDescriptors(string profile = null)
GetAreas
public static IReadOnlyList<string> GetAreas(bool prefixed, string profile = null)
GetAreaDescriptor
public static ToyopucAreaDescriptor GetAreaDescriptor(string area, string profile = null)
GetSupportedRanges
public static IReadOnlyList<ToyopucAddressRange> GetSupportedRanges(string area, bool prefixed, string profile = null)
GetSupportedRanges
public static IReadOnlyList<ToyopucAddressRange> GetSupportedRanges(string area, bool prefixed, bool packed, string profile = null)
GetSupportedRanges
public static IReadOnlyList<ToyopucAddressRange> GetSupportedRanges(string area, bool prefixed, string unit, bool packed = false, string profile = null)
FormatAddressRange
public static string FormatAddressRange(string familyCode, ToyopucAddressRange range, int width)
FormatAddressRanges
public static string FormatAddressRanges(string familyCode, IEnumerable<ToyopucAddressRange> ranges, int width)
GetSupportedRange
public static ToyopucAddressRange GetSupportedRange(string area, bool prefixed, string profile = null)
GetSupportedRange
public static ToyopucAddressRange GetSupportedRange(string area, bool prefixed, bool packed, string profile = null)
GetSupportedRange
public static ToyopucAddressRange GetSupportedRange(string area, bool prefixed, string unit, bool packed = false, string profile = null)
IsSupportedIndex
public static bool IsSupportedIndex(string area, int index, bool prefixed, string profile = null)
IsSupportedIndex
public static bool IsSupportedIndex(string area, int index, bool prefixed, bool packed, string profile = null)
IsSupportedIndex
public static bool IsSupportedIndex(string area, int index, bool prefixed, string unit, bool packed = false, string profile = null)
GetSuggestedStartAddresses
public static IReadOnlyList<string> GetSuggestedStartAddresses(string area, string prefix = null, string profile = null)
GetSuggestedStartAddresses
public static IReadOnlyList<string> GetSuggestedStartAddresses(string area, ToyopucAddressingOptions options)
GetSuggestedStartAddresses
public static IReadOnlyList<string> GetSuggestedStartAddresses(string area, string prefix, ToyopucAddressingOptions options)
GetSuggestedStartAddresses
public static IReadOnlyList<string> GetSuggestedStartAddresses(string area, string prefix, string unit, bool packed, string profile)
ToyopucDeviceClient
public class ToyopucDeviceClient
Members
ReadDWord
public uint ReadDWord(object device)
WriteDWord
public void WriteDWord(object device, uint value)
ReadDWords
public uint[] ReadDWords(object device, int count, bool atomicTransfer = false)
WriteDWords
public void WriteDWords(object device, IEnumerable<uint> values, bool atomicTransfer = false)
ReadFloat32
public float ReadFloat32(object device)
WriteFloat32
public void WriteFloat32(object device, float value)
ReadFloat32s
public float[] ReadFloat32s(object device, int count, bool atomicTransfer = false)
WriteFloat32s
public void WriteFloat32s(object device, IEnumerable<float> values, bool atomicTransfer = false)
RelayReadDWord
public uint RelayReadDWord(object hops, object device)
RelayWriteDWord
public void RelayWriteDWord(object hops, object device, uint value)
RelayReadDWords
public uint[] RelayReadDWords(object hops, object device, int count, bool atomicTransfer = false)
RelayWriteDWords
public void RelayWriteDWords(object hops, object device, IEnumerable<uint> values, bool atomicTransfer = false)
RelayReadFloat32
public float RelayReadFloat32(object hops, object device)
RelayWriteFloat32
public void RelayWriteFloat32(object hops, object device, float value)
RelayReadFloat32s
public float[] RelayReadFloat32s(object hops, object device, int count, bool atomicTransfer = false)
RelayWriteFloat32s
public void RelayWriteFloat32s(object hops, object device, IEnumerable<float> values, bool atomicTransfer = false)
ResolveDeviceAsync
public Task<ResolvedDevice> ResolveDeviceAsync(string device, CancellationToken cancellationToken = default)
RelayReadAsync
public Task<object> RelayReadAsync(object hops, object device, int count = 1, CancellationToken cancellationToken = default)
RelayWriteAsync
public Task RelayWriteAsync(object hops, object device, object value, CancellationToken cancellationToken = default)
RelayReadWordsAsync
public Task<object> RelayReadWordsAsync(object hops, object device, int count = 1, CancellationToken cancellationToken = default)
RelayWriteWordsAsync
public Task RelayWriteWordsAsync(object hops, object device, object value, CancellationToken cancellationToken = default)
RelayReadManyAsync
public Task<object[]> RelayReadManyAsync(object hops, IEnumerable<object> devices, CancellationToken cancellationToken = default)
RelayWriteManyAsync
public Task RelayWriteManyAsync(object hops, IEnumerable<KeyValuePair<object, object>> items, CancellationToken cancellationToken = default)
ReadFrAsync
public Task<object> ReadFrAsync(object device, int count = 1, CancellationToken cancellationToken = default)
RelayReadFrAsync
public Task<object> RelayReadFrAsync(object hops, object device, int count = 1, CancellationToken cancellationToken = default)
WriteFrAsync
public Task WriteFrAsync(object device, object value, bool commit = false, bool? wait = null, double timeout = 30, double pollInterval = 0.2, CancellationToken cancellationToken = default)
RelayWriteFrAsync
public Task RelayWriteFrAsync(object hops, object device, object value, bool commit = false, bool? wait = null, double timeout = 30, double pollInterval = 0.2, CancellationToken cancellationToken = default)
CommitFrAsync
public Task CommitFrAsync(object device, int count = 1, bool wait = false, double timeout = 30, double pollInterval = 0.2, CancellationToken cancellationToken = default)
RelayCommitFrAsync
public Task RelayCommitFrAsync(object hops, object device, int count = 1, bool wait = false, double timeout = 30, double pollInterval = 0.2, CancellationToken cancellationToken = default)
ReadAsync
public Task<object> ReadAsync(object device, int count = 1, CancellationToken cancellationToken = default)
WriteAsync
public Task WriteAsync(object device, object value, CancellationToken cancellationToken = default)
ReadManyAsync
public Task<object[]> ReadManyAsync(IEnumerable<object> devices, CancellationToken cancellationToken = default)
WriteManyAsync
public Task WriteManyAsync(IEnumerable<KeyValuePair<object, object>> items, CancellationToken cancellationToken = default)
ReadDWordAsync
public Task<uint> ReadDWordAsync(object device, CancellationToken cancellationToken = default)
WriteDWordAsync
public Task WriteDWordAsync(object device, uint value, CancellationToken cancellationToken = default)
ReadDWordsAsync
public Task<uint[]> ReadDWordsAsync(object device, int count, bool atomicTransfer = false, CancellationToken cancellationToken = default)
WriteDWordsAsync
public Task WriteDWordsAsync(object device, IEnumerable<uint> values, bool atomicTransfer = false, CancellationToken cancellationToken = default)
ReadFloat32Async
public Task<float> ReadFloat32Async(object device, CancellationToken cancellationToken = default)
WriteFloat32Async
public Task WriteFloat32Async(object device, float value, CancellationToken cancellationToken = default)
ReadFloat32sAsync
public Task<float[]> ReadFloat32sAsync(object device, int count, bool atomicTransfer = false, CancellationToken cancellationToken = default)
WriteFloat32sAsync
public Task WriteFloat32sAsync(object device, IEnumerable<float> values, bool atomicTransfer = false, CancellationToken cancellationToken = default)
RelayReadDWordAsync
public Task<uint> RelayReadDWordAsync(object hops, object device, CancellationToken cancellationToken = default)
RelayWriteDWordAsync
public Task RelayWriteDWordAsync(object hops, object device, uint value, CancellationToken cancellationToken = default)
RelayReadDWordsAsync
public Task<uint[]> RelayReadDWordsAsync(object hops, object device, int count, bool atomicTransfer = false, CancellationToken cancellationToken = default)
RelayWriteDWordsAsync
public Task RelayWriteDWordsAsync(object hops, object device, IEnumerable<uint> values, bool atomicTransfer = false, CancellationToken cancellationToken = default)
RelayReadFloat32Async
public Task<float> RelayReadFloat32Async(object hops, object device, CancellationToken cancellationToken = default)
RelayWriteFloat32Async
public Task RelayWriteFloat32Async(object hops, object device, float value, CancellationToken cancellationToken = default)
RelayReadFloat32sAsync
public Task<float[]> RelayReadFloat32sAsync(object hops, object device, int count, bool atomicTransfer = false, CancellationToken cancellationToken = default)
RelayWriteFloat32sAsync
public Task RelayWriteFloat32sAsync(object hops, object device, IEnumerable<float> values, bool atomicTransfer = false, CancellationToken cancellationToken = default)
ToyopucDeviceClient
public ToyopucDeviceClient(string host, int port, int localPort = 0, ToyopucTransportMode transport = Tcp, TimeSpan timeout = default, int retries = 0, TimeSpan retryDelay = default, int recvBufsize = 65535, ToyopucAddressingOptions addressingOptions = null, string plcProfile = null)
ResolveDevice
public ResolvedDevice ResolveDevice(string device)
RelayRead
public object RelayRead(object hops, object device, int count = 1)
RelayWrite
public void RelayWrite(object hops, object device, object value)
RelayReadWords
public object RelayReadWords(object hops, object device, int count = 1)
RelayWriteWords
public void RelayWriteWords(object hops, object device, object value)
RelayReadMany
public object[] RelayReadMany(object hops, IEnumerable<object> devices)
RelayWriteMany
public void RelayWriteMany(object hops, IEnumerable<KeyValuePair<object, object>> items)
ReadFr
public object ReadFr(object device, int count = 1)
RelayReadFr
public object RelayReadFr(object hops, object device, int count = 1)
WriteFr
public void WriteFr(object device, object value, bool commit = false, bool? wait = null, double timeout = 30, double pollInterval = 0.2)
RelayWriteFr
public void RelayWriteFr(object hops, object device, object value, bool commit = false, bool? wait = null, double timeout = 30, double pollInterval = 0.2)
CommitFr
public void CommitFr(object device, int count = 1, bool wait = false, double timeout = 30, double pollInterval = 0.2)
RelayCommitFr
public void RelayCommitFr(object hops, object device, int count = 1, bool wait = false, double timeout = 30, double pollInterval = 0.2)
Read
public object Read(object device, int count = 1)
Write
public void Write(object device, object value)
ReadMany
public object[] ReadMany(IEnumerable<object> devices)
WriteMany
public void WriteMany(IEnumerable<KeyValuePair<object, object>> items)
AddressingOptions
public ToyopucAddressingOptions AddressingOptions { get; }
PlcProfile
public string PlcProfile { get; }
ToyopucDeviceClientExtensions
public static class ToyopucDeviceClientExtensions
Members
ReadTypedAsync
public static Task<object> ReadTypedAsync(ToyopucDeviceClient client, string device, string dtype, CancellationToken ct = default)
ReadTypedAsync
public static Task<object> ReadTypedAsync(QueuedToyopucDeviceClient client, string device, string dtype, CancellationToken ct = default)
WriteTypedAsync
public static Task WriteTypedAsync(ToyopucDeviceClient client, string device, string dtype, object value, CancellationToken ct = default)
WriteTypedAsync
public static Task WriteTypedAsync(QueuedToyopucDeviceClient client, string device, string dtype, object value, CancellationToken ct = default)
WriteBitInWordAsync
public static Task WriteBitInWordAsync(ToyopucDeviceClient client, string device, int bitIndex, bool value, CancellationToken ct = default)
WriteBitInWordAsync
public static Task WriteBitInWordAsync(QueuedToyopucDeviceClient client, string device, int bitIndex, bool value, CancellationToken ct = default)
ReadNamedAsync
public static Task<IReadOnlyDictionary<string, object>> ReadNamedAsync(ToyopucDeviceClient client, IEnumerable<string> addresses, CancellationToken ct = default)
ReadNamedAsync
public static Task<IReadOnlyDictionary<string, object>> ReadNamedAsync(QueuedToyopucDeviceClient client, IEnumerable<string> addresses, CancellationToken ct = default)
PollAsync
public static IAsyncEnumerable<IReadOnlyDictionary<string, object>> PollAsync(ToyopucDeviceClient client, IEnumerable<string> addresses, TimeSpan interval, CancellationToken ct = default)
PollAsync
public static IAsyncEnumerable<IReadOnlyDictionary<string, object>> PollAsync(QueuedToyopucDeviceClient client, IEnumerable<string> addresses, TimeSpan interval, CancellationToken ct = default)
ReadWordsAsync
public static Task<ushort[]> ReadWordsAsync(ToyopucDeviceClient client, string device, int count, CancellationToken ct = default)
ReadWordsAsync
public static Task<ushort[]> ReadWordsAsync(QueuedToyopucDeviceClient client, string device, int count, CancellationToken ct = default)
ReadDWordsAsync
public static Task<uint[]> ReadDWordsAsync(ToyopucDeviceClient client, string device, int count, CancellationToken ct = default)
ReadDWordsAsync
public static Task<uint[]> ReadDWordsAsync(QueuedToyopucDeviceClient client, string device, int count, CancellationToken ct = default)
ReadWordsSingleRequestAsync
public static Task<ushort[]> ReadWordsSingleRequestAsync(ToyopucDeviceClient client, string device, int count, CancellationToken ct = default)
ReadWordsSingleRequestAsync
public static Task<ushort[]> ReadWordsSingleRequestAsync(QueuedToyopucDeviceClient client, string device, int count, CancellationToken ct = default)
ReadDWordsSingleRequestAsync
public static Task<uint[]> ReadDWordsSingleRequestAsync(ToyopucDeviceClient client, string device, int count, CancellationToken ct = default)
ReadDWordsSingleRequestAsync
public static Task<uint[]> ReadDWordsSingleRequestAsync(QueuedToyopucDeviceClient client, string device, int count, CancellationToken ct = default)
WriteWordsSingleRequestAsync
public static Task WriteWordsSingleRequestAsync(ToyopucDeviceClient client, string device, IReadOnlyList<ushort> values, CancellationToken ct = default)
WriteWordsSingleRequestAsync
public static Task WriteWordsSingleRequestAsync(QueuedToyopucDeviceClient client, string device, IReadOnlyList<ushort> values, CancellationToken ct = default)
WriteDWordsSingleRequestAsync
public static Task WriteDWordsSingleRequestAsync(ToyopucDeviceClient client, string device, IReadOnlyList<uint> values, CancellationToken ct = default)
WriteDWordsSingleRequestAsync
public static Task WriteDWordsSingleRequestAsync(QueuedToyopucDeviceClient client, string device, IReadOnlyList<uint> values, CancellationToken ct = default)
ReadWordsChunkedAsync
public static Task<ushort[]> ReadWordsChunkedAsync(ToyopucDeviceClient client, string device, int count, int maxWordsPerRequest, CancellationToken ct = default)
ReadWordsChunkedAsync
public static Task<ushort[]> ReadWordsChunkedAsync(QueuedToyopucDeviceClient client, string device, int count, int maxWordsPerRequest, CancellationToken ct = default)
ReadDWordsChunkedAsync
public static Task<uint[]> ReadDWordsChunkedAsync(ToyopucDeviceClient client, string device, int count, int maxDwordsPerRequest, CancellationToken ct = default)
ReadDWordsChunkedAsync
public static Task<uint[]> ReadDWordsChunkedAsync(QueuedToyopucDeviceClient client, string device, int count, int maxDwordsPerRequest, CancellationToken ct = default)
WriteWordsChunkedAsync
public static Task WriteWordsChunkedAsync(ToyopucDeviceClient client, string device, IReadOnlyList<ushort> values, int maxWordsPerRequest, CancellationToken ct = default)
WriteWordsChunkedAsync
public static Task WriteWordsChunkedAsync(QueuedToyopucDeviceClient client, string device, IReadOnlyList<ushort> values, int maxWordsPerRequest, CancellationToken ct = default)
WriteDWordsChunkedAsync
public static Task WriteDWordsChunkedAsync(ToyopucDeviceClient client, string device, IReadOnlyList<uint> values, int maxDwordsPerRequest, CancellationToken ct = default)
WriteDWordsChunkedAsync
public static Task WriteDWordsChunkedAsync(QueuedToyopucDeviceClient client, string device, IReadOnlyList<uint> values, int maxDwordsPerRequest, CancellationToken ct = default)
OpenAndConnectAsync
public static Task<QueuedToyopucDeviceClient> OpenAndConnectAsync(ToyopucConnectionOptions options, CancellationToken ct = default)
OpenAndConnectAsync
public static Task<QueuedToyopucDeviceClient> OpenAndConnectAsync(string host, int port = 1025, CancellationToken ct = default)
ToyopucDeviceClientFactory
public static class ToyopucDeviceClientFactory
Factory helpers for creating connected queued TOYOPUC clients.
Remarks: This factory is the preferred application entry point when you want explicit profile, relay, retry, and timeout settings captured in one documented type.
Members
OpenAndConnectAsync
public static Task<QueuedToyopucDeviceClient> OpenAndConnectAsync(ToyopucConnectionOptions options, CancellationToken cancellationToken = default)
Creates, configures, and opens a queued TOYOPUC client.
Remarks: When RelayHops is supplied, the returned queued client keeps the normalized relay chain available through RelayHops.
Returns: A connected queued client.
Parameters:
- options: Explicit connection options.
- cancellationToken: Cancellation token.
ToyopucDeviceResolver
public static class ToyopucDeviceResolver
Members
ResolveDevice
public static ResolvedDevice ResolveDevice(string device, ToyopucAddressingOptions options = null, string profile = null)
ToyopucError
public class ToyopucError
Members
ToyopucError
public ToyopucError()
ToyopucError
public ToyopucError(string message)
ToyopucError
public ToyopucError(string message, Exception innerException)
ToyopucPlcProfile
public sealed class ToyopucPlcProfile
Members
ToyopucPlcProfile
public ToyopucPlcProfile(string Name, ToyopucAddressingOptions AddressingOptions, IReadOnlyList<ToyopucAreaDescriptor> Areas)
Name
public string Name { get; set; }
AddressingOptions
public ToyopucAddressingOptions AddressingOptions { get; set; }
Areas
public IReadOnlyList<ToyopucAreaDescriptor> Areas { get; set; }
ToyopucPlcProfiles
public static class ToyopucPlcProfiles
Members
GetNames
public static IReadOnlyList<string> GetNames()
NormalizeName
public static string NormalizeName(string profile)
GetDisplayName
public static string GetDisplayName(string profile)
FromName
public static ToyopucPlcProfile FromName(string profile)
Generic
public static ToyopucPlcProfile Generic { get; }
ToyopucPlusStandard
public static ToyopucPlcProfile ToyopucPlusStandard { get; }
ToyopucPlusExtended
public static ToyopucPlcProfile ToyopucPlusExtended { get; }
Nano10GxMode
public static ToyopucPlcProfile Nano10GxMode { get; }
Nano10GxCompatible
public static ToyopucPlcProfile Nano10GxCompatible { get; }
Pc10GStandardPc3Jg
public static ToyopucPlcProfile Pc10GStandardPc3Jg { get; }
Pc10GMode
public static ToyopucPlcProfile Pc10GMode { get; }
Pc3JxPc3Separate
public static ToyopucPlcProfile Pc3JxPc3Separate { get; }
Pc3JxPlusExpansion
public static ToyopucPlcProfile Pc3JxPlusExpansion { get; }
Pc3JgMode
public static ToyopucPlcProfile Pc3JgMode { get; }
Pc3JgPc3Separate
public static ToyopucPlcProfile Pc3JgPc3Separate { get; }
ToyopucProtocol
public static class ToyopucProtocol
Members
FtCommand
public const byte FtCommand
FtResponse
public const byte FtResponse
BuildCommand
public static byte[] BuildCommand(int cmd, byte[] data = null)
ParseResponse
public static ResponseFrame ParseResponse(byte[] frame)
PackU16LittleEndian
public static byte[] PackU16LittleEndian(int value)
UnpackU16LittleEndian
public static int[] UnpackU16LittleEndian(byte[] data)
PackExtBitSpec
public static int PackExtBitSpec(int number, int bit)
PackBcd
public static int PackBcd(int value)
UnpackBcd
public static int UnpackBcd(int value)
BuildClockRead
public static byte[] BuildClockRead()
BuildCpuStatusRead
public static byte[] BuildCpuStatusRead()
BuildCpuStatusReadA0
public static byte[] BuildCpuStatusReadA0()
BuildScanResume
public static byte[] BuildScanResume()
BuildScanStop
public static byte[] BuildScanStop()
BuildScanStopRelease
public static byte[] BuildScanStopRelease()
BuildClockWrite
public static byte[] BuildClockWrite(int second, int minute, int hour, int day, int month, int year2Digit, int weekday)
ParseClockData
public static ClockData ParseClockData(byte[] data)
ParseCpuStatusData
public static CpuStatusData ParseCpuStatusData(byte[] data)
ParseCpuStatusDataA0
public static CpuStatusData ParseCpuStatusDataA0(byte[] data)
ParseCpuStatusDataA0Raw
public static byte[] ParseCpuStatusDataA0Raw(byte[] data)
BuildWordRead
public static byte[] BuildWordRead(int address, int count)
BuildWordWrite
public static byte[] BuildWordWrite(int address, IEnumerable<int> values)
BuildByteRead
public static byte[] BuildByteRead(int address, int count)
BuildByteWrite
public static byte[] BuildByteWrite(int address, IEnumerable<int> values)
BuildBitRead
public static byte[] BuildBitRead(int address)
BuildBitWrite
public static byte[] BuildBitWrite(int address, int value)
BuildMultiWordRead
public static byte[] BuildMultiWordRead(IEnumerable<int> addresses)
BuildMultiWordWrite
public static byte[] BuildMultiWordWrite(IEnumerable<ValueTuple<int, int>> pairs)
BuildMultiByteRead
public static byte[] BuildMultiByteRead(IEnumerable<int> addresses)
BuildMultiByteWrite
public static byte[] BuildMultiByteWrite(IEnumerable<ValueTuple<int, int>> pairs)
BuildExtWordRead
public static byte[] BuildExtWordRead(int number, int address, int count)
BuildExtWordWrite
public static byte[] BuildExtWordWrite(int number, int address, IEnumerable<int> values)
BuildExtByteRead
public static byte[] BuildExtByteRead(int number, int address, int count)
BuildExtByteWrite
public static byte[] BuildExtByteWrite(int number, int address, IEnumerable<int> values)
BuildExtMultiRead
public static byte[] BuildExtMultiRead(IEnumerable<ValueTuple<int, int, int>> bitPoints, IEnumerable<ValueTuple<int, int>> bytePoints, IEnumerable<ValueTuple<int, int>> wordPoints)
BuildExtMultiWrite
public static byte[] BuildExtMultiWrite(IEnumerable<ValueTuple<int, int, int, int>> bitPoints, IEnumerable<ValueTuple<int, int, int>> bytePoints, IEnumerable<ValueTuple<int, int, int>> wordPoints)
BuildPc10BlockRead
public static byte[] BuildPc10BlockRead(int address32, int count)
BuildPc10BlockWrite
public static byte[] BuildPc10BlockWrite(int address32, byte[] dataBytes)
BuildPc10MultiRead
public static byte[] BuildPc10MultiRead(byte[] payload)
BuildPc10MultiWrite
public static byte[] BuildPc10MultiWrite(byte[] payload)
BuildFrRegister
public static byte[] BuildFrRegister(int exNo)
BuildRelayCommand
public static byte[] BuildRelayCommand(int linkNo, int stationNo, byte[] innerPayload, int enq = 5)
BuildRelayNested
public static byte[] BuildRelayNested(IEnumerable<ValueTuple<int, int>> hops, byte[] innerPayload)
ToyopucProtocolError
public class ToyopucProtocolError
Members
ToyopucProtocolError
public ToyopucProtocolError()
ToyopucProtocolError
public ToyopucProtocolError(string message)
ToyopucProtocolError
public ToyopucProtocolError(string message, Exception innerException)
ToyopucRelay
public static class ToyopucRelay
Members
ParseRelayHops
public static IReadOnlyList<ValueTuple<int, int>> ParseRelayHops(string text)
NormalizeRelayHops
public static IReadOnlyList<ValueTuple<int, int>> NormalizeRelayHops(object hops)
NormalizeRelayHops
public static IReadOnlyList<ValueTuple<int, int>> NormalizeRelayHops(IEnumerable<ValueTuple<int, int>> hops)
FormatRelayHop
public static string FormatRelayHop(int linkNo, int stationNo)
ParseRelayInnerResponse
public static ValueTuple<ResponseFrame, byte[]> ParseRelayInnerResponse(byte[] innerRaw)
UnwrapRelayResponseChain
public static ValueTuple<IReadOnlyList<RelayLayer>, ResponseFrame> UnwrapRelayResponseChain(ResponseFrame response)
ToyopucTimeoutError
public class ToyopucTimeoutError
Members
ToyopucTimeoutError
public ToyopucTimeoutError()
ToyopucTimeoutError
public ToyopucTimeoutError(string message)
ToyopucTimeoutError
public ToyopucTimeoutError(string message, Exception innerException)
ToyopucTraceDirection
public enum ToyopucTraceDirection
Members
Send
public const ToyopucTraceDirection Send
Receive
public const ToyopucTraceDirection Receive
ToyopucTraceFrame
public sealed class ToyopucTraceFrame
Members
ToyopucTraceFrame
public ToyopucTraceFrame(ToyopucTraceDirection Direction, byte[] Data, DateTime Timestamp)
Direction
public ToyopucTraceDirection Direction { get; set; }
Data
public byte[] Data { get; set; }
Timestamp
public DateTime Timestamp { get; set; }
ToyopucTransportMode
public enum ToyopucTransportMode
Members
Tcp
public const ToyopucTransportMode Tcp
Udp
public const ToyopucTransportMode Udp
TransportTraceFrame
public sealed class TransportTraceFrame
Members
TransportTraceFrame
public TransportTraceFrame(byte[] Tx, byte[] Rx)
Tx
public byte[] Tx { get; set; }
Rx
public byte[] Rx { get; set; }