Eaton Logo

How can the IP address of an HMI/PLC be displayed in Codesys visualization?

It can be displayed by using the library  called  ea23_syslib_add and then please create following program.

 

PROGRAM PLC_PRG

VAR

                xGetIP_Address : BOOL:=TRUE;

                Sys_IpMaskAddr1:Sys_IpMaskAddr;

                bIP_a:                                  BYTE;

                bIP_b:                                  BYTE;

                bIP_c:                                  BYTE;

                bIP_d:                                  BYTE;

                sIP_Addr:                           STRING(20);

                bMask_a:                           BYTE;

                bMask_b:                           BYTE;

                bMask_c:                           BYTE;

                bMask_d:                           BYTE;

                sMask_Addr:    STRING(20);

                iError:                                   INT;

END_VAR

 

Sys_IpMaskAddr1(

                xStr:=xGetIP_Address ,

                bIP_a=>bIP_a ,

                bIP_b=>bIP_b ,

                bIP_c=>bIP_c ,

                bIP_d=>bIP_d ,

                sIP_Addr=>sIP_Addr ,

                bMask_a=>bMask_a ,

                bMask_b=>bMask_b ,

                bMask_c=>bMask_c ,

                bMask_d=>bMask_d ,

                sMask_Addr=>sMask_Addr ,

                iError=>iError );