Home  Contents

TCP/IP Configuration

TCP/IP Application Notes

ABSTRACT

This application note explains how to set-up the IP address configuration.

PARAMETERS

For TCP/IP to work, each node on the network needs a few parameters. These parameters are:

  • IP Address
  • Netmask
  • Default Gateway

Configuration can be automatic using the standard DHCP protocol, or it can be entered manually.

CONFIGURATION

Configuration modes

Networking can be in the modes Disabled, DHCP or Static.

In DHCP mode, no further manual configuration is necessary. The controller will ask a DHCP server on the network for its configuration. This requires that the controller is networked with a functioning DHCP server.

In Static mode, all network configuration must be entered manually.

Changing configuration from within an application

Note: Changing any of these settings needs a system restart to activate the changes.

Changing the mode
Setting the mode to one of Disabled, DHCP or Static.
kconfig.setValue("c4s_network", "c4t_net_mode", "c4e_net_mode_disabled") kconfig.setValue("c4s_network", "c4t_net_mode", "c4e_net_mode_dhcp") kconfig.setValue("c4s_network", "c4t_net_mode", "c4e_net_mode_static")
Changing the static configuration
The following settings are ignored unless the mode is Static.
Examples:
kconfig.setValue("c4s_network", "c4t_net_ip", "192.168.200.223") kconfig.setValue("c4s_network", "c4t_net_netmask", "255.255.255.0") kconfig.setValue("c4s_network", "c4t_net_gw", nil)
Reading the configuration
The current configuration can be queried like this example:
local mode = kconfig.value("c4s_network", "c4t_net_mode") local ip = kconfig.value("c4s_network", "c4t_net_ip") local netmask = kconfig.value("c4s_network", "c4t_net_netmask") local gateway = kconfig.value("c4s_network", "c4t_net_gw")

Changing configuration using Core4Manager

The TCP/IP configuration can be changed through a network connection using Core4Manager. This works even if the configuration is not yet set or is invalid.

  • In order to use Core4Manager, remote configuration must be enabled on the controller by activating the debug DIP-switch or debug jumper.
  • Connect the controller and your PC via ethernet LAN. Both must be on the same physical subnet.
  • Make sure the controller is powered up.
  • In Core4Manager, select the Firmware Server tab and click Scan.
    The controller should appear in the list if it's running and connected to your LAN.
  • Click on the controller in the list, then chose the Configure button.
  • The Device Configuration dialog appears, allowing you to change the network settings.

  • Restart the controller.