95 lines
3.7 KiB
Markdown
95 lines
3.7 KiB
Markdown
# Code Style
|
|
|
|
# General Code styling
|
|
|
|
Try to adhere to the rust style guide:
|
|
https://doc.rust-lang.org/nightly/style-guide/
|
|
|
|
# Beckhoff terminals and Machines
|
|
|
|
For Beckhoff terminals you should first implement the basic functionality, then an Interpreter of the device/data is built on top.
|
|
A good example of how to do this is by looking at the following code:
|
|
el3021.rs , AnalogInputDevice
|
|
|
|
El3021 implements a so called AnalogInputDevice, which acts like an interface.
|
|
This allows us to use AnalogInputDevice instead of having to always specify which device should be used.
|
|
In Essence any Device that implements AnalogInputDevice can be used.
|