# ePowerSwitch EPICS StreamDevice An EPICS driver based on StreamDevice allowing to control remotely both ePowerSwitch 4 IEC and 8M+ ![alt text](.img/ePowerSwitch_8M_Plus.png) # How to install ```bash git clone https://gitea.psi.ch/lin-epics-modules/ePowerSwitch && make install ``` # How to use To start the IOCSH, ```bash $ ./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: ```bash 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 ```bash sh maketestenv.sh && source testenv/bin/activate && python3 test/test.py ``` # User guide - [ePowerSwitch 4 IEC](.doc/neol_epowerswitch_4iec_manual.pdf) - [ePowerSwitch 8M+](.doc/ePowerSwitch-8M-Plus-EN.pdf) # Preview This is the setup of all EPICS records for a 4-outlet device ![alt text](.img/powerSwitch.png) ## 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.