GX Works 2 instruction Definition

Daye.04

Member
Join Date
Jul 2012
Location
Fredrikstad
Posts
70
Hey all. I have just started to try and make sense of the mitsubishi PLC's. And now there's some instructions that I can not for the life of me understand. Is there anyone who has any experience with GX Works that could help me?

The list of the instructions are as follows:
ALTP
ZRST I reccon that means resetting the zone
SFTR & SFTL

Greatly appreciated
 
Hello,

ALT is a handy instruction that will alternate the state of a bit each time the preceeding rung conditions are met.

ALTP is the pulse form of this command meaning it will only happen once each false to true transition.
I think it is also known as a flip-flop command.

SFTR and SFTL are bit shift commands, R shifting to the right, and L shifting to the left.

And yes, ZRST will reset a defined zone of outputs, registers, etc.

Hope this helps,

-Dave
 
It does. it helps a bunch. Still not able to quite deciphfer the program, but I am getting forward. I'll come back once I meet another wall. ^^

For now - thanks =D

EDIT: There's allready a wall! =O
I think I might be in a maze.

Now I see the Zone Comparison function (ZCP), and I read the explanation (Yeah, I finally found "Open instruction help" ^^), and it says something like "Condition A; bit device D is ON, Condition B; bit device D+1 is ON and condition C; bit device D+2 is ON"

My question then is - what is bit device D+X?
As far as I can understand the bit device would be the last operand in the string. I.E., I have for example the following code in the Ladder "ZCP D9 D11 D2 M50". And I assume bit device D is M50. in that case - what does M50+1 mean? Alternatively, what is bit device D if it's not M50?
 
Last edited:
Hmmm how to explain it simply?

Ok - ZCP compares (in this case) the number in D2 against the range of numbers D9 and D11.
Imagine a speed dial needle going up a scale from 0 to 100.
You have marked the dial between 30 and 50 in red. While the needle is below 30, M50 will be on.
When the needle is between 30 & 50, M51 will be on and when it is greater than 50 M52 will be on.

So in this case, D9's value would be 30, D11's would be 50 and D2's is the value you are monitoring to see if it is lower than 30 - inbetween 30 & 50 or greater than 50 - the M50 M51 M52 will will turn on for each case.
 
A tad deeper than necessarily, but that's neat. Now there's no doubt about how that works. Thanks a bunch ^^

next question. How does the "To" and "From" functions work? And when I ask about these, I am fairly certain I have no real clue as to how their correlation with the operands.

An example of both:
From K0 K5 D2 K4
To K0 K1 K8 K1

My assumptions are as follows. I would assume it read an word-value (as in analogue) from one of them. I'm guessing K0 and then some kind of reading from K5 as well? And ultimately leave it all in K4. Like I said, I really have no clue. Anyone up for the challenge? :p
 
A tad deeper than necessarily, but that's neat. Now there's no doubt about how that works. Thanks a bunch ^^

next question. How does the "To" and "From" functions work? And when I ask about these, I am fairly certain I have no real clue as to how their correlation with the operands.

An example of both:
From K0 K5 D2 K4
To K0 K1 K8 K1

My assumptions are as follows. I would assume it read an word-value (as in analogue) from one of them. I'm guessing K0 and then some kind of reading from K5 as well? And ultimately leave it all in K4. Like I said, I really have no clue. Anyone up for the challenge? :p

Hello,

TO and FROM are used to read and write data between the PLC and any extension units connected to it. You must be using a FX series PLC, with a Q series using GX Works 2 the need for this is eliminated. Anyhoo...

To break down your example code, FROM K0 K5 D2 K4 the K0 is the location of the special function module you are reading from. K0 is the first module mounted. K5 is the buffer memory location the data to be read is stored in, D2 is the data register the data is going to be put into, and k4 is the number of words transferred.
Your TO command simply puts the constant 8 into the buffer memory location 1 of the first module connected to the PLC, using 1 word of data.

Dave
 
The reason for that difference is probably because the program was made with Medoc, and then merely converted to GX Works 2, I guess.

Thanks a lot for the help, you're a great aid.

I have yet another question, though. If there's an analogue output. How do I find if there's such a thing in the program?

Because There's one module on this PLC. And as far as I can gather from your reply, that module is mapped to K0?

And in that case - if the module is used for reading analogue values, and there's only one channel connected to anything, is it then safe to assume that there is no analogue output, or does the FX-64MR PLC come with an merged analogue output?

