Thank you Dave for the suggestion, but no luck it doesn't work either. With "~" I get ascii 46 when portB.0 is false and the same ascii 47 when the portB.0 is True.

Looking into the manual the character for the NOT is "!", I could not find any reference to "~" as a NOT notation.

Cheers

Al.