Determine the parameters under which you will determine the machine is down, such as being idle for 10 minutes, motor stopped, or some other paramter.
There are two kinds of down time. Planned, and unplanned.
Unplanned downtime should have a few cause codes, such as:
operator unavailable
break down
unplanned tooling maintenace.
In the event that an unplanned downtime is detected, the operator has to select a cause code to proceed.
Allow time to change parts and reload material - this is part of operating the machine, even if the machine is stopped, and should not be counted as downtime.
Planned downtime might include
Set-up
First article inspection
Product unavailable
Planned maintenance
Operator break/lunch
Planned dowtime does not genearally count against the overall equipment efficiency, while unplanned downtime does.
I hope that helps get you started. Once you have what you need sketched out we will be able to give you more help.