hi all,
i have a question about function's temp variables.
i know that a temp variable must not be read before writing on it.
so if i have to set a variable and use it later, it must be a in_out variable and i have to allocate a memory bit (or dbx) for it.
but i saw a code like: (still working on a huge warehouse controlled by 4 s7 300s for 3 years)
on i_emergency
o
a temp13
an i_reset
= temp13
this means if i push emergency button i set temp13, if i release emergency button, temp13 still remains "1" until i press reset button.
but how can it be?
can i set a temp variable and trust it later?
i mean, if i call this fc from fc1 and fc1 writes 1 on temp13, than i call it from fc2 again and fc2 writes 0 on temp13, when fc1 calls it again, what will be the value of temp13?
(i think it will be 0 now but how is the system working if so?)
i have a question about function's temp variables.
i know that a temp variable must not be read before writing on it.
so if i have to set a variable and use it later, it must be a in_out variable and i have to allocate a memory bit (or dbx) for it.
but i saw a code like: (still working on a huge warehouse controlled by 4 s7 300s for 3 years)
on i_emergency
o
a temp13
an i_reset
= temp13
this means if i push emergency button i set temp13, if i release emergency button, temp13 still remains "1" until i press reset button.
but how can it be?
can i set a temp variable and trust it later?
i mean, if i call this fc from fc1 and fc1 writes 1 on temp13, than i call it from fc2 again and fc2 writes 0 on temp13, when fc1 calls it again, what will be the value of temp13?
(i think it will be 0 now but how is the system working if so?)