> ## Documentation Index
> Fetch the complete documentation index at: https://notevil.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# CAPLfunctionOnValueChange

# on value\_change (obsolete)

[Valid for](../../../Shared/FeatureAvailability.md): CANoe DE

## Function Syntax

```plaintext theme={null}
on value_change <value>;
```

### Description

The event procedure is called whenever the specified value changes. It’s not called when the value is updated, but does not change. You can use the event procedure for all values of communication objects, including e.g. signal and event values, **LatestCall** or **LatestReturn** of methods, service states, etc.

### Parameters

* **`<value>`**: Designates the value on which the procedure shall be called.

### Selectors

* **ChangeTimeNS**: Last time the value was changed, in nanoseconds since measurement start.\
  Type: `int64`\
  Access Limitation: Read only

* **UpdateTimeNS**: Last time the value was updated, in nanoseconds since measurement start.\
  Type: `int64`\
  Access Limitation: Read only

### Example

```plaintext theme={null}
on value_change MirrorAdjustment.consumerSide[CANoe,LeftMirror].CurrentPosition
{
  write("New position received: (%d,%d)", $this.x.phys, $this.y.phys);
}
```

[Programming with the Communication Concept (C#, Python and CAPL)](../../../CANoeCANalyzer/CommunicationConcept/Programming/CCP.md) • [on value\_update](CAPLfunctionOnValueUpdate.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.