If making numerous changes to the I/O configuration during development, power cycle the uController after reprogramming the unit to make sure any previous I/O setting get cleared from memory.
While running the Codesys Debugger, view the Output I/O Mapping to verify the output state is enabled and the duty Cycle or desired Current is as expected. Actual and desired may be out of sync for 1 second due to a time lag in the debugger.
While running the Codesys Debugger, view the System COnfig i/O Mapping and verify the relayState and relayIsActive CURENT VALUE are set to TRUE. If your code is setting the value to true but the actual value is false there is likely a fault that is overriding the output to protect the system. Look through the FaultMonitor folder for possible issues.