system.mes.getTagCollectorPreviousTimeStamp

Sepasoft MES Module Suite

system.mes.getTagCollectorPreviousTimeStamp(equipmentPath, collectorType, key, dateTime)

Return the timestamp of the value at, or just previous to, the specified date and time.

Syntax

system.mes.getTagCollectorPreviousTimeStamp(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. See Tag Collector Types for more details.

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 to start searching for the previous timestamp to return. 

  • Returns

Date previousTimeStamp - The timestamp of the value at, or just prior to, the specified dateTime value.

  • Scope

All

Python
#Prints the previous time stamp
dateTime = system.date.now()
equipmentPath = '[global]\Enterprise\San Marcos\MP Rotator\MP Rotator 1'
collectorType = 'Equipment State'
key = ''

print system.mes.getTagCollectorPreviousTimeStamp(equipmentPath, collectorType, key, dateTime)

Output

Code
2017-03-20 15:13:31.0

Sepasoft MES Module Suite