INT to Real Datatype Conversion

Hi,
can anyone help me out by guiding me how to perform INT to REAL Conversion..Pls It urgent
Most PLCs have a build in function block of sorts that will do that for you.
Not sure if you have read the help files or the manual but it is in there, give it a try.
 
I tried but i didnt find any in siemens we have some standard instruction to do so but i didnt find the same in control logix. can you please help me out with some other suggestion
 
What PLC? Every PLC does it differently...

Have you just tried a copy from your int into the new real??
 
I Made It On s7-200 U Have To Convert It From INT TO DINT Then To Real ,You Will Find This Instrctions In ''Convert'',Put In Your Mind To Display Number Eventually As A Floating Point Wherever You Display It Status Chart,Scada Software..etc
 
SS4884 - the MOV command moves the VALUE from the Source to the Destination. Thus with an INT Source and a REAL Destination you will perform the operation you requested.
 
SS4884 - the MOV command moves the VALUE from the Source to the Destination. Thus with an INT Source and a REAL Destination you will perform the operation you requested.
Sorry Bernie. But MOVE merely moves the content in a bitwise manner. There is no conversion.

In STL you write:
L "int_val"
ITD // convert to double-integer
DTR // Convert to real
T "real_val"

In LAD/FBD there are the blocks I_DI and DI_R.
Unfortunately they require that the result is stored in an intermediary address. So it is 'neater' in STL.
 
jesperMP - no, COPy is the bitwise mover that you are thinking of. MOV interprets the value of the source and creates that value (as close as possible) in the destination.

I may have not made this clear. based on SS4884's last post it appears he is trying to sent an INT to a REAL in ControlLogix. It is for that platform that I made my staatement.
 
SS4884 - the MOV command moves the VALUE from the Source to the Destination. Thus with an INT Source and a REAL Destination you will perform the operation you requested.
Bernie is right.
In CLX all you need to do is MOV the (integer value) which will be the SOURCe to a (real value) which will be the DESTINATION.
No additional conversion is needed, CLX does it automatically.
 
I tried but i didnt find any in siemens we have some standard instruction to do so but i didnt find the same in control logix.
Reading this again, I am not certain if he used to work with CLX and is now working with S7, or it is is vice-versa. I just love it when someone post so ambigously.
 
Try this

In siemens..there is no direct conversion methods..but you have STL commands like ITD - Integer to Double

and DTR - Double to Real



Hi,
can anyone help me out by guiding me how to perform INT to REAL Conversion..Pls It urgent
 

Similar Topics

Hi all. Me again still learning Rockwell. So I'll be polling an INT data array from a Modbus SE power meter with a L82 (with a Modbus ProSoft in...
Replies
56
Views
1,211
I seem to be making this harder than it should be, and Its not making any sense. I simply need to move a real variable to two integer variables...
Replies
8
Views
917
Situation: Single [EQU] instruction with single [OTE] on a rung, nothing else/simple. [EQU] operand(A) is a real number data type...
Replies
16
Views
2,557
I work at a cheese factory and we recently ran into a problem where in an older controller they where able to use a REAL Data type in OTU and XIC...
Replies
13
Views
2,402
Hello I have a question about SCL if I have a real value like valor: INT I would do valor : = 1.5 Or this trhow me an error? How can I save...
Replies
6
Views
1,655
Back
Top Bottom