Is it possible to compile conditionally based on some unique parameter such as logger serial number?
I have a number of CR1000 loggers running the same program with one exception. Each logger has transducers with unique calibrations.
Since each logger is running the same program, I would prefer to use just one master program for all. That way when I make a change to code, I don't have to propagate it to a file for each logger. The calibrations for all loggers would be in the master program, but conditionally compile based on logger serial number.
consider using the Include instruction
------
'filename: CPU:calibration.cr1
'calibration numbers for site A
Const A = 1
Const B = 2
------
Include "CPU:calibration.cr1"
BeginProg
'do shared stuff
EndProg
I found another way that is working well for a logger system that has only two loggers each with only a few transducers. The size of the program is not affected too much by including code which is unnecessary for all but the current logger.
Below is my solution for entering transducer calibration values based on data logger serial number. In this case the StationName variable holds the default value equivalent to the logger serial number.
If Status.StationName = 49000 Then
Zero_cal=1046
FS_cal=6230
Rated_PSI=10000
EndIf
If Status.StationName = 49001 Then
Zero_cal=1012
FS_cal=5990
Rated_PSI=10000
EndIf
The values shown above are then used to create the appropriate calibration and offset values for the VoltSe command.