1. Project requirements
1. The on-site teaching console has three hosts, and there are two hosts in the cockpit (without hardware control for the time being).
It is required to add two buttons (rebound, without self-locking type) on the teaching console, and use two buttons to control one-button startup and shutdown.
Second, program design
1. Add a switch card behind each host. Turn on and off by switching the card.
2. Make a main control module. Used to receive two IOs (switch variables). The main control module and all switch cards communicate through Ethernet and share a network segment.
3. Don't bother to use the magic package, and go directly to the hardware.
Three, the realization process
1, IO button
It adopts the industrial non-locking button, also called the start-stop box. Go straight to the installation. If you need to install the button directly on the teaching console on site, you need to prepare an electric drill and a hole saw in advance.
2. Main control board
The core function of the main control board is communication. Send switch command. - You can also send a forced shutdown command.
The button command here does not send a signal directly by detecting high voltage. It is recommended to use the detection of rising edge to distinguish.
for example:
For the shutdown button.
When a falling edge is detected, a power-on command is sent within 2s. If it exceeds 2s, send a forced shutdown command. (The reason why it is necessary to send a forced shutdown command is that our computer cannot be turned off with a single touch of the power button when it is in lock screen mode or not logged in,)
For communications:
Do not add unnecessary instructions: For example, if the main control board receives an unrecognized instruction, do not return it to Biren. The on-site switch card also has the same function, which causes the data to circulate wirelessly and the site is abnormal.
3, switch machine card ()
Protocol
Local IP: It is the information that needs to configure the switch card
Target IP: It is our main control board. Note that the information must be filled in correctly.
3. Host computer
The final link in the system is the computer. If we are shutting down, we find that the network cable light behind the switch card does not flicker. Indicates the current switch card.
Entering Bios needs to be set:
ERP READY, turn it off, this is a power-saving function, so that the motherboard will power off all ports after shutdown, which will affect the network or PCIe devices to start the computer. In addition, look for wakeup on lan or ring, there is also called wakeup on pcie, set it to start
Gigabyte board: the erp setting is responsible for the wakeup on lan/ring (ring is through the telephone line and modem equipment) function.
It's over here.
There is a trace of loneliness engraved behind the glory