Hello, I'm Jason.I will do my best to answer your question quickly and accurately using the information you have provided.
Just so you're aware, it's quite possible that we won't be able to come to a definitive answer here, which is often the case with problems like this. Some problems like this are difficult enough to diagnose with the car right in front of me, and much more challenging to diagnose through the computer screen. However, what I can do is try to steer you down the right path, and provide you with some information, and relevant questions that you can ask your dealer/service provider. If you're doing your own work, I can try to guide you through some of those troubleshooting procedures as well.
Now, my questions to you:
I have a bad feeling that you've got a timing chain/tensioner/broken chain rail problem. I have my doubts that either the crank sensor or cam sensor is faulty, as the text of the 1340 code would suggest. Here is the code description
P1340 - crankshaft/camshaft position sensor signals out of sequence.
In about 90% of cases I deal with, this means a skipped chain. I'm shocked there are no other supporting codes (P030x misfires).
Here, let me show you a perfect example of what typically happens. This one just happens to be on my own '00 Jetta GLS VR6
Look at the black chain guide rail to the lower left of this picture and see how much slack there is in the chain
Now, let me show you what it should look like
This job requires transmission removal to complete. If the car is a 5-spd manual, also a good time to replace the clutch set. If you would like a link to the absolute best writeup ever on a VR6 chain DIY, I will be happy to post the link.
Honestly, I've never done this job in less than 6, and I've done quite a few of them. Actual book time, including transmission removal and replacement is 13.5 hours.
And yes, the link is to the Vortex (I used to be a mod on there long ago).
Even now, I still use this link rather than the official repair manual
Your best first step is to pull the valve cover, and set the crankshaft to TDC, and then take a look at the camshaft positions to see if the chain has skipped. All marks and information are in the link.
If the car is still running, then it's very likely that there is no valvetrain damage, and you will just have to do a chain/tensioner/rail replacement. Actually, either way, with that mileage, a chain job is necessary if the chain is slack and/or skipped.
Here is an excellent chain kit: