I have no way to test this, but from the API Documentation:
Dim board As xpGPIBoard
engine.GetGPIBoard(0, board)
board.TriggerAction(PinID.Value)
The board would need to be defined in Xpression, I'd assume. Put in OnOnline and OnOffline events.
#XPression