If the manufacturer offers EthernetIP, then you don´t need those ladder functions, just a few steps to configure the PLC as Ethernet/IP scanner importing the EDS of the device. It will create the structures and IO tags required to comunicate to/from the valve controller.
Take a look to the examples that can be downloaded from https://downloads.unitronicsplc.com/Sites/plc/Unilogic/UniLogic_Examples.zip