And what is the definition of Kxx? I just can't seem to wrap my head around it. it seems like it's being used everywhere for everything with no real correlation ...
 
The reason for that difference is probably because the program was made with Medoc, and then merely converted to GX Works 2, I guess.

Thanks a lot for the help, you're a great aid.

I have yet another question, though. If there's an analogue output. How do I find if there's such a thing in the program?

Because There's one module on this PLC. And as far as I can gather from your reply, that module is mapped to K0?

And in that case - if the module is used for reading analogue values, and there's only one channel connected to anything, is it then safe to assume that there is no analogue output, or does the FX-64MR PLC come with an merged analogue output?

And what is the definition of Kxx? I just can't seem to wrap my head around it. it seems like it's being used everywhere for everything with no real correlation ...

K in front of something simply means it is a constant. It is written in the code and cannot be changed without modifying the code. For example if I wanted a 1 second timer the instruction would be wriiten as T0 K10. If I wanted to be able to adjust the timer preset value than I could use a D register instead of a K, i.e. T0 D1. The timer will run until it reaches the value in D1 which can be adjusted via HMI etc.
What is the part number on the module connected to the unit? If it ends with AD (analog to digital)it is an analog input module. If it ends with DA (digital to analog)it is an analog output module.

The PLC does not have integrated analog. The expansion module is doing that. To find the data you could reference the to/from commands we talked about before. Look at the sample code you posted, FROM K0 K5 D2 K4. If this is the code you can monitor online and do a device batch monitor of data register D2 and see what data is in there.

I hope I am making sense here.

Dave
 
yeah, you're making more than enough sense for my part. Although i can't speak for anyone who's curious or wondering in the future - but they'll have to post themselves if there's something they don't understand ^^

So far it seems my guesses has been accurate enough - that's good to know =P

I have a question, though. Whenever i use the Open Instruction List Help when having a "output" labeled I.E. T11 with parameters of K5, it simply explains what an "out-function" does.

I am in the right by assuming the program is only looking at the connection, and figuring that's what I'm asking about - not bothering with the fact that there's actually a timer there I'm curious about? Or is this some kind of interesting way of defining an output I just don't understand?

Yet again. Thanks so much for the immense help you've given me. i'm very grateful
 
yeah, you're making more than enough sense for my part. Although i can't speak for anyone who's curious or wondering in the future - but they'll have to post themselves if there's something they don't understand ^^

So far it seems my guesses has been accurate enough - that's good to know =P

I have a question, though. Whenever i use the Open Instruction List Help when having a "output" labeled I.E. T11 with parameters of K5, it simply explains what an "out-function" does.

I am in the right by assuming the program is only looking at the connection, and figuring that's what I'm asking about - not bothering with the fact that there's actually a timer there I'm curious about? Or is this some kind of interesting way of defining an output I just don't understand?


Yes, your assumption is correct. You can go to Mitsubishis website and download the FX programming manual. There are detailed descriptions of the commands and usage examples.

Yet again. Thanks so much for the immense help you've given me. i'm very grateful

No problem!

Dave
 
I'm not quite certain I follow you, Goody. Seeing as the wall comment was'nt a response to your explanation.

And yes, you have no ground for knowing my or future readers' competence. Thus the thorough explanation was a good idea.

Now rest assured, i didn't mean the "tad-deeper-comment" as any form of critique. 'Twas but my way of saying that I am allready familiar with some part of it. Not to say that it was pointless to explain it that well. Just that it wasn't neccessary for my part.

None the less, it did help a lot. And for that I am thankful :D
 
Hi there,
In relation to the ZRST instruction, has anyone tried to use in in Instruction List? No matter what I tried, on checking the body of the code, I always get an error (C2054) on the second address.
 

Similar Topics

I am noticing a problem where i am using MOV instruction and writing literal text into source and String datatype in destination. It works fines...
Replies
6
Views
488
Hi everybody, I am working on a packaging machine that communicates with 2 servo drives and need a little help understanding the instruction. I...
Replies
2
Views
2,157
Is it possible to send a MSG instruction to a PLC on a different network? I am attempting to send the MSG from a CompactLogix PLC on a network...
Replies
3
Views
1,968
I’m attempt to establish a communication between two simulator M580 CPUs, using a READ_VAR, I have two vitalization Windows 10 in VMWare and each...
Replies
0
Views
1
Hey everyone and anyone that can lend a helping hand. I have a project that I am being asked to add some animations of Solidworks or "3D" models...
Replies
9
Views
333
Back
Top Bottom