Custom c++ to blueprint funtion crashes

Hi

I have a c++ function that is using a Third party Library to communicate With a PLC.
The function works fine when running it from c++, but when I create a BP (UFuction) the engine crashes With Access violation - code c0000005.
Aany idea?

Found it…
UFUNCTION(BlueprintCallable, Category = “MyFunctions NOV”)
int16 WriteDB_Bit(int DB, int byte, int bit, bool data);
Engine did not like the int16 for some reason

now it Works:
UFUNCTION(BlueprintCallable, Category = “MyFunctions NOV”)
int WriteDB_Bit(int DB, int byte, int bit, bool data);