Top | Previous | Next |
system.tag.read |
Description Reads the value of the tag at the given tag path. Returns a qualified value object. You can read the value, quality, and timestamp from this object. If the tag path does not specify a tag property, then the Value property is assumed. Syntax system.tag.read(tagPath) Parameters String tagPath - Reads from the given tag path. If no property is specified in the path, the Value property is assumed. Returns QualifiedValue - A qualified value. This object has three sub-members: value, quality, and timestamp. Scope All Examples This example would read a value and display it in a message box.
qv = system.tag.read("[]EastSection/ValveG/HOA_bit") system.gui.messageBox("The value is %d" % qv.value)
This example would check the quality of a tag value, and write it to the database if the quality is good
qv = system.tag.read("[]EastSection/ValveG/HOA_bit") if qv.quality.isGood(): system.db.runPrepQuery("INSERT INTO VALVE_TABLE (HOA) VALUES (?)", qv.value)
|