|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface extending the IOServer
interface with additional
functionality
Method Summary | |
boolean |
writeMultipleItems(Vector itemWriteList)
Used for bulk write of one or more IOItem objects. |
Methods inherited from interface dk.opi.io.IOServer |
getGroups, releaseConnection, releaseConnection, removeGroup |
Method Detail |
public boolean writeMultipleItems(Vector itemWriteList) throws RbxIOException
IOItem
objects. Use this
method to improve write performance when writing to many items at the same
time. All the items are sent to the server as a single package, thus
possible minimizing network bandwidth.
The method runs to completion. The values are written to the DEVICE. That is, the method will not return until it verifies that the device has actually accepted (or rejected) the data.
Writes are not affected by the ACTIVE state of the item.
Example of usage:
import java.util.Vector; import dk.opi.io.*; import dk.opi.io.opc.opcclient.*; IOServer2 is; IOItem intItem; IOItem boolItem; IOItem stringItem; Vector witems = new Vector(); witems.addElement(new IOItemWriteValue(intItem, new Integer(22))); witems.addElement(new IOItemWriteValue(boolItem, Boolean.TRUE)); witems.addElement(new IOItemWriteValue(stringItem, "test string")); if (is.writeMultipleItems(witems)) { // one or more items not written - check the error for (int j = 0; j < witems.size(); j++) { IOItemWriteValue wVal = (IOItemWriteValue )witems.elementAt(j); String errText = wVal.getErrorText(); if (errText != null) { System.out.println("errorText item no." + j + " errorText=" + errText); } // end of if () } // end of for (int = 0; < ; ++) } // end of if ()
itemWriteList
- a Vector
holding
IOItemWriteValue
objects. If an element in
itemWriteList is not of this type, an exception will be thrown
IOItemWriteValue.getErrorText()
method for the error description. In case false is returned all items
were sucessfully written, so the user need not query the
itemWriteList Vector.
RbxIOException
- if an write failure occured or if the size of
the items and values Vectors are not the same.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |