instant stop of robot using vcHelpers.Robot2

Hi
I built a generic robot program for a pick and place application using the vcHelper.Robot2 that is controlled by a PLC.
However i want to have an instant stop function which i want to utilize for instant stops as well as emergency stops.
My first idea was to use the OnSignal callback function but the helpers.Robot2 does not work within that scope
i tried running a second script to deal with the stop but once i added any robot commands in the stop script (just wrote the line, did not even have to execute the command) the robot object disapered from the main script and the whole simulation pretty much crashed.
I found solutions where you use the robot program editor and just stop its execution and then stop the robot but that is not an option for me.