# Using Performance Equations with Digital States

Question asked by pauljohnson on Jan 21, 2019
Latest reply on Jan 24, 2019 by pauljohnson

Hi there I am experimenting with performance equations to satisfy a use-case within our company.  We have a number of analogue tags which hold Amps.  I have associated a digital set (Traffic Lights) with this particular use-case, the idea being that when Amps falls below x  it will respond with a 'Green' state

Amps is between x and y it will respond with an 'Amber' state

Amps is above y it will respond with a 'Red' State

The digital state 'Traffic Lights' is

0 - White

1 - Green

2 - Amber

3 - Red

As an example:

The PE Tag is - 33~SUB1~TRANSFORMER~~~~DMD~TOPSTEST1

- DMD denotes <D>erived <M>ulti-state <D>igital

- TAI denotes <T>elemmetered <A>nalogue <I>nstantaneous

and the associated calculation:

IF '33~SUB~TRANSFORMER1~~AMPS~~TAI'<=600THEN "Green"

ELSE IF '33~TRANSFORMER1~~AMPS~~TAI'>600 OR '33~TRANSFORMER1~~AMPS~~TAI'<=700 THEN "Amber"

ELSE IF '33~TRANSFORMER1~~AMPS~~TAI''>700 THEN "Red"

ELSE 0

A more complex example might be:

IF '33~SUB~TRANSFORMER1~~AMPS~~TAI'<=600 OR '33~SUB~TRANSFORMER2~~AMPS~~TAI'<=600 THEN "Green"

ELSE IF ('33~TRANSFORMER1~~AMPS~~TAI'>600 OR '33~TRANSFORMER1~~AMPS~~TAI'<=700) OR ('33~TRANSFORMER2~~AMPS~~TAI'>600 OR '33~TRANSFORMER2~~AMPS~~TAI'<=700) THEN "Amber"

ELSE IF ('33~SUB~TRANSFORMER1~~AMPS~~TAI'>700) OR ('33~SUB~TRANSFORMER2~~AMPS~~TAI' >700) THEN "Red"

ELSE 0

Ideally I would like the PEs to be event-based, however I cant see any way in PISMT of specifying this...

If the PEs must be based on 'Clock Scheduling' then it needs to be refreshed very frequently, How would I go about specifying this in PISMT for say a refresh rate of 1 second?  Would a refresh rate of this frequency have a detrimental effect on the system?

Kind Regards

Paul.