public abstract class PLCDeviceServer extends PortDeviceServer
SimpleDataSource.NameEditorData
DataSource.Writable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
cvsRev |
static boolean |
sharedPLCSimulation
Set to true to use a mapped file to share simulated PLC data.
|
CANNOT_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_ERROR
UPDATE_DISPLAYED_VALUE, VALUE_INPUT
customTimer, EXPORT_READ_ONLY, EXPORT_READ_WRITE, NO_EXPORT, requiresSyncWrite, sharedTimer, syncWriteTimeout, timebase
autoSuspend, 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 |
---|
PLCDeviceServer()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addServer(PLCServer plcServer)
Find, or create a block to which to add the PLC server.
|
void |
aggregateBlocks(java.lang.String type)
Looks and see if any of the blocks are touching.
|
void |
destroy()
Indicate by means of a property change event that the device server is
no more.
|
java.util.Vector<? super PLCAddressBlock> |
getBlocksForType(java.lang.String type)
Find the appropriate blocks.
|
int |
getMaximumBlockOffset()
Returns the message offset.
|
byte[] |
getRegisterBlock(java.lang.String blockType,
int startAddress,
int size)
This method returns a register block (byte[]) that is the correct type
and at least large enough to read or write the simulated registers.
|
byte[] |
getRegisterBlockLocal(java.lang.String blockType,
int startAddress,
int size)
This method returns a register block (byte[]) that is the correct type
and at least large enough to read or write the simulated registers.
|
byte[] |
getRegisterBlockShared(java.lang.String blockType,
int startAddress,
int size)
This method returns a register block (byte[]) that is the correct type
and at least large enough to read or write the simulated registers.
|
boolean |
hasServers()
Returns true if there are any servers associated with this device.
|
void |
printException(java.lang.Throwable t)
Print the exceptions.
|
void |
readAllLongTimebaseServers()
Read all the values for this device that have timebase of < 2 seconds.
|
abstract PLCDataBlock |
readDevice(PLCDataBlock msgOut)
A PLC transaction.
|
void |
removeServer(PLCServer plcServer)
Removes a PLCServer, typically a bean or other data source, from this object.
|
void |
setMaximumBlockOffset(int maximumBlockOffset)
Sets the message offset.
|
void |
simulatedWrite(java.lang.String blockType,
int startAddress,
PLCDataBlock values)
This method is used to simulate a write to the device.
|
void |
simulatedWrite(java.lang.String blockType,
int startAddress,
PLCDataBlock values,
int bit)
This method is used to simulate a write to the device.
|
PLCDataBlock |
simulateRead(java.lang.String blockType,
int startAddress,
int size)
This method is used to provide data for a simulated read of the device.
|
void |
simulationStateChanged(SimulationChangedEvent simulationChangedEvent)
Sets/resets the global simulation flag.
|
void |
start()
This method controls communication to the device.
|
void |
stop()
This method is the opposite of "start" after calling this method, until
the start method is called again, there will be no communication with the
device.
|
java.lang.String |
toString()
Returns the assigned name of this device.
|
abstract PLCDataBlock |
writeDevice(PLCDataBlock msgOut)
Writes the packet to the PLC.
|
canConnect, clearMessageLog, configurePort, equals, getLinkTimeout, getLinkTimeoutMilliseconds, getResponseTimeout, incrementErrorCount, init, initializePortPool, isSimulating, isSimulationFlag, messageLog, releasePortPool, resetErrorCount, setLinkTimeout, setName, setResponseTimeout, setSimulationFlag, setTimebase
availableServers, clientRequest, createServer, deleteDevice, deleteServer, earlyStart, getEditableServers, getPersistentServers, getServerContainer, getServers, getServersInternal, getViewServers, preparingServer, setContainer, setServers
getDefaultQualityForLocation
getInPortNames, getStaticLocationFor, setBooleanValue, setBoolValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setShortValue, setStringValue, valueChanged, valueInput
addConnector, 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, tick, VIBEvent
addVIBEventListener, 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, whoAmI
public static final java.lang.String cvsRev
public static boolean sharedPLCSimulation
public void addServer(PLCServer plcServer)
public void aggregateBlocks(java.lang.String type)
public void destroy() throws BadParameterException
destroy
in class PortDeviceServer
BadParameterException
DataSource.destroy()
public java.util.Vector<? super PLCAddressBlock> getBlocksForType(java.lang.String type)
public int getMaximumBlockOffset()
public byte[] getRegisterBlock(java.lang.String blockType, int startAddress, int size) throws PLCException
PLCException
public byte[] getRegisterBlockLocal(java.lang.String blockType, int startAddress, int size) throws PLCException
PLCException
public byte[] getRegisterBlockShared(java.lang.String blockType, int startAddress, int size) throws PLCException
PLCException
public boolean hasServers()
allBlocksByType.size() != 0
hasServers
in class PortDeviceServer
public void printException(java.lang.Throwable t)
printException
in class PortDeviceServer
public void readAllLongTimebaseServers() throws BadParameterException
BadParameterException
public abstract PLCDataBlock readDevice(PLCDataBlock msgOut) throws PLCException
msgOut
- the message to sendPLCException
public void removeServer(PLCServer plcServer)
plcServer
- the server to be removed.addServer(com.ergotech.vib.servers.plc.PLCServer)
public void setMaximumBlockOffset(int maximumBlockOffset)
maximumBlockOffset
- the maximumBlockOffset in bytes.public void simulatedWrite(java.lang.String blockType, int startAddress, PLCDataBlock values) throws PLCException
PLCException
public void simulatedWrite(java.lang.String blockType, int startAddress, PLCDataBlock values, int bit) throws PLCException
PLCException
public PLCDataBlock simulateRead(java.lang.String blockType, int startAddress, int size) throws PLCException
PLCException
public void simulationStateChanged(SimulationChangedEvent simulationChangedEvent) throws java.lang.Exception
PortDeviceServer
simulationStateChanged
in interface SimulationListener
simulationStateChanged
in class PortDeviceServer
java.lang.Exception
- TODOSimulationListener.simulationStateChanged(com.ergotech.util.SimulationChangedEvent)
public void start() throws BadParameterException, VIBUpdateFailedException
start
in class PortDeviceServer
BadParameterException
VIBUpdateFailedException
com.ergotech.vib.utils.LifeCycle#start()
public void stop() throws BadParameterException
stop
in class PortDeviceServer
BadParameterException
com.ergotech.vib.utils.LifeCycle#stop()
public java.lang.String toString()
toString
in class PortDeviceServer
PortDeviceServer.setName(java.lang.String)
public abstract PLCDataBlock writeDevice(PLCDataBlock msgOut) throws PLCException
PLCException
Copyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.