A method and system for delivering a pharmaceutical gas to a patient. Themethod and system provide a known desired quantity of the pharmaceutical gasto the patient independent of the respiratory pattern of the patient. Thepreferred pharmaceutical gases are CO and NO, both of which are provided as aconcentration in a carrier gas. The gas control system determines the deliveryof the pharmaceutical gas to the patient to result in the known desiredquantity (e.g. in molecules, milligrams or other quantified units) of thepharmaceutical gas being delivered. Upon completion of that known desiredquantity of pharmaceutical gas over a plurality of breaths, the system caneither terminate any further delivery of the pharmaceutical gas or canactivate an alarm to alert the user that the known quantity has beendelivered. The system also has alarm functions to alert the user of possiblemalfunctions of the system.