Presentation is loading. Please wait.

Presentation is loading. Please wait.

Do-more Technical Training Instruction Set (Program Control)

Similar presentations


Presentation on theme: "Do-more Technical Training Instruction Set (Program Control)"— Presentation transcript:

1 Do-more Technical Training Instruction Set (Program Control)

2 Instruction Set THE BASICS ▫1▫181 instructions CContact (14) CCoil/Bit Output (11) AAnalog/Process (13) DDate/Time/Calendar (7) EEthernet (5) HHardware/Device (9) HHigh Speed/CTRIO (19) MMath (5) MMisc/Data Manipulation (23) PProgram Control (20) PProgram-Looping (8) PProtocol-Custom/ASCII (7) PProtocol-Standard (10) SString (14) TTimer/Counter/Drum (16)

3 THE BASICS ▫1▫181 instructions IIn-line (100) – n nn no flag EExecutes completely in-line on same scan FFully Asynchronous (48) – R RR Red DDependent on shared Device’s availability LLocks Device when executed to make it exclusive UUnlocks Device after it is finished MMust not terminate before it is finished MMust wait for Success or Error indication MMulti-scan (20) – Y YY Yellow TTakes 2 or more scans to complete or function properly DDepend on the status of the instruction from previous scan ((Edge-triggering inputs normally take 2 also) YYielding (5) – B BB Blue CCan temporarily postpone operation until next scan (YIELD) SSkipping (6) – G GG Green CCan skip forward or backward in code (EXIT, REBOOT, RESTART, STOP, WATCHDOG) YYielding/Skipping (2) - B BB Blue Green CCan temporarily postpone operation until next scan and skip forward or backward in code (GOTO) Box Instruction Corner

4 Instruction Set (Program Control) Program Control ▫E▫ENTASK ▫E▫E▫E▫EXIT ▫G▫G▫G▫GOTO ▫H▫HALT ▫J▫JMP (Stage) ▫J▫JMPI (Stage) ▫L▫LABEL ▫R▫R▫R▫REBOOT ▫R▫R▫R▫RESTART ▫R▫RUN ▫S▫SG (Stage) ▫S▫SGCONVRG (Stage) ▫S▫SGDIVRG (Stage) ▫S▫SGRST (Stage) ▫S▫SGRSTR (Stage) ▫S▫SGSET (Stage) ▫S▫S▫S▫STOP ▫S▫SUSPEND ▫W▫W▫W▫WATCHDOG ▫Y▫Y▫Y▫YIELD

5 GOTO “Go To Label” ▫I▫Immediate branch to LABEL instruction CCannot reference Labels in a different Program/Task IIf inside FOR/NEXT, WHILE/WEND, or REPEAT/UNTIL loop, cannot target Labels outside that loop CCannot target Labels in a different stage BBranching backward subjects it to yielding (blue triangle) LABEL “Program Label” ▫T▫The target of the G GG GOTO instruction

6 REBOOT “Reboot PLC” ▫C▫Causes CPU to perform a cold reboot (just like a power cycle)

7 RESTART “Restart Program or Task” ▫S▫Stops Program or Task then restarts it so that it begins running from the beginning RResets Stages, clears internal flags, counters, etc.

8 STOP “Switch to Program Mode” ▫C▫Causes CPU to go to STOP (Program) Mode SSince there is no way, of course, to programmatically switch back to RUN Mode, this could be a safety concern

9 SUSPEND “Suspend Program or Task” ▫S▫Suspends the target Program or Task from running TThe current state of all ladder logic in target is maintained ..InstrSuspend = ON NName of target is shown in y yy yellow CCannot suspend itself

10 WATCHDOG “Force Watchdog Error” ▫G▫Generates a software or hardware watchdog error UUsed to verify emergency shutdown PParameters: FFire Software Watchdog ▫C▫CPU goes to STOP (Program) Mode ▫A▫Acts like scantime > $WatchdogTimeVal (DST23) FFire Hardware Watchdog ▫D▫Depends on setup of $DisableHwWdog (ST25) & $HwWatchdogMode (ST24) IIf input logic is retentive & Mode switch is in RUN or TERM, CPU will execute Force Watchdog Error instruction continuously. PPlace Mode switch in STOP to break out of this

11 YIELD “Yield Program or Task” ▫S▫Stops execution of current Program or Task & passes control to next code block in the execution order YYields (blue triangle) regardless of value in.TimeSlice CCode block continues at instruction directly below upon next execution UUsed so scantime can be controlled EE.g. Program normally takes long time to complete ▫I▫Inserting YIELDs in the code breaks it up 1 st scan 2 nd scan

12 Stage Programming Introduction to sequencing ▫Ladder logic Pros Pros:  Very good at controlling concurrent processes Cons Cons:  Not good at controlling sequential processes  Not good at event-driven sequences  Programs get filled with numerous interlocking bits  Difficult to debug  Difficult to modify  All logic impacts scantime

13 Stage Programming Ladder Program ▫S▫States of Y0 OOFF OON ▫I▫Initially Y0 = OFF ▫X▫X0 causes Y0 to transition to ON state ▫X▫X1 causes Y0 to transition to OFF state

14 State Diagram ▫S▫States of Y0 OOFF OON ▫I▫Initially Y0 = OFF ▫X▫X0 causes Y0 to transition to ON state ▫X▫X1 causes Y0 to transition to OFF state OFF ON Y0 X0 X1 OFF ON

15 Stage Programming Sequence Diagram ▫S▫States of Y0 OOFF OON ▫I▫Initially Y0 = OFF ▫X▫X0 causes Y0 to transition to ON state ▫X▫X1 causes Y0 to transition to OFF state

16 Stage Program ▫S▫States of Y0 OOFF OON ▫I▫Initially Y0 = OFF ▫X▫X0 causes Y0 to transition to ON state ▫X▫X1 causes Y0 to transition to OFF state

17 Numbering ▫T▫Tasks do not have Stages ▫P▫Programs can have 128 Stages (SG; S0-S127) each ▫S▫Stage number does not determine sequence The Initial Stage is the first one (very top) Enabling/Disabling ▫E▫Enabled Stages are executed each PLC scan ▫W▫When a Stage is enabled/scanned the first time it artificially generates an “edge” by setting Edge bits for each bit in the Stage that is already ON when the Stage was enabled* ▫D▫Disabled Stages are not scanned ▫A▫A disabled Stage runs a “Termination Scan” immediately following the scan in which it was disabled *Exception: Bits associated with Counter instructions

18

19 Enabling: target ▫When the Stage is the target of: (1) JMP “Jump To Stage” (2) JMPI “Indexed Jump” (3) SGSET “Enable Stage” (4) SGDIVRG “Jump to Multiple Stages” (5) SGCONVRG “Converge Multiple Stages to SG” Disabling: ▫When the Stage is: source  The source of: (1) JMP “Jump To Stage” (2) JMPI “Indexed Jump” (4) SGDIVRG “Jump to Multiple Stages” (5) SGCONVRG “Converge Multiple Stages to SG” target  The target of: (6) SGRST “Disable Stage” (7) SGRSTR “Disable Range of Stages”

20 Stage Programming JMP “Jump To Stage” ▫D▫Disables Stage in which it is contained & enables the “jump-to” Stage ▫P▫Parameters: TTransition To – target Stage to “jump” to ▫N▫NOTES: DDoes not “jump” immediately CCode between the JMP and end of the Stage is still scanned / executed CCannot “jump” to Stages in other Programs

21 JMPI “Indexed Jump” ▫D▫Disables Stage in which it is contained & enables the “jump-to” Stage based on an Index ▫P▫Parameters: IIndex – memory location of index value FFirst Stage – 1 st Stage in range for index = 0 LLast/Exception Stage – Stage to “jump” to if index is out of range ▫N▫NOTES: DDoes not “jump” immediately CCode between the JMPI and end of the Stage is still scanned / executed CCannot “jump” to Stages in other Programs

22 SGSET “Enable Stage” ▫Enables target Stage ▫Parameters:  Stage – target Stage to enable ▫NOTES:  Does not disable Stage containing SGSET  Cannot enable Stages in other Programs

23 Stage Programming SGRST “Disable Stage” ▫D▫Disables target Stage ▫P▫Parameters: SStage – target Stage to disable ▫N▫NOTES: IIf it disables itself, code between the SGRST & end of the Stage is still scanned / executed CCannot disable Stages in other Programs

24 SGRSTR “Disable Range of Stages” ▫D▫Disables a range of Stages ▫P▫Parameters: SStart Stage – 1 st Stage in range to disable EEnd Stage – last Stage in range to disable ▫N▫NOTES: IIf it disables itself, code between the SGRSTR & end of the Stage is still scanned / executed CCannot disable Stages in other Programs

25 SGDIVRG “Jump to Multiple Stages” ▫D▫Disables Stage in which it is contained & enables all Stages listed ▫P▫Parameters: TTransition To – list of Stages to enable ▫N▫NOTES: CCannot disable Stages in other Programs

26 SGCONVRG “Converge Multiple Stages to SG” ▫D▫Disables listed Stages & enables target Stage based on condition ▫P▫Parameters: SStage – target Stage to be enabled FFrom Stages – list of Stages to be disabled when condition is true TThen converge when – condition causing the convergence ▫N▫NOTES: CCannot use Stages in other Programs

27 Design Stage Program ▫X0 is for door control ▫X1 indicates door is raised ▫X2 indicates door is lowered ▫Y1 must be energized to raise the door ▫Y2 must be energized to lower the door

28 Stage Programming Design Stage Program Initially, the door is down When X0 comes ON, Stage0 is disabled and Stage1 is enabled When X0 goes OFF, Stage1 is disabled and Stage2 is enabled Y0 turns the motor ON to raise the door When X1 comes ON (indicating the door has reached its upper limit), Stage2 is disabled and Stage3 is enabled The door is in the up position When X0 comes ON, Stage3 is disabled and Stage4 is enabled When X0 goes OFF, Stage4 is disabled and Stage5 is enabled Y1 turns the motor ON to lower the door When X2 comes ON (indicating the door has reached its lower limit), Stage5 is disabled and Stage0 is enabled When Stage2 is disabled, Y0 automatically goes OFF When Stage5 is disabled, Y1 automatically goes OFF The door is back to the initial position (down)

29 Stage Programming Design Stage Program ▫A▫Add Y3 as the safety light ▫Y▫Y3 must come ON each time door is activated (up or down) ▫Y▫Y3 must go OFF after a timeout

30 Design Stage Program When the door has been triggered to go up, Stage6 (a new stage) is enabled When the door has been triggered to go down, Stage6 (a new stage) is enabled New Stage6 is added Y3 comes ON and Timer0 is started… When Timer0 is done (3 minutes), Stage6 disables itself When Stage6 is disabled, Y3 automatically goes OFF and Timer0 is reset

31 Stage Programming Design Stage Program ▫Add X3 as emergency stop ▫X3 must cause door to raise

32 Stage Programming Design Stage Program When the door has been triggered to lower and there’s an obstruction, Stage5 is disabled and Stage2 is enabled to shut OFF the lowering motor (Y1) and turn ON the raising motor (Y0)

33 Instruction SetInstruction Set (Program Control)


Download ppt "Do-more Technical Training Instruction Set (Program Control)"

Similar presentations


Ads by Google