Mitsubishi GXWorks2 Array Handling

plcman

Member
Join Date
Aug 2004
Location
Wolverhampton
Posts
14
Hi

I am using a FX3u plc and as i want to create function blocks, I have to use labels.

I have to use an array in my program, I want to use a label to select the element in my array. For instance,

Array[10] works ok and gives me the value in the 11th element.

I want to use
Array[element] where 'element' is a var holding the number 10.

This syntax doesn't work, is there a way to achieve this?
 
Homework?

I doubt it, it's a legitimate question for anyone who isn't familiar enough with Mitsubishi. I've dealt with it enough to know that Mitsubishi isn't for me.

OP, I no longer have access to a program I did on this platform from awhile back, but IIRC I was able to achieve this by going the structured text route. I had a basic recipe storage array that I would read/write too. I am pretty sure I went with ST so I could do just what you're asking. I don't think it worked in ladder.
 
Well,

Kwade, It isn't homework because I am 50 years old, having read my question , do you know how to do it? (and look at my joining date next to yours)

Paully's5.0, Thankyou for your response. My problem is I am trying to encapsulate this into a function block. This means in GXworks2 I have to use labels instead of register addresses. My question is how to use a label as the element of an array i.e. array[element] instead of array[10]
 
It was the formation of the statements in your post.
... I have to use labels.
... I have to use an array

No offense intended.
I was just trying to gauge how to respond.

Join date and post count have no correlation with talent/capability.
Age -vs- not homework is a false dichotomy.


Re: Mitsu, I have used LCPU. And like you paully, just enough to know that I won't be spec'ing it in a project.
 
Well,

Paully's5.0, Thankyou for your response. My problem is I am trying to encapsulate this into a function block. This means in GXworks2 I have to use labels instead of register addresses. My question is how to use a label as the element of an array i.e. array[element] instead of array[10]

Right so all the logic would have to be structured text in your FB.

Then I am fairly certain: LabelArrray[labelPointer] in ST works. But again my memory might be missing something, but I am a programmer who uses labels/tags as much as possible so I am pretty sure I made it work.
 
It was the formation of the statements in your post.
... I have to use labels.
... I have to use an array

No offense intended.
I was just trying to gauge how to respond.

Join date and post count have no correlation with talent/capability.
Age -vs- not homework is a false dichotomy.


Re: Mitsu, I have used LCPU. And like you paully, just enough to know that I won't be spec'ing it in a project.


No offence taken but you obviously took no real interest into my problem (same as Mitsubishi tech support who are struggling too)

I have to use labels because in GXWorks2 to create a function block you 'have to use labels'.

My requirement means that I have to 'Use an Array' of 4800 elements.

How else should I frame my problem, this is my 'dichotomy'
 
Thank you

Yes, I tried this today and couldn't get it to work, Mitsi Tech support in the UK are still chewing over this so I thought I would ask on here for some advice.
 
So I will take that as a NO then.

I'm sorry that I did not UNDERSTAND and ANSWER your questions TO YOUR SAFTISFACTION!

attachment.php

The only difference between my ignoring you and Mitsu ignoring you, is I don't get paid to do it.

I also don't get paid to help you or read your mind or accept your disrespect because I wanted to clarify if your question(s) were homework-based or if I should assume that you had IN-DEPTH knowledge of creating/using FBs in the Mitsu.
 
Kwade -

All you really had to do before responding was take an extra step, look at plcman's other posts on the forum to know the question was legitimate. None of your responses have helped to answer the OP's question, nor to clarify the OP's question.

plcman -

Obviously you have taken some offense to it, and given how "homework" questions are responded to here, I can understand why you're on the defensive.

Cut the bickering. Hopefully an answer can be found but Mitsubishi experience is a bit limited here. It's bugging the heck out of me because I did exactly this, but it's probably the one program I didn't archive!
 
Kwade -

All you really had to do before responding was take an extra step, look at plcman's other posts on the forum to know the question was legitimate. None of your responses have helped to answer the OP's question, nor to clarify the OP's questions.

No. I don't have to do a background chech on every thread to which I respond. A civil yes/no response and I would have fired up gxworks and investigated.
Sorry to disappoint.
 
What errors are you getting? Mitsubishi ST is pretty standard

The below is taken from a FX3U project FB


FOR X := 0 TO MAX_STEP_INDEX DO
IF RecipeSteps[X].Operation > 0 THEN
CheckSum := CheckSum + RecipeSteps[X].Operation;
END_IF;
END_FOR;

FOR X := MAX_STEP_INDEX TO StepIndex BY -1 DO
BMOV_M(TRUE,RecipeSteps[X-1].Operation,K100,RecipeSteps[X].Operation);
END_FOR;

FOR X := 0 TO 9 DO
IF LoginEnteredPassword = PasswordArrayNumbers[X] THEN
LoginLevel_Int := PasswordArrayLevels[X];
END_IF;
END_FOR;
 
Last edited:

Similar Topics

Not very often I ask for help, but this one has got me stumped. There are two ways to indirectly address memory areas in Mitsubishi PLC's. Using...
Replies
15
Views
4,488
Hello! If someone can help me with the following problem. I can't change the phone number. Do I really need the interface (AL-232CAB - Programming...
Replies
0
Views
34
how to communicate FactoryTalk Optix and Mitsubishi Q Series. I want to know the details of that
Replies
0
Views
37
I'm at a new job as the sole control engineer and trying to piece together where my predecessor left off. One machine I'm trying to get online...
Replies
2
Views
99
Back
Top Bottom