For the general puzzle, you have to keep two things in mind: the slots the various chemicals are inside the machine and the order in which you need to use them.
Those are the slots/positions those chemicals are stored in the machine. However, we still need to mix them in the right order.
The order is Chlorine, Acetone, Iodine, Bromine, Nitrogen, and then Sulphur as the last chemical.
Then you corresond that with the numbers on the machines. In essence, we need to press the buttons for slots 2, 1, 4, 6, 5, and then 3.
I am just typing this from my little note when I read all that. Hopefully I have it all in the right order, else I'm really going to confuse people! At the very least, it should help explain the puzzle a bit.