3 downloading a program, 1 the dl command, 2 the program download process – ElmoMC SimplIQ Software Manual User Manual
Page 85: Ole_link5, Downloading a program -23
SimplIQ
Software Manual
Program Development and Execution
MAN-SIMSW (Ver. 1.4)
6-23
6.5.3
Downloading a Program
6.5.3.1 The DL Command
The DL command downloads data to the serial flash memory of the drive. The command is
used primarily to download compiled user programs to the drive. When downloading to a
non-protected area in the flash, the process is as follows:
LP[1]=start;
DL##xxxxxxxxx
where:
xxxxxxxxx
denotes the escape-sequenced data payload.
start
denotes the byte address in the user program flash.
CS
denotes the 16-bit checksum for the message, including DL##.
The DL process takes time to proceed, because it needs to burn and verify.
Failures in executing the DL command may occur if:
An attempt is made to write to a protected area of the flash. While the DL may begin to
write legally to the flash, its last bytes may attempt an illegal (protected) write. In any
such case, the DL command will be rejected and the contents of the serial flash will be
unpredictable.
DL is used when the motor is on.
DL is used when a program is running.
There is a faulty checksum. In this case, DL will be rejected but no harm will be caused.
A verify error occurs. If DL attempts to write to an error in the flash that was written to
previously, the write will probably fail due to a Verify error. In this case, the contents of
the flash will be unpredictable and it will need to be cleared and completely rewritten.
The DL string is too long. The maximum length of a DL string is 500 bytes, due to
internal
SimplIQ
drive limits.
The Program Valid flag is not -1. In this case, the DL command will not be executed (CP
must be issued before DL).
6.5.3.2 The Program Download Process
In order to download a program image to the
SimplIQ
drive, perform the following
procedure:
1. Read the location (loc) and the length of the user code partition, using the LP[3] and
LP[4] commands.
2. Verify that your image block will fit inside the allocated space.
3. Clear the program flash using the CP command.
4. Download your image file using the following sequence:
LP[1]=loc;
DL##…100 bytes of payload
LP[1]=(loc+100)
DL##…next 100 bytes of payload
. . . and so on until the end of the image