Writes a persistent data block. Persistent data, valid across all opened simulator scenes, remains until the simulator ends, or until it is cleared by writing an empty data block. If the options flag is set appropriately, then persistent data can also be stored on file, and be automatically reloaded next time CoppeliaSim starts


sim.persistentDataWrite(string dataTag, string/bytes dataValue, int options = 0) sim.persistentDataWrite(string dataTag, buffer dataValue, int options = 0)


  • dataTag: name of the data block
  • dataValue: content of the data block (which may contain any value, including embedded zeros). If dataValue is an empty string, then the data block is cleared (if present).
  • options: bit-coded:
    • bit0 is set (1): data is also stored on file ("system/persistentData.dat"), and automatically reloaded next time CoppeliaSim start

See also: