How To Get Word From Bits Of The Same DB ?

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
Post Reply
Alex3110
Posts: 159
Joined: Mon Sep 27, 2010 7:17 pm

How To Get Word From Bits Of The Same DB ?

Post by Alex3110 » Fri Nov 09, 2018 5:47 pm

Hello, everybody !

I have 25 bits in a DB which are located separately in a distance 6 bytes one after another.
How to make up all the bits into 2 words. The bits must be located one by one in every word.
The bit with least "address" in DB must be put into a bit0 in the word1 of the same DB.
Next bit with "address_1" = "address" + P#6.0 must be put into a bit1 in the word1, and so on.

I know how to do it in LAD.
But how to do it in STL in order to make the code shorter and to decrease the CPU cycle.
I think it's possible using AR1,AR2 and maybe some inner cycles.

Thanks in Advance.

Post Reply