EasyManuals Logo

Sensia JISKOOT InSpec Sampler User Manual

Sensia JISKOOT InSpec Sampler
127 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #74 background imageLoading...
Page #74 background image
SECTION 11: USER CONFIGURABLE LOGIC (UCL) InSpec Sampler Controller
74
If there are mismatching conditional/jump section labels, then the file will fail to compile. The simple
premise is that a conditional statement needs to know where the code will jump to (go to) when the conditional
equation returns true.
In order to understand this feature in UCL, we will set a scenario and work towards building the UCL file.
Scenario:
An oil rig wants any active alarm to result in a horn being sounded periodically across the oil rig.
When an alarm becomes active, there is a 30 second delay before the horn is sounded. If the alarm is
cleared during this 30 second window, then nothing happens. The horn is not activated.
After 30 seconds, if the alarm is still active, the horn will sound for 15 seconds. There will then be a
further 30 second period of silence.
Again, if the alarm is not cleared after the next 30 second period then the horn will sound again for 15
seconds. This cycle repeats continually until the ACTIVE_ALARM is cleared (I_USER_INT4=0).
What do we need?
ACTIVE_ALARM = BOOLEAN. [System/user sets this flag to TRUE/FALSE
externally]
ALARM_DELAY_COUNTER = INTEGER_COUNTER (needed to count up to 30 before the
horn is sounded.)
ALARM_SOUND_HORN = BOOLEAN [IF ALARM_DELAY_COUNTER > 30 = TRUE, ELSE =
FALSE]
HORN_OUTPUT_COUNTER = INTEGER_COUNTER (Counts up whilst horn sounds. If it reaches 15,
the ALARM_SOUND_HORN flag is set to FALSE and both the ALARM_DELAY_COUNTER and
HORN_OUTPUT_COUNTER are reset to 0).
Note: Nothing within the program sets the ACTIVE ALARM boolean flag register. If this is never set, the
program does nothing. If it is TRUE and is then never set to FALSE then the cycle period of delay, alarm, horn,
delay, alarm, horn etc will repeat ad infinitum.
What conditions are there?
1 If the ALARM_SOUND_HORN is TRUE, trigger the horn [ALARM_SOUND_HORN is only true when
ACTIVE_ALARM is TRUE and ALARM_DELAY_COUNTER has exceeded 30].
2 If ALARM_SOUND_HORN remains TRUE, increment the HORN_OUTPUT_COUNTER.
3 If the HORN_OUTPUT_COUNTER is > 15, set the ALARM_SOUND_HORN to FALSE and reset the
counters.
This program is triggered by manually setting InSpec register I_USER_INT4, defined as
ACTIVE_ALARM in our UCL file to 1.
If there is an ACTIVE_ALARM, increment the ALARM_DELAY_COUNTER. If the user sets the
ACTIVE_ALARM to zero before the ALARM_DELAY_COUNTER reaches 20 then the
ALARM_DELAY_COUNTER is reset and the program sleeps, waiting for the next ACTIVE_ALARM.
If the ALARM_DELAY_COUNTER reaches 30, the ALARM_SOUND_HORN output flag is set to true.
This remains true whilst the HORN_OUTPUT_COUNTER is counting up to 15.
On reaching 20, the ALARM_SOUND_HORN output flag is set back to FALSE and both the
ALARM_DELAY_COUNTER and HORN_OUTPUT_COUNTER are reset to zero. If the
ACTIVE_ALARM is still TRUE (I_USER_INT4 = 1) then the ALARM_DELAY_COUNTER will count up to 30
again and the ALARM_SOUND_HORN flag will be set once more.
Conditional loops - pseudocode.
1 If ALARM_SOUND_HORN is TRUE
jump to 2 ALARM_TRIGGERED section of code
else
if ACTIVE_ALARM = TRUE,
increment the ALARM_DELAY_COUNTER counter + 1
else
set the ALARM_DELAY_COUNTER counter = 0
2 ALARM_TRIGGERED
If ALARM_SOUND_HORN is FALSE
jump to 3 ALARM_END section of code 3
else
increment the HORN_OUTPUT_COUNTER + 1

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sensia JISKOOT InSpec Sampler and is the answer not in the manual?

Sensia JISKOOT InSpec Sampler Specifications

General IconGeneral
BrandSensia
ModelJISKOOT InSpec Sampler
CategoryController
LanguageEnglish

Related product manuals