The invention discloses a
tidal current energy generator set master control program coding method. The
tidal current energy generator set master control program coding method comprises the steps thata master control program is divided into a plurality of modules according to functions, the modules include a sensor data reading module, a
data processing module, a state
machine module, a rotating speed torque control module, a component
monitoring and control module, an alarming module and a first-occurring fault recording module, and the state
machine module is used for achieving a dispatchingeffect; coding is carried out according to the multiple modules, and independent testing is carried out after coding for each module is completed; and all modules obtained after testing are subjectedto integration and overall testing, and a set of
tidal current energy generator set master control program is synthesized. By means of the method, a modularization
programming manner is adopted, split coding and independent testing can carried out at the same time by different engineers, finally, a chief engineer integrates all modules to conduct overall testing, logic
correctness and testing integrity of subcomponents are guaranteed, the
fault rate is reduced to the maximum degree,
programming and debugging efficiency and security are improved, the development cycle is greatly shortened, andthe market need is met.