Complete the code to represent the first step of the PLC scan cycle.
def plc_scan_cycle(): # Step 1: [1] inputs inputs = read_inputs() return inputs
The first step in the PLC scan cycle is to read the inputs from the field devices.
Complete the code to represent the program execution step in the PLC scan cycle.
def plc_scan_cycle(): inputs = read_inputs() # Step 2: [1] the program logic outputs = execute_program(inputs) return outputs
The second step is to execute the program logic using the inputs.
Fix the error in the code to correctly update outputs in the PLC scan cycle.
def plc_scan_cycle(): inputs = read_inputs() outputs = execute_program(inputs) # Step 3: [1] outputs to devices write_outputs(outputs)
The third step is to update the outputs to the field devices.
Fill both blanks to complete the PLC scan cycle steps in order.
def plc_scan_cycle(): # Step 1: [1] inputs inputs = read_inputs() # Step 2: [2] program logic outputs = execute_program(inputs) return outputs
The PLC scan cycle starts by reading inputs, then executing the program logic.
Fill all three blanks to complete the full PLC scan cycle code.
def plc_scan_cycle(): # Step 1: [1] inputs inputs = read_inputs() # Step 2: [2] program logic outputs = execute_program(inputs) # Step 3: [3] outputs write_outputs(outputs)
The PLC scan cycle consists of three steps: read inputs, execute program logic, and update outputs.
