global.h Statemachine