Operator bitwise and does not work

Hello there,

I am trying to make the following application:

The idea to generate is to calculate IP addresses when a subnet is made, for this I ask the user to enter the IP address with its proper subnet mask. I convert these values ​​later into binary values:

this is my block code

and these are the labels and text fields that I use

The problem is that I try to do a bitwise AND operation of what the user enters in the txtIP4 field with txtMasc4 and the operator “bitwise and” returns anything but what it should and failed to see where the error is.

1 Like

The bitwise blocks operate on decimal number values, not on the text strings of 1’s and 0’s that are returned by the phony base conversion blocks.

bitwise_x_ABG.aia (2.6 KB)

2 Likes

It is true! the bitwise operation block code has decimal input parameters and returns decimals. I never would have found out.

Many, thank you very much.!

this is the solution.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.