
adccommunitymod (AutomationDirect) asked a question.
single first scan contact
Created Date: October 19,2018
Created By: Mike Conwell
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
I want to reset 3 internal registers when the program first starts, (Shen operator switchs to auto) Is the right way to do it to write in SC2 or should I pick the rising transitional contact (contact with the arrow pointing up) I saw aother tread sometime that said to just type in SC2. Can anyone explain that to me???
Created Date: October 19,2018
Created by: Mike Conwell
I want to reset 3 internal registers when the program first starts, (Shen operator switchs to auto) Is the right way to do it to write in SC2 or should I pick the rising transitional contact (contact with the arrow pointing up) I saw aother tread sometime that said to just type in SC2. Can anyone explain that to me???
Created Date: October 19,2018
Created by: Mike Conwell
I had another programmer tell me to be really careful when using the rising or falling transition contacts.
Created Date: October 19,2018
Created by: Adisharr
Normally you would use a first scan contact which is SC2 on the Click. That contact will only be true for one scan cycle and then never one again unless you stop and then start the program again.
Created Date: October 20,2018
Created by: kewakl
I had another programmer tell me to be really careful when using the rising or falling transition contacts .
That would depend on where (and what 'type ' of program/task/subprogram/ladder/module/POU ) the rising edge contract resides with respect to where the 'output ' coil resides.
Created Date: October 20,2018
Created by: RogerR
I use the rising or falling transition contacts all the time. Very handy instruction.
Created Date: October 20,2018
Created by: Alexandru
The program does not save status from the run prior to last shutdown.
Therefore, at first scan all registers contain the default value.
Use control bit C1 which at first scan is zero. If is zero, then you are in first scan. Set it to 1 and call a subroutine specific to first scan.
Or, as mentioned prior, check the system control registers to see which one indicates the first scan.
Created Date: October 20,2018
Created by: bcarlton
To reassure yourself place a rung wit SC2 a as contact then an instruction which adds 1 to a register. Run and verify only 1 was added.
Created Date: October 25,2018
Created by: winterrossi
The first scan contact only works when the PLC goes from stop to run mode. That is not the way to reset or clear a register when the operator switches to auto. I would use the rising edge of the auto switch input, or the rising edge of the auto sequence, or something like that.