Neither can anyone else with what you have written. Please list the hardware pieces you have an a schematic of how you have them all connected, including all the power supplies.
Then show the software you have tried.
void setup()
{
}
void loop()
{
// I reach the maximum needed vacuum
// (Poff on the graph) and I turn off the
// vacuum pump
if (getVacuum() > Poff)
VacuumPumpOff();
// time is passing by and the pressure increases, I
// have to turn on the pump at Pon
if (getVacuum() < Pon)
VacuumPumpOn();
}
@red_car's solution avoids constantly turning on a pump that is already on, or off one that has already been turned off.
It may not matter the difference. But if there was something special about firing up the pump you didn't want to or need to or perhaps even shouldn't do again, or a similar function of Turing off powering down the pump, take the longer version that doesn't.
Or consider the current state of the pump within the functions VacuumPumpOn() and VacuumPumpOff() and act accordianly.