system.mes.updateTagCollectorLastValue

Sepasoft MES Module Suite

system.mes.updateTagCollectorLastValue(equipmentPath, collectorType, key, value)

Update the last chronological value recorded by the MES tag collector.

Syntax

system.mes.updateTagCollectorLastValue(equipmentPath, collectorType, key, value)

  • 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.

Datatype value - The last value recorded for the MES tag collector will be updated with this value. 

  • Returns

Nothing

  • Scope

All

Python
#Set the start and end time
date = system.date.getDate(2017, 2, 21)
beginDateTime = system.date.setTime(date, 15, 54, 59)
endDateTime = system.date.now()
 
equipmentPath = '[global]\Enterprise\San Marcos\MP Rotator\MP Rotator 1'
collectorType = 'Equipment State'
key = ''
system.mes.updateTagCollectorLastValue(equipmentPath, collectorType, key, 2)
#get the tag values
data= system.mes.getTagCollectorValues(equipmentPath, collectorType, key, beginDateTime, endDateTime)
for row in range(data.rowCount):
   for col in range(data.columnCount):
      print data.getValueAt(row, col)

Output

Code
Tue Mar 21 15:55:15 PDT 2017
4
3
None
None
Tue Mar 21 15:55:15 PDT 2017
4
3
None
None
Tue Mar 21 15:55:15 PDT 2017
4
3
None
None
Tue Mar 21 15:58:15 PDT 2017
2
3
None
None
Tue Mar 21 15:58:15 PDT 2017
2
5
None
None
Tue Mar 21 15:58:15 PDT 2017
2
5
None
None
Tue Mar 21 15:58:15 PDT 2017
2
5
None
None

Sepasoft MES Module Suite