Sepasoft MES Module Suite
system.mes.getTagCollectorValue
Tag Collectors bring raw values into the system and record them off for use in calculations or triggering events. The getTagCollectorValue script functions are used to return a single value that has previously been recorded for the MES tag collector.
Some tag collectors have multiple possible values, and therefore have a 'key'. Consider the case of a product count from a machine. The counted product could be Infeed, Outfeed, or a Reject part. By asking for a tag collector value of "Equipment Count" collectorType, we still need to indicate the infeed/outfeed/reject that we seek.
See Tag Collector Types for more details.
In some cases, the collectorType and key are insufficient to discern which value is requested. The most common example being Equipment State. Equipment State may be changed, for example, if a downtime reason is overridden by an operator. Therefore the original reason and the re-assigned reason could be returned. Thus Auxiliary Values are used to determine the relevant piece of data to return to the user calling the getTagCollectorValue function when collector type and key are insufficient to determine just one value.
Equipment State Tag Collector Auxiliary Values
|
|
system.mes.getTagCollectorValue(equipmentPath, collectorType, key, dateTime)
Return a single value that has previously been recorded for the MES tag collector.
Syntax
system.mes.getTagCollectorValue(equipmentPath, collectorType, key, dateTime)
Parameters
String equipmentPath - The path from the production model to the desired equipment.
String collectorType - The name of the tag collector type.
String key - Where there are multiple instances of a tag collector type, this specifies which one to use. For example, there can be multiple MES counters for the "Equipment Count" tag collector type. If not needed, pass an empty string. In other words it is the name of the MES counter or the name of the Additional Factor.
Date dateTime - The date of the value to return. As of 3.81.10 SP8, additional Factors can now be set in the future. Use system.date.addHours:

Returns
Object value - The single value recorded for the specified dateTime, or None if there is no entry for the specified date.
Scope
All
Code Examples
Python |
date = system.date.getDate(2017, 2, 20) dateTime = system.date.setTime(date, 15, 13, 31) equipmentPath = '[global]\Enterprise\Site\Area\Line 1' collectorType = 'Equipment State' key = '' tagValue = system.mes.getTagCollectorValue(equipmentPath, collectorType, 'OriginalState', key, dateTime) print tagValue |
Output
Code |
8 |
system.mes.getTagCollectorValue(equipmentPath, collectorType, auxValueName, key, dateTime)
Return a single value that has previously been recorded for the MES tag collector.
Syntax
system.mes.getTagCollectorValue(equipmentPath, collectorType, auxValueName, key, dateTime)
Parameters
String equipmentPath - The path from the production model to the desired equipment.
String collectorType - The name of the tag collector type.
String auxValueName - This specifies which auxiliary value to update. For example, the Equipment State tag collector has an "OriginalState" auxiliary value. See Auxiliary value listing at the top of the page for more information.
String key - Where there are multiple instances of a tag collector type, this specifies which one to use. For example, there can be multiple MES counters for the "Equipment Count" tag collector type. If not needed, pass an empty string. In other words it is the name of the MES counter or the name of the Additional Factor.
Date dateTime - The date of the value to return.
- Returns
Object value - The single value recorded for the specified dateTime, or None if there is no entry for the specified date.
- Scope
All
Code Example
Python |
date = system.date.getDate(2017, 2, 20) dateTime = system.date.setTime(date, 15, 13, 31) equipmentPath = '[global]\Enterprise\Site\Area\Line 1' collectorType = 'Equipment State' key = '' tagValue = system.mes.getTagCollectorValue(equipmentPath, collectorType, 'OriginalState', key, dateTime) print tagValue |
Output
Code |
8 |
Sepasoft MES Module Suite