It sounds like your Ford F-250 truck has a problem with the emission monitors not being ready. Replacing the battery erased the emission monitors. Driving your truck through a drive cycle will allow it to complete (make ready) the emission monitors (also known as Readiness Flags) which are needed to pass the smog check.
A drive cycle is a series of driving patterns which allow your Ford's engine control unit (ECU) to perform various emission tests, referred to as Emission Monitors. In order for your Ford F-250 to pass the smog check these monitors must show Ready or Complete when the vehicle is connected to the smog machine via the OBD-II Data Link Connector.
Normally we recommend driving at least 300 miles over the course of a week in order to go through all the specific sections of a complete Ford F-250 Drive Cycle, without following the drive pattern specifically. At times however it may be required to follow the Ford Excursion drive cycle (indicated below) step by step in order to complete the drive cycle faster.
Take extra caution when performing the drive cycle on city streets and highways as there are many stops, slow downs, and speed ups. Usually driving in normal traffic on both city streets and highways, over the course of a week completes the drive cycle. Just make sure at no time in-between driving is the battery disconnected or discharged, as well as ensure the check engine light is not on... or else you'll have to start all over, or in the case of the check engine light being on, the drive cycle will not initiate, requiring repairs first
Ford F-250 Drive Cycle
The following procedure is directly from Ford and designed to complete the OBDII monitors required to get your Ford F-250 to pass the OBDII Monitors portion of the smog check, also known of the I/M readiness test. You may use a scan tool in order to monitor the status of the emission monitors as your Ford F-250 is being driven.
Drive Cycle Recommendations:
1.Your Ford truck's emission monitors will complete quicker when using a "steady foot" driving style during cruise or acceleration modes. Operating the gas pedal in a "smooth" manner will minimize the time required for monitor completion.
2. Ensure fuel tank level is between 1/2 and 3/4 fill during the drive cycle in order to allow the EVAP monitor to run.
3.The Evaporative Monitor can only operate during the first 30 minutes of engine operation. During the EVAP portion of the drive cycle, drive in a smooth fashion to minimize "fuel slosh".
Drive Cycle Preparation
4. If using a scan tool, go ahead and connect it now. Turn key on with the engine off. Cycle key off, then on. Select the appropriate vehicle make and model on your scan tool. Start your Ford truck WITHOUT returning to Key Off. Idle the vehicle for 15 seconds, and then drive at 40 MPH until engine coolant temperature is at least 170°F, which is normal engine operating temperature. 10 to 15 minutes of drive will achieve this.
Drive Cycle Drive Trace
HEGO Monitor - 5. Cruise at 40 MPH for up to 4 minutes.
EVAP Monitor - 6. Cruise at 45 to 65 MPH for 10 minutes (avoid sharp turns and hills).
Catalyst Monitor - 7. Next, drive your truck in stop and go traffic conditions. Include five different constant cruise speeds, ranging from 25 to 45 MPH over a 10 minute period.
EGR Monitor - 8. From a stop, accelerate to 45 MPH at 1/2 to 3/4 throttle. Repeat this pattern 3 times.
SEC AIR/CCM (Engine) - 9. Bring your truck to a stop. Idle with transmission in drive (neutral for M/T) for 2 minutes.
CCM (Trans) - 10. If your Ford has a manual transmission, go ahead and accelerate from 0 to 50 MPH, continue to step 11. For Automatic Transmissions, start from a stop and in overdrive, then moderately accelerate to 50 MPH and cruise for at least 15 seconds. Stop the vehicle and repeat without overdrive to 40 MPH cruising for at least 30 seconds. While at 40 MPH, activate overdrive and accelerate to 50 MPH and cruise for at least 15 seconds. Stop for at least 20 seconds and repeat step 10 five times.
Misfire & Fuel Monitors - 11. From a stop, accelerate to 65 MPH. Decelerate at closed throttle until 40 MPH (no brakes). Repeat this 3 times.
Readiness Check - 12. If using a scan tool, go ahead and access the ON-Board System Readiness (OBDII monitor status) function on the scan tool. Determine whether all emission monitors have completed.
Evap Monitor "Bypass" - 13. Park vehicle for a minimum of 8 hours. Repeat steps 2 through 12. NOTE" This step is not necessary if (where the vehicle is located) ambient air temperature is between 40 to 100° F and altitude is below 8000 feet.
If all emissions systems are functioning properly, completing the drive cycle above should set or make ready (complete) your Ford F-250's emission monitors. If the emission monitors are still not complete, check for any trouble codes and whether the check engine light is on or not. If faults are found make the appropriate repairs and conduct the drive cycle again. Take extreme caution when performing drive cycles on public roadways. Perform the drive cycle at your own risk.