hannah Posted January 17, 2013 Report Posted January 17, 2013 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
Geir Posted January 17, 2013 Report Posted January 17, 2013 Hi, you need to check out the APR instruction, somewhere in this thread there is an example program. Geir
gtsuport Posted January 17, 2013 Report Posted January 17, 2013 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.
Michael Walsh Posted January 17, 2013 Report Posted January 17, 2013 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
hannah Posted January 24, 2013 Author Report Posted January 24, 2013 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
pfort Posted January 24, 2013 Report Posted January 24, 2013 (edited) With a compare instruction, if CIO2001 >= #F000 (Negative value) then you write 0 as result. (MOV &0 in D5) Edited January 24, 2013 by pfort
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now