decimal numbers

Azi

Member
Join Date
Nov 2007
Location
Canada
Posts
1
hey,

im trying to extract the 3rd decimal digit from a number using RSLogix 500. but i have no clue how to do it.

lets assume that the number is 5.059835

what i want to do is take the 9 and copy it to its own N7:X block

now, my number is going to change once my timer ends, so it is not constant. does anybody have an idea on how to do this?

thanks
 
Azi
Look up SLC Instruction help on the COP instruction which will get your floating point number to a string format. then depending on the position of the of the digit from the left look at the ASCII String Control instructions AEX and the ACI

Hooey
 
100*abc.defg - (100*abc.defg rounded down) = 0.fg.
10*(0.fg) rounded down = f.

I think this should do it, but my brain hurts a little this morning.
 

Similar Topics

why are octal and hexidecimal numbers used in the implementation of plc and microcomputer systems?
Replies
2
Views
5,969
In S7/TIA Portal, is there a function to round a real to a specified number of decimal places? e.g. If I have 22.519432 and I want to round it to...
Replies
16
Views
1,810
I am using a Micro 850E PLC (the new one with implicit messaging capability) to drive a Kinetix 5100 servo drive. The error code number on the...
Replies
7
Views
1,687
I'm using numeric input enable link tag to PLC DINT type. What I want is for the example in the panel view user will input 350.568 (and shown on...
Replies
1
Views
1,128
Hello, I have a SINT array I am receiving and one of the positions of this array contains the direction of the product. Inside the ladder...
Replies
4
Views
1,113
Back
Top Bottom