Skip to content

2.7 Device Application Layer Machine

luosheng edited this page Jun 7, 2023 · 1 revision

Device Presentation Layer means a device that links to host software. It is an ecapsulution of Utility in Modbus.Net.

It is the high level API in Modbus.Net.

Implementation

Machine in Modbus.Net has two parts: IMachineProperty and IMachineMethod.

  • IMachineProperty: All properties of a machine, including Id, Name, Addresses.

  • AddressUnit: Definitions of addresses.

    AddressUnit describes communication addresses in a class. It has multiple definitions that makes the address easy to read by developers and users. It could be changed at any time.

  • AddressFormater: Formatting tool to an address.

    AddressFormater change AddressUnit to a string definition, this string could be used for IUtility. It could be changed at any time.

  • AddressCombiner: Combination tool to many addresses.

    AddressCombiner combine duplicated address into an address group, one group send one group of messages(often once) to the device and device will response in one protocol communication.

  • Endian: Endian of data storage.

    BaseMachine need to import Endian at the same time because of the bytes reading and writing. It needs to reorganize and transform these datas in a proper way。

  • IMachineMethod: Method groups of a machine.

  • IMachineMethodData: Data reading and writing interface, inherit from IMachineMethod.

    When machine read datas, it first combine addresses that require to read to one or multiple continus addresses, then change these AddressUnit groups into string address and read count, then send it to Utility.

    When machine write datas, first it will read data once, and replace writing datas into the reading datas, finally send write data message into Utility to write replacing datas.

  • Only IMachineProperty will be shown to users, by there is a function in IMachineProperty called GetMachineMethods will show all functions in the method group interface.

inner 6

Interface

BaseMachine has been implemented IMachineMethodData, including GetDatas(Async) and SetDatas(Async).

outer 6

Home

Clone this wiki locally