Vai al contenuto

System variables: updating methods

Information on the system operation through specific variables is available for applicative system 1131. The complete list is available in the Variables chapter.These variables, the names of which have a shared prefix “GPV_xxx” , are usually copies, made available to program 1131, of original values resident in the various management of the system firmware which produces or uses them.The “exchange” of these variables between applicative program 1131 and the system is managed cyclically within the FAST task, like with the I/O variables: at the FAST start, the “GPV_xxx” variables are updated with system values and, at the end, the variables that can be written are transferred from the “GPV_xxx” to the original variables.Unlike the I/O variables, there is no private copy mechanism for tasks other than FAST (see paragraph I/O and process image).This means that reading access to the “GPV_xxx” variables can be run by all tasks, when we know that the value of the variable could change during the same cycle. Only FAST is synchronous with the update operations.This is why particular attention must be paid to writing the system variables from applicative 1131: in the (rare) case of variables that can only be written, no precautions are required, but in the (frequent) case of variables that supply a value (reading) and allow editing (writing), the operation in question can be performed correctly only within the FAST task.In the other tasks, the assignment of a new value can only take place when the FAST task is blocked, due to the multi-tasking mechanisms and the rule of priority. This means that, during the next FAST run, the 1131 copy variables will be overwritten again by the originals and the value edited by other tasks will be lost.