4.3 Data Buffers access instructions
All data coming to of from target device can be saved in the temporary buffers (see Figure 4.2)
located inside the API-DLL. The data saved in these buffers can be copied to target devices using an
encapsulated or sequential functions. When the full block of data is ready to be saved (eg. code data),
then the part of the data buffers can be modified by adding some unique data like serial numbers,
calibration data etc. to each target before executing the flash programming process. Data buffers can
be modified at any time, as long as the F_OpenInstancesAndFPAs(..) and F_Initialization() have
been executed successfully. When more then one FPA are used then it is recommended to use only
an executable instructions uses the data buffers for read and write. For example when the read process
is used with external data buffer like it is in instruction F_Memory_Read( BYTE * data), then the
simultaneous process can not be used and data from each targets must be read sequentially. Using for
this purpose instruction F_Copy_All_Flash_to_Buffer() allows to make this process simultaneously.
Results from each targets are saved in a Read Data buffers - one Read Buffer per one API-DLL. When
the simultaneous process is done, then the content from each buffers can be individually read. The
API-DLL contains four buffers (see Figure 4.2) - Code, Password, Write Data and Read Data
buffers. Contents for the Code and Password buffers can be taken from the files, or data can be
written directly to the specified buffer location. Data to the Write Data buffer can be written directly
only, while data from the Read Data buffer can be read directly only. The FLASH memory can be
programmed using contents taken from the Code buffer or from the Write Data buffer. Data to
RAM, registers, I/O (seen as RAM) can be taken from Write Data buffer only. Contents from RAM,
registers, I/O and flash are saved in Read Data buffer.
Note: The Code buffer contains two items inside - data and flag in each address location. Data is
related to the written value 0 to 0xFF, while flag - used or empty informs is the particular byte
is used and should be programmed, verified etc, or if it is empty and should be ignored even
if data is 0xFF. All flags are cleared when the new code from the file is downloaded, or if the
F_Clr_Code_Buffer() instruction is used.
Below are listed the data buffers access between an application and API-DLL buffers instruction.
F_ReadCodeFile, F_Read_CodeFile
F_ReadCodeFile - Read code data from the file and download it to internal buffer.
or F_Read_CodeFile
VALID FPA index - ( 1 to 64 ) or 0 (ALL FPAs) executed sequentially.
Function F_ReadCodeFile downloads code from the file to internal memory buffer. Code file format
and file name and location path of the desired file must be specified. Three file formats are supported
75