Sign in to follow this  
Followers 0
Guest llrelease

Working with Analog Inputs and Micrologix

6 posts in this topic

I am developing an application in which I will utilize a Micrologix 1200 PLC and a IT4 thermocouple input module. I have configured the controller and the module and I am able to monitor the temperature at one of the inputs by means of the input table. The analog input data is displayed in the form of a word for each of the 4 inputs. Bit 0 is the least significant bit and bit 14 is the MSB. Bit 15 is the sign bit. In the module configuration, I can specify raw or engineering units as well as the T/C type. What is the best way to convert the words to integer or floating values so that I can work with them (perform averaging, compare to limits, etc.). I am thinking that the first step would be to create an array in the integer or floating point files and write current values to the array, but I am not sure how to do this. I am also not sure this is the way to go. Perhaps I could use scaling functions and specify the output to be a word in the integer or floating point files. I am not looking for a solution, but rather a direction. Any help would be appreciated. Thanks in advance!

Share this post


Link to post
Share on other sites
If I understand your question you would like to move your data from the I "Input File" to a N "Integer File" or a F "Floating Point File" so you are able to use the data in a Ladder Logic capacity using the entire word..... There is no reason to have to convert to integer or Floating point data, you can use this data addressed to the word value of the input like "I:1.0". But if you want to copy to an Integer or Float file, use a Fill File "FLL", specify the beginning source "Your Input" the destination source "Your "N" or "F" file", and then a length of 4. This will transfer your input data to which ever file you specify whether an N File of F file. Change your Radix in the Input table data to Decimal instead of Binary to see the Dec. Value of your input, assuming you are using RSLogix 500. JJ Edited by TechJunki

Share this post


Link to post
Share on other sites
Thanks TechJunki. I knew I could change the radix and view the current value as a decimal, but I forgot that I could use the word from the input table in a comparison function (for example) and compare it to a decimal constant. I.E. there is no need to convert the value to integer or floating point. This solves part of my problem. If I wanted to average the last n readings, how would I do this?

Share this post


Link to post
Share on other sites
Be nice if there was an Average fuction, the following example is the easiest way I can think of... This program will average the Last five readings from the thermocouple and store that value in F8:1. If you would like to average more readings simply increase the FIFO length but beware not to overwrite N7:10 and 11, these will need to be changed if averaging more that 10 values. Average.RSS Edited by TechJunki

Share this post


Link to post
Share on other sites
There is an example for averaging many numbers in the download section: http://forums.mrplc.com/index.php?act=Downl...&CODE=02&id=339 It uses indexed addressing and a for next loop. The example has 100 entries, but could be modified to do n entries very easily. Ken

Share this post


Link to post
Share on other sites
Both examples were very informative. Thanks for the help!

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