Code 24 u turn on computer and it finished booting to windows it means all went fine and dandy..
If code 40 pops It means the same Its just that code 40 u have turned on fast startup, u can try to get code 40 from 24 just too see.
Go to power options>System settings>Choose what the power button do, there u see the option to check mark< turn on fast startup >, and it is recommended and should be on by default, but u can try and see if u get code 40 with that on assuming yours is off, I have it on so mine shows code 40, but if I turn it off it shows 24, nothing wrong here
Stuff u need to worry about is the codes in the manual, if it ain't there ur fine no mater the code.
x370 Gaming K7 is a great board btw.