3 conditional compile and save, 4 templates, Conditional compile and save -31 – Campbell Scientific LoggerNet Datalogger Support Software User Manual

Page 249: Templates -31

Advertising
background image

Section 7. Creating and Editing Datalogger Programs

Sending the Program
To send the file and perform the associated functions you have selected in the

screen, press the

Send button. If LoggerNet, PC400, or RTDAQ is not

running, an error message will appear indicating that there is no

communications server currently running. If LoggerNet, PC400, or RTDAQ is

running and the program compiles properly on the hardware, you will receive a

message indicating that the program is now running on the datalogger. If

something goes wrong when sending the program, a message will appear

indicating the error conditions. This may be a hardware-level compile error or

another failure as reported to the software by the datalogger’s program load

and run process.

Press

Cancel if you do not wish to send the program to the datalogger.

When sending a program with the Compile, Save, and Send

feature to a CR9000X datalogger while you are connected to the

datalogger, you may get a disconnect message or similar

notification. This is unique to the CR9000X datalogger and does

not indicate any problem with the sending of the program. You

can simply reconnect to the datalogger and continue your work.

7.3.3.3 Conditional Compile and Save

The

Conditional Compile and Save option is used to generate a new CRBasic

program from code that uses conditional compile syntax (#If/Else/ElseIf

statements) or constant customization. (See conditional compilation in the

CRBasic Editor’s online help for more information on conditional compile

syntax. See Section 7.3.3.9.2, Constant Customization, for more information

on constant customization.)

When a program is compiled that uses conditional syntax, any conditional

compilation statements that do not evaluate as true are removed from the

program and the program is compiled. When a program is compiled that uses

constant customization, the constant values selected in the Tools | Customize

Constants menu item are used when compiling the new program. In either

instance, you are prompted to save the file under a user-specified name or the

file will be saved under the name of the original program with _CC# appended.

The # is a number that increments to create a unique filename. For instance, if

the program name is myprogram.cr1, the first time it is compiled the default

name will be myprogram_CC1.cr1. If myprogram_CC1.cr1 exists, the program

will be named myprogram_CC2.cr1.

7.3.3.4 Templates

The use of templates can be a powerful way to quickly create a set of similar

datalogger programs. All or part of a program can be saved so that it can be

used when creating new programs. These files are called templates. The

Template menu provides access to create and use templates.

Save as Template - Saves the comments and instructions in the active file as a

template. To save part of a program as a template, copy the selected part to a

new program file and then

Save as Template.

NOTE

7-31

Advertising