Sign in to follow this  
Followers 0
netdomain

REAL NUMBER IN GT DESIGNER

4 posts in this topic

Hi, Anyone else having this problem? When I try to enter a real integer in Gt Designer/Gt Simulator, it doesn't let me. I chose 32 bit , as real integer field in Numeric Display, Numeric Input. But lets say when I enter 32.33 it just accepts 32.00 and not 32.33. Can someone try this and tell me if it works or there is a bug in Gt designer 2? Thanks.

Share this post


Link to post
Share on other sites
Not a bug, just a little lack of clarity on the part of GT Designer. There are actually three things you have to do to get a Numerical Input/Display to read and write "real" numbers. I'm qualifying the word "real" because unless you want to get a headache, you should try to stick to integers (numbers with no decimal place) for reading and writing purposes. True real numbers in a PLC is called "floating point", and can be a bear to work with. There is a simpler way that works for most applications. You've probably already done this, but for other readers, here's what I mean. Say you want to display a temperature value on your GOT with two decimal places. You designate a data register in the PLC where you store the temperature value in units of 1/100 of a degree. So the data register will always be an integer. Now, for all your math operations, just remember that you're working in 1/100 degrees instead of just degrees. Simple two decimal place math without hurting yourself on floating point. Assuming that you've done this, here's how to get the GOT to enter and display the number properly. 1. Set your Input/Display to Real and your decimal point to "2". This sets up the display to show the number with two decimal places. But the GOT is still reading and writing integers, so you never see anything in those places but zeros. 2. Check the Data Operation box at the bottom of the setting window. This will create a new tab for modifying the data you are inputting/displaying. In the "Data Operation" area, with the "Monitor" button depressed, set up this formula: $$(Device Value) / 100 This will divide the integer in the PLC by 100 before displaying it on the GOT. Now you will be able to see decimal values. 3. Now depress the "Write" button and set up this formula: $W(Device Value) * 100 That will take the two-place decimal number in the GOT, and multiply it by 100 before sending it to the PLC. Now you can input decimal values. All done! The layout is a little unclear, and not simple for simple data operations, but the divided parameters allow you a huge variety of things you can do.

Share this post


Link to post
Share on other sites
you can use either fixed point or floating point (REAL or REAL32 is commonly used for single precission floating point). if you want to use REAL on GOT, you must set it not just in BASIC but also in EXTENDED tab. Same works for both numberical display as for numerical data entry...

Share this post


Link to post
Share on other sites
Thankyou very much!!!! It worked!!! Saved me so much headache. :))))

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