Handling Data Types in PLCs (General)

sabledanny

Member
Join Date
Sep 2013
Location
Malaysia
Posts
6
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
 
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.
 
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.
 
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.
 

Similar Topics

Hello All, I am currently working on a Project that retrieves data from a SQL table and stores in a PLC. This data is an array with multiple rows...
Replies
2
Views
2,901
Hi - I currently have a custom controller board that does some things that are clearly within the domain of ladder logic. But it also does some...
Replies
10
Views
4,764
Hello everybody! I need to implement the options to run different products in a machine. The settings for the different products would be data...
Replies
7
Views
7,742
I am collecting a large amount of data from an another system, and showing the data on my Wincc application. To save tags I am reading data as raw...
Replies
1
Views
7,368
I am trying to get Codesys to work with a couple of Moxa ioLogik E1200 series DIO devices (E1210 and E1211). I am able to write to the E1211 DOs...
Replies
2
Views
113
Back
Top Bottom