User Manual
15
6.6.2
Serial Output
The
TCPOpen()
instruction must be used first to open a TCP socket. An example
of this instruction is shown below. For more information on this instruction, see
the
CRBasic Editor
help.
socket =
TCPOpen(
“192.168.7.85”,6784,100
)
Once a socket has been opened with the
TCPOpen()
instruction, serial data may
be sent out with a
SerialOut()
instruction. An example of this instruction is
shown below. For more information on this instruction, see the
CRBasic Editor
help.
result
=
SerialOut(
socket,sent,"",0,100
)
6.7
TCP ModBus
With an NL121 attached, the datalogger can be set up as a TCP ModBus Master or
Slave device. For information on configuring the datalogger as a TCP ModBus
Master or Slave, see the ModBus section of the datalogger manual.
6.8
DHCP
The IP address of the datalogger may be obtained through DHCP, if a DHCP
server is available. The DHCP address will be automatically assigned if there is a
DHCP server available and no static IP address has been entered. The IP address
should be available a few minutes after the datalogger has been powered up with
the NL121 attached and Ethernet cable plugged in. The IP address can be found
with the
DevConfig
Settings
tab under
TCP/IP
Info
. It can also be found using a
CR1000KD attached to the datalogger. Go to
Configure, Settings | Settings
(general)
, scroll down to
IPInfo
and press the right arrow.
An IP address obtained through DHCP is not static but is leased for a period of
time set by the network administrator. The address may change, if the datalogger
is powered down.
6.9
DNS
The datalogger provides a DNS client that can query a DNS server to resolve a
fully qualified domain name. When a DNS server is available, domain names can
be used in place of the IP address in the datalogger instructions.