Sign in to follow this  
Followers 0
GlennP

data registers

10 posts in this topic

Hi there, I am in the proces of converting AB code into Mitsibushi FX2n. This site has been invaluable so far. There is one thing i haven't been able to find and that is how can I set a bit in a data register. eg in AB I can use N7:0/0 and at the same time use N7:0. can i set D1000.0 or something like it I know i can set an auxiliary relay and then use a [MOV K4M1000 D1000] but this seems to be a long way round If it is in the manual, it is hiding from me. any info would be helpful

Share this post


Link to post
Share on other sites
There is no bit level access to data registers. You can use logic OR with a word containing 1 in position(s) you want to set (WOR instruction). Or logic AND with a word containing 0 in position(s) you want to reset. All other bits will remain intact. For example: WOR D1000 H4 D1000 will set bit 2 in D1000 (H4 is binary 100) WAND D1000 HFEFF D1000 will reset bit 8 in D1000 (HFEFF is binary 1111 1110 1111 1111). I am curious what is a need to access data registers on bit level? I never needed this in my 15 years with PLCs. Edited by Sergei Troizky

Share this post


Link to post
Share on other sites
Personally, I always found it harder to remember addresses when moving from Mitsubishi to Allen Bradley. I always found it easier to remember M100 than N57:5/0, especially regarding the syntax and the fact that there is more than one way of addressing the Allen Bradley bit. Makes my head spin on occasion. Interestingly, with IEC Developer and Control Logix, both software packages have now moved away from being address based and are now name based, where the names are assigned to addresses in a Global Variables part of the software, and meaningful names can now be applied to individual bits and data registers. Makes life a lot easier

Share this post


Link to post
Share on other sites
GlennP, the functionality you are after is available in the System Q and FX3U range of PLC's. I remember when I programmed between AB and Mits that the AB plc had the power of accessing bits in words. Even the old dreaded Modicon PLC's had it (still 984 ladder lagic) using the SENS instruction. Anyway, maybe a FX3U would have made the move easier!!!

Share this post


Link to post
Share on other sites
When i have multiple processes that are use the same code, on one PLC all i need to do is copy the existing code into new subroutines and then search and replace, say, N11:* with N12:* and then I have the code for another process.

Share this post


Link to post
Share on other sites
But what it has with setting individual bits in data registers? They are intended to be used for numbers in Mitsubishi. Why not use M if you need individual bits? Edited by Sergei Troizky

Share this post


Link to post
Share on other sites
all my data is in the one data range which makes it easy. I am used to the AB way of doing things and am merely converting the AB PLC code to mitsibushi. cheers

Share this post


Link to post
Share on other sites
I agree it would be much easier to just use the M bits instead of trying to use bits within the D registers. Of course you can MOV D0 K4M0 to move D0's 16 bits to M0-M15. But I would just use M bits for bit level and D registers for numeric data.

Share this post


Link to post
Share on other sites
If you have a SCADA which reads a large amount of data over a serial (or slow) link, it is worth the while compacting the bits into words.

Share this post


Link to post
Share on other sites
agreed, packing is way to go. i try to use one block for read and one for write (to and from HMI). i see very often where people dedicate range of memry for HMI comm. but mix them up so transfer times are still slower (to and from hmi bits are mixed up). i think FX doesn't allow bit wise addressing of D registers while this is supported on bigger plcs. even there this is still a problem because one cannot individually comment them and program without comments is not something i like to see. i would use M devices for bits regardless where they are used. if it is paramount to have everything in one block of memory, i would simply copy smaller block of M bits into transfer block made out of D registers.

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