Sigma - Creating a Programmable object to identify if a temperature is higher or lower than an earlier one.

Issue

The requirement is to save a temperature taken at 10:00am, and to compare it with the temperature taken at 4:00pm. If the temperature was found to be lower at 4pm, then the output of the programmable object will be false, if the temperature is found to be higher, then the output will be true.

Product Line

Satchwell Sigma

Environment

Sigma

Programmable Object

Program

Prog Point

Cause

Assistance is required to create a suitable programmable object.

Resolution

The following programme will meet the requirements.

10 IF TIME = 10:00 THEN XINT = 1

20 IF TIME = 16:00 THEN XINT = 2

30 IF XINT UP THEN GOTO 50

40 GOTO 100

50 IF XINT = 1 THEN XFLO = POINT 1

60 IF XINT = 2 THEN YFLO = POINT 2

70 IF XINT <> 2 THEN GOTO 90

80 IF XFO > FLO THEN YINT = 1 ELSE YINT = 0

90 XINT = 0

100 IF YINT = 1 THEN RETURN TRUE "Higher" ELSE RETURN FALSE "Lower"

Lines 10 and 20 establish if this is the first or second entry.

Line 30 establishes that XINT has increased.

Lines 50 and 60 store the two temperature values.

Line 70 decides if the comparison should be made.

Line 80 decides if the 4pm temperature is higher or lower than the 10am value.