RPM revs up and down non-stop and now check engine lite. 1998 EX v6

Thanks for a quick response. I was wondering if you could tell me why the RPM acted the way it? I am at work right now so when I start my car again on my way back I will stop by kragens to see if they can check the code for my car. I am still curious about the RPM and wonder if it will do that again in the evening when I start my car again? Thanks again for the quick response and I will post again with the code.