Class Tag

java.lang.Object
javaforce.controls.Tag

public class Tag extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    Color of tag (for reporting)
    int
    Speed to poll data (delay = ms delay between polls) (min = 25ms)
    User defined description
    float
    float min/max values (for reporting)
    float
    float min/max values (for reporting)
    Host (usually IP Address)
    int
    int min/max values (for reporting)
    int
    int min/max values (for reporting)
    int
    Size of tag.
    Tag name.
    int
    Type of host (S7, AB, MB, NI, MIC) See ControllerType
  • Constructor Summary

    Constructors
    Constructor
    Description
    Tag()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    addChild(Tag child)
    Adds a child tag and returns index.
    boolean
     
    void
     
    double
    Returns current value as double (float64) (only valid if start() has been called).
    float
    Returns current value as float (only valid if start() has been called).
     
    Get user data.
     
     
    int
    Returns # of bytes tag uses.
     
    Returns current value (only valid if start() has been called).
    int
    Returns current value as int (only valid if start() has been called).
    boolean
    Returns true is controller is Big Endian byte order.
    boolean
    Returns true if data type is float32 or float64
    boolean
    Returns true is controller is Little Endian byte order.
    boolean
     
    byte[]
    Reads value directly.
    void
    setData(String key, Object value)
    Set user data.
    void
     
    void
    setMultiRead(boolean state)
    Enables reading multiple tags in one request (currently only S7 supported)
    void
    setSOCKS(String socksHost)
     
    void
    setTag(String host, int type, String tag, int size, int delay)
    Set host,type,tag,size,delay(ms).
    void
    Queues pending data to be written on next cycle.
    boolean
    Start reading tag at interval (delay).
    boolean
    start(Tag parent)
    Start reading tag at interval (delay) using another Tags connection.
    void
    Stop monitoring tag value.
     
    void
    write(byte[] data)
    Writes data to tag.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • host

      public String host
      Host (usually IP Address)
    • type

      public int type
      Type of host (S7, AB, MB, NI, MIC) See ControllerType
    • tag

      public String tag
      Tag name.
    • size

      public int size
      Size of tag. See TagType
    • color

      public int color
      Color of tag (for reporting)
    • min

      public int min
      int min/max values (for reporting)
    • max

      public int max
      int min/max values (for reporting)
    • fmin

      public float fmin
      float min/max values (for reporting)
    • fmax

      public float fmax
      float min/max values (for reporting)
    • delay

      public int delay
      Speed to poll data (delay = ms delay between polls) (min = 25ms)
    • desc

      public String desc
      User defined description
  • Constructor Details

    • Tag

      public Tag()
  • Method Details

    • getData

      public Object getData(String key)
      Get user data.
    • setData

      public void setData(String key, Object value)
      Set user data.
    • setTag

      public void setTag(String host, int type, String tag, int size, int delay)
      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

      public int addChild(Tag child)
      Adds a child tag and returns index.
    • getSize

      public int getSize()
      Returns # of bytes tag uses.
    • getURL

      public String getURL()
    • getController

      public Controller getController()
    • setListener

      public void setListener(TagListener listener)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getmin

      public String getmin()
    • getmax

      public String getmax()
    • start

      public boolean start()
      Start reading tag at interval (delay).
    • start

      public boolean start(Tag parent)
      Start reading tag at interval (delay) using another Tags connection.
    • stop

      public void stop()
      Stop monitoring tag value.
    • setSOCKS

      public void setSOCKS(String socksHost)
    • connect

      public boolean connect()
    • disconnect

      public void disconnect()
    • getValue

      public String getValue()
      Returns current value (only valid if start() has been called).
    • setValue

      public void setValue(String value)
      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.