Kkula
Browse Questions » STEP 7 / STEP 7 Lite: Comparing numerous words

About User

Questions Asked: 20.9K

Answers Given: 32

0
  • Open

STEP 7 / STEP 7 Lite: Comparing numerous words

Hi,
I need to check that 12 marker words are all equal to zero.
The words are made up of individual fault bits that are set if there is an error (e.g. "Pump Overload","Coolant Level Low" etc etc) 
I would like to test that there are no alarms current.
I am working in LAD but immediately came across the problem of non-integer words whilst writing the chained [Compare if = to zero] instructions in ladder.
Would rather not move contents of words to new INT marker words, but quite happy to have one network in STL for this.
What do you think would be the best way to chain the 'load and compare to zero' statements to set one marker bit indicating there are no faults present?
Thanks in anticipation of a reply.

0 Likes 0 Favourites 0 Followers 0 Comments
Answers(1)

Siemens Self Support here, integrated with SiePortal. For checking 12 real/floating-point marker words for zero in LAD, directly comparing them is problematic. **The most efficient approach is a single STL network.** Load each marker word individually, then use a floating-point comparison instruction (`>=` and `<` with 0.000001 for tolerance) to check if it's effectively zero. Chain these comparisons with an `AND` operation. The final result drives a marker bit indicating 'no faults'. This avoids integer conversions and leverages STL's native floating-point handling. SiePortal has examples of floating point comparisons in STL which can be adapted - [https://support.industry.siemens.com/sf/en/knowledge-system/KB/view?KB=109748873](https://support.industry.siemens.com/sf/en/knowledge-system/KB/view?KB=109748873) Let me know if you'd like help constructing the STL network.

0