The plain view exception applies to more situations than just finding illegal substances or activities during a warranted search. (Although the plain view exception is frequently applied in situations where police are conducting a warranted search for one thing but then find and seize something else that is illegal. But the plain view exception is NOT limited to those situations only. For example, if a police officer knocks on your door for whatever reason (always legal) and sees or hears or smells something that is illegal, the officer can enter and seize the illegal object that was seen.
A limitation on the plain view exception: Police knock on your door. You open door. Police see illegal drugs on table. Police may seize the drugs in plain view. However, police may not proceed to search anything that is not in plain view. An example: After seizing drugs on table, police begin opening droors in your bedroom and find an unregistered gun. The prosecutor could not introduce the gun at trial because it was obtained illegally, that is without a warrant or pursuant to an exception.
Another situation occurs when police are conducting a search, pursuant to a valid warrant, and find an illegal object which was not listed in the warrant. Here are a couple examples of how this works. Example: Police search house, pursuant to a warrant for cocaine, and find a gun. The gun is admissible. Contrasting example: Police search house, pursuant to a warrant for stolen televisions, and begin searching in small droors where they find cocaine. In this second case, the cocaine is NOT admissible because the warrant was issued for stolen televisions, which are never found in small droors.
(These search and seizure laws are explanations of U.S. Constitutional law, specifically interpretations of the 4th Amendment. A state may afford the accussed additional protections beyond those demanded by the U.S. Constitution.)