MaxRoberts22
Member
I'm new to S7 programming and finding it a whole lot like running backwards through a corn field!
I am helping my company develop our current standards in S7. So I know the logic is sound, but the "uniquenesses" of S7 are presenting challenges.
I would like to develop a starndard motor routine with several inputs and outputs. Instead of making an FB (with an instance DB), I'd like to create an FC for each motor and have it point to one DB that contains all of my motor data. This DB contains 4 instances of a motor UDT I created (e.g., M100, M101, M200, and M201). Each FC would have an input integer that would point to a starting byte location in the big motor data DB. I would like to create logic in the routine to increment the incoming pointer integer so that I could point to other bytes and bits in the DB as well.
My problem is with the indirect addressing of the DB location. In addition to the DB byte location, I'd like to be able to dynamically point the DB number itself (i.e. DB[xxx].DBy[zzz] where xxx = indirected DB number; y = data types X, W, and D; zzz = indirected byte or bit location).
Is there a way to dynamically address both the DB number and DB byte location, even down to the bit location? Again, I'd like to pass into the FC a DB number and a DB starting byte.
I am helping my company develop our current standards in S7. So I know the logic is sound, but the "uniquenesses" of S7 are presenting challenges.
I would like to develop a starndard motor routine with several inputs and outputs. Instead of making an FB (with an instance DB), I'd like to create an FC for each motor and have it point to one DB that contains all of my motor data. This DB contains 4 instances of a motor UDT I created (e.g., M100, M101, M200, and M201). Each FC would have an input integer that would point to a starting byte location in the big motor data DB. I would like to create logic in the routine to increment the incoming pointer integer so that I could point to other bytes and bits in the DB as well.
My problem is with the indirect addressing of the DB location. In addition to the DB byte location, I'd like to be able to dynamically point the DB number itself (i.e. DB[xxx].DBy[zzz] where xxx = indirected DB number; y = data types X, W, and D; zzz = indirected byte or bit location).
Is there a way to dynamically address both the DB number and DB byte location, even down to the bit location? Again, I'd like to pass into the FC a DB number and a DB starting byte.