Sign in to follow this  
Followers 0
308guru

Help needed with getting value from analog card

16 posts in this topic

I have an analog card (FX2N-2AD) hooked up to my FX1N. I have never used an analog card before. What code do I need to put in the program to get the 4-20ma value from the card? What I want to do is check to see if the value falls within some predefined ranges and then turn on certain outputs based on that condition. How do I "look" at the current value? Any help is appreciate. I tried some code that was in the manual but it wasn't doing anything for me. Thanks! Mike

Share this post


Link to post
Share on other sites
The FROM instruction must be used in your program to move the analog value from the buffer memory of the card into the CPU For instance, if your analog card e.g. a FX4AD is the first special card connected to the plc (K0), and the analog is connected to channel 1 (K9) and you want the value to appear in D10, the instruction would be: ----[FROM K0 K9 D10 K1]---- The buffer memory can be monitored directly using GX developer with the "Buffer Memory Monitor" function. Attached is the FXAD manual Hope this helps FX4AD.PDF Edited by navillusi

Share this post


Link to post
Share on other sites
I tried that and it didn't work. Do I have to tell the plc somehow that there's an expansion card? Is there any diagnostic function that tells me it's working ok and hte PLC knows it's there?

Share this post


Link to post
Share on other sites
An fx does not need to know if there is an expansion attached. If you tell me the plc model and exp model Ill post you a piece of code. medoc or gx ? oh yeah, and the if there r any other modules attached

Share this post


Link to post
Share on other sites
FX2N-2AD hooked up to my FX1N-14MR-ES/UL. I'm also using the RS232-BD but that is mounted directly on the PLC. Nothing other than those two. I'm using GX-DEV FX V7

Share this post


Link to post
Share on other sites
ill email u someting in the morning, I'll wake the missus up if i go out to car this time of night :)

Share this post


Link to post
Share on other sites
There is functioning example code in the manual for the FX2N-2AD. Check the manual, which you can get from www.meau.com, or see attached. The 2AD module takes a bit more code than the 4AD. You have to read the analog values in one byte at a time instead of one word. I typically use the 4AD for my projects, bt it's resolution is 0-1000 for current and 0-2000 for voltage, where the 2AD is 0-4000 for both. JY992D74701_D.pdf

Share this post


Link to post
Share on other sites
Chris, that's exactly the code I've been trying: X000--------------[T0 K0 K17 H0000 K1 ] |------------[T0 K0 K17 H0002 K1 ] |------------[FROM K0 K0 K2M100 K2 ] |------------[MOV K4M100 D100 ] When I enter H0000 and H0002 it automatically changes it to H0 and H2. Should it? I don't get anything in D100 (in device monitor) though. Power light is on in the 2AD, but I was wondering if there is some other way to verify that it's working properly?

Share this post


Link to post
Share on other sites
Hi mckeand13, Try going to "online|monitor|buffer memory batch". Enter module 0, start address 0. (dec). Scroll down to address 30. You should at least see a value there. Usually all special cards have an id in that BFM. This is a start to see if the card is connected and ok. Also, check the connections after verifying the above. Make sure that the V&I signals are bridged if using current input. Good luck.

Share this post


Link to post
Share on other sites
I checked everything over and all seems ok. I am using the current input and have the jumper between the VIN1 AND IIN1. When I go to online|monitor|buffer memory batch monitor, put in 0 and 0 I get an error when I "start monitor" It's attached as a pic. Edited by mckeand13

Share this post


Link to post
Share on other sites
I went to Diagnostics on the menu bar and clicked on Run Diagnostics. There is one error in the list but I don't know what it means. See attached pic.

Share this post


Link to post
Share on other sites
Then it must mean that the module is not connected to the PLC. Darn!!! I checked the docs now, it does not look like this module connects to the FX1N PLC. They mention FX0N, FX2N and FX2NC. Maybe this is the reason. Best to try another AD card. Maybe the FX1N-2AD-BD card is your alternative. They are cheap. Also, offers 12-bit resolution. First check if the module is plugged in ok (right hand side of PLC). Maybe you are lucky. Good luck

Share this post


Link to post
Share on other sites
Might be that this card is not ok. Will look a bit deeper.

Share this post


Link to post
Share on other sites
Mike, I have had a deep look through the GX Developer manuals. There is no mention of the "PLC/PP comm err" that you are currently experiencing. First of all, if the module is correctly connected; disconnect it to see if the error goes away. Just to see if the compatibility is not an issue. If the error stays, we have got some big trouble. Hope it is only a compatibility issue.

Share this post


Link to post
Share on other sites
Well, I unplugged it, did some other work on the enclosure, plugged it back in. The error is gone and the analog card is working. I was on the phone with the supplier and he was thinking that Buffer Memory Batch Monitor was not supported by the FX1N and may have been causing trouble when I tried it. Works now, that's all I care about. Although it's always nice to know what not to do again and what caused it. Thanks for all the help!!!

Share this post


Link to post
Share on other sites
The manual says it shouldn't work ....... scary!!

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