Io_update_occurs event, Syntax, Example – Echelon Neuron C User Manual

Page 26

Advertising
background image

6

Predefined Events

when (io_out_ready(io_bus))
{
io_out(io_bus, &data);
}

io_update_occurs

Event

The io_update_occurs event evaluates to TRUE when the input object specified
by

io-object-name

has an updated value. The io_update_occurs event applies only

to timer/counter input object types listed in Table 3.

Table 3. Timer/Counter Objects for the io_update_occurs Event

I/O Object

io_update_occurs

evaluates to TRUE after:

dualslope

The A/D conversion is complete

ontime

The edge is detected defining the end of a period

period

The edge is detected defining the end of a period

pulsecount

Every 0.8388608 seconds

quadrature

The encoder position changes

An input object may have an

updated

value that is actually the

same

as its

previous value. To detect

changes

in value, use the io_changes event. A given

I/O object cannot be included in when clauses with both io_update_occurs and
io_changes events.
A task can access the updated value for the I/O object through the input_value
keyword. The input_value type is always a signed long, but may be cast to

another type as necessary.

Syntax

io_update_occurs (

io-object-name

)

io-object-name

The I/O object name (see the

I/O Model Reference

).

Example

#include <io_types.h>
ontime_t therm_value;

// 'ontime_t' defined in io_types.h

IO_7 input ontime io_thermistor;

when (io_update_occurs(io_thermistor))
{
therm_value = (ontime_t)input_value;
}

Advertising