Ok, if p0340 has gone away, your timing chains are probably fine.
P1140 is Intake Valve Timing Control Performance Bank 1, see herefor causes:
http://nissanhelp.com/diy/obd_codes/p1140_nissan.html
It seems your cam position sensor is ok since P0340 went away, and your crank sensor is not setting any codes, so you should be ok there. You need a good ecm, good circuit to the solenoid valve, a good solenoid valve, and adequate oil pressure for everything to work (read the NISSAN description section in that link).
I think you have already swapped solenoid valves, and found that did not fix the problem.
The only way I 've seen to definitively diagnose this is to use a good professional scan tool. You set it to read the duty cycle of the intake solenoid valve, and to also read the intake cam advance in degrees. Test the driver side ( bank 2) first since it is ok and not setting codes. The duty cycle is increased as the engine is revved up to advance the intake cam timing, and you can see the degrees of advance on the scan tool. Advance will decrease as the engine returns to idle.
Now measure the passenger side (bank 1). The duty cycle should increase like on bank 2 as the engine is revved. This means:
- the ecm is properly monitoring and trying to adjust the cam advance.
- the circuits are ok, as you see the duty cycle increase.
So you can rule out the ecm and the circuit to the solenoid valve.
You already swapped solenoid valves, so you have a known good intake solenoid valve.
Now, if the intake cam is not advancing properly, it will be because of low oil pressure to that solenoid valve. The ecm will continue to increase the duty cycle of the solenoid to try and get the cam to advance (by providing more oil flow), but when it fails to see the amount of advance needed, it will set the p1140 code.
A good shop should have a scan tool that can do this (intake cam advance systems are not unique to Nissan) or Nissan can do it.
All of that is from a post by NissanTech several years ago on here, but I've lost the link.
Unfortunately, if it's oil pressure, the front of the engine comes off to find where the problem is.
So make sure you have a p1140, then I guess you can go from there.