---
title: "system.mes.updateTagCollectorValue"
id: "system-mes-updatetagcollectorvalue"
project: "MES User Manual"
url: "https://docs.sepasoft.com/articles/user-manual/system-mes-updatetagcollectorvalue"
updated: 2026-07-31T14:58:09Z
---

# system\.mes\.updateTagCollectorValue

**Sepasoft MES Module Suite**

### system.mes.updateTagCollectorValue

These script functions are used to update the value specified by the date and time for the MES tag collector.

#### Method Options

system.mes.updateTagCollectorValue(equipmentPath, collectorType, key, dateTime, value)
Description

Update the value specified by the date and time for the MES tag collector. If a value does not existing for the specified timestamp, then an exception will be returned.

Syntax

**system.mes.updateTagCollectorValue(equipmentPath, collectorType, key, dateTime, value)**

* 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](/articles/user-manual/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 of the value to update.

Datatype **value** - 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)
dateTime = system.date.setTime(date, 15, 58, 15)
endDateTime = system.date.now()
  
equipmentPath = '[global]\Enterprise\San Marcos\MP Rotator\MP Rotator 1'
collectorType = 'Equipment State'
key = ''
system.mes.updateTagCollectorValue(equipmentPath, collectorType, 'DifferedState', key, dateTime, 4)

#get the tag values
data= system.mes.getTagCollectorValues(equipmentPath, collectorType, key, dateTime, endDateTime)
for row in range(data.rowCount):
   for col in range(data.columnCount):
      print data.getValueAt(row, col)
```

Output

Code

```
Tue Mar 21 15:58:15 PDT 2017
9
2
None
4
Tue Mar 21 15:58:15 PDT 2017
9
5
None
4
Tue Mar 21 15:58:15 PDT 2017
9
5
None
4
Tue Mar 21 15:58:15 PDT 2017
9
5
None
4

```


system.mes.updateTagCollectorValue(equipmentPath, collectorType, auxValueName, key, dateTime, value)
Description

Update the value specified by the date and time for the MES tag collector. If a value does not existing for the specified timestamp, then an exception will be returned.

If you are using this scripting function to alter a downtime entry, and you point the DifferedToUUID to another equipment item, ensure it is part of the same line. In other words, do not set a Line 1 downtime event to Line 2, this is not supported functionality.

Syntax

**system.mes.updateTagCollectorValue(equipmentPath, collectorType, auxValueName, key, dateTime, value)**

* 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](/articles/user-manual/tag-collector-types) for more details.

String **auxValueName** - This specifies which auxiliary value to update. The collectorType 'Equipment State' has the following auxiliary values:

**OriginalState** - The original Equipment State before it is updated.

**OriginalDifferedToUUID** - The DifferedToUUID on the ***first*** time a downtime state is moved to a new equipment.

**DifferedToUUID** - If the original EquipmentUUID is changed using the Downtime Table then the new UUID is DifferedToUUID.

**DifferedState** - If the original state is changed using the Downtime Table then the new state is DifferedState.

**SplitTimeStamp** - If an event is split, this will be the timestamp of the State that was split from.

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 update.

DataType **value** - The MES tag collector will be updated with this value.

* Returns

Nothing

* Scope

All

Code Example

```python
#Set the start and end time
date = system.date.getDate(2017, 2, 21)
dateTime = system.date.setTime(date, 15, 58, 15)
endDateTime = system.date.now()
  
equipmentPath = '[global]\Enterprise\San Marcos\MP Rotator\MP Rotator 1'
collectorType = 'Equipment State'
key = ''
system.mes.updateTagCollectorValue(equipmentPath, collectorType, 'DifferedState', key, dateTime, 4)

#get the tag values
data= system.mes.getTagCollectorValues(equipmentPath, collectorType, key, dateTime, endDateTime)
for row in range(data.rowCount):
   for col in range(data.columnCount):
      print data.getValueAt(row, col)
```

Output

Code

```
Tue Mar 21 15:58:15 PDT 2017
9
2
None
4
Tue Mar 21 15:58:15 PDT 2017
9
5
None
4
Tue Mar 21 15:58:15 PDT 2017
9
5
None
4
Tue Mar 21 15:58:15 PDT 2017
9
5
None
4

```


**Sepasoft MES Module Suite**