com.atiia.automation.sensors

## Class NetFTSensor

- java.lang.Object
- - com.atiia.automation.sensors.NetFTSensor

-     public class NetFTSensor
      extends java.lang.Object

  Represents an ATI Industrial Automation Net F/T force and torque load cell.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NetFTSensor(java.net.InetAddress setAddress)` creates new Net F/T representation.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `getVersion()` Get the version of the Net F/T interface.
    `java.net.DatagramSocket` | `initLowSpeedData()` Request a single RDT F/T record from the Net F/T sensor.
    `NetFTRDTPacket[]` | `readHighSpeedData(java.net.DatagramSocket cNetFTSocket, int iCount)` Read high speed data from the Net F/T sensor.
    `NetFTRDTPacket` | `readLowSpeedData(java.net.DatagramSocket cNetFTSocket)`
    `java.net.DatagramSocket` | `startHighSpeedDataCollection(int iCount)` Start interrupt-driven (high-speed) data collection from Net F/T sensor.
    `void` | `stopDataCollection(java.net.DatagramSocket cNetFTSocket)` Stop the Net F/T from outputting any more RDT samples.
    `void` | `tare()` Tares the current load of the sensor.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NetFTSensor

          public NetFTSensor(java.net.InetAddress setAddress)
                      throws java.net.UnknownHostException

      creates new Net F/T representation.
      Parameters:
        `setAddress` - the address of the Net F/T sensor
      Throws:
        `UnkownHostException` - If setAddress is an unknown host.
        `java.net.UnknownHostException`

  - ### Method Detail

    - #### initLowSpeedData

          public java.net.DatagramSocket initLowSpeedData()
                                                   throws java.net.SocketException,
                                                          java.io.IOException

      Request a single RDT F/T record from the Net F/T sensor.
      Returns:
        the RDT Packet from the sensor.
      Throws:
        `java.net.SocketException` - If there is an error with the socket.
        `java.io.IOException` - If there is an I/O error with the load cell.

    - #### startHighSpeedDataCollection

          public java.net.DatagramSocket startHighSpeedDataCollection(int iCount)
                                                               throws java.net.SocketException,
                                                                      java.io.IOException

      Start interrupt-driven (high-speed) data collection from Net F/T sensor.
      Parameters:
        `iCount` - The number of samples to collect. A value of 0 means the Net F/T should keep outputting samples until it is sent a stop command. The stop command can be sent by calling stopDataCollection.
      Returns:
        A DatagramSocket that you should pass to subsequent calls to readHighSpeedData in order to read the samples sent back from the Net F/T.
      Throws:
        `java.net.SocketException` - A SocketException is thrown if there is a problem setting up the socket that is returned.
        `java.io.IOException` - An IOException is thrown if there is a problem sending the start command to the Net F/T.

    - #### tare

          public void tare()
                    throws java.net.SocketException,
                           java.io.IOException

      Tares the current load of the sensor.
      Throws:
        `java.net.SocketException` - A SocketException is thrown if there is trouble setting up the socket to send the tare command.
        `java.io.IOException` - An IOException is thrown if there is trouble communicating with the sensor.

    - #### readHighSpeedData

          public NetFTRDTPacket[] readHighSpeedData(java.net.DatagramSocket cNetFTSocket,
                                           int iCount)
                                             throws java.io.IOException

      Read high speed data from the Net F/T sensor. This method is not thread-safe, so take care that you do not perform other operations on the DatagramSocket while this function is executing, i.e. calling stopDataCollection while this function is executing could cause a "socket is closed" error.
      Parameters:
        `cNetFTSocket` - The socket returned from startHighSpeedDataCollection.
        `iCount` - The number of samples to read from the Net F/T sensor. This can be less than the total number of samples that the Net F/T will output. I.e. you could call startHighSpeedDataCollection with a count of 1000, then call this function 10 times, each time reading 100 samples.
      Returns:
        An array of NetFTRDTPackets of length iCount, which represent the F/T records collected from the sensor.
      Throws:
        `java.io.IOException` - An IOException will be thrown if there is an error reading data from the Net F/T.

    - #### readLowSpeedData

          public NetFTRDTPacket readLowSpeedData(java.net.DatagramSocket cNetFTSocket)
                                          throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### stopDataCollection

          public void stopDataCollection(java.net.DatagramSocket cNetFTSocket)
                                  throws java.io.IOException

      Stop the Net F/T from outputting any more RDT samples.
      Parameters:
        `cNetFTSocket` - The socket returned by startHighSpeedDataCollection. This socket will be closed by this function, so don't use it again!
      Throws:
        `java.io.IOException` - An IOException will be thrown if there is an error sending the stop command to the Net F/T.

    - #### getVersion

          public static java.lang.String getVersion()

      Get the version of the Net F/T interface.
      Returns:
        The version of the Net F/T interface.