Programming from Memory Cards
Memory cards can be used to program the dataTaker, independently of a host computer. This feature is particularly useful where dataTaker must be remotely deployed, remote host facilities are unavailable, or loggers are programmed by unskilled personnel.
The memory cards have a program area which can store up to 4090 characters of dataTaker program and commands.
Whenever a memory card containing a program or commands in the program area is inserted into the dataTaker, these are automatically read and executed by the logger.
A number of the dataTaker commands are not appropriate for use from the memory card. These include the Unload command, the STATUS command, the TEST command, etc. which only return data or system information to a host computer.
Recording Commands into a Memory Card
dataTaker commands or programs are recorded into a memory card by installing a memory card into any logger, and then sending the program or commands from a host computer.
Commands are directed to the program area of the memory card by prefixing each command with the semicolon character in the general format
The following program for example
is copied directly to the program area of the inserted memory card. The commands are not executed by the dataTaker.
When dataTaker commands are entered into the program area of memory cards, the commands are not checked for syntax or executed to check for run-time errors. Therefore it is advisable to test memory card programs before using them in the field.
When commands that are copied to the program area of a memory card by the logger, these commands are appended to any commands that may already be stored in the area.
If a memory card is not inserted in the dataTaker when ;commands are entered, then the commands are lost.
Enabling Memory Card Programming
Remote programming of the dataTaker from programs and commands stored in a memory card is controlled by the Execute Card Commands Switch as follows
/Q Programming by memory card commands is enabled (Default)
Following initial power up, a hardware reset, or a RESET command, the Execute Card Commands Switch is enabled.
The current setting of the Execute Card Commands Switch can be determined by the STATUS command or the STATUS9 command (See Section III ó Status Command).
Executing Commands from Memory Cards
When a memory card is inserted into a dataTaker, the program area of the memory card is searched for programs or commands. If there are any programs or commands stored in the program area, then these are downloaded into the dataTaker and executed under the following conditions
inserting the card into a logger that has the Execute Card Commands Switch enabled (/Q)
resetting the logger via the Reset Hole while the card is inserted
powerdown/powerup resetting the logger while the card is inserted
resetting the logger by RESET command from the host computer while the card is inserted
sending the command RUNPROG from the host computer while the card is inserted
dataTakers fitted with a display, display the message
If the Execute Card Commands Switch is disabled at the time of memory card insertion, then commands stored in the program area of the memory card are not executed.
The stored commands are executed each time that the memory card is inserted. Therefore if the card is inserted, withdrawn, and then reinserted, then the commands will be executed twice. This may be overcome by disabling the Execute Card Commands Switch with a /q command within the card program.
Controlling the Transfer of Data to Memory Cards
When a memory card is inserted into the dataTaker, the program area of the memory card is searched first and any commands found are downloaded into the logger and executed.
Following the execution of any commands present, and if the data area of the card is clear, then any data in the internal data memory is automatically transferred to the memory card.
However the automatic transfer of data can be controlled if required, to synchronize data transfer with programs stored on the memory card.
Forcing the Transfer of Data
The transfer of data can be forced at any time during the execution of a card program, rather than automatically after execution of the card programs. The command
instructs the dataTaker to transfer data from the internal memory to the memory card when the command is executed, rather than later in the normal course of events.
The following example illustrates the use of the COPY command in a card program. This program is stored in the program area of a memory card.
When the memory card is inserted into a logger, this program in the memory card will
transfer the data from the internal data memory to the data area of the memory card
clear the internal memory and channel table, disable data logging ready for a new program
load the new program Schedules and enable logging again.
If the COPY command had not been used in the above program, the internal memory would have been cleared by the CLEAR command before the dataTaker could automatically transfer the data.
The COPY command is only appropriate for use in programs stored in the memory card. The command has no use when entered directly from a host computer to the dataTaker.
Preventing the Transfer of Data
The automatic transfer of data from the internal data memory to the memory card can be prevented by the command
which instructs the dataTaker not to transfer data from the internal data memory to the data area of the inserted memory card. The NOCOPY state remains active until the memory card which contains the command is removed. When another memory card is inserted, automatic data transfer is again enabled.
The following example illustrates the use of the NOCOPY command in a card program. This program is stored in the program area of a memory card.
The NOCOPY command is used in this program to instruct the logger not to transfer data from the internal data memory to the memory card at any time while this memory card is inserted in the logger.
This programming example is typical of a memory card being used as a program only card, to enter new alarms or alarm setpoints, change Schedule triggers, etc. while the current program continues.
The data from this operation is logged to the internal memory while this memory card is inserted, but can be copied into the next memory card that is inserted if valid.
The NOCOPY command is only appropriate for use in programs stored in the memory card. The command has no use when entered directly from a host computer or terminal.
Using the CDATA Command from the Program Area
The data area of memory cards can be cleared of stored data by the command
The CDATA command can be included in a memory card program to clear the memory card of data stored in the data area, when inserted into a dataTaker to collect the data stored in the internal memory.
For example the card program
will clear the data area of the memory card, and transfer data from the internal data memory.
Clearing the data area of a memory card with the CDATA command enables the memory card for data logging. The COPY command in this example is not necessary, because data transfer would occur after all of the commands in the program area are executed. However the command can be included if preferred.
A memory card containing this program is typical for applications where a memory card is used to periodically collect data from remote dataTakers, to transfer the data to a central computing facility.
Caution : Use of the CDATA command in this way has potentially damaging consequences. If a memory card containing this program is inserted into another dataTaker to unload the data, then the CDATA command will again be executed and the memory card will be cleared !!
The Execute Card Commands Switch must be disabled (/q) in the second dataTaker to prevent execution of the card commands.
The preferred method is to clear the memory card by the CDATA command from the host, or clearing the card with the MCI-04 Memory Card Interface, after the data has been unloaded.
Forcing Execution of the Memory Card Program
When a memory card is inserted into the dataTaker, the program area is searched and any commands or program found are executed. However once the card is inserted, the program will not automatically run again while the card remains inserted.
The program in the memory card can be executed in response to a command from the host computer
This will force the program stored in an inserted memory card to be read and executed.
The command can be entered at any time from the host, and can be used for memory card control when operating the dataTaker remotely via modems.
However the command has limited application when included in a program stored in a memory card.
Executing RESET Command from the Program Area
The RESET command can be included in the program area of the memory card, to reset the dataTaker before entering a new program.
However use of the RESET command in this manner will also clear any data stored in the internal data memory.
If a memory card program contains the RESET command, then this reset does not cause the card program to be read again (unlike a commanded reset from a host computer). The prevents the dataTaker getting into an infinite loop.
Clearing the Program Area
The program area of a memory card is cleared by the command
Checking the Program Area
The number of characters of program stored in the program area of a memory card can be returned by the STATUS command which returns the response
3406,684 Program Characters Free,Stored
The program and commands stored in a memory card can be returned separately by the STATUS8 command, which returns a listing of the commands as follows
4008,82 Program Characters Free,Stored
Example of a Card Program
The following example provides a guide to the general format for programming a dataTaker from a memory card.
;' Program Card for Boiler House
When the memory card is inserted, the following procedure occurs
Storing Programs in to Memory Cards from DeLogger
Programs developed in the Program Builder of DeLogger can be stored into memory cards for remote use. Firstly create your program in the Program Builder, keeping in mind that the program will be used in a logger not connected to a computer.
To send the program to a memory card inserted in a dataTaker connected to DeLogger, select Program:Send to Card on ConnectionÖ from the main menu bar.
This will open the Card Management dialog.
This dialog has 3 predefined modes of operation which configure the card program for 3 commonly used roles of card programming of loggers. The dialog also provides control of the data logging command, the Memory Overwrite switch, and the Execute Card Commands switch.
Select the required mode of operation and options settings, then click OK button to send the program to the memory card.
Once the memory card is programmed, the card program should be test run before taking into the field. The program can be run by selecting dataTaker:Run Card ProgramÖ on the main menu bar.
Summary of Memory Card Insertion
The following flow chart indicates how a memory card containing a dataTaker program is managed on insertion.