The present invention provides an event-driven programming method of programmable logic controller (PLC), including: registering at least one event to be detected; storing at least one event handler segment corresponding to the at least one event to be detected respectively; detecting the occurrence of the at least one event to be detected; adding the detected event into an event queue; extracting events from the event queue; and executing the event handler segment corresponding to the extracted event.