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 Sun Dec 16, 2018 8:50 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Error in simple division
PostPosted: Wed Nov 22, 2017 12:50 pm 
Offline

Joined: Sun Jun 25, 2017 11:57 am
Posts: 7
Hello,

I have a simple division line, but the problem is that the variable does store the value of that division.
I tried with a simple example: a := 100 / (600 -3437);
But 'a' does not store the value, and shows 0.
'a' is defined as REAL, also tried LREAL.

Any suggestions about what the problem is?

Best regards,
Jonathan


Top
   
PostPosted: Wed Nov 22, 2017 2:13 pm 
Offline
Frequent User
Frequent User

Joined: Wed May 04, 2016 6:00 pm
Posts: 259
A:=600.0/(123.0-2300.0)

Use .0 after all numbers


Top
   
PostPosted: Wed Nov 22, 2017 2:53 pm 
Offline

Joined: Sun Jun 25, 2017 11:57 am
Posts: 7
Thanks you!
That worked.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 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