Sign in to follow this  
Followers 0
Poppachoppa

FX2N-32MR with FX2n-4AD

7 posts in this topic

Hello all. Hoping someone can help. I am quite familiar with other makes of PLC but not so much with Mitsubishi. I am using Melsoc Medoc Plus version 2.32. and the above PLC configuration. I have managed to access the built in digital I/O, but I am failing miserably at accessing the four analogue channels. Can someone point me in the right direction or an example? I've looked through pages of manuals but can only find code for an older (or newer) programming software. I am using Ladder Logic, wish to read the four analogue inputs as o-10V. Thanks in advance,

Share this post


Link to post
Share on other sites
Here's a document for the FX2N-4AD http://www.beijer.se/web/BExFilePileAUT.ns...2N_4AD_verC.pdf There are a set of settings you need to do before you start collecting data. First you need to make sure what channels you are using and configure if you are going to use 4-20mA, -10 to +10V, -20mA to +20mA or not to use the channel at all. You do this by sending a command to the 4AD unit with the "TO" command. I don't have Medoc infront of me, but will be infront of it before the end of this day. You need to find the TO command in the menus of Medoc (might have to use the [] command and write TO) then send the Hex value according to the manual on page 4 (for Example H3330 to use channel 1 as -10 to +10. The TO command would look like this -> TO K0(1) K0(2) H3330(3) K1(4) (1) Module position (first expantion module would be 0, second would be 1 and so on) (2) The BFM (Buffert memory) where the "setting" is stored in the module. (3) The setting we are sending to the module as explained above. (4) Number of 16bit you want to send, as we are sending H3330 is 13104 in decimal form and 16bit is as you know 32767 so we only need one 16bit word to be sent. You might also want to chose how many readings an avarage value should be based on. This can be good if your "process" isn't steady, this way it can base the value of the last n of readings to give you an avarage. This is done with BFM #1 for channel 1 (#2 for channel 2 and so on) by sending the value of the number of readings it should be based on. For example if you want to set it to 10 readings you would make a TO like this: TO K0 K1 K10 K1 Thats everything thats needed to get started besides the actual part where you gather the value. For this you need to use the FROM command to gather the AD value. As of the manual the value is stored in BFM 10, 11, 12 and 13 depending on what channel we use by the setting we did above. As we said we wanted to gather -10 to +10 V on channel 1 we have to use BFM #10 So the command would look like this: FROM K0 K10 D10(1) K1 (1) The registry we want to save the value to that we gathered from the module. It's the same order as before. First K is module position, Second is BFM which we agreed (i hope) to be #10 and (1) has been explained and the last K is the number of 16 bit words we want to gather, as the module is 12 bit we only need one. Hope that helped. Regards Alex

Share this post


Link to post
Share on other sites
Thanks Alex for the quick reply. I sort of understand your answer, but I don't know how to get the ladder page to allow me to put the data in that format. When I access the instruction list I can find FROM_M which then gives me a block on the ladder page with EN, n1, n2, n3 as inputs and ENO and d as outputs. From what I can find, the output (d) is where I put/store the analogue value, the inputs (EN) is an X value (but I don't know what), n1, n2, n3 ? All I need to do is gather the 4 values, with no averaging as the input is very stable. Hope that makes some sense, Richard

Share this post


Link to post
Share on other sites
Sorry, it clicked in my brain when you said Medoc, I instantly thought you ment the DOS version and didn't notice it said "Medoc Plus". Never used Medoc plus, that does however look alot like GX IEC Developer. And FROM_M is the correct command. Now the problem is that I don't have such a program where I'm at not so I'm not sure of the exact order of n1,n2,n3. Is there a posibility to press F1 when you select the FROM_M in the ladder view? Do you get an explantion on the command? Or parhaps there's a place on the Help menu to vew "commands", it won't say "commands" it will most likley say something else. Try serching for "FROM". The TO command is also called "TO_M". And you're correct that "d" is the output data register, where I used D10. And EN stands for enable, this can be a memory bit (for example M1) and Output (so when the out put is 1 it will be true and trigger EN) such as Q1 or a Input bit such as X1. Will check Beijer.se to see if i can find a manual on how to configure FROM and TO commands. Edited by Alexander K

Share this post


Link to post
Share on other sites
TO instruction: s: What to send to the module n1: Module position n2: BFM n3: Number of 16 bit From d: Where to store the value gathered n1: Module position n2: BFM n3: Number of 16bit Regards Alex

Share this post


Link to post
Share on other sites
Thanks Alex. It's now talking. Not sure exactly why I set M1 always on as the enable. n1 to 0 n2 to 9 n3 to 4 d to D10. Have tested it and all four channels read to D10-D13. I can understand it all except n2 being set to 9. Really appreiciate your help, saved some of my hair Just had a look at the manual again... BFM 9 is present value currently being read for channel 1.. Thanks again

Share this post


Link to post
Share on other sites
You're welcome, lern alot myself about help others so they are able to understand what I mean, it's easy to go to fast forward and not go in to more detail when it's detail that's needed. EDIT: Looked at another manual and indeed it said #9 #10 #11 #12 there, I had the problem another time, need to be the right version, which was hard this time as I didn't have it infront of me. Remember one time with a high speed counter where I struggeled for an hour before I realiced it might be an old version manual, this was the case and it only took two minutes to get it working with the right manual Edited by Alexander K

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