CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Tue Dec 10, 2019 3:00 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Mar 11, 2019 11:37 pm 
Offline

Joined: Tue Jun 20, 2017 4:21 pm
Posts: 2
In PLCOpen's Coding Guidlines, section 5.28 says to avoid using deprecated features. Under Examples, it lists "Standard Function 'TRUNC.'" I assume that the preferred method at this point is to use a REAL_TO_INT conversion operator. Can someone elaborate on the differences, and why to use one over the other?


Top
   
PostPosted: Wed Mar 13, 2019 1:16 am 
Offline
Frequent User
Frequent User

Joined: Tue Dec 03, 2013 11:52 pm
Posts: 125
Trunc - Removes anything after the decimal.
Real_to_int - Rounds up if after decimal is >= 0.5.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited