It looks like you just tried to copy C code into your VISA writes. That will not work. You need to use the proper SCPI commands as documented in the manual. Alternatively, you could download the LabVIEW drivers that Keithley provides.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions Unofficial Forum Rules and Guidelines "Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5