Sign in to follow this  
Followers 0
mhowasso

MicroLogix 1400 Thermocouple Input

5 posts in this topic

Hi All, I'm using a MicroLogix 1400 with a 1762-IT4 Thermocouple module and I have my SCP instruction values set per manual. How can I use a CPT instruction to add an offset value for accuracy and carry out to .xx decimal points..?? Thanks

Share this post


Link to post
Share on other sites
To use the "CPT" instruction. ( Temperature+Offset)=New Temperature You can use the "SCP" instruction to give you your decimal places with a floating point as it's destination. You can add an offset with a simple "ADD" instruction. You can also configure the card to give you "Engineering Units x 1 or x10".(Temerperature value directly) Edited by Mickey

Share this post


Link to post
Share on other sites
Hi Mickey, I did what I think you are saying to do. (See attached file) I put the values Im using in the rung comments. I used Eng Units X1 for Channel 0, and Eng Units X10 for Channel 1 so I could see the differences. BUT...Im not getting my final values to be only displayed to 2 decimal places. They currently go as far out to 5 decimal places. I was thinking I could cure this in my CPT expression, but maybe not. And I guess if I tag this value in an HMI then I can limit the value to 2 decimal places. But Im curious how I can do this in my PLC program. I know its just me not seeing the forrest for the trees. Any suggestions would be appreciated. Also, in the I/O Config, under the Generic Extra Data Config Tab. What is this Offset for..??? Should I zero these out..??? Thanks THERMOCOUPLES.RSS Edited by mhowasso

Share this post


Link to post
Share on other sites
If you only want to "Display" two decimal places then that will have to be done in your HMI.

Share this post


Link to post
Share on other sites
The number has even more digits after the decimal than just the five shown by the Logix500 software. The number of decimal places is dictated by the IEEE 754 floating point number format used to represent real numbers in binary. The number will be represented as accurately as possible within a 32 bit frame. You can multiply the number by 100 and store it in and integer or long integer and infer the two decimal places. However, IIRC, your T/C module is capable of returning the temperature in .1 degree units, so the two decimal point resolution is basically meaningless. You might think you are seeing higher resolution but you are not. For example, the number .2 cannot be represented exactly in a computer. If can be .1999999999999999999 but not .20. The software that displays the number on your computer screen contains sophisticated algorithms to recognize this shortcoming and display .2, but in memory you still have .1999999999999999999. Logix500 software dutifully reports what is in memory, so you may be under the illusion that you have higher resolution. This is where your judgment as a programmer to recognize meaningful resolution comes in. If you set the HMI to display the correct amount of decimal places (in this case just 1) it can reflect the fact that you only have .1 degree resolution. For simple one operand addition the ADD instruction is much more efficient than the CPT instruction. It executes considerably faster - and unlike the CPT instruction it shows what is in each register, which can be handy sometimes during troubleshooting and debugging. Use the CPT instruction when you have multiple operations ((A-B)/(C-D)) to do - CPT is more efficient then because it doesn't have to do any intermediate writes to memory. Edited by Alaric
2 people like this

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