Beckhoff TwinCAT Frequently Asked Questions and Answers(Part26)

 Q: The program reads IP address with the function FB_MDP_NIC_Read, but cannot retrieve the IP address.

A: When reading, switch between different network card information by modifying the modID to retrieve only one IP.

In this case, ensure that the network port is connected to a device that is in use, as only then will DHCP assign an IP.

If you need to change the IP using FB_MDP_NIC_Write_IP, a soft reboot of the controller is required for the changes to take effect.

The reboot command can be: NT_Reboot.

Q: Screen Variables; Displaying the Currently Logged-in User, Modifying the User in the HMI, and Switching Screens Based on Variables (twincat3 plc hmi)

A:

  1. Displaying the Currently Logged-in User

① First, configure the user management settings.

② Configure a display box and bind it to the variable visuinputs.CurrentUserName or VisuElemsWinControls.CurrentUserName. Both are equivalent.



  1. Modifying Users in HMI

When configuring button functions, you can add the User Managerment configuration to enable the modification, addition, and deletion of users directly in the HMI. To use this function, it is necessary to log in with an admin account before clicking and using it.


  1. Switching Screens Using Screen Names VisuElems.CurrentVisu := ‘Visualization1‘; 

     Enable Settings When Using

Q: When using TwinCatScope2, how can I prevent the TcScopeServer.log file from continuously growing?

A: You can turn off Tracing (set it to OFF) in the ScopeServer, as shown in the following operation:



Q: How do I specify the display format for a textbox in TC3 HMI? For example, how can I display numbers in hexadecimal?

A: (number).toString(16)

Where "number" is the defined variable.

Q: Error starting TcNckinL4 server. WIN32 Error: 2

A: First, it was confirmed that the customer had installed the TF511X function, but they only had a trial license without purchasing it, which allows a maximum of 4 degrees of freedom.


Q: In TwinCAT3, can unused variables be detected?

A:

  1. Right-click on the PLC's Project and select Properties.

  2. Choose Static Analysis and tick the Unused Variables option under Additional Compile Checks.

  3. After recompiling, unused variables will be indicated with a double red underline, and a compilation error will appear in the error bar stating "Unused Variable 'variable_name'". However, this error will not affect the program's login.

Q: I have set a password for the PLC Control program in TwinCAT2. I know the password and now I want to remove the password from the project. Is it possible?

A:

  1. Access the .pro program with Level 0 (the highest level) and the password.

  2. Select "Project" from the menu bar and then "User Group Passwords...".


  3. Manually delete the password for each Level.

  4. Save the project.