Sign in to follow this  
Followers 0
hannah

Analog signal problem

6 posts in this topic

Hi Experts!! I am new in cx programmer software of omron. my question is: I have 4-20ma input signal for analog module (ad081-v1). I need to display 0-100%: when the signal is 4ma=0%, 20ma=100% etc. how can i do this? Can you please make me a sample ladder program? Thank you for your help.. i really appreciate it. God bless

Share this post


Link to post
Share on other sites
Hi, you need to check out the APR instruction, somewhere in this thread there is an example program. Geir

Share this post


Link to post
Share on other sites
If it is strictly linear, the SCL instruction will work also. You have not told us what processor you are using. Please review the manual for both of these instructions and post your program if you are still having problems.

Share this post


Link to post
Share on other sites
Personally, I like to use function blocks for this type of thing. In the picture below, I am showing the use of a function block that I wrote. It allows you to input the analog signal address, the low and high point to which you are scaling (0 to 100 for the percent example) and the maximum value of the analog input (4000 or 8000 for the AD081). The function block provides the scaled value in three different formats (Real, Integer and BCD). Normally, you would pick one of these formats and use it, but I have shown it with all three formats assigned to addresses below: Normally, I don't like just giving code to people because it does not give them a chance to figure it out on their own, but creating you own function block is a step beyond the basics. The code should allow you to learn how to apply function blocks. I will add it to the downloads area and come back here and provide a link. The files can be found here: http://forums.mrplc.com/index.php?app=downloads&showfile=996

Share this post


Link to post
Share on other sites
i am using AD081-v1 module. here is the parameter i've entered to SCL function: s = 2001 p=d1:// d1=0 d2=0 d3=100 d4=fa0 r=d5 my problem is when the input of cio 2001= &-127 the result will be 100. supposed to be it must be at 0 value. what will i do inorder to get the 0 value when its negative? thank you

Share this post


Link to post
Share on other sites
With a compare instruction, if CIO2001 >= #F000 (Negative value) then you write 0 as result. (MOV &0 in D5) Edited by pfort

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