2.4 KiB
ePowerSwitch EPICS StreamDevice
An EPICS driver based on StreamDevice allowing to control remotely both ePowerSwitch 4 IEC and 8M+
How to install
git clone https://gitea.psi.ch/lin-epics-modules/ePowerSwitch && make install
How to use
To start the IOCSH,
$ ./startioc.sh
Documentation
Setters
The stream device exposes 4 or 8 individual setter records.
$(DEVICE_NAME)_set_outlet_n
By default, it should be called
ePowerSwitch_set_outlet_1
ePowerSwitch_set_outlet_2
...
ePowerSwitch_set_outlet_n
Getters
The stream device exposes 4 or 8 individual getter records:
$(DEVICE_NAME)_get_outlet_n
By default, it should be called
ePowerSwitch_get_outlet_1
ePowerSwitch_get_outlet_2
...
ePowerSwitch_get_outlet_n
Furthermore, a record exposes the number of sockets of this device: It should not be overwritten
$(DEVICE_NAME)_config_$(CONFIG_PARAMETER_NAME)
By default, it should be called
ePowerSwitch_config_maxOutlet
Simulator
the subfolder 'sim' contains a simulator of the real device
To start it:
sh maketestenv.sh && source testenv/bin/activate && python3 sim/ePowerSwitch8_sim.py
No simulator available for the 4-outlet device since none are available
Test
A CI pipeline is setup
To manually start tests
sh maketestenv.sh && source testenv/bin/activate && python3 test/test.py
User guide
Preview
This is the setup of all EPICS records for a 4-outlet device

outlet_init
This record initially attempts to fetch the current state of all outlets to initialize each set_outlet_x record with its current value.
init_x
These records overwrite the current value of all set_outlet_x records to match the actual initial state of the outlets.
set_outlet_x
These records allow commands to be sent to the device by writing to them.
Acceptable states are: { OFF, ON, RESTART }
outlet_getter
This record fetches the state of the device's outlets and stores these values into its own fields.
get_outlet_x
This record can be read to retrieve the current state of a specific outlet.
config_maxOutlet
This record allows users to easily determine how many outlets are present on the device.
