Sign in to follow this  
Followers 0
mhi

Indirect Adressing S7-300

14 posts in this topic

Hello, Currently I'am struggling to convert the Mitsubishi A2A Plc programming to Siemens S7-400. However, I got 1 problem on how to convert the instruction which use "z" for index qualification purpose. Please refer to page 50 (page 3.7) for the mitsubishi instruction example. Hope you can consult me on how to implement/convert this kind of instruction application in S7-400 programming. Thank you. The mitsubishi program is look like below : In Main Program : Move K50 Z CALL P130 In P130 Program : Z------- K D0 * 1000 --- D700-------------- ; This mean that the value of data register D(0 + 50)/D50 will multiply with constant 1000 and then store in D700 INC Z ------------------------------ ; The 'Z' is increment by one for the next operation. So the next data register use will be D 51, D52, D 53 and so on...... untitled.bmp Edited by mhi

Share this post


Link to post
Share on other sites
What else is there in the P130 program? How many times does the Z value increment and where are the values stored? If it "loops" then are the results all stored in D700 ? If there are not to many then carry out the calculation seperatly (in ladder), to make it easier for yourself and anyone else trying to fault find.

Share this post


Link to post
Share on other sites
Information about indirect adressing in S7. Thanks to Anit who uploaded this in the Siemens forum. indirect_add.zip Edited by Globe

Share this post


Link to post
Share on other sites
Hello Mr Sparky, The Z value is increment for 6 times for P130 program. And the result is stored in D702,D704,D706,D708,D7010 and D7012. I cant carry out the calculation separetly/manually via ladder as the main program will call several time about 3 subroutine program (P130,P140 and P150) which use 'Z' as index register. In Main Program : Move K50 Z CALL P130 --------------------------------------- Move K60 Z CALL P130 ---------------------------------------- Move K80 Z CALL P140 ---------------------------------------- Move K90 Z CALL P140 --------------------------------------- Move K70 Z CALL P140 -------------------------------------- When Bit M400 true, CALL P150 Move D300Z to D410 ---------------------------------------- Hope u could consult me on how to implement this kind of application via S7-400 programming. Thank you.

Share this post


Link to post
Share on other sites
If there are only 6 registers each time then the simplest/quickest way is to write them in STL see attachment for simple explanation - (also what data type are you using?) calc.bmp

Share this post


Link to post
Share on other sites
Dear Moggie, The data type that I using is REAL type. what is the function of the 'TAK' instruction? in my case, the main program will call 3 different subroutine at different time sequence.(P130,P140 and P150) which will use 'Z' indexing in each subroutine.

Share this post


Link to post
Share on other sites
Dear Moggie, The data type that I using is REAL type. what is the function of the 'TAK' instruction? in my case, the main program will call 3 different subroutine at different time sequence.(P130,P140 and P150) which will use 'Z' indexing in each subroutine.

Share this post


Link to post
Share on other sites
see attachment for REAL calculation of 6 registers in ladder. Easy to understand and no "indexing". Easy for anyone to understand. Just write different FC's for the different Z values and call them in the correct order. You did not mention that there were timed calls to the P130,P140&P150 in your earlier posts????? real.bmp Edited by Moggie

Share this post


Link to post
Share on other sites
According to your example, What i need to configure in my main program? I still not clear with example given.

Share this post


Link to post
Share on other sites
According to your example, What i need to configure in my main program? I still not clear with example given.

Share this post


Link to post
Share on other sites
From an earlier post you stated - In Main Program : Move K50 Z CALL P130 In S7 CALL FC130 --------------------------------------- Move K60 Z CALL P130 In S7 CALL FC131 ---------------------------------------- Move K80 Z CALL P140 In S7 CALL FC132 ---------------------------------------- Move K90 Z CALL P140 In S7 CALL FC133 --------------------------------------- Move K70 Z CALL P140 In S7 CALL FC134 Then in each FC (FC130 to FC 134) perform the calculation on the registers used as shown in my previous example. If you send me a copy of the program / or details of the registers used within eace P with the Z value I will show you a complete example in S7. As you will see from my previous example it is very easy to perform the calculation on 6 registers each time without any indexing. This makes it very simple to see what is happening for you or anyone else that has to fault find on the program. If the calls to P130 are unconditional then all the calculations for each P130 could be performed in one FC and another FC for all the P140 ie: in the first Call of P130 the Z value is 50 and in the next 60 So D50 to D55 and D60 to D65 registers are multiplied by 1000 In P140 the Z value is 80, 90 & 70 so D80 to D85, D90 to D95 & D 70 to D75 - assuming 6 registers in each P, are multiplied by xxxx

Share this post


Link to post
Share on other sites
Thank you for your good support. Could you give me ur e-mail address? Then I will forward to you the original program for mitsubishi and my current developing S7-400 program. In order to open the Mitsubishi program, u need to use MEDOC software which is based on DOS. I will e-mail to u too....

Share this post


Link to post
Share on other sites
Thank you for your good support. Could you give me ur e-mail address? Then I will forward to you the original program for mitsubishi and my current developing S7-400 program. In order to open the Mitsubishi program, u need to use MEDOC software which is based on DOS. I will e-mail to u too....

Share this post


Link to post
Share on other sites
Hello, Could anyone show to me on how to make increment 1 by 1 for these below pointer? So that i can read the content from register MD 100, MD 104, MD 108 and so on. L P#100.0 T MD 4 L MD (MD4) Thank you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0