Flash Objects


A Flash object manages nonvolatile flash memory on the XMP motion controller. Because all of flash memory must be written as one contiguous piece (which takes a lot of time), and a host-resident flash memory cache is used to provide faster writing performance, and to also reduce the number of write cycles performed.

After your application creates a Flash object (using meiFlashCreate(...)), the Flash object then creates a host-resident flash memory cache, initializing it using a copy of actual flash memory [by calling meiFlashMemoryToFile(fileName=Null)]. Using the data structures defined in xmp.h and pointers to those structures (returned by the mpiControlMemory(...) method), your application can then use the meiFlashData[Get/Set](...) methods to access this memory cache. Note that the meiFlashDataSet(...) method updates the flash cache, and doesn't update the actual flash memory. To write the flash memory cache to actual flash memory, your application must call meiFlashMemoryFromFile(fileName=Null).

Use the FlashDataGet/Set(...) methods to move data between your application and the flash cache. Use the FlashMemoryTo/FromFile(...) methods to move data between the flash cache (or file) and the actual flash memory. Typically, your application would:

  1. Create a Flash object [using meiFlashCreate(...)].
  2. Pass the MEIFlash handle to the FlashConfig[Get/Set](...) methods of the objects to be configured (which in turn call the meiFlashData[Get/Set](...) methods).
  3. Write the flash cache to actual flash memory [using meiFlashMemoryFromFile(...)].
  4. Delete the Flash object.
Create, Delete, Validate Methods
  meiFlashCreate Create Flash object
  meiFlashDelete Delete Flash object
  meiFlashValidate Validate Flash object
Configuration and Information Methods
  meiFlashConfigGet Copy flash config from cache to application memory
  meiFlashConfigSet Copy flash config from application memory to cache
  meiFlashDataGet Get count bytes of flash data memory and write them in application memory
  meiFlashDataSet Set count bytes of flash data memory using application memory
Memory Methods
  meiFlashMemoryErase Erase actual flash memory on XMP
  meiFlashMemoryFromFile Write actual flash memory using cache or file
  meiFlashMemoryFromFileType Write actual flash memory using the binary image contained in filename
  meiFlashMemoryGet Copy count bytes of flash memory to application memory
  meiFlashMemoryModified Determine if flash cache has been modified
  meiFlashMemorySet Copy count bytes of application memory to flash memory
  meiFlashMemoryToFile Save actual flash memory to cache or to file
  meiFlashMemoryVerify Compare actual flash memory to cache or to file
Relational Methods
  meiFlashControl Return handle of Control that is associated with Flash
Data Types