to configure and run a Beckhoff PLC you need to go a few simple steps:
1. Write the PLC program. Declare the inputs / outputs in a configurable way, e.g. "ValveOutput AT %Q*: WORD;"
2. Open the TwinCAT SystemManager, use the Actions menu to set it to Configuration mode
2a. Make a new TwinCAT SystemManager project, add an EtherCAT device to the I/O configuration --> I/O Devices (see Beckhoff documentation for details of driver and protocol installation), then scan the boxes.
2b. In the TwinCAT SystemManager PLC-Configuration, add your PLC project.
2c. Then, in the TwinCAT Systemmanager I/O list, expand the terms to the used inputs / outputs. Click a term and use the "Linked to ..." button to assign this terminal to an input/output variable of the PLC program.
2d. When all used inputs/outputs are assigned to the matching PLC input/output, use "Actions --> Activate Configuration" to activate this configuration (this also will set logical input/output addresses in PLC program) and to switch over to Run Mode.
3. Go back to PLC program, go online (this will download the PLC program).
Done. Do not forget to make a boot project. You can read the analog input now and write to the analog output. For that, on my website http://www.geisler-controls.de
there is the freeware library AnalogEA.lib, which has some useful procedures to handle analog signals (unfortunately, documentation is in German only).
I don't know the MXG valve, so I do not have any advices how to control it. Maybe, somebody else can help.