Package javaforce.controls
Class Tag
java.lang.Object
javaforce.controls.Tag
-
Field Summary
FieldsModifier and TypeFieldDescriptionintColor of tag (for reporting)intSpeed to poll data (delay = ms delay between polls) (min = 25ms)User defined descriptionfloatfloat min/max values (for reporting)floatfloat min/max values (for reporting)Host (usually IP Address)intint min/max values (for reporting)intint min/max values (for reporting)intSize of tag.Tag name.intType of host (S7, AB, MB, NI, MIC) See ControllerType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintAdds a child tag and returns index.booleanconnect()voiddoubleReturns current value as double (float64) (only valid if start() has been called).floatReturns current value as float (only valid if start() has been called).Get user data.getmax()getmin()intgetSize()Returns # of bytes tag uses.getURL()getValue()Returns current value (only valid if start() has been called).intintValue()Returns current value as int (only valid if start() has been called).booleanisBE()Returns true is controller is Big Endian byte order.booleanisFloat()Returns true if data type is float32 or float64booleanisLE()Returns true is controller is Little Endian byte order.booleanisValid()byte[]read()Reads value directly.voidSet user data.voidsetListener(TagListener listener) voidsetMultiRead(boolean state) Enables reading multiple tags in one request (currently only S7 supported)voidvoidSet host,type,tag,size,delay(ms).voidQueues pending data to be written on next cycle.booleanstart()Start reading tag at interval (delay).booleanStart reading tag at interval (delay) using another Tags connection.voidstop()Stop monitoring tag value.toString()voidwrite(byte[] data) Writes data to tag.
-
Field Details
-
host
Host (usually IP Address) -
type
public int typeType of host (S7, AB, MB, NI, MIC) See ControllerType -
tag
Tag name. -
size
public int sizeSize of tag. See TagType -
color
public int colorColor of tag (for reporting) -
min
public int minint min/max values (for reporting) -
max
public int maxint min/max values (for reporting) -
fmin
public float fminfloat min/max values (for reporting) -
fmax
public float fmaxfloat min/max values (for reporting) -
delay
public int delaySpeed to poll data (delay = ms delay between polls) (min = 25ms) -
desc
User defined description
-
-
Constructor Details
-
Tag
public Tag()
-
-
Method Details
-
getData
Get user data. -
setData
Set user data. -
setTag
Set host,type,tag,size,delay(ms). -
isValid
public boolean isValid() -
isFloat
public boolean isFloat()Returns true if data type is float32 or float64 -
isBE
public boolean isBE()Returns true is controller is Big Endian byte order. -
isLE
public boolean isLE()Returns true is controller is Little Endian byte order. -
setMultiRead
public void setMultiRead(boolean state) Enables reading multiple tags in one request (currently only S7 supported) -
addChild
Adds a child tag and returns index. -
getSize
public int getSize()Returns # of bytes tag uses. -
getURL
-
getController
-
setListener
-
toString
-
getmin
-
getmax
-
start
public boolean start()Start reading tag at interval (delay). -
start
Start reading tag at interval (delay) using another Tags connection. -
stop
public void stop()Stop monitoring tag value. -
setSOCKS
-
connect
public boolean connect() -
disconnect
public void disconnect() -
getValue
Returns current value (only valid if start() has been called). -
setValue
Queues pending data to be written on next cycle. (only valid if start() has been called). -
intValue
public int intValue()Returns current value as int (only valid if start() has been called). -
floatValue
public float floatValue()Returns current value as float (only valid if start() has been called). -
doubleValue
public double doubleValue()Returns current value as double (float64) (only valid if start() has been called). -
read
public byte[] read()Reads value directly. -
write
public void write(byte[] data) Writes data to tag.
-