Sign in to follow this  
Followers 0
CoolBreeze

Indirect Addressing help

23 posts in this topic

I'm trying to indirect address "D200" word to a counter, D200.XX , XX will be the counters value. The finished result should be something like this D200:[C205].

Share this post


Link to post
Share on other sites
Not sure if I understand but .... We have a counter C0 counting from 0-49. The timer just gives a nice interval. It copies these values to the index Z. It the uses this index to copy the values to D220 - D269. It also copies D220 + C0 to D0 And uses that value as the preset count for C1. PS. Some of my comments are full of typos. PPS. Are you sure you want the Mitsubishi forum? Edited by Veganic

Share this post


Link to post
Share on other sites
Depending on the Mitsubishi PLC you are using, you may have multiple index registers, in which case the "Z" in the above example would be replaced with "Z0" or similar. Index registers on the FX1N series, for example, are Z0 - Z7 and V0 - V7.

Share this post


Link to post
Share on other sites
TRYING TO CONVERT RSLOGIX INTO MITSUBISHI. I WANT THE COUNTER VALUE TO BE WHERE D200 IS LOOKING @. I WILL TRY THE ABOVE AND SEE WHAT I GET. TRIED ABOVE AND IT WAS NOT WHAT I NEEDED. Edited by CoolBreeze

Share this post


Link to post
Share on other sites
I think we are confusing the word indirect addressing. You want counter C205 to take its preset from D200 You would do the counter like this -----(C205 D200) and to get a preset in D200 you would do this -------[MOVP K50 D200] (it can be with the P or without - the P denotes a ONS)

Share this post


Link to post
Share on other sites
JUST THE OPPOSITE, I WANT THE D200 TO LOOK AT THE COUNTER PRESET. HERE IS AN EXAMPLE OF RSLOGIC: B203:0[C205.ACC], WHERE B203:0 IS LOOKING AT WHAT EVER THE INTEGER IS IN C205.

Share this post


Link to post
Share on other sites
I think I follow now. I haven't had the pleasure of using AB, but I've learned a bit hanging around on this forum! Mitsubishi counters (and timers, for that matter) are handled a bit differently. Say you have counter C0. That address is a contact, a coil, and a register, depending on how it is used in the code. Take this example: |--| X0 |---------( C0 K50 )--| |--| C0 |--------------( Y0 )--| |--| X1 |----[ MOV C0 D0 ]--| First rung sets up the counter to count input conditions (coil). Second rung uses the complete bit (contact) to turn on an output. Third rung moves the accumulated value (register) into another data register, perhaps for math or something. The preset in the example (K50) is a constant, and therefore isn't available for external use. However, if you use Goody's example, and put a data register in instead of a constant... |--| X0 |---------( C0 D200 )--| ...then you can use that register elsewhere in the program. It also makes the counter more flexible, allowing on-the-fly adjustability. Is that what you're driving at?

Share this post


Link to post
Share on other sites
Can you post a pic of the AB ladder you want to convert? I think we've covered most of what can be done with a counter, a D register and an indirect address other than: -----------( C0 D100Z0) Edited by Veganic

Share this post


Link to post
Share on other sites
Looks like you need to deal with the counter accumulated value and word "preset" in post #6 is a mistake. Either you need the counter accumulated value to be the indexing offset starting from D200, If so, after executing MOV C205 Z, your indexed address will be D200Z. Or, you need to read into D200 from a register, whose address is equal to the counter accumulated value. If so: MOV C205 Z MOV D0Z D200 Edited by Sergei Troizky

Share this post


Link to post
Share on other sites
I believe your first answer is what I want, I will post the AB ladder tomorrow when I get to work. On a different laptop. Basically what I'm trying to do is a scrolling fault message display. Where I made all of the bits in word D200.x an individual fault. then what I want to do is use a not bit(N.C.) to keep a counter counting. the not bit is the D200 & counter value. and the way i get the counter to stop is by having the next ladder line with a n.o. bit to a move command and a timer. so if D200.1 is on (or a fault is present) then the counter will stop on 1, for a certain amount of time, and then it will be displayed on a HMI. This is how I get a scrolling Fault display.

Share this post


Link to post
Share on other sites
The file is taking too long to download so here is my blind effort. I have ditched the the counter for an incrementing D1. The line of M bits is just to monitor the status. Note: this one is on a Q series. Edit: the Mov D0 D1 should be Mov K0 D1. Edited by Veganic

