Sign in to follow this  
Followers 0
Inntele

Syntax of INDEX_M and OUTEX_M instructions in GX IEC Developer IL (Instruction List)

10 posts in this topic

Hi everybody! After several years at the forum this is my first question to experts: What is the syntax of INDEX_M and OUTEX_M instructions in GX IEC Developer IL? Thanks

Share this post


Link to post
Share on other sites
I'm tempted to say "Welcome" Here you are, see attached picture with Ladder, MC, IL and a new MC of that one. The variables are all global to use the same names, and the "OffsetConstant" is of course a constant (required for use in INDEX and OUTEX).

Share this post


Link to post
Share on other sites
Hi Kaare_T, Thank you much for the clear and detailed explanation! I have repeated your sample, then modified it according to my task and the code is compiled fine. Please, look the pictures: The next issue is how to add a logical condition to the command sequence, because after compiling I need to get the following code: LD M0MOV K100 Z0MOV K102 V0

Share this post


Link to post
Share on other sites
Not sure if I fully understood your last question. Did you need the code as in the picture? If not, please explain a bit more

Share this post


Link to post
Share on other sites
Hi Kaare, Yes, I need to get this code after compilation.

Share this post


Link to post
Share on other sites
OK, my last picture I posted (previous post) in IL will do that.

Share this post


Link to post
Share on other sites
You do not understand me. I've talked about INDEX_M and OUTEX_M, that is controlled by a logical condition. Please, look at the picture below: The code is produced in GX IEC Developer v7.04 with a choosen box of v7.03 compiler in Extras-Option window. The same program code after compilation I need to get using INDEX_M commands in IEC IL.

Share this post


Link to post
Share on other sites
I see your point, however: Are you aware that the value of D100 and D102 does not depend on the value of each register?? As your code shows above you will generate a code that generates a constant: "D100 = K100". In other words: No matter what lies inside D100 (the actual value), the value passed to the INDEX function is still K100. In other words: Why do you specify "D100" when you should specify "K100"? I've never seen INDEX and OUTEX with dataregisters as I've always used them for calculating the IN/OUT addresses of A/AnS/Q series intelligent cards, based on a HeadAddress of the card you can determine during compile time the physical address of the specified IO. INDEX/OUTEX are compile time aware instructions and will generate a static code depending on the constants that are put into the instructions. In other words, dynamic (runtime) indexing wont work. So regarding your example: The value in Z0 will always be K100, and the value in V0 will always be K102. So what is your purpose with this program? Could you please explain what you need to do, and which PLC do you use?

Share this post


Link to post
Share on other sites
It's difficult for me to explain by words for what purposes I use these instructions... Certainly, the code, that is created by these instructions, is static. They is used for an fixed settings, then the dynamic selection of addresses is provided with index registers... Will be easier to send you some program examples, of which you could understand, how I use the INDEX_M and OUTEX_M. I'll do it today with a personal message. UPD: All in all, I managed it and got a shortest compiled code Thanks for the help, Kaare! I'll send you the first result... Edited by Inntele

Share this post


Link to post
Share on other sites
Hello everybody, This is a next question, connected with programming in IEC IL, when using INDEX_M and OUTEX_M instructions. Can anyone help, how to rewrite correctly the following ladder construction in IEC IL?:

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