I have some code that writes the HMI's IP Address to a string in the PLC (Micrologix1400).
PLC.TAG = GetNetIp(0);
This does write the HMI IP address, but the problem that I have is that it seems to add a space at the end of the string. For example if the HMI IP address is 10.13.2.2 the String tag in the PLC should have a length of 9, but I'm ending up with a length of 10 due to the additional space. The HMI tag in Crimson is set up for a length of 15 (the max. number of characters the IP address could be) and under communications, the String Padding is set to NULL.
Anyone have any ideas on how to get rid of the extra space?
PLC.TAG = GetNetIp(0);
This does write the HMI IP address, but the problem that I have is that it seems to add a space at the end of the string. For example if the HMI IP address is 10.13.2.2 the String tag in the PLC should have a length of 9, but I'm ending up with a length of 10 due to the additional space. The HMI tag in Crimson is set up for a length of 15 (the max. number of characters the IP address could be) and under communications, the String Padding is set to NULL.
Anyone have any ideas on how to get rid of the extra space?