beautypg.com

2 ec100configure() instruction, Ec100configure() instruction – Campbell Scientific IRGASON Integrated CO2/H2O Open-Path Gas Analyzer and 3D Sonic Anemometer User Manual

Page 47

background image

IRGASON

®

Integrated CO

2

/H

2

O Open-Path Gas Analyzer and 3D Sonic Anemometer

10.2 EC100Configure() Instruction

EC100Configure() provides a third option, beside the ECMon software and

DevConfig utility, for retrieving and modifying settings. ECmon and Device

Configuration are user-interactive, whereas 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 the

processing task. This functionality allows

EC100Configure() to be placed in

conditional statements. Running from the processing task has ramifications

when attempting to execute

EC100Configure() while other SDM instructions

are executing in pipeline mode.

EC100Configure() 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 IRGASON.

For the IRGASON 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 IRGASON. 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 data were 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 the command was successful. 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 IRGASON. 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 result 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. A result code of NAN (i.e., not a number) indicates the setting was not

changed or acknowledged, or a signature failure occurred.

SDMAddress defines the address of the IRGASON to configure. Valid SDM

addresses are 0 through 14 (address 15 is reserved for

SDMTrigger()).

ConfigCmd is a variable that indicates whether to get or set a setting. The

options are listed in TABLE 10-4.

37