Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: JRB on September 29, 2018, 06:59:23 PM
-
I have been able to get the EIPMSG instruction working to read and write parameters when using a fixed IP address in the message setup. I need to have the instruction set up so I can change the IP address dynamically from a touchscreen entry, and I haven't been able to figure out how to get the variable IP address part of the instruction working. If I try to use the default D0 address, I don't know how to put an IP address like 169.254.93.16 in that address. I tried breaking it up into 4 sets of hexadecimal numbers (A9FE5D10), but that exceeds the range of the D0 memory location. What am I missing?
-
D memory is 32 bits, as are IP V4 addresses. Each byte of the D location contains one digit of the IP address. There are several ways to do this, but the easiest to explain is probably to use casting. If you are using D0, the cast to access each byte is D0:B0, D0:B1, D0:B2, D0:B3. I used the INI instruction to plug the individual bytes of D0, and then displayed it as an IP address in the data view.
-
Thank you. That got the variable IP setup working for me, and gives me a good starting point for what I am trying to do. I'm still pretty new to using the Do-More BRX, but I like what I see.