Chapter 6. Service Request FunctionGFK-2950C February 2018 3356.33 SVC_REQ 57: Logic Driven Write to Nonvolatile StoragePACSystems controllers support a 65,500 byte nonvolatile flash memory area that can be accessedby the logic-driven read/write service requests. Values are stored in the nonvolatile storage areausing SVC_REQ 57. These values are applied to the controller user memory on power up.SVC_REQ 57 specifies a range of reference addresses to read from a running PACSystems CPU andwrite to nonvolatile storage. This feature is intended to retain a limited set of values, such as setpoints or tuning parameters that need to change when the PACSystems is running.This feature uses 65,536 bytes of nonvolatile storage. But not all of this memory is available for theactual data being written by the service request. Some of the memory is used internally by thecontroller to maintain information about the data being stored.Note: Nonvolatile storage is intended for storing values that do not change frequently. Once thenonvolatile storage area fills up, a power cycle or STOP Mode Store is required to store morevalues. The logic-driven write is not a replacement for battery backed RAM for values thatchange frequently or during every sweep. (Refer to When nonvolatile storage is full below.)6.33.1 Length of Data WrittenSVC_REQ 57 scans the nonvolatile storage to find the most recent values stored for the specifiedrange. If it finds no values for the range or the most recent stored values are different, the newvalues are written to nonvolatile storage.SVC_REQ 57 reports the length of data written in word 8 (starting address + 7) of the parameterblock. The number of words written is calculated from the first word that changed to the end of thearray. For example, if you specify 8 words to be written, but only the values of words 3 and 4 arechanged, the SVC_REQ identifies the first mismatch at word 3 and writes the values of words 3through 8 (a length of 6 words).You can write up to 32 words (64 bytes) inclusively per invocation of SVC_REQ 57. Each invocationrequires 4 words of command data (8 bytes). A 1-byte write requires 9 bytes whereas a 64-bytewrite requires 72 bytes. You can generally make the most efficient use of nonvolatile storage bytransferring data in 56-byte increments, since this will actually write 64 bytes to the device. Giventhe bookkeeping overhead required by the Controller and possible fragmentation, at least 54,912bytes and no more than 64,000 bytes will be available for the reference data and the 8 bytes ofcommand data for each invocation. For additional information, refer to Fragmentation below.6.33.2 Write FrequencyMultiple calls to SVC_REQ 57 in a single sweep may cause CPU watchdog timeouts. The number ofcalls to SVC_REQ 57 that can be made requires consideration of many variables: the softwarewatchdog timeout value, how much data is being written, how long the sweep is, age of nonvolatilestorage (flash), etc. If the application attempts to write to flash too frequently, the CPU couldexperience a watchdog timeout while waiting for a preceding write operation to complete.The Logic Driven Read/Write to Flash service requests are not intended for high frequency use. Werecommend limiting the number of calls to SVC_REQ 57 to one call per sweep to avoid the potentialof for causing a watchdog timeout and the resulting transition to STOP-Halt mode.