1 Fieldbus-Device Subsystem 2 ============================================ 3 4Part 0 - What is a Fieldbus Device ? 5------------------------------------ 6 7Fieldbus is the name of a family of industrial computer network protocols used 8for real-time distributed control, standardized as IEC 61158. 9 10A complex automated industrial system -- such as manufacturing assembly line -- 11usually needs a distributed control system -- an organized hierarchy of 12controller systems -- to function. In this hierarchy, there is usually a 13Human Machine Interface (HMI) at the top, where an operator can monitor or 14operate the system. This is typically linked to a middle layer of programmable 15logic controllers (PLC) via a non-time-critical communications system 16(e.g. Ethernet). At the bottom of the control chain is the fieldbus that links 17the PLCs to the components that actually do the work, such as sensors, 18actuators, electric motors, console lights, switches, valves and contactors. 19 20(Source: Wikipedia) 21 22A "Fieldbus Device" is such an actuator, motor, console light, switch, ... 23controlled via the Fieldbus by a PLC aka "Fieldbus Controller". 24 25Communication between PLC and device typically happens via process data memory, 26separated into input and output areas. The Fieldbus then cyclically transfers 27the PLC's output area to the device's input area, and vice versa. 28 29Part I - Why do we need this subsystem? 30--------------------------------------- 31 32Fieldbus device (client) adapters are commercially available. They allow data 33exchange with a PLC aka "Fieldbus Controller" via process data memory. 34 35They are typically used when a Linux device wants to expose itself as an 36actuator, motor, console light, switch, etc. over the fieldbus. 37 38The purpose of this subsystem is: 39a) present a general, standardized, extensible API/ABI to userspace; and 40b) present a convenient interface to drivers. 41 42Part II - How can drivers use the subsystem? 43-------------------------------------------- 44 45Any driver that wants to register as a Fieldbus Device should allocate and 46populate a 'struct fieldbus_dev' (from include/linux/fieldbus_dev.h). 47Registration then happens by calling fieldbus_dev_register(). 48 49Part III - How can userspace use the subsystem? 50----------------------------------------------- 51 52Fieldbus protocols and adapters are diverse and varied. However, they share 53a limited few common behaviours and properties. This allows us to define 54a simple interface consisting of a character device and a set of sysfs files: 55 56See: 57drivers/staging/fieldbus/Documentation/ABI/sysfs-class-fieldbus-dev 58drivers/staging/fieldbus/Documentation/ABI/fieldbus-dev-cdev 59 60Note that this simple interface does not provide a way to modify adapter 61configuration settings. It is therefore useful only for adapters that get their 62configuration settings some other way, e.g. non-volatile memory on the adapter, 63through the network, ... 64 65At a later phase, this simple interface can easily co-exist with a future 66(netlink-based ?) configuration settings interface. 67