Downloader in the batch mode
The batch mode of the downloader
The program downloader starting with version 5.03 ensures processing of various steps in the batch mode. . So it is for example possible to load the operating system, user program and parameters in one operation into the controller. To do so parameters can be conveniently created under Windows (e.g. using Excel).
The parameter data have to be available in CSV format. This format is supported by many office programs (e.g. Excel, Star-Calc, etc.). The structure of a parameter table is explained below using an excel table.
All Excel functions are available for creating your parameter tables. To enable the downloader to allot the parameter data correctly the following rules have to be observed:
The completed Excel table has to be stored in CSV format using a separating mark. " ; “ is used as separating mark for columns and " CR " (Carried Return) for lines.
The data range in the controller has to be entered as identifier into the first line preceding the parameter data as designation, e.g.
ifm data AT 100000 for EEPROM data
ifm Data AT 7C000 for flash data
ifm Data AT 9E000 for autosave data
In the first column there is the address, in the second column there is the parameter value and in the third column there is the parameter type (BYTE, WORD, TIME, etc.). All other columns are for user-specific entries.
In each line there is a parameter value and the parameter range must not be interrupted by spaces or comment lines.
Example of a valid table
Example of an invalid table: There is a headline between the identifier and the parameter range!!
Furthermore it has to be noted that the address ranges are always written as a block, i.e. completely. It is not possible to divide e.g. the address range of the EEPROM into two Excel tables, addresses 0 to 255 with data and addresses, 1024 to 1500 with texts.
Therefore it is absolutely necessary to create a table with all EEPROM data. The range 768 to 1023 (16#300 to 16#3FF) reserved for the operating system is protected and will not be overwritten.
The EEPROM ADR column is ignored by the downloader during conversion and its function is merely for the user's orientation. This information is important to ensure reading of the respective parameters from the EEPROM via the function block E2READ_.
The downloader calculates the EEPROM addresses by means of the type indication, irrespective of the entry in the EEPROM ADR column.
The user is responsible for the correct size of the table.
The TYPE column indicates how many bytes the value in EEPROM is assigned and how this value is filed in the EEPROM (high byte - low byte). This type also has to be taken into consideration for reading.
For the STRING data type it has to be observed that a STRING is always ended with the value 16#00 (zero terminated). In the EEPROM the This is a text STRING takes up 14 characters, i.e. 15 bytes. This, too, has to be observed for reading the EEPROM.
The size of the EEPROM depends on the controller used. If the parameter table is too big, no other memory areas are overwritten but the EEPROM overwrites itself with the data which exceed the actual EEPROM size in the table. The user is responsible for the correct size of the table.
The CR051 until CR0017 controllers have a 1 kB EEPROM,
starting with the CR0018 controller a 4 kB EEPROM.
256 bytes are reserved for the operating system (see system manual).
Call of the downloader in the batch mode
The Downloader program can be called by means of various parameters, e.g.
It is also possible to write the parameters in a text file in ASCII format (e.g. with NotePad or WordPad) and to indicate them as parameters.
In this example the Downloader is started using the parameters in test.cmd. The advantage is that the command line is not too long and comments can be added to the individual parameters. A batch file can look as follows:
Example of a batch file
Rem load operating system, user program, Excel file and start the controller
Rem select RS232
rem select Com1
rem set baud rate to 9600
rem load operating system
rem start download
rem load user program
rem file to be loaded in EEPROM
rem load Excel table in CSV format
rem start PLC
Overview of command line arguments in DOWNLOAD.EXE
/CFx execute command file (x=path\name of the file)
/RS232 use RS232 interface (default)
/COMx x = number of the COM port (1, 2 ...)
/CANx use CAN interface (x = board type, ‘1’ for IPCI 320)
/BAUDRATEx e.g. x = 9600 for RS232 or x=125 for CAN
/CANINTx interrupt number of the CANcard (default = &H5)
/CANBASEx basic address of the CANcard (default = &HD000)
/MODULx module number of the controller 0..31 (default = 0)
/DEBUG extended function accessible
/Fx x = path\name of the file to be loaded
/DLFILE upload/download of operating system or user program (default)
/DATAFLASHFILE upload/download of flash data (16K starting with 0x7C000), this area can be accessed via FLASHREAD: and FLASHWRITE
/USERRETAINFILE upload/download of retain data (autosave %MB0 - %MB254)
/EEPROMFILE upload/download of data in the serial EEPROM
/NOCRC do not verify the checksum
/CRC verify the checksum (default)
Executable commands (only in combination with /DEBUG)
/DOWNLOAD execute download
/UPLOAD execute upload
/VERIFY make comparison
/RUN start user program
/STOP stop user program
/IDENTITY read identifier
/SETCANBAUDRATEx change the CAN baud rate of the controller (x = baud rate)
/SETRS232BAUDRATEx change RS232 baud rate of the controller (x = baud rate)
The executable commands are executed in the same order as indicated in the command line. After execution the program is ended.
If executable commands are used the program runs automatically without waiting for any user input.
Exception: Error messages have to be acknowledged.
Exception: The result of IDENTITY has to be acknowledged.
For each call a log file 'DOWNLOAD.TXT' is created.