Same output on multiple programs

Reekki

Member
Join Date
May 2018
Location
Stockholm
Posts
7
Hi!

I have a problem related to using same output on multiple programs.

I have for example "Out1" in PLC1 Program and i need to use that same digital output in my another POU. But i dont know how i get both programs work to together with the same output.

Using CODESYS 3.5 enviroment

Thanks allready,
Joel
 
It is not exactly considered good practice, but you can easily access the same output multiple places.
Say you have Out1 AT Q*.
In Prg1 you set this to blink every 2 seconds, in Prg2 you set it to blink every 1 second.
Then you call either Prg1 or Prg2.


Keep in mind though, that the output will keep its last called state.
So if the output is high in Prg1 and you suddenly stop calling Prg1, then the output will remain high.
 
In serious programs (more complex than garage doors) it is not good practice to work directly with outputs.
Better practice is using some type of pre outputs instead, let's call it x_out_1 to x_out_n.
In the beginnig of the cycle init all these pre outputs to false (zero).
Now, different functions (or other parts of the program) can set some x_out to true (one) (be carefule, use SET or if (condition) then x_out = true).
At the end of the cycle write these pre outputs to outputs, out_1 = x_out_1 ..

Djuro
 
First of all. Declare your physical outputs always as a global variables. Then, use local variables in your pous and assign them to global vars elsewhere
 
I just ran across this, interesting

By output I have to assume that you are referring to remote outputs (Networked)
inputs and outputs in a base unit of a plc can only be accessed by that processor
As for remote I/O you would never want to control a output from more then one plc it could cause real problems.
Rockwell dos allow you read inputs from a remote input with multiple plc's but there is a limit on the number.
but they only allow 1 plc to control the outputs (Master)
You use produced and consumed I/O to pass info from the second plc to the master and program the master control the output as needed
 
By "Global variable" i mean variables which are declared in the global variable list in the project tree as a VAR_GLOBAL. Global variables are recognized throughout the project. "Local variables" are declared in the individual programs inside plc project. Physical I/O's are to be linked only to global_variables.




By output I have to assume that you are referring to remote outputs (Networked)
inputs and outputs in a base unit of a plc can only be accessed by that processor


Some Codesys based plc's like Beckhoff (Wago also?) doesn't include any I/O's in the "base plc". It's just a processor and all I/O cards are connected bus like Ethercat.
 
First off, I have never used codesys.

I have a customer that has a machine that has interchangeable assembly fixtures. they have the same valves.

we used 4 proxes to set up an id system to id the fixture.
we then had the main routine and multiple subroutines.
each subroutine defined an output BIT, not the physical output.
at the end of the program, we hade the physical outputs.
each cycle, all outputs had to be off and everything had to be in the home position before the accept / fail light would turn on a part sensor was used to reset the accept light and allow the next cycle to start.

hope this helps, james
 
Last edited:

Similar Topics

Hi everyone, I have a AB Powerflex 753 powering a simple 480V permanent magnet motor using flux vector control (I believe it's the only control...
Replies
3
Views
1,328
Hi all! I have one question, it might be simple for one of you but I spent hours searching and reading through different platform until I found...
Replies
11
Views
1,614
Hello everyone, I wanted to know if it was possible to use the same routine with the same outputs, routine that I will duplicate, which has...
Replies
10
Views
3,176
I have a ladder with a mov and sub function block paralleled (see attached) with the same output address. Conflict?
Replies
10
Views
2,367
hi all, what is the best way to implement ON OFF when there is only one DO? i'm using rslogix 5000. there is a feedback if the ON is active...
Replies
4
Views
1,613
Back
Top Bottom