NModbus4 Object simulation of device memory map. The underlying collections are thread safe when using the ModbusMaster API to read/write values. You can use the SyncRoot property to synchronize direct access to the DataStore collections. Initializes a new instance of the class. Occurs when the DataStore is written to via a Modbus command. Occurs when the DataStore is read from via a Modbus command. Gets the coil discretes. Gets the input discretes. Gets the holding registers. Gets the input registers. An object that can be used to synchronize direct access to the DataStore collections. Retrieves subset of data from collection. The collection type. The type of elements in the collection. Write data to data store. The type of the data. Updates subset of values in a collection. Data story factory. Factory method for default data store - register values set to 0 and discrete values set to false. Factory method for default data store - register values set to 0 and discrete values set to false. Factory method for test data store. Collection of discrete values. Initializes a new instance of the class. Initializes a new instance of the class. Initializes a new instance of the class. Initializes a new instance of the class. Gets the network bytes. Gets the byte count. Returns a that represents the current . A that represents the current . A 1 origin collection represetative of the Modbus Data Model. Initializes a new instance of the class. Initializes a new instance of the class. The data. Initializes a new instance of the class. The data. Adds a default element to the collection. The data. Inserts an element into the at the specified index. The zero-based index at which item should be inserted. The object to insert. The value can be null for reference types. index is less than zero.-or-index is greater than . Replaces the element at the specified index. The zero-based index of the element to replace. The new value for the element at the specified index. The value can be null for reference types. index is less than zero.-or-index is greater than . Removes the element at the specified index of the . The zero-based index of the element to remove. index is less than zero.-or-index is equal to or greater than . Removes all elements from the . Types of data supported by the Modbus protocol. read/write register readonly register read/write discrete readonly discrete Collection of 16 bit registers. Initializes a new instance of the class. Initializes a new instance of the class. Initializes a new instance of the class. Initializes a new instance of the class. Gets the network bytes. Gets the byte count. Returns a that represents the current . A that represents the current . Event args for read write actions performed on the DataStore. Type of Modbus data (e.g. Holding register). Start address of data. Data that was read or written. Modbus message containing data. Gets the network bytes. Gets the byte count. Modbus master device. Transport for used by this master. Reads from 1 to 2000 contiguous coils status. Address of device to read values from. Address to begin reading. Number of coils to read. Coils status Asynchronously reads from 1 to 2000 contiguous coils status. Address of device to read values from. Address to begin reading. Number of coils to read. A task that represents the asynchronous read operation Reads from 1 to 2000 contiguous discrete input status. Address of device to read values from. Address to begin reading. Number of discrete inputs to read. Discrete inputs status Asynchronously reads from 1 to 2000 contiguous discrete input status. Address of device to read values from. Address to begin reading. Number of discrete inputs to read. A task that represents the asynchronous read operation Reads contiguous block of holding registers. Address of device to read values from. Address to begin reading. Number of holding registers to read. Holding registers status Asynchronously reads contiguous block of holding registers. Address of device to read values from. Address to begin reading. Number of holding registers to read. A task that represents the asynchronous read operation Reads contiguous block of input registers. Address of device to read values from. Address to begin reading. Number of holding registers to read. Input registers status Asynchronously reads contiguous block of input registers. Address of device to read values from. Address to begin reading. Number of holding registers to read. A task that represents the asynchronous read operation Writes a single coil value. Address of the device to write to. Address to write value to. Value to write. Asynchronously writes a single coil value. Address of the device to write to. Address to write value to. Value to write. A task that represents the asynchronous write operation Writes a single holding register. Address of the device to write to. Address to write. Value to write. Asynchronously writes a single holding register. Address of the device to write to. Address to write. Value to write. A task that represents the asynchronous write operation Writes a block of 1 to 123 contiguous registers. Address of the device to write to. Address to begin writing values. Values to write. Asynchronously writes a block of 1 to 123 contiguous registers. Address of the device to write to. Address to begin writing values. Values to write. A task that represents the asynchronous write operation Writes a sequence of coils. Address of the device to write to. Address to begin writing values. Values to write. Asynchronously writes a sequence of coils. Address of the device to write to. Address to begin writing values. Values to write. A task that represents the asynchronous write operation Performs a combination of one read operation and one write operation in a single Modbus transaction. The write operation is performed before the read. Address of device to read values from. Address to begin reading (Holding registers are addressed starting at 0). Number of registers to read. Address to begin writing (Holding registers are addressed starting at 0). Register values to write. Asynchronously performs a combination of one read operation and one write operation in a single Modbus transaction. The write operation is performed before the read. Address of device to read values from. Address to begin reading (Holding registers are addressed starting at 0). Number of registers to read. Address to begin writing (Holding registers are addressed starting at 0). Register values to write. A task that represents the asynchronous operation Modbus Serial Master device. Transport for used by this master. Serial Line only. Diagnostic function which loops back the original data. NModbus only supports looping back one ushort value, this is a limitation of the "Best Effort" implementation of the RTU protocol. Address of device to test. Data to return. Return true if slave device echoed data. Modbus IP master device. Modbus IP master factory method. Modbus IP master factory method. Modbus IP master factory method. Modbus IP master factory method. Reads from 1 to 2000 contiguous coils status. Address to begin reading. Number of coils to read. Coils status Asynchronously reads from 1 to 2000 contiguous coils status. Address to begin reading. Number of coils to read. A task that represents the asynchronous read operation Reads from 1 to 2000 contiguous discrete input status. Address to begin reading. Number of discrete inputs to read. Discrete inputs status Asynchronously reads from 1 to 2000 contiguous discrete input status. Address to begin reading. Number of discrete inputs to read. A task that represents the asynchronous read operation Reads contiguous block of holding registers. Address to begin reading. Number of holding registers to read. Holding registers status Asynchronously reads contiguous block of holding registers. Address to begin reading. Number of holding registers to read. A task that represents the asynchronous read operation Reads contiguous block of input registers. Address to begin reading. Number of holding registers to read. Input registers status Asynchronously reads contiguous block of input registers. Address to begin reading. Number of holding registers to read. A task that represents the asynchronous read operation Writes a single coil value. Address to write value to. Value to write. Asynchronously writes a single coil value. Address to write value to. Value to write. A task that represents the asynchronous write operation Write a single holding register. Address to write. Value to write. Asynchronously writes a single holding register. Address to write. Value to write. A task that represents the asynchronous write operation Write a block of 1 to 123 contiguous registers. Address to begin writing values. Values to write. Asynchronously writes a block of 1 to 123 contiguous registers. Address to begin writing values. Values to write. A task that represents the asynchronous write operation Force each coil in a sequence of coils to a provided value. Address to begin writing values. Values to write. Asynchronously writes a sequence of coils. Address to begin writing values. Values to write. A task that represents the asynchronous write operation Performs a combination of one read operation and one write operation in a single MODBUS transaction. The write operation is performed before the read. Message uses default TCP slave id of 0. Address to begin reading (Holding registers are addressed starting at 0). Number of registers to read. Address to begin writing (Holding registers are addressed starting at 0). Register values to write. Asynchronously performs a combination of one read operation and one write operation in a single Modbus transaction. The write operation is performed before the read. Address to begin reading (Holding registers are addressed starting at 0). Number of registers to read. Address to begin writing (Holding registers are addressed starting at 0). Register values to write. A task that represents the asynchronous operation Represents an incoming connection from a Modbus master. Contains the slave's logic to process the connection. Occurs when a Modbus master TCP connection is closed. Catches all exceptions thrown when action is executed and removes the master end point. The exception is ignored when it simply signals a master closing its connection. Modbus serial master device. Modbus ASCII master factory method. Modbus ASCII master factory method. Modbus ASCII master factory method. Modbus ASCII master factory method. Modbus RTU master factory method. Modbus RTU master factory method. Modbus RTU master factory method. Modbus RTU master factory method. Serial Line only. Diagnostic function which loops back the original data. NModbus only supports looping back one ushort value, this is a limitation of the "Best Effort" implementation of the RTU protocol. Address of device to test. Data to return. Return true if slave device echoed data. Modbus device. Gets the Modbus Transport. The transport. Releases unmanaged and - optionally - managed resources Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. Modbus master device. Reads from 1 to 2000 contiguous coils status. Address of device to read values from. Address to begin reading. Number of coils to read. Coils status Asynchronously reads from 1 to 2000 contiguous coils status. Address of device to read values from. Address to begin reading. Number of coils to read. A task that represents the asynchronous read operation Reads from 1 to 2000 contiguous discrete input status. Address of device to read values from. Address to begin reading. Number of discrete inputs to read. Discrete inputs status Asynchronously reads from 1 to 2000 contiguous discrete input status. Address of device to read values from. Address to begin reading. Number of discrete inputs to read. A task that represents the asynchronous read operation Reads contiguous block of holding registers. Address of device to read values from. Address to begin reading. Number of holding registers to read. Holding registers status Asynchronously reads contiguous block of holding registers. Address of device to read values from. Address to begin reading. Number of holding registers to read. A task that represents the asynchronous read operation Reads contiguous block of input registers. Address of device to read values from. Address to begin reading. Number of holding registers to read. Input registers status Asynchronously reads contiguous block of input registers. Address of device to read values from. Address to begin reading. Number of holding registers to read. A task that represents the asynchronous read operation Writes a single coil value. Address of the device to write to. Address to write value to. Value to write. Asynchronously writes a single coil value. Address of the device to write to. Address to write value to. Value to write. A task that represents the asynchronous write operation Writes a single holding register. Address of the device to write to. Address to write. Value to write. Asynchronously writes a single holding register. Address of the device to write to. Address to write. Value to write. A task that represents the asynchronous write operation Write a block of 1 to 123 contiguous 16 bit holding registers. Address of the device to write to. Address to begin writing values. Values to write. Asynchronously writes a block of 1 to 123 contiguous registers. Address of the device to write to. Address to begin writing values. Values to write. A task that represents the asynchronous write operation Writes a sequence of coils. Address of the device to write to. Address to begin writing values. Values to write. Asynchronously writes a sequence of coils. Address of the device to write to. Address to begin writing values. Values to write. A task that represents the asynchronous write operation Performs a combination of one read operation and one write operation in a single Modbus transaction. The write operation is performed before the read. Address of device to read values from. Address to begin reading (Holding registers are addressed starting at 0). Number of registers to read. Address to begin writing (Holding registers are addressed starting at 0). Register values to write. Asynchronously performs a combination of one read operation and one write operation in a single Modbus transaction. The write operation is performed before the read. Address of device to read values from. Address to begin reading (Holding registers are addressed starting at 0). Number of registers to read. Address to begin writing (Holding registers are addressed starting at 0). Register values to write. A task that represents the asynchronous operation Executes the custom message. The type of the response. The request. Modbus serial slave device. Modbus ASCII slave factory method. Modbus ASCII slave factory method. Modbus RTU slave factory method. Modbus RTU slave factory method. Start slave listening for requests. Modbus slave device. Raised when a Modbus slave receives a request, before processing request function. The Modbus request was invalid, and an error response the specified exception should be sent. Raised when a Modbus slave receives a write request, after processing the write portion of the function. For Read/Write Multiple registers (function code 23), this method is raised after writing and before reading. Gets or sets the data store. Gets or sets the unit ID. Start slave listening for requests. Modbus Slave request event args containing information on the message. Gets the message. The message. Modbus TCP slave device. Gets the Modbus TCP Masters connected to this Modbus TCP Slave. Gets the server. The server. This property is not thread safe, it should only be consumed within a lock. Modbus TCP slave factory method. Creates ModbusTcpSlave with timer which polls connected clients every milliseconds on that they are connected. Start slave listening for requests. Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. Dispose is thread-safe. Modbus UDP slave device. Modbus UDP slave factory method. Creates NModbus UDP slave with default Modbus UDP slave factory method. Start slave listening for requests. Utility extensions for the Enron Modbus dialect. Read contiguous block of 32 bit holding registers. The Modbus master. Address of device to read values from. Address to begin reading. Number of holding registers to read. Holding registers status Read contiguous block of 32 bit input registers. The Modbus master. Address of device to read values from. Address to begin reading. Number of holding registers to read. Input registers status Write a single 16 bit holding register. The Modbus master. Address of the device to write to. Address to write. Value to write. Write a block of contiguous 32 bit holding registers. The Modbus master. Address of the device to write to. Address to begin writing values. Values to write. Convert the 32 bit registers to two 16 bit values. Convert the 16 bit registers to 32 bit registers. An exception that provides the exception code that will be sent in response to an invalid Modbus request. Initializes a new instance of the class with a specified Modbus exception code. The Modbus exception code to provide to the slave. Initializes a new instance of the class with a specified error message and Modbus exception code. The error message that explains the reason for the exception. The Modbus exception code to provide to the slave. Initializes a new instance of the class with a specified Modbus exception code and a reference to the inner exception that is the cause of this exception. The Modbus exception code to provide to the slave. The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. Initializes a new instance of the class with a specified Modbus exception code and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The Modbus exception code to provide to the slave. The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. Initializes a new instance of the class with serialized data. The object that holds the serialized object data. The contextual information about the source or destination. Sets the object with the Modbus exception code and additional exception information. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. Gets the Modbus exception code to provide to the slave. Represents a serial resource. Implementor - http://en.wikipedia.org/wiki/Bridge_Pattern Indicates that no timeout should occur. Gets or sets the number of milliseconds before a timeout occurs when a read operation does not finish. Gets or sets the number of milliseconds before a timeout occurs when a write operation does not finish. Purges the receive buffer. Reads a number of bytes from the input buffer and writes those bytes into a byte array at the specified offset. The byte array to write the input to. The offset in the buffer array to begin writing. The number of bytes to read. The number of bytes read. Writes a specified number of bytes to the port from an output buffer, starting at the specified offset. The byte array that contains the data to write to the port. The offset in the buffer array to begin writing. The number of bytes to write. Refined Abstraction - http://en.wikipedia.org/wiki/Bridge_Pattern Transport for Internet protocols. Refined Abstraction - http://en.wikipedia.org/wiki/Bridge_Pattern Create a new transaction ID. Refined Abstraction - http://en.wikipedia.org/wiki/Bridge_Pattern Transport for Serial protocols. Refined Abstraction - http://en.wikipedia.org/wiki/Bridge_Pattern Gets or sets a value indicating whether LRC/CRC frame checking is performed on messages. Modbus transport. Abstraction - http://en.wikipedia.org/wiki/Bridge_Pattern This constructor is called by the NullTransport. Number of times to retry sending message after encountering a failure such as an IOException, TimeoutException, or a corrupt message. If non-zero, this will cause a second reply to be read if the first is behind the sequence number of the request by less than this number. For example, set this to 3, and if when sending request 5, response 3 is read, we will attempt to re-read responses. If set, Slave Busy exception causes retry count to be used. If false, Slave Busy will cause infinite retries Gets or sets the number of milliseconds the tranport will wait before retrying a message after receiving an ACKNOWLEGE or SLAVE DEVICE BUSY slave exception response. Gets or sets the number of milliseconds before a timeout occurs when a read operation does not finish. Gets or sets the number of milliseconds before a timeout occurs when a write operation does not finish. Gets the stream resource. Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Check whether we need to attempt to read another response before processing it (e.g. response was from previous request) Provide hook to check whether receiving a response should be retried Provide hook to do transport level message validation. Releases unmanaged and - optionally - managed resources true to release both managed and unmanaged resources; false to release only unmanaged resources. Empty placeholder. Concrete Implementor - http://en.wikipedia.org/wiki/Bridge_Pattern Concrete Implementor - http://en.wikipedia.org/wiki/Bridge_Pattern Concrete Implementor - http://en.wikipedia.org/wiki/Bridge_Pattern Methods specific to a modbus request message. Validate the specified response against the current request. Returns a that represents the current . A that represents the current . A message built by the master (client) that initiates a Modbus transaction. The function code tells the server what kind of action to perform. Address of the slave (server). Composition of the slave address and protocol data unit. Composition of the function code and message data. A unique identifier assigned to a message when using the IP protocol. Initializes a modbus message from the specified message frame. The frame. Class holding all implementation shared between two or more message types. Interfaces expose subsets of type specific implementations. Defines constants related to the Modbus protocol. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Specialized use in conjunction with programming commands. The server (or slave) has accepted the request and is processing it, but a long duration of time will be required to do so. This response is returned to prevent a timeout error from occurring in the client (or master). The client (or master) can next issue a Poll Program Complete message to determine if processing is completed.. Looks up a localized string similar to Argument endPoint cannot be empty.. Looks up a localized string similar to Specialized use in conjunction with gateways, indicates that the gateway was unable to allocate an internal communication path from the input port to the output port for processing the request. Usually means that the gateway is misconfigured or overloaded.. Looks up a localized string similar to Specialized use in conjunction with gateways, indicates that no response was obtained from the target device. Usually means that the device is not present on the network.. Looks up a localized string similar to Hex string must have even number of characters.. Looks up a localized string similar to The data address received in the query is not an allowable address for the server (or slave). More specifically, the combination of reference number and transfer length is invalid. For a controller with 100 registers, the PDU addresses the first register as 0, and the last one as 99. If a request is submitted with a starting register address of 96 and a quantity of registers of 4, then this request will successfully operate (address-wise at least) on registers 96, 97, 98, 99. If a request is submitted with [rest of string was truncated]";. Looks up a localized string similar to A value contained in the query data field is not an allowable value for server (or slave). This indicates a fault in the structure of the remainder of a complex request, such as that the implied length is incorrect. It specifically does NOT mean that a data item submitted for storage in a register has a value outside the expectation of the application program, since the MODBUS protocol is unaware of the significance of any particular value of any particular register.. Looks up a localized string similar to The function code received in the query is not an allowable action for the server (or slave). This may be because the function code is only applicable to newer devices, and was not implemented in the unit selected. It could also indicate that the server (or slave) is in the wrong state to process a request of this type, for example because it is unconfigured and is being asked to return register values.. Looks up a localized string similar to Specialized use in conjunction with function codes 20 and 21 and reference type 6, to indicate that the extended file area failed to pass a consistency check.. Looks up a localized string similar to Array networkBytes must contain an even number of bytes.. Looks up a localized string similar to Specialized use in conjunction with programming commands. The server (or slave) is engaged in processing a long–duration program command. The client (or master) should retransmit the message later when the server (or slave) is free.. Looks up a localized string similar to An unrecoverable error occurred while the server (or slave) was attempting to perform the requested action.. Looks up a localized string similar to Function Code: {1}{0}Exception Code: {2} - {3}. Looks up a localized string similar to Invalid function code value for SlaveExceptionResponse.. Looks up a localized string similar to The compact framework UDP client does not support timeouts.. Looks up a localized string similar to UdpClient must be bound to a default remote host. Call the Connect method.. Looks up a localized string similar to Unknown slave exception code.. Looks up a localized string similar to WaitToRetryMilliseconds must be greater than 0.. Represents slave errors that occur during communication. Initializes a new instance of the class. Initializes a new instance of the class. The message. Initializes a new instance of the class. The message. The inner exception. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The class name is null or is zero (0). The info parameter is null. Gets a message that describes the current exception. The error message that explains the reason for the exception, or an empty string(""). Gets the response function code that caused the exception to occur, or 0. The function code. Gets the slave exception code, or 0. The slave exception code. Gets the slave address, or 0. The slave address. When overridden in a derived class, sets the with information about the exception. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The info parameter is a null reference (Nothing in Visual Basic). Possible options for DiscriminatedUnion type Option A Option B A data type that can store one of two possible strongly typed options. The type of option A. The type of option B. ' Gets the value of option A. Gets the value of option B. Gets the discriminated value option set for this instance. Factory method for creating DiscriminatedUnion with option A set. Factory method for creating DiscriminatedUnion with option B set. Returns a that represents the current . A that represents the current . Modbus utility methods. Converts four UInt16 values into a IEEE 64 floating point format. Highest-order ushort value. Second-to-highest-order ushort value. Second-to-lowest-order ushort value. Lowest-order ushort value. IEEE 64 floating point value. Converts two UInt16 values into a IEEE 32 floating point format High order ushort value Low order ushort value IEEE 32 floating point value Converts two UInt16 values into a UInt32 Converts an array of bytes to an ASCII byte array The byte array An array of ASCII byte values Converts an array of UInt16 to an ASCII byte array The ushort array An array of ASCII byte values Converts a network order byte array to an array of UInt16 values in host order The network order byte array The host order ushort array Converts a hex string to a byte array. The hex string Array of bytes Calculate Longitudinal Redundancy Check. The data used in LRC LRC value Calculate Cyclical Redundancy Check The data used in CRC CRC value