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 February 9th, 2018, 02:13 PM   #1
sabledanny
Member
Malaysia

sabledanny is offline
 
Join Date: Sep 2013
Location: Malaysia
Posts: 6
Handling Data Types in PLCs (General)

Hello,

I've been meaning to study on PLC data types and how to ensure I do not move a data that exceeds the maximum value such as moving a DINT to INT etc. Do recommend me some links to read on.

Thanks and best regards,
Danny
  Reply With Quote
Old February 9th, 2018, 02:28 PM   #2
mk42
Member
United States

mk42 is offline
 
Join Date: Jun 2013
Location: MI
Posts: 1,636
Quote:
Originally Posted by sabledanny View Post
Hello,

I've been meaning to study on PLC data types and how to ensure I do not move a data that exceeds the maximum value such as moving a DINT to INT etc. Do recommend me some links to read on.

Thanks and best regards,
Danny
The first thing you can do is to check that the data type is valid when you're creating your program. Before you move the DINT into the INT, check that it is smaller than the max INT allowed.

Many systems automatically build these into the convert/move blocks. Check out Overflow errors. It's a topic that has probably been discussed for 30 years, in just about every programming language: PC or PLC.
  Reply With Quote
Old February 10th, 2018, 09:32 AM   #3
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Duxford
Posts: 554
It seems like you are looking into AB... mind you that AB is very forgiving with data types, whilst other PLC manufacturers (like Siemens) aren't and you need to ensure that the right data type goes into the right place. Instead of being a case of fitting 32bits in 16 bits it's a case of getting a floating point value into an integer variable.
  Reply With Quote
Old February 10th, 2018, 11:30 AM   #4
spaderkung
Member
Sweden

spaderkung is offline
 
Join Date: Aug 2007
Location: A flat type "4"
Posts: 267
How you move them and for what purpose is important.
Using built in functions, what kind, or if you do it on a lower level. For use internally or read write over raw tcp it all makes your method more or less important.
__________________
Jon Bolmstedt, Inspired Automatician.
  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
Using PLCs fur pure data acquisition stube40 LIVE PLC Questions And Answers 12 August 22nd, 2012 08:03 PM
Module_Defined data types.. alz LIVE PLC Questions And Answers 6 February 27th, 2011 03:15 PM
S7 datablock data types Ned_Flanders LIVE PLC Questions And Answers 5 February 21st, 2011 12:19 PM
Logix5000 AOI vs Data types? jimdi4 LIVE PLC Questions And Answers 4 June 16th, 2010 11:54 AM
Extracting Tag Values from ControlLogix MajorFault LIVE PLC Questions And Answers 8 July 9th, 2009 10:22 AM


All times are GMT -5. The time now is 04:32 PM.


.