#XenonCode - Timer vs Update

1 messages · Page 1 of 1 (latest)

west root
#

Hi there i spend like 2 hours to find out what is wrong with my code so i made small test.


timer frequency 1
    output_number(0, 0, 1)

update
    ;output_number(0, 0, 1)

The problem is that i have code that is executed once per second and in this place i set FluidPump ON/OFF and it is not working!
It is not working because i set output_number in timer frequency. If i change to update it works!

Is it bug or expected behavior. It doesnt matter if i connect thru router or directly to computer port.

steady idol
#

Not a bug.
Pumps are protected against runaway situations, this means if they don't receive any data within a tick, they will shut off. They need to constantly receive a value so they can keep pumping.
Imagine this pump is connected to a Thruster, and your computer is sending it data to stay on, but the computer crashes or runs out of power, the pump may continue and the thruster continues out of control.

#

@west root did you have any specific use case for this? I'm not sure I understand what you were trying to achieve

west root