2 ec100configure() instruction, Ec100configure() instruction – Campbell Scientific EC155 CO2 and H2O Closed-Path Gas Analyzer and EC100 Electronics with Optional CSAT3A 3D Sonic Anemometer User Manual
Page 50

EC155 CO
2
and H
2
O Closed-Path Gas Analyzer
10.2 EC100Configure() Instruction
This instruction is another way, besides ECMon and Device Configuration, to
retrieve and modify settings. ECmon and Device Configuration are user-
interactive, while the
EC100Configure() instruction allows automated control
under CRBasic datalogger programming.
EC100Configure() is a processing instruction. Whether running in pipeline
mode or sequential mode the datalogger will execute the instruction from
processing. This functionality allows the instruction to be placed in conditional
statements. Running from processing also introduces ramifications when
attempting to execute the
EC100Configure() instruction while other SDM
instructions are executing in pipeline mode. This instruction locks the SDM
port during the duration of its execution. If the pipelined SDM task sequencer
needs to run while the SDM is locked, it will be held off until the instruction
completes. This locking will likely result in skipped scans when reconfiguring
an EC155.
For the EC155 to save settings, it must go through a lengthy write-read-verify
process. To avoid saving the settings after each set command, the result code
can be used to determine if any settings were modified from their original
value. When a change is detected the save settings command (command code
99) can then be sent to the EC155. The DestSource parameter variable should
be set to 2718 to save the settings. The reception of this command is
acknowledged but since it takes up to a second to complete, a successful return
code does not mean that all of the data was successfully written to the
appropriate non-volatile memory.
The instruction syntax is:
EC100Configure(Result,SDMAddress,ConfigCmd,DestSource)
Result is a variable that contains a value indicating the success or failure of the
command. A result code of 0 means that the command was successfully
executed. If reading a setting, 0 in the result code means that the value in the
DestSource variable is the value the desired setting has in the EC155. When
writing a setting, if the result code is 0, the value and setting were compatible,
but the value was not changed because it contained the same value that was
sent. A return code of 1 from the set operation means that the value was valid,
different, set and acknowledged. This allows CRBasic code to control whether
or not to save the settings. NAN (i.e., not a number) indicates that the setting
was not changed or acknowledged or a signature failure occurred.
SDMAddress defines the address of the EC155 to configure. Valid SDM
addresses are 0 through 14. Address 15 is reserved for the
SDMTrigger()
instruction.
ConfigCmd is a variable that indicates whether to get or set a setting. The
options are listed in TABLE 10-4.
DestSource
is a variable that will contain the value to read when getting a
setting, or that will contain the value to send when writing a setting to the
EC155.
40