Share this post


Link to post
Share on other sites
I think Veganic has it. I did come up with a way to do this on an FX1N, but it takes more steps. You might consider just using a series of M-bits directly for your fault bits.

Share this post


Link to post
Share on other sites
As there is no bit indexing and bit-level access to word data in FX-series (except FX3U), you better specified your PLC model. Anyways, the most natural way is to use consecutive M bits. In such case the following will work on any Mitsubishi PLC. It scans cyclically bits M301-M399, writes an active message# (1 to 99) to D6, keeps it there for T32 timer time, then continues scanning. Bit M300 (message #0) means No Messages and activates when no active bits found. In such case 0 is written to D6. The program will affect bits M48 to M51, so do not use them for anything else. The program may be easily modified for as many scanned bits as necessary. PRINTOUT.doc Edited by Sergei Troizky

Share this post


Link to post
Share on other sites
Thanks! I will try it out, after looking @ it I believe this is what I want. I won't know until I get power on my PLC, and HMI. Unless there is away to Realtime my PLC and HMI? Does Mitsubishi do this. I have a Q Series PLC and a GOT1150.

Share this post


Link to post
Share on other sites
If you purchase GX Simulator, then you can use it and GT Simulator (comes with GT Designer) together to simulate the PLC/HMI system.

Share this post


Link to post
Share on other sites
This one works in fx (I think - not checked) just for completeness. There is no RND funtion so D200 values have to be created some other way. Whenever M0 is on the message to be displayed is in D1. Note: This is limited to 16 messages max. Edited by Veganic

Share this post


Link to post
Share on other sites
HAVING TROUBLE WRITING THE FUNCTION FOR LINE 1889 LINE #2 Edited by CoolBreeze

Share this post


Link to post
Share on other sites
X01 |--I/I----------------------------------------( M5040.1) | | M5040.(C205 ACCUMULATOR) *depends on how many faults are wanted to be used |--I/I-------I/I------------------------------[ + C205 K* ] |--I I---| C205 | T204 | | M5040.(C205 ACCUMULATOR) |--I I----------------------------------------[ MOV C205 D180 ] |``````````````````` | T204 |``````````````````` |-----I/I---------( T204 K500 ) | | C205 |--I I----------------------------------------( RST C205 ) | ** If no fault is present ( M5040.xx ), the counter will continually count and recount. ** This example shows that every time X01 goes off, it will turn on M5040.1, while @ the same time, when the counter reaches ( 1 ) which is indirected to M5040, it will stop the counter. Now what keeps the scroll going is the timer in the branch underneath it, and also sends it to the HMI ( 180 ). The timer will count which in turn will determine how long it is displayed on the HMI, and once the counter resumes it will reset the timer. I tried the logic in the above posts, but could not get it to work, so I hope this explains what I need better. I don't know if the M's should be D's. This logic will allow me to have multiple bits/words for faults. Edited by CoolBreeze

Share this post


Link to post
Share on other sites
Sergei's code is for the fx series. My 2nd one is for the Q series. They do the same thing, but Sergei takes it a bit further. My test code (RND and series M's) may only serve to confuse. The line you are struggling with should be as follows on the Q series: ----[MOV K1M300Z1 M48]. This is not absolutely necessary on the Q as you can "LD M300Z1 OUT M48". What is necessary is the change the M8000 to SM400, and the Z to say Z1. The M8000 is the 'always on' bit for the fx series. The SM400 is the 'always on' bit for the Q series.

Share this post


Link to post
Share on other sites
The instruction mentioned is necessary to bypass the lack of bit indexing in the FX-series. After its execution the M48 bit becomes an equivalent of M300Z (which is impossible in FX). As the Q-Series supports bit indexing, the instruction is not necessary anymore in my program and the bit M48 should simply be replaced by M300Z1. Z has to become Zx and M8000 to become SM400 as stated. Sorry for misleading, I did not mean that it will work on any Mitsubishi series without any changes. Edited by Sergei Troizky

Share this post


Link to post
Share on other sites
I TRIED THE LOGIC BUT CAN'T SEEM TO GET HAT LINE OF LOGIX TO WORK. IT SAYS DEVICE SETTING IS WRONG.

Share this post


Link to post
Share on other sites
----[MOV K1M300Z1 K1M48]. Oops. But, as stated, not necessary now. Edited by Veganic

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