1. Open your project from previous exercises or create a new one (see the instructions for the previous lab assignment).
  2. Using ladder diagrams, create a program that changes the state of the green light (0 → 1 → 0 …) when the green button is pressed. Use positive edge detection R_TRIG and an RS memory cell.
  3. Familiarize yourself with the counter – try one that can count up or down, specifically use the CTUD function block from the Tc2_StandardCounter library.

  4. Try using timers from the Tc2_StandardTimer library: pulse generator TP, on-delay TON, and off-delay TOF.
    • For the timer function block’s IN input, use a button, and for the Q output, connect a light.
    • The time at the PT input is of type TIME; constants are defined in the following format: T#2ms, T#1min3s, etc.
  5. Using FUN functions and FB function blocks:
    • Create a new function that performs a logical AND over two inputs, x1 and x2. The output should be y. Call this function in the MAIN program, where you’ll define inputs and outputs – they can be buttons and a light.
    • Create the first version of a function block for motor control. You need to set two output bits: direction (0: forward, 1: backward) and movement (0: stationary, 1: moving). What will the inputs for the FB be?
  6. Choose a model for your project:

  7. Open the electrical diagram of the teaching model (the links are provided in the previous point) and familiarize yourself with the inputs %I* and outputs %Q*. In TwinCAT, create a new global variable list (GVL – global variable list) and enter the inputs and outputs into it.
  8. Read the document "Manual control - requirements," which presents the requirements for manual control. Create a solution, which will be the subject of the first project progress check.
  9. Save the project and archive it for use in future exercises: FileSave Project As Archive...