DS200DCFBG1BNC External Interrupt Service Program

DS200DCFBG1BNC

Control functions
Direct indication of channel readiness via LEDs
Safe and fast installation
Quick module identification
Individual channel identification marking strips

Categories: ,
Get a quote, please contact me immediately:
Simon Zhang
dcsplcsales@gmail.com
Phone/Whatsapp/Skype/Wechat: +86 133 6590 9307

Description

DS200DCFBG1BNC External Interrupt Service Program


The DS200DCFBG1BNC system refreshes the input signals, executes the user program, and outputs the operation results week after week based on the scanning principle [4], and it is difficult to make the PLC system’s output signals jump in one scanning cycle, so one clock cycle in Fig. 4 takes up two scanning cycles of the PLC system. The addition of three synchronization pulses for each transmission process is to improve the reliability of the transmission process and to ensure that the PLC system and its transmission line can correctly transmit the display data within one transmission cycle after the fault is recovered, regardless of the fault.

The program of DS200DCFBG1BNC digital display instrument consists of four parts: initialization, external interrupt 0 service program, external interrupt 1 service program and timer T0 interrupt service program.T0 interrupts every 5ms, and completes the dynamic display of the 4-digit digital tube according to the received display data and its decimal point position information in its interrupt service program. The external interrupt 0 service program is used to detect the synchronization signal, and the external interrupt 1 service program is used to receive the BCD code of the 16-bit display data and the 2-bit information indicating the decimal point display position.

DS200DCFBG1BNC external interrupt 0 is triggered by the falling edge of the data signal line, and in its interrupt service program, if the clock line is detected to be low, it is regarded as a synchronization signal. When three synchronization pulses are detected, it indicates that the correct synchronization signal has been received, at which time external interrupt 0 is turned off and external interrupt 1 is turned on to receive data with the help of the external interrupt 1 service program. If the synchronization pulse has been detected in the previous or the previous two interrupt service programs and the synchronization pulse is not detected this time, it is regarded as an invalid synchronization signal.