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 Mon Dec 17, 2018 5:31 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Sep 16, 2018 1:32 pm 
Offline

Joined: Mon Dec 04, 2017 3:07 pm
Posts: 2
Hi Everyone!
I have a problem with variables in Codesys.
Firstly, I would like to use 1 variable as Coil, serveral times in the same program, but if i have use other firstly variable, which runs Coil, then coil is not working. When I use other secondly variable, which runs Coil, then coil is working. Why? How to fix it?
I would like to attach a coil from several places in the program.


Thanks.


Image

Image

Image


Top
   
PostPosted: Sun Sep 16, 2018 2:21 pm 
Offline
User avatar

Joined: Fri Jan 19, 2018 3:38 pm
Posts: 56
You can do these tasks in a single rung;
Set the input coils in parallel (in an OR operation) and then write output-coil once.
Also, by-design the latest operation in writing to the same output always get executed (in a single cycle).
So, in your case the lowest rung always has highest precedence.

_________________
https://github.com/Aliazzzz


Top
   
PostPosted: Wed Sep 19, 2018 1:58 pm 
Offline

Joined: Wed Jan 31, 2018 1:08 pm
Posts: 8
Try to use bits with an output only once in your program to avoid things like this.

For your example you need to make an OR statement by paralleling the two inputs in the same rung as the output.


----| |-----|----------------------( )----
----| |-----|


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