valvesegment

Usage

>> valvesegment

<segment_number> [ delay | interval ]

Security

Unsafe.

Description

This is a specialized command available in firmware versions 1.142 or later.  It is used in BPR|zero logger systems to help implement a more flexible schedule of valve episodes than was previously available.

If desired, the schedule of valve episodes can now be divided into a series of segments.  Each segment effectively has its own "start time", specified by the delay, and an interval between episodes that can be specified independently of other segments.  This command sets or reports the parameters associated with the requested segment <segment_number>.

  • <segment_number> is a required parameter giving the index of the segment to be accessed.  The first segment has an index of 1; this is the minimum value accepted.  The maximum acceptable value of the segment index is equal to the segment count, accessible using the valvesegments command.  The keyword all in place of a <segment_number> causes the parameters for all valid segments to be reported, segments being separated by a pair of pipe (vertical bar) characters, '||'.  Segment 1 is at the start of the schedule/deployment and is required; the remaining segments are optional, and may be included or omitted by using the valvesegments count command.  If further segments are included, then they follow Segment 1 in order as the schedule/deployment progresses; it is not possible to 'skip' a segment.
  • delay = <delay_ms>.  This is the segment delay, measured in milliseconds from the start of the previous segment; for Segment 1, it is measured from the first sample of the deployment,  After this delay has expired, the given <interval_ms> and the universal duration are used for the valve schedule.  A delay value of zero is permitted only for Segment 1, so that Segment 1 can start immediately when the schedule/deployment begins; a delay value of zero for any other segment is forbidden.
  • interval = <interval_ms>.  The time in milliseconds between the start of consecutive valve episodes, applicable during the specified segment.

Segment parameters can be read and modified while the scheduletype is uniform, and values will be retained even if a uniform schedule is in use; however, segment parameter settings will not become effective until the scheduletype is changed to segmented.

When querying or specifying segment parameters, the <segment_number> (or all) is always required and must be specified first.  When setting values, the logger will do some basic error checking, but it is the user's responsibility to ensure that all three time parameters (delayinterval, and universal duration) are consistent with a valid schedule.  It is not possible to update parameters for multiple segments at once; each segment must be updated separately.  The logger will perform a final check on the consistency of all parameter values before the instrument is enabled.  

All time parameters are in milliseconds, to be consistent with other time parameters for the valve command and many other logger commands.  All values can be specified to a resolution of 1 minute (60000ms).  The minimum delay for Segment 1 is zero; for other segments the minimum value is 60000 (1 minute).  The minimum interval is 120000 (2 minutes), since the interval must be greater than the duration, and the minimum for the universal duration is one minute.  The maximum value for both <delay_ms> and <interval_ms> is the equivalent of 45000 days, which in practice is no restriction at all.  The maximum duration is 86400000, corresponding to 1 day.

As the deployment progresses, the instrument evaluates which segment is applicable at the start of each valve episode, and not continuously between or during episodes.  Thus specifying a delay which expires between intervals would mean that the <new_interval> value does not take effect immediately, but at the start of the next episode scheduled according to the <current_interval>.

The diagram below should help to clarify the relationships between the parameters for different segments.

BPR-zero segmented schedule, fixed duration

Note

Segment 3 in the above example illustrates what happens if a delay is specified that does not coincide with the start of an interval.  The logger re-evaluates the schedule only at the start of each interval according to the current segment parameters, so the parameters for Segment 3 do not take effect until the current interval of Segment 2 has ended.

Examples

>> valvesegment 1
<< valvesegment 1 delay = 0, interval = 7200000

>> valvesegment 1 delay = 86400000
<< valvesegment 1 delay = 86400000

>> valvesegment all
<< valvesegment 1 delay = 86400000, interval = 7200000 || valvesegment 2 delay = 604800000, interval = 86400000

>> valvesegment 3 interval = 172800000
<< E0108 invalid argument to command '3'
>> valvesegments
<< valvesegments count = 2
>> valvesegment 2 interval = 172800000
<< valvesegment 2 interval = 172800000

Errors

Error E0114 feature not supported by hardware 
An attempt was made to use the command with a logger that does not have the BPR|zero valve controller installed.

Error E0105 command prohibited while logging 
Settings may not be modified while logging is in progress; reading them is permitted.

Error E0107 expected argument missing 
A required argument to the command was not given; for example, there must always be a <segment_index> specifying the segment to access.

Error E0108 invalid argument to command 
The argument supplied is out of range, or is not recognized as a valid argument.

Error E0111 command failed
An unidentified problem prevented the operation from being completed.

Error E0702 no devices configured 
The configuration of the valve controller interface on this instrument is not correct.