com.langner.jmatic2
Class FetchWriteTCPSettings

java.lang.Object
  extended bycom.langner.jmatic2.FetchWriteTCPSettings

public final class FetchWriteTCPSettings
extends java.lang.Object

This class is used to preparing the settings for a new FetchWrite object for a PC/PLC communication using a TCP connection.

Version:
2.0
Author:
Langner Communications AG
Copyright:
Langner (c) 2001-2005

Field Summary
static int PORT_NOT_USED
          Use this value for portfetch or portwrite if one of these connections is not needed.
 
Constructor Summary
FetchWriteTCPSettings(java.net.InetAddress address, int port)
          Constructs an initialized object.
FetchWriteTCPSettings(java.net.InetAddress address, int portfetch, int portwrite)
          Constructs an initialized object.
 
Method Summary
 java.net.InetAddress getInetAddress()
          Returns the network address for connecting the PLC.
 int getPortFetch()
          Returns the TCP/IP port (FETCH commands) for connecting the remote PLC.
 int getPortWrite()
          Returns the TCP/IP port (WRITE commands) for connecting the remote PLC.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PORT_NOT_USED

public static final int PORT_NOT_USED
Use this value for portfetch or portwrite if one of these connections is not needed.

See Also:
Constant Field Values
Constructor Detail

FetchWriteTCPSettings

public FetchWriteTCPSettings(java.net.InetAddress address,
                             int portfetch,
                             int portwrite)
                      throws JMaticException
Constructs an initialized object. This constructor initializes the properties with the supplied values. The initalized FetchWriteTCPSettings object will be used to construct and initialize a new FetchWrite object. Note: You may use the Fetch/Write protocol for accessing either a Siemens S5 via the CP1430 or a Siemens S7 via the CP343/443. If you want read and write data from the plc please note that two connections must be configured in the Simatic manager (NetPro), one for the Fetch connection and one for the Write connection.

Parameters:
address - The internet address of the remote PLC. You can obtain a valid address for a given hostname by calling InetAddress.getByName()
portfetch - The TCP port for a Fetch connection. If you don't want a fetch connection use the predefined value
portwrite - The TCP port for a Write connection.
Throws:
JMaticException - if portfetch and portwrite are equal.
See Also:
PORT_NOT_USED.

FetchWriteTCPSettings

public FetchWriteTCPSettings(java.net.InetAddress address,
                             int port)
                      throws JMaticException
Constructs an initialized object. This constructor initializes the properties with the supplied values. The initalized FetchWriteTCPSettings object will be used to construct and initialize a new FetchWrite object. Note: You may use the Fetch/Write protocol for accessing either a Siemens S5 via the CP1430 or a Siemens S7 via the CP343/443. If you want read and write data from the plc please note that two connections must be configured in the Simatic manager (NetPro), one for the Fetch connection and one for the Write connection.

Parameters:
address - The internet address of the remote PLC. You can obtain a valid address for a given hostname by calling InetAddress.getByName()
port - The TCP port for a connection.
Throws:
JMaticException
Method Detail

getInetAddress

public java.net.InetAddress getInetAddress()
Returns the network address for connecting the PLC.

Returns:
InetAddress

getPortFetch

public int getPortFetch()
Returns the TCP/IP port (FETCH commands) for connecting the remote PLC.

Returns:
Port number

getPortWrite

public int getPortWrite()
Returns the TCP/IP port (WRITE commands) for connecting the remote PLC.

Returns:
Port number


Copyright © 2001-2005 Langner Communications AG. All Rights Reserved.