0
0
SCADA systemsdevops~10 mins

Modbus protocol for SCADA in SCADA systems - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the Modbus function code for reading coils.

SCADA systems
modbus_request = {"function_code": [1], "address": 0x0013, "quantity": 19}
Drag options to blanks, or click blank then click option'
A0x01
B0x03
C0x10
D0x05
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0x03 instead of 0x01 for reading coils.
2fill in blank
medium

Complete the code to specify the Modbus register type for holding registers.

SCADA systems
register_type = "[1]"
Drag options to blanks, or click blank then click option'
Acoil
Bholding_register
Cinput_register
Ddiscrete_input
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing input_register with holding_register.
3fill in blank
hard

Fix the error in the Modbus RTU frame checksum calculation.

SCADA systems
checksum = calculate_crc([1])
Drag options to blanks, or click blank then click option'
Amodbus_frame
Bmodbus_frame[-2:]
Cmodbus_frame[2:]
Dmodbus_frame[:-2]
Attempts:
3 left
💡 Hint
Common Mistakes
Including checksum bytes in calculation causing errors.
4fill in blank
hard

Fill both blanks to create a Modbus TCP request header with transaction ID and protocol ID.

SCADA systems
header = [1].to_bytes(2, 'big') + [2].to_bytes(2, 'big') + b'\x00\x06'
Drag options to blanks, or click blank then click option'
Atransaction_id
Bprotocol_id
Cunit_id
Dlength
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping protocol_id and transaction_id.
5fill in blank
hard

Fill all three blanks to build a dictionary comprehension filtering coils with status ON.

SCADA systems
active_coils = {addr: status for addr, status in coils.items() if status [1] [2] and addr [3] 100}
Drag options to blanks, or click blank then click option'
A==
BTrue
C<
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using != True or wrong comparison operators.