You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old March 23rd, 2009, 04:47 AM   #1
ss4884
Member
India

ss4884 is offline
 
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
  Reply With Quote
Old March 23rd, 2009, 04:50 AM   #2
bkottaras
Member
United States

bkottaras is offline
 
Join Date: Oct 2005
Location: Chicago
Posts: 1,382
Quote:
Originally Posted by ss4884 View Post
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.
  Reply With Quote
Old March 23rd, 2009, 05:05 AM   #3
ss4884
Member
India

ss4884 is offline
 
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
  Reply With Quote
Old March 23rd, 2009, 05:08 AM   #4
OZEE
Member
United States

OZEE is offline
 
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??
  Reply With Quote
Old March 23rd, 2009, 05:45 AM   #5
L D[AR2,P#0.0]
Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
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.
  Reply With Quote
Old March 23rd, 2009, 06:12 AM   #6
speedcat
Member
Egypt

speedcat is offline
 
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
  Reply With Quote
Old March 23rd, 2009, 09:18 AM   #7
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is offline
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 4,624
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
  Reply With Quote
Old March 23rd, 2009, 09:31 AM   #8
JesperMP
Lifetime Supporting Member + Moderator
Denmark

JesperMP is offline
 
JesperMP's Avatar
 
Join Date: Feb 2003
Location: Copenhagen.
Posts: 10,888
Quote:
Originally Posted by bernie_carlton View Post
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.
__________________
Jesper
  Reply With Quote
Old March 23rd, 2009, 09:38 AM   #9
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is offline
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 4,624
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
  Reply With Quote
Old March 23rd, 2009, 09:51 AM   #10
bkottaras
Member
United States

bkottaras is offline
 
Join Date: Oct 2005
Location: Chicago
Posts: 1,382
Quote:
Originally Posted by bernie_carlton View Post
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.
  Reply With Quote
Old March 23rd, 2009, 09:56 AM   #11
JesperMP
Lifetime Supporting Member + Moderator
Denmark

JesperMP is offline
 
JesperMP's Avatar
 
Join Date: Feb 2003
Location: Copenhagen.
Posts: 10,888
Quote:
Originally Posted by ss4884 View Post
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.
__________________
Jesper
  Reply With Quote
Old March 23rd, 2009, 10:49 AM   #12
OZEE
Member
United States

OZEE is offline
 
Join Date: Mar 2006
Location: Kansas
Posts: 1,670
Quote:
Originally Posted by JesperMP View Post
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.
That's the deal -- he hasn't told us!!
  Reply With Quote
Old March 24th, 2009, 01:22 AM   #13
ss4884
Member
India

ss4884 is offline
 
Join Date: Mar 2009
Location: Chennai
Posts: 9
Thanks bernie i tried as you suggested,It works
  Reply With Quote
Old March 24th, 2009, 05:05 AM   #14
Kakka
Member
India

Kakka is offline
 
Join Date: Mar 2009
Location: India
Posts: 9
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



Quote:
Originally Posted by ss4884 View Post
Hi,
can anyone help me out by guiding me how to perform INT to REAL Conversion..Pls It urgent
  Reply With Quote
Old March 24th, 2009, 06:55 AM   #15
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is offline
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 4,624
Quote:
Thanks bernie i tried as you suggested,It works
I guess that's an indirect answer to our 'which platform' question.
__________________
Controlling outputs is the PLC's way of getting its inputs to change.

www.thePLCguy.com
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 08:55 AM.


.