![]() |
||
|
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
| ||
New Here? Please read this important info!!!
|
|
#1 |
|
Member
![]() Join Date: Mar 2009
Location: Chennai
Posts: 9
|
INT to Real Datatype Conversion
Hi,
can anyone help me out by guiding me how to perform INT to REAL Conversion..Pls It urgent |
|
|
|
#2 |
|
Member
![]() Join Date: Oct 2005
Location: Chicago
Posts: 1,382
|
|
|
|
|
#3 |
|
Member
![]() Join Date: Mar 2009
Location: Chennai
Posts: 9
|
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
|
|
|
|
#4 |
|
Member
![]() Join Date: Mar 2006
Location: Kansas
Posts: 1,670
|
What PLC? Every PLC does it differently...
Have you just tried a copy from your int into the new real?? |
|
|
|
#5 |
|
Supporting Member
![]() Join Date: Nov 2006
Location: UK
Posts: 4,555
|
If it's Siemens S7-300, you have to convert INT to DINT, then DINT to REAL.
|
|
|
|
#6 |
|
Member
![]() Join Date: Mar 2009
Location: cairo
Posts: 27
|
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
|
|
|
|
#7 |
|
Lifetime Supporting Member + Moderator
|
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.
__________________
Controlling outputs is the PLC's way of getting its inputs to change. www.thePLCguy.com |
|
|
|
#8 | |
|
Lifetime Supporting Member + Moderator
|
Quote:
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.
__________________
Jesper
|
|
|
|
|
#9 |
|
Lifetime Supporting Member + Moderator
|
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.
__________________
Controlling outputs is the PLC's way of getting its inputs to change. www.thePLCguy.com |
|
|
|
#10 | |
|
Member
![]() Join Date: Oct 2005
Location: Chicago
Posts: 1,382
|
Quote:
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. |
|
|
|
|
#11 |
|
Lifetime Supporting Member + Moderator
|
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.
__________________
Jesper
|
|
|
|
#12 |
|
Member
![]() Join Date: Mar 2006
Location: Kansas
Posts: 1,670
|
|
|
|
|
#13 |
|
Member
![]() Join Date: Mar 2009
Location: Chennai
Posts: 9
|
Thanks bernie i tried as you suggested,It works
|
|
|
|
#14 |
|
Member
![]() Join Date: Mar 2009
Location: India
Posts: 9
|
Try this
|
|
|
|
#15 | |
|
Lifetime Supporting Member + Moderator
|
Quote:
__________________
Controlling outputs is the PLC's way of getting its inputs to change. www.thePLCguy.com |
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Topics
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Confused "again" S7 indirect | Thim | LIVE PLC Questions And Answers | 17 | July 22nd, 2008 04:47 PM |
| Step7 INT to REAL conversion | Levanteri | LIVE PLC Questions And Answers | 3 | February 14th, 2008 11:49 AM |
| Not able to understand this S7-code | drspanda | LIVE PLC Questions And Answers | 8 | November 13th, 2007 12:06 PM |
| Ideas needed for Siemens S7 program | tesalmin | LIVE PLC Questions And Answers | 12 | March 4th, 2004 12:40 PM |
| Ab SLC FLOAT to Double Int Conversion | wirehead | LIVE PLC Questions And Answers | 10 | March 29th, 2003 09:56 AM |