public class MelsecServer extends PLCServer
SimpleDataSource.NameEditorData
DataSource.Writable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ADDRESS_REGEX |
static int |
maxBlockSize
The maximum allowable block size for an address block.
|
BINARY_VALUE, BOOLEAN_VALUE, BOTHSWAP, BYTESWAP, cvsRev, DOUBLE_WORD_VALUE, FLOAT_VALUE, NOSWAP, STRING_VALUE, WORD_VALUE, WORDSWAP
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, debugLevel, DEFAULT_AUTOSUSPEND, dontConnect, gwtLog, hardSuspended, popupLogger, PRIMARYOUTPORTNAME, sendColors, stopped, suspended, timedPopupLogger, traceLogger, valueHi, valueHiHi, valueLo, valueLoLo
Constructor and Description |
---|
MelsecServer()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAddress()
Returns the PLC address.
|
int |
getByteOffset()
Returns the offset of the register of this server.
|
boolean |
getByteSwapString()
Returns whether strings are byte-swapped.
|
int |
getDeviceCode()
Returns the device code of this server.
|
static java.lang.String |
getErrorString(int errorCode)
Maps error codes to error strings.
|
int |
getMemoryAddress() |
int |
getValueType()
Returns the value type for this server.
|
boolean |
isConfigured()
Returns true if the configuration of this server is complete.
|
static void |
outByteSwap(int value,
int swapFormat,
byte[] buf,
int offset)
This method will swap the bytes in the value according to the swap format.
|
void |
setAddress(java.lang.String address)
Sets the PLC address.
|
void |
setByteSwapString(boolean byteSwapString)
Sets whether strings are byte-swapped.
|
void |
setLength(int length)
sets the number of bytes that need to be read to satisfy this server.
|
void |
setValueFrom(byte[] image,
int offset,
int quality)
Update the value of the server from an address block
Response:
0xD0 0x00 - 3E frame response message header
0x00 - network number
0xFF pc number
0xFF 0x03 - request destination module I/O number
0x00 - request destination module station number
0x06 0x00 - response data length (from after here to the end of the message).
|
void |
setValueType(int valueType)
Set the value type for this server.
|
java.lang.String |
toString()
returns a string representation of this server.
|
PLCDataBlock |
validateResponse(PLCDataBlock msgOut,
PLCDataBlock msgIn)
Returns true if the response to a message is correct.
|
configure, destroy, fromBCD, fromBCD, getAddressType, getBit, getBitCount, getDefaultQualityForLocation, getDeviceName, getDeviceServer, getDirty, getLength, getOptimizeReads, getOutputBytes, getPLCAddressBlock, getSigned, getStaticLocationFor, getStationAddress, getSwapStyle, inByteSwap, isBCD, isDirty, isSimilar, isTriggerOnThread, propertyChange, setAddressType, setBCD, setBit, setBitCount, setDeviceName, setDirty, setOptimizeReads, setOutputBytes, setSigned, setStationAddress, setSwapStyle, setTimebase, setTriggerOnThread, setValueObject, shouldBeAdded, start, stop, toBCD, toBCD, triggerRead, triggerValueChanged, valueChanged, VIBEvent
getInPortNames, setBooleanValue, setBoolValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setShortValue, setStringValue, valueInput
addConnector, addConnector, addDataSource, addPropertyChangeListener, addValueChangedListener, addVetoableChangeListener, authenticatedClientRequest, clientRequest, 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, setContainer, setCustomTimer, setDataSourceName, setExportCriteria, setExposeComponentConnections, setName, setPullFromServers, setPushData, setPushName, setPushToServers, setScreenLocal, setServerListData, setTrace, tick
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, init, 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 ADDRESS_REGEX
public static int maxBlockSize
public java.lang.String getAddress()
public int getByteOffset()
getByteOffset
in class PLCServer
public boolean getByteSwapString()
public int getDeviceCode()
public static java.lang.String getErrorString(int errorCode)
the
- error codepublic int getMemoryAddress()
public int getValueType()
public boolean isConfigured()
PLCServer
isConfigured
in class PLCServer
public static void outByteSwap(int value, int swapFormat, byte[] buf, int offset)
value
- the value to swapswapFormat
- the swap style to use, the should be on of the defined types WORDSWAP, NOSWAP, BYTESWAP, BOTHSWAPbuf
- the bytes are swapped into the buffer which is assumed to have enough space to hold themoffset
- the starting offset in the bufferpublic void setAddress(java.lang.String address) throws PLCException
address
- The new value.PLCException
public void setByteSwapString(boolean byteSwapString)
public void setLength(int length)
public void setValueFrom(byte[] image, int offset, int quality) throws java.lang.ArrayIndexOutOfBoundsException
setValueFrom
in class PLCServer
java.lang.ArrayIndexOutOfBoundsException
public void setValueType(int valueType)
valueType
- the value type for this serverpublic java.lang.String toString()
public PLCDataBlock validateResponse(PLCDataBlock msgOut, PLCDataBlock msgIn) throws PLCException
validateResponse
in class PLCServer
PLCException
Copyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.