I got a little confussed on this nested If-Then:

Code:
if level<=high_level then
	if thermiko1=0 then
		if thermistor1=0 then
			if auto1=0 then
				if onboard_an2<=pres_limit then
					if pump=0 then
						module_rel_out=1
					else
						module_rel_out=0
					endif
				endif
			endif
		endif
	endif
endif
does make module_rel_out=1 but does not makes it 0 if the conditions (one or more) are not met.

I am missing something but cannot figure what...

Any help appreciated.
Ioannis