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 December 13th, 2011, 08:42 PM   #1
bdmfab
Member
United States

bdmfab is offline
 
Join Date: Jun 2011
Location: MI
Posts: 2
Omron Function Block

First time with structured text and something isn't working correctly. Simple block, copy of the SCP in Allen Bradley (scale with parameter). The math is off, I think its syntax. Driving me nuts. Its a CJ2M series. Thanks.
Attached Files
File Type: zip Analog Scale.zip (872 Bytes, 47 views)
  Reply With Quote
Old December 14th, 2011, 03:01 AM   #2
hooey
Member
Australia

hooey is offline
 
hooey's Avatar
 
Join Date: Aug 2005
Location: Melbourne
Posts: 32
see attached file for my version for scaling int to real
hooey
Attached Files
File Type: zip InToRealScale.zip (642 Bytes, 57 views)
  Reply With Quote
Old December 14th, 2011, 09:44 AM   #3
bdmfab
Member
United States

bdmfab is offline
 
Join Date: Jun 2011
Location: MI
Posts: 2
Thanks Hooey,

The conversion to real was helpful.

Getting roughly the same result. I'm running the simulator, here are the values I am using.

In = 1000

InMin = 100

InMax = 20000

SclMin = 1

SclMax = 100

SclOut = -49597.80.

My trusty excel sheet yields 5.48

This is only my second Omron project so I am still green on this. I attached the .cxp with the FB. Am I using the correct registers? Cheers.
Attached Files
File Type: zip Scale Test.zip (2.0 KB, 30 views)
  Reply With Quote
Old December 14th, 2011, 03:18 PM   #4
BobB
Lifetime Supporting Member
Australia

BobB is offline
 
BobB's Avatar
 
Join Date: Jun 2002
Location: Sydney
Posts: 3,632
Hear is a link to an Omron scale with parameters FB.
http://forums.mrplc.com/index.php?ap...s&showfile=523
__________________
The Old Pfhaart

  Reply With Quote
Old December 14th, 2011, 03:57 PM   #5
hooey
Member
Australia

hooey is offline
 
hooey's Avatar
 
Join Date: Aug 2005
Location: Melbourne
Posts: 32
Quote:
Originally Posted by bdmfab View Post
Thanks Hooey,

The conversion to real was helpful.

Getting roughly the same result. I'm running the simulator, here are the values I am using.

In = 1000

InMin = 100

InMax = 20000

SclMin = 1

SclMax = 100

SclOut = -49597.80.

My trusty excel sheet yields 5.48

This is only my second Omron project so I am still green on this. I attached the .cxp with the FB. Am I using the correct registers? Cheers.
bdmfab
you use of d registers might need reviewing, d registers are 16 bit storage locations so used to store a real type number will use 2 16 bit locations d0 and d1 and as you have used d1 as a input to the function block as constant you will end up with corrupted results . define symbols for inputs to the function block as type real ie. InMin type real, InMax type real, SclMin type real, SclMax type real, SclOut type real and give that a go.
Hooey
  Reply With Quote
Old December 14th, 2011, 04:16 PM   #6
BobB
Lifetime Supporting Member
Australia

BobB is offline
 
BobB's Avatar
 
Join Date: Jun 2002
Location: Sydney
Posts: 3,632
I have basically given away using FBs for almost everything - too slow and painful. I used to use FBs for floating point maths. I often have to extract data from Caterpillar, and other brands, engines. It is extr5acted by Modbus RTU but is in J1939 format - absolute pain. Value, precision and offset. I have attached a routine I recently used on a job - fairly obvious what is going on. Admittedly not scale with parameters nut may help you get a handle on floating point in Omron.
It is part of a standard routine I developed - the engines all come with different information available. I stick in the standard routine and then delete what I do not get from the engine. The only other thing I do is use FIXL (fix long) to read the values in decimal. I then delete the FIXL function when I am happy with the readings I use the floating point values on Omron NS screens.
Hope this helps you get a handle on things.
Float all values first, including the constants you have to use for precision, multiples to make the values useful and offset values.
Attached Files
File Type: pdf Caterpillar-NewProgram1-Calculatio.pdf (74.4 KB, 89 views)
__________________
The Old Pfhaart

  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
Create Function Block RS Logix 5000 mrsoliveira LIVE PLC Questions And Answers 1 September 10th, 2008 10:35 AM
Migrating VB6 IDEA app to VB.Net Extrasoft LIVE PLC Questions And Answers 5 November 4th, 2007 06:13 AM
ST Help, function & block function najs LIVE PLC Questions And Answers 3 February 24th, 2006 01:09 AM
Function block irfan22in LIVE PLC Questions And Answers 0 September 16th, 2005 07:05 AM
PID function block for sucosoft ver4.20 sivakumar LIVE PLC Questions And Answers 0 September 30th, 2002 02:49 PM


All times are GMT -5. The time now is 02:47 PM.


.