View Single Post
Old February 9th, 2018, 01:28 PM   #2
mk42
Member
United States

mk42 is offline
 
Join Date: Jun 2013
Location: MI
Posts: 1,838
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