question on displaying very small numbers

Discuss issues and ideas you have to configuring displays with PowerVision
drphil69
Posts: 139
Joined: Wed Mar 02, 2011 5:59 pm

question on displaying very small numbers

Post by drphil69 » Tue Jun 07, 2011 6:14 pm

Hello,

I am wondering how to display numbers out to 4 or more decimal places. I gather that the processor does not do floating point math, so I was trying to display 0.0345 by using x1000 in the calculation, 4 decimal places for the display value, and a divisor of 10000... but the divisor reverts to a max of 999. This is a value that changes, it can range from 0.0200 - 0.5000, and I need the last decimal place displayed. Any ideas? Any way to show a leading zero in the value... such that the value would show 0345 and I would just place a text object decimal point in front of it? I think with some programming (artificially add the leading zero if value <1000) but I am hoping for an easier solution.

Suggestion for next update, allow the divisor to go to at least 100,000. That would give me the 5 decimal places that I need on occasion.

Thanks!
Phil
bmcrae
Enovation Controls Development
Enovation Controls Development
Posts: 75
Joined: Thu Sep 09, 2010 11:20 am

Re: question on displaying very small numbers

Post by bmcrae » Wed Jun 08, 2011 4:29 pm

Phil,

You can definitely display numbers out to 4 or more decimal places. The display you have does do floating point math. There are a number of ways to do this. The Divisor is limited to 999 for gauges, but if you set you Small Increment to .0001 and the decimal places to 4 you will get 4 decimal places for a variable. Looks like from your question, that is all you really need.

To divide a whole number by 10000, the simplest thing is to use a calculated event. I have attached a simple configuration that one of our test engineers created to help answer this question. It displays a 4 decimal place variable. In this example, which is setup for a pv450 and is saved using 7zip, if you press the third button down on the left it will trigger the calculated event and divide the whole number by 10000 and display it correctly. You can do the same to multiply a number up by 10000.

You can also do floating point math in angelscript under the programming tab.

In the next update you will be able to add leading 0s in front of numbers for text gauges.

Thanks,

Brian McRae
Software Test Lead
FW Murphy
Attachments
4DecimalPlaces.7z
sample simple configuration showing calculated events
(1.62 MiB) Downloaded 13 times
drphil69
Posts: 139
Joined: Wed Mar 02, 2011 5:59 pm

Re: question on displaying very small numbers

Post by drphil69 » Wed Jul 06, 2011 4:44 pm

Hi Brian,

Thanks... I ASSumed it didn't do floating point math and that is why it had the divisor on the display area. That made it very easy...

I was on another project for awhile so just getting back to this.

Thanks again!
Phil