carlostana8437@gmail said:
V30+. i used to be able to use S:V without a math instruction before it but now it wont let me. is there a work around this.
No. There is no direct workaround. If using Studio 5000 Logix Designer v27 or newer you must place an arithmetic instruction, which will produce a math status flag, before any instruction instances which will consume a math status flag (S:V, S:C, S:N, or S:Z).
As an indirect workaround, you can use the
S:V operand in an instruction after the intended arithmetic instruction, as they now expect you to do, and then at the end of the rung assign a user-defined overflow condition BOOL tag to an output instruction.
Example:
XIC
Execute_ADD ADD
myTagA myTagB myTagC XIC
S:V OTE
myADD_SV
If the ADD instruction were to overflow, then
myADD_SV will be set to "1".
Then, where you would like to use the
S:V operand for overflow status, for this particular arithmetic instruction, you can use
myADD_SV instead and no arithmetic instruction needs to be present on the rung.
If you need to add a general
S:V operand, where you need to evaluate if any overflow is active, to a rung where there are no arithmetic instructions, then you could create a DINT tag
Prog_SV especially for user-defined overflow status for the particular program. The DINT will provide 32 x BOOL tags for use as individual user-defined overflow tags. These BOOL tags are then used throughout the program similar to the example above. You can then compare the entire DINT as an integer value (GRT>0) and if one or more of the overflow BOOLs within the DINT are set to "1" then the DINT value will be a non-zero value. This evaluation could set a BOOL tag, say
Sys_SV. The status of
Sys_SV should then tell you if there is currently any overflow conditions in the program, similar to how the
S:V operand would tell you.
There may be other considerations if attempting to implement this or indeed other methods, but that is the bones of it.
Regards,
George