getting the fraction part of a divide function

jtokash

Member
Join Date
Feb 2007
Location
New Jersey
Posts
3
Hello!

I am simply trying to convert a distance in inches to feet showing the number of feet with the fractional part just displayed as .xxx. I do not need to convert the .xxx to inches as I will be using the number to calculate square feet (I am also taking a width measurement in inches that I need to do the same for). I am using an automationdirect DL-06 microplc. I have tried using double word and floating point division with BCD numbers, floating point, etc... but whatever I try all I get in the V memory location I output the result to is the whole number part of the calculation, not the fractional part at all. I need to be able to get that fractional part to get an accurate square footage of the material I am measuring. Any ideas?

Thanks in advance!
 
First - convert your inch measurment (whole inches?) to a REAL number. I'll assume that the inch measurement is in BCD. let's say your inch measuremtn is in V2000. We'll leave the REAL output in V2002/V2003

LD V2000 - INCH MEASUREMENT BCD
BIN
BTOR
DIVR R12.0
OUTD V2002 - THE DISTANCE IN FEET

Make sure that when you view V2002 (either in DirectSoft or on a display) that the format is REAL (FLOAING_POINT32 on EZ-Touch and CMore)
 
Do you have a "MOD" or "MODULO" function, if yes it will return the "Remainder" of a "Divide" function.
 

Similar Topics

Hi how's it going. Was just wondering if someone could help me out. Recently one of the guys over on the LinuxCNC forums put me onto getting an...
Replies
15
Views
333
The application was working in Twincat 4022.16 Used VM for offline. recently changed the laptop and the getting the error with Message as below...
Replies
0
Views
84
We are using wincc scada WinCC system software V7.5 SP2 , connected to few plc . Past 3 weeks we getting this alarm continously when we checked...
Replies
0
Views
115
I am very, very new to PLCs. I only have experience with Picos, but I knew enough to save this from the dumpster. Apparently, everything on it is...
Replies
13
Views
711
Hi, I tried today to get RD3A and WR3A instructions to work on the PLC and it didn't work, but it worked in simulation. I followed the clone...
Replies
18
Views
1,522
Back
Top Bottom