08-20-2012 04:27 PM
In your first VI, you were appending a line feed. In the latest, we have no idea what you are appending if anything at all. If all you are entering into the string control is "pin 1 state", then that is much different than the first VI you posted and almost certainly wrong. I'll say it again that you need to check for '\' Codes Display if you type in \n. You also need to understand the difference between \n and /n. The /n you have in your code is NOT a line feed. You just can't freely mix up \n and /n. Pay a little more attention.
08-20-2012 05:08 PM
Sorry for the confusion. I guess I was messing myself up in the process.
I have tidied up my code and I have solved my problem. It will now write and read for both pins without error. Hopefully the attached images will show what I was intending.
Thanks for all your help guys.
08-20-2012 05:15 PM
I'm glad it's working but now you need to do some cleanup. The VISA Configure Serial Port and the VISA Close should not be inside the loop. As mentioned several times, you don't need the VISA Bytes at Serial Port (or the wait). Since the returned data is terminated, as long as the termination character you set with the VISA Configure Serial Port is the same, you can just use a high number of bytes to read. The VISA Read will wait and then terminate all by itself when the termination character is detected.
08-20-2012 05:30 PM
I have did as you said and everything works perfectly. The code now instantly updates without the need for the waits.
Once again, many thanks for your help. I'm slowly but surely getting my head around serial communication.