I working on a program that was converted from ControlLogix to Unit Pro (M340).
The ControlLogix program used common Routines that were called multiple times with the appropriate data structure passed in as a parameter.
The common routines made ample use of One-shots. To keep the One-shots in one call instance from conflicting with the One-shots in another instance all of the One-shot used bits in the data structure that was passed in as a parameter.
This all worked well in the ControlLogix program but does not work as expected when using Positive Transition contacts |P| in Unity Pro. I need some information on exactly how Unity Pro implements the Transition contacts in order to devise a solution (e.g. Is it using a hidden bit to detect the transition, etc).
Here's a simplification of the logic in the two versions:
In ControlLogix
COP Buffer1 -> Temp
CALL CommonRoutine
COP Temp -> Buffer1
COP Buffer2 -> Temp
CALL CommonRoutine
COP Temp -> Buffer2
CommonRoutine
Temp.1 Temp.2
--| | ---[ONS] ---( ) Temp.3
Works Fine (One-shot transitions isolated between calls)
In Unity Pro
COP Buffer1 -> Temp
CALL CommonRoutine
COP Temp -> Buffer1
COP Buffer2 -> Temp
CALL CommonRoutine
COP Temp -> Buffer2
CommonRoutine
Temp.1
--| |------------( ) Temp.2
Temp.2
--|P|------------( ) Temp.3
Does not appear to work.
The ControlLogix program used common Routines that were called multiple times with the appropriate data structure passed in as a parameter.
The common routines made ample use of One-shots. To keep the One-shots in one call instance from conflicting with the One-shots in another instance all of the One-shot used bits in the data structure that was passed in as a parameter.
This all worked well in the ControlLogix program but does not work as expected when using Positive Transition contacts |P| in Unity Pro. I need some information on exactly how Unity Pro implements the Transition contacts in order to devise a solution (e.g. Is it using a hidden bit to detect the transition, etc).
Here's a simplification of the logic in the two versions:
In ControlLogix
COP Buffer1 -> Temp
CALL CommonRoutine
COP Temp -> Buffer1
COP Buffer2 -> Temp
CALL CommonRoutine
COP Temp -> Buffer2
CommonRoutine
Temp.1 Temp.2
--| | ---[ONS] ---( ) Temp.3
Works Fine (One-shot transitions isolated between calls)
In Unity Pro
COP Buffer1 -> Temp
CALL CommonRoutine
COP Temp -> Buffer1
COP Buffer2 -> Temp
CALL CommonRoutine
COP Temp -> Buffer2
CommonRoutine
Temp.1
--| |------------( ) Temp.2
Temp.2
--|P|------------( ) Temp.3
Does not appear to work.