public class ModbusServer extends PLCServer
SimpleDataSource.NameEditorData
DataSource.Writable
Modifier and Type | Field and Description |
---|---|
static int |
DATA_OFFSET
The location of the DATA in a Modbus message.
|
static int |
DEC_REG
Used to determine if the register was set as hex or decimal.
|
static int |
FUNCTION
The location of the FUNCTION in a Modbus message.
|
static int |
FUNCTION_CODE_3X
The function code for 3X registers.
|
static int |
FUNCTION_CODE_4X
The function code for 4X registers.
|
static int |
HEX_REG_0x
Used to determine if the register was set as hex or decimal.
|
static int |
HEX_REG_OTHER
Used to determine if the register was set as hex or decimal.
|
static int |
ICL_STYLE
Used to determine if the register was set as % (ICLinks Style).
|
static int |
OCTAL_REG
Used to determine if the register was set as hex or decimal.
|
static int |
PERCENT_STYLE
Used to determine if the register was set as %MW (Premium style).
|
static int |
REGISTER_0X
The register type 0x
|
static int |
REGISTER_1X
The register type 1x
|
static int |
REGISTER_3X
The register type 3x
|
static int |
REGISTER_4X
The register type 4x
|
static java.lang.String[] |
registerTypeNames
The names of the various register types.
|
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 |
---|
ModbusServer()
Create the ModbusServer.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAddressType()
Return the address type.
|
int |
getByteOffset()
Returns the offset of the register of this server.
|
static java.lang.String |
getErrorString(byte errorCode)
Maps error codes to error strings.
|
java.lang.String |
getReg()
Gets the registerNumber of the server.
|
int |
getRegisterType()
Returns the register type for this server.
|
int |
getSwapStyle()
This returns the 32 bit swap style.
|
int |
getValueType()
Returns the value type for this server.
|
boolean |
isConfigured()
Checks the address to make sure that this server is configured.
|
void |
setReg(java.lang.String register)
Sets the registerNumber of the server.
|
void |
setRegisterType(int registerType)
Set the register type for this server.
|
void |
setSwapStyle(int swapStyle)
This sets the 32 bit swap style.
|
void |
setValueFrom(byte[] image,
int offset,
int quality)
Update the value of the server from an address block.
|
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 write message is correct.
|
configure, destroy, fromBCD, fromBCD, getBit, getBitCount, getDefaultQualityForLocation, getDeviceName, getDeviceServer, getDirty, getLength, getOptimizeReads, getOutputBytes, getPLCAddressBlock, getSigned, getStaticLocationFor, getStationAddress, inByteSwap, isBCD, isDirty, isSimilar, isTriggerOnThread, outByteSwap, propertyChange, setAddressType, setBCD, setBit, setBitCount, setDeviceName, setDirty, setLength, setOptimizeReads, setOutputBytes, setSigned, setStationAddress, 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 int DATA_OFFSET
public static final int DEC_REG
public static final int FUNCTION
public static final int FUNCTION_CODE_3X
public static final int FUNCTION_CODE_4X
public static final int HEX_REG_0x
public static final int HEX_REG_OTHER
public static final int ICL_STYLE
public static final int OCTAL_REG
public static final int PERCENT_STYLE
public static final int REGISTER_0X
public static final int REGISTER_1X
public static final int REGISTER_3X
public static final int REGISTER_4X
public static java.lang.String[] registerTypeNames
public java.lang.String getAddressType()
getAddressType
in class PLCServer
public int getByteOffset()
getByteOffset
in class PLCServer
public static java.lang.String getErrorString(byte errorCode)
the
- error codepublic java.lang.String getReg()
public int getRegisterType()
public int getSwapStyle()
getSwapStyle
in class PLCServer
public int getValueType()
public boolean isConfigured()
isConfigured
in class PLCServer
PLCServer.isConfigured()
public void setReg(java.lang.String register) throws PLCException
newValue
- The new value.PLCException
DataSource#setParameters
public void setRegisterType(int registerType)
valueType
- the value type for this serverpublic void setSwapStyle(int swapStyle)
setSwapStyle
in class PLCServer
public void setValueFrom(byte[] image, int offset, int quality) throws java.lang.ArrayIndexOutOfBoundsException
setValueFrom
in class PLCServer
image
- the registers read from the PLC. This is the raw register
values in PLC format. That is, no swapping, or other processing.offset
- the offset from the start of the image of the raw register
data.quality
- the quality flag for the datajava.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.