public class CP243SlaveDeviceServer extends PLCDeviceServer implements java.lang.Runnable
There are a number of outputs from this component:
New Target DataSource: This outputs the ip address of any PLC that has not previously been seen.
Last Written DataSource: This outputs the ArrayValueObject of the last data received from a PLC. The ArrayValueObject contains the IP address of the PLC as the zero'th element.
Selected Output DataSource: This outputs the last values read from the PLC that is selected by the currentKeyInput input. This output will be updated whenever the key is changed or when new values are received.
Watchdog DataSource: This output will output the hostname/ip address of a PLC if the time since it was last accessed is greater than the timeout. The output will repeat every timeout unless a message is received.
| Modifier and Type | Class and Description |
|---|---|
static class |
CP243SlaveDeviceServer.PPITarget |
SimpleDataSource.NameEditorDataDataSource.Writable| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
cvsRev |
static java.util.Vector |
fetchWriteDeviceServers
We maintain a list of all instances of ModbusDeviceServers which can
be readily accessed when creating a list for the editor.
|
static java.lang.String |
PORT_FACTORY_NAME
The name of the port factory.
|
sharedPLCSimulationCANNOT_OPEN_PORT, currentErrorCount, debugLevel, DEFAULT_NAME, globalDebugLevel, globalSimulation, MISSING_PARAMETER, NO_ERROR, NO_PORT, NO_RESOURCES, PORT_ERROR, READ_ERROR, TOO_MANY_ERRORS_STRING, UNKNOWN_ERROR, WRITE_ERRORUPDATE_DISPLAYED_VALUE, VALUE_INPUTcustomTimer, EXPORT_READ_ONLY, EXPORT_READ_WRITE, NO_EXPORT, requiresSyncWrite, sharedTimer, syncWriteTimeout, timebaseautoSuspend, AUTOSUSPEND_DEFAULT, AUTOSUSPEND_NEVER, AUTOSUSPEND_NO_LISTENERS, AUTOSUSPEND_NO_LISTENERS_AND_NO_SOURCES, colorHi, colorHiHi, colorLo, colorLoLo, colorNormal, connectors, consoleLogger, currentColor, currentValue, DEFAULT_AUTOSUSPEND, dontConnect, gwtLog, hardSuspended, popupLogger, PRIMARYOUTPORTNAME, sendColors, stopped, suspended, timedPopupLogger, traceLogger, valueHi, valueHiHi, valueLo, valueLoLo| Constructor and Description |
|---|
CP243SlaveDeviceServer()
The default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
_initializePortPool()
If the port and host are set, this creates the factory for this object.
|
java.util.LinkedHashMap |
availableServers()
No servers are available currently.
|
SimpleDataSource |
createServer(java.lang.String className,
java.lang.String serverName)
This method should never be called since "availableServers" returns null.
|
void |
currentKeyInput(ValueChangedEvent e)
Changes the value of the key that is currently being sent to the selected output data source.
|
void |
forceDependency()
Force a dependency on the com.ergotech.vib.ports.TCPPassivePortFactory.
|
static java.util.Vector |
getFetchWriteDeviceServers() |
int |
getPortNumber()
Returns the PLC port number.
|
int |
getStaticLocationFor(java.lang.String method)
This is the default getStaticLocationFor with a location used by the staticmethodevent
to find a specific entry value object.
|
CP243SlaveDeviceServer.PPITarget |
getTarget(java.lang.String sourceAddress)
Returns a valid target for the given source address creating one if necessary.
|
int |
getTimeout() |
void |
listenForMessages(TCPPassiveSocket socket)
Listens on the socket and handles incoming messages.
|
PLCDataBlock |
readDevice(PLCDataBlock msgOut)
A PLC transaction.
|
void |
run()
Listens on the port.
|
void |
setPortNumber(int portNumber)
Sets the port number of the PLC.
|
void |
setTimeout(int timeout) |
void |
simulationStateChanged(SimulationChangedEvent simulationChangedEvent)
Starts the listening thread when moving out of simulation mode.
|
void |
start()
initialize the port pool once the container has been set.
|
java.lang.String |
toString()
Return the string representation of this object.
|
void |
valueChanged(int loc,
ValueChangedEvent e)
This is the default valuechanged with a location used by the staticmethodevent
to find a specific entry value object.
|
void |
valueInput(ValueChangedEvent newEvent)
This method accepts data that is to be sent to the PLC.
|
void |
VIBEvent(VIBEvent vibEvent)
Resets "applethost".
|
PLCDataBlock |
writeDevice(PLCDataBlock msgOut)
Writes the packet to the PLC.
|
addServer, aggregateBlocks, destroy, getBlocksForType, getMaximumBlockOffset, getRegisterBlock, getRegisterBlockLocal, getRegisterBlockShared, hasServers, printException, readAllLongTimebaseServers, removeServer, setMaximumBlockOffset, simulatedWrite, simulatedWrite, simulateRead, stopcanConnect, clearMessageLog, configurePort, equals, getLinkTimeout, getLinkTimeoutMilliseconds, getResponseTimeout, incrementErrorCount, init, initializePortPool, isSimulating, isSimulationFlag, messageLog, releasePortPool, resetErrorCount, setLinkTimeout, setName, setResponseTimeout, setSimulationFlag, setTimebaseclientRequest, deleteDevice, deleteServer, earlyStart, getEditableServers, getPersistentServers, getServerContainer, getServers, getServersInternal, getViewServers, preparingServer, setContainer, setServersgetDefaultQualityForLocationgetInPortNames, setBooleanValue, setBoolValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setShortValue, setStringValueaddConnector, addConnector, addDataSource, addPropertyChangeListener, addValueChangedListener, addVetoableChangeListener, authenticatedClientRequest, clientResponse, determineSuspendedStatus, getClassLicenseManager, getContainer, getCustomTimer, getDataSource, getDataSources, getDisplayName, getExportCriteria, getExposeComponentConnections, getName, getOutPortNames, getPullFromServers, getPushData, getPushName, getPushToServers, getServerListData, getTimebase, getTrace, isActive, isScreenLocal, refreshCurrentValue, removeConnector, removeDataSource, removePropertyChangeListener, removeValueChangedListener, removeVetoableChangeListener, requestSyncWrite, setAutoSuspend, setClassLicenseManager, setCustomTimer, setDataSourceName, setExportCriteria, setExposeComponentConnections, setPullFromServers, setPushData, setPushName, setPushToServers, setScreenLocal, setServerListData, setTrace, setValueObject, tickaddVIBEventListener, checkScript, executeInScriptInternal, executeScript, executeScriptInternal, executeScriptInternal, getAutoSuspend, getBooleanValue, getBoolValue, getColorHi, getColorHiHi, getColorLo, getColorLoLo, getColorNormal, getConnectors, getConsoleLogger, getCurrentColor, getDataSourceName, getDoubleValue, getFloatValue, getGWTLogger, getIncomingValueObject, getInScript, getIntValue, getLongValue, getParent, getPopupLogger, getScript, getScriptEngine, getSendColors, getSources, getStringValue, getSyncWriteTimeout, getTimedPopupLogger, getTraceLogger, getValueHi, getValueHiHi, getValueLo, getValueLoLo, getValueObject, isHardSuspended, isRunning, isSendOnlyChangedValuesDefault, isSuspended, logException, logGWT, logGWT, logMessage, logTrace, n2sortConnectors, performScriptSubstitutions, popupMessage, post, removeConnector, removeVIBEventListener, replaceConnectors, scriptExtensionSubstition, setColorHi, setColorHiHi, setColorLo, setColorLoLo, setColorNormal, setConsoleLogger, setGWTLogger, setHardSuspended, setInScript, setParent, setPopupLogger, setScript, setSendColors, setSendOnlyChangedValuesDefault, setSyncWriteTimeout, setTimedPopupLogger, setTraceLogger, setValueHi, setValueHiHi, setValueLo, setValueLoLo, updateColor, updateListeners, updateListeners, updateListeners, whoAmIpublic static final java.lang.String cvsRev
public static java.util.Vector fetchWriteDeviceServers
public static final java.lang.String PORT_FACTORY_NAME
public void _initializePortPool()
factoryName - public java.util.LinkedHashMap availableServers()
availableServers in class DeviceManagerManipulatorpublic SimpleDataSource createServer(java.lang.String className, java.lang.String serverName) throws BadParameterException
createServer in class DeviceManagerManipulatorBadParameterExceptionavailableServers()public void currentKeyInput(ValueChangedEvent e) throws VIBUpdateFailedException
VIBUpdateFailedExceptionpublic void forceDependency()
public static java.util.Vector getFetchWriteDeviceServers()
public int getPortNumber()
public int getStaticLocationFor(java.lang.String method)
throws BadParameterException
getStaticLocationFor in class ManipulatorBadParameterExceptionpublic CP243SlaveDeviceServer.PPITarget getTarget(java.lang.String sourceAddress)
sourceAddress - public int getTimeout()
public void listenForMessages(TCPPassiveSocket socket)
Runnable.run()public PLCDataBlock readDevice(PLCDataBlock msgOut) throws PLCException
PLCDeviceServerreadDevice in class PLCDeviceServermsgOut - the message to sendPLCExceptionpublic void run()
run in interface java.lang.RunnableRunnable.run()public void setPortNumber(int portNumber)
portNumber - The portNumber to set.public void setTimeout(int timeout)
timeout - The timeout to set.public void simulationStateChanged(SimulationChangedEvent simulationChangedEvent) throws java.lang.Exception
simulationStateChanged in interface SimulationListenersimulationStateChanged in class PLCDeviceServerjava.lang.Exception - TODOSimulationListener.simulationStateChanged(com.ergotech.util.SimulationChangedEvent)public void start()
throws BadParameterException,
VIBUpdateFailedException
start in class PLCDeviceServerBadParameterExceptionVIBUpdateFailedExceptionPLCDeviceServer.start()public java.lang.String toString()
toString in class PLCDeviceServerPortDeviceServer.setName(java.lang.String)public void valueChanged(int loc,
ValueChangedEvent e)
throws VIBUpdateFailedException,
BadParameterException
valueChanged in class ManipulatorVIBUpdateFailedExceptionBadParameterExceptionpublic void valueInput(ValueChangedEvent newEvent) throws VIBUpdateFailedException
valueInput in class ManipulatornewEvent - The ValueChangedEvent that the bean or data source has sent.VIBUpdateFailedExceptionManipulator.valueInput(com.ergotech.vib.valueobjects.ValueChangedEvent)public void VIBEvent(VIBEvent vibEvent)
throws BadParameterException
VIBEvent in class SimpleDataSourceBadParameterExceptioncom.ergotech.vib.servers.SimpleDataSource#VIBEvent(com.ergotech.vib.utils.VIBEvent)public PLCDataBlock writeDevice(PLCDataBlock msgOut) throws PLCException
PLCDeviceServerwriteDevice in class PLCDeviceServerPLCExceptionCopyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.