Solenoid stays on when output turned off
A common problem.  Its all to do with the coil on the device, I have had the same issue with energising contactors before.

Try instead to used the PLC output to energise a small relay and switch the solenoid via a relay contact.  That should solve your problem.