displaying fractions

escoplcguy

Member
Join Date
Jun 2010
Location
New Jersey
Posts
191
Hey guys, im working on another measuring program, this time they want me to display the fraction equivalent of the decmal that is currently being shown. what i did was subtracted the whole number out of the measurment reading and used 8 different bits to represent their fractional equivalent. on the HMI (rsview32) i displayed the whole number and left out the decmal then have 7 different fractions that use visibality based upon their corresponding bit. If none of this makes sense i will post a piece of the ladder.

so my problem is, we log 9 different points....in order to show the fraction part of the decmal do i need to set this up 9 different times using 72 different bits??? or is there an easier way to get this task done.....this program is not finished there are 2 lines that will be added and they will use the same PLC...as you will see "line1 or line2" so if it was 72 bits that would end up being 216 and i need to conserve as much space as possible.

alot of times i will write tons of code cause it was how i thought about it in my head then look at it and think...."hmm, if i did this i could have saved so much memory and much less rungs"


Thanks guys!


file posted is a logix500 file......i am using a SLC processor.
 
One way is to get the integer portion of the distance and subtract it from the whole number to get the decimal portion. Then you could use a look-up table to get the nearest 1/8" or whatever resolution you want.
 
i think that is what i have already done. found the whole number subtracted it from my floating which gave me the decimal form of the number then had a series of bits (were only looking for 8ths) so i had 8 bits with a great than and less than instruction before it..trying to see how i can maybe simplify the ammount of bit for 9 different readings.
 
If i understand you correctly, you want to simplify the plc / display programming.
1. copy the information into a data file for processing.
2. process those regesters and store that information into another data file.
3. program the display to look at step 2 registers.

regards,
james.
 

Similar Topics

I wish to display machine position measurements for setup people when changing between different products. This being the 'good ole USA', where...
Replies
102
Views
23,574
paul c
P
Hey everyone and anyone that can lend a helping hand. I have a project that I am being asked to add some animations of Solidworks or "3D" models...
Replies
9
Views
333
Using FTview ME to create an HMI screen. Simplest task is giving me trouble. How do I create an HMI tag that will allow the name of the current...
Replies
3
Views
132
Hello Folks, plc : micrologix 1500 The analog output from the loadcell is given to the plc. Using the SCP function I have scaled it into an...
Replies
3
Views
763
Hi Everyone, I am hoping a Red Lion Expert can point me in the right direction. I am experimenting with data logging on a CR3000 10" screen...
Replies
4
Views
603
Back
Top Bottom