Is the software button momentary or latching?
What you want is a little harder than it might first appear, in that if the relay is "on" on the screen, you need a mechanism to turn it off if the hardware button changes state.
The simplest way to do this (if you have control of the GUI, and are not, for example, using something like coolant-flood which has hardwired behaviour) is to use a momentary button which has its onscreen appearance linked to the actual state of the output pin.
For the case of a momentary onscreen button with no status display, use a second toggle component and combine the two toggle outputs with a HAL "XOR2" component.
You can do all this in a single HAL component using LUT5, if you wire the output to the input (as well as to the physical output). Though I think you might need to also pass both inputs through an edge detector or you simply get a 500Hz output all the time any button remains pressed. (I would have to think harder on this point than I curently have time for to be sure)