adapnex::drivers::bnr_x2x::X20BC0087Driver
Driver for the X20BC0087 bus controller.
Synopsis
Declared in <adapnex/drivers/bnr_x2x/x20bc0087_driver.h>
class X20BC0087Driver final
: public core::Task
Description
|
We recommend leaving the factory default configuration on the bus controller to avoid configuration conflicts. Setting the network address switches to 0xFE ensures the factory default configuration is loaded at boot. However, if an X2X Link bus cycle time other than 4ms is desired, a setting between 0x00 and 0xF0 must be used. |
During the shutdown phase, the driver sends the output process image one final time, so that the outputs are left at the values the tasks wrote during their own TearDown(). The bus controller continues to drive these values until it is power‐cycled.
Only one driver instance may drive a given bus controller at a time, since two instances would overwrite each other's configuration and process image. The driver detects this and refuses to start a second instance for a bus controller that is already being driven. Instances for different bus controllers are unaffected.
|
The duplicate‐instance protection covers instances of this driver running on the same device. It cannot detect an instance running on another device on the network, nor other software communicating with the same bus controller, such as a configuration tool or another Modbus master. It is also not a security mechanism: unrelated software on the device may, deliberately or by accident, prevent the driver from starting. |
Additional limitations to the duplicate‐instance protection apply, depending on the operating system:
-
Linux: instances are detected regardless of which user runs them, but only within the same network namespace. Two containers that each have their own network namespace can therefore each start an instance for the same bus controller, even when both can reach it.
-
macOS and other Unix systems: instances are only detected if they share the same temporary directory, which is not the case for a sandboxed application or a container with its own filesystem. Protection is also lost if the driver's lock file is removed while an instance is running, for example by a tool that cleans up old temporary files. If a lock file exists but cannot be accessed, typically because it belongs to another user, the driver refuses to start rather than risk a second instance.
-
Windows: protection covers the whole device only if the application is permitted to create global system objects, which is normally the case for services and for applications running with administrator rights. For all other applications, protection is limited to the current logon session, so instances started from two different sessions, such as those of two remote desktop users, are not detected.
-
Other operating systems: only instances within the same application are detected.
Base Classes
Name |
Description |
Task represents a base class to implement schedulable application components. Tasks are combined via TaskGroup and executed by the scheduler according to the given scheduling parameters. See Application::CreateCyclicTaskGroup() and Application::CreateFreewheelingTaskGroup(). |
Member Functions
Name |
Description |
|
Default constructor |
|
Destructor |
Adds a module to the bus controller. The driver will return the first available module of this type on the X2X Link bus. To add multiple modules of the same type, call AddModule for each. They will be returned in physical order. |
|
Returns the active firmware version of the bus controller. |
|
Returns the serial number of the bus controller. |