Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: ATU on June 12, 2019, 03:36:13 PM

Title: peerlink question
Post by: ATU on June 12, 2019, 03:36:13 PM
When working with Peerlink I/O, should you use Sets/Resets inside stages? Do they not turn off when the stage is off?
Title: Re: peerlink question
Post by: franji1 on June 12, 2019, 05:17:26 PM
Not sure what you mean by PEERLINK I/O.  There is no I/O associated with PEERLINK.  It's a way to share data between PLCs.

There is no "termination" behavior for SET/RST.  Use those in SGs when you do NOT want them to "terminate".

The OUT coil instruction DOES have "termination" behavior, it will turn OFF the referenced C/Y/PL.xxx parameter when you exit a SG (or a program).

C42 will stay ON from SG1 to SG3 since you used SET, not OUT:
SG 1
SET C42
JMP S2

SG S2
STR X0
JMP S3

SG S3
RST C42

Title: Re: peerlink question
Post by: ATU on June 12, 2019, 05:54:18 PM
Sorry, used the wrong terminology.  I view Peerlink coils as remote I/O .  I get this error when I use the PL bits in a stage
[Warning]   SystemConfig#7(@13)   W424 Using retentive element (PL32:2) in OUT coil within a non-retentive stage (SystemConfig.S1)

Not sure what it means.
Title: Re: peerlink question
Post by: franji1 on June 12, 2019, 06:34:59 PM
If you lose power, the SystemConfig PROGRAM structure entire status, including what Stages are ENABLED, will be lost/cleared, upon power-up.  That just means you expect a power-loss to restart your logic.

But you are using a RETENTIVE memory location (PL32:2), and that value WILL be RETAINED on power loss.

That points to an inconsistency - on one hand, your logic is restarting, but the data is being retained.  Usually both are retained, or both are not.  (Note that you COULD have RSTR or MEMCLEAR or something ON FIRST SCAN to do "intelligent" restart.)

If your application behavior needs to be tolerant of power-glitches, you may want to make your SystemConfig heap item be retentive, so that your logic will continue where you left off.  If power-glitches are a don't care, and you write logic to clear or initialize specific retained data anyway, then it doesn't matter.  You know best what you need your app to do when the PLC loses power.
Title: Re: peerlink question
Post by: ATU on June 12, 2019, 06:46:57 PM
Ok, I see the problem. Thanks. Good point, power glitches happen all the time.