CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Wed Aug 15, 2018 2:16 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Nov 30, 2017 9:33 am 
Offline

Joined: Sat Apr 22, 2017 8:58 am
Posts: 19
Hello everyone,

I have a eaotn XN-322-16DIO-PC05 modul. And there is 2 counter inputs.
So when i recieve 10000 pulses form counter input it means that i have 1 lt water.
But my counter input is one byte. And it returns to 0 after 255.
Is there is any way to change my byte counter to ─▒nt or word?

Thank you.


Top
   
PostPosted: Sat Dec 02, 2017 1:24 am 
Offline
Frequent User
Frequent User

Joined: Fri Sep 02, 2011 8:02 pm
Posts: 288
Make a small FB that has an UINT. Add 256 to the UINT whenever you see counter < old counter. Set old counter = counter. This will catch the rollover. Then when UINT > 10000, you have 1 liter. You could even make a liter counter and roll over your UINT every 10000 counts. This way you can make a FB give you liters instead of worrying about counting.

_________________
Scott Cunningham
KEB America, Inc.
www.kebblog.com
www.kebamerica.com


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 2 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