06-06-2012 03:04 PM
I haven't been able to fix this error problem that I have seen a lot of people post in this forum:
Error -1073807339 occurred at VISA Read in Serial Read with Timeout.vi->Serial Communication.vi->TestLoops.vi
VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.
It lists that the problem is in my VISA Read. I've gone onto the site below in hopes of trying to fix the problem:
Even when I narrow it down to reading only 1 byte while debugging it is still giving me the same error. I tried to see if I could see the number of bytes in the Serial Port by following the above site's instruction but I don't believe it's the right version since I couldn't follow along with their:
"Right-click the Property Node and select Select VISA Class»I/O Session»Serial Instr. Then right-click the Property Node and select Properties»Serial Settings»Number of Bytes at Serial Port"
I also tried to increase the timeout value to the best of my knowledge. I have attached the appropriate VIs from which the error is occuring. Thanks!
06-06-2012 03:25 PM
Most of the time, the cause of a timeout is with the write. You could have the wrong com settings, wrong type of serial cable, the wrong command, or the wrong termination character. Any of these will cause the instrument to not respond. Ypu have not mentioned the make and model of the instrument. You have not provided the manual. You have not provided the VI called TestLoops. The only command that I can see is thewrite string of 'Jon'. Are you actually sending that to an instrument? Also, you have a '>' for a read termination character but you are sending a carriage return as the write termination character.
06-06-2012 03:32 PM
Thanks for the note. I'm using a New Focus Picomotor model 8751-C. Attached is the TestLoops VI. The write string 'Jon' (Enable Joystick Control), I believe, is the syntax for Joystick Control Command (I'm using a Picomotor control command not a joystick control commands).
06-06-2012 03:36 PM
I had the same problem with serial control of my DUT. All I had to do to fix it was to go to the Open Serial Visa and increase the timeout time to something longer than it took for the device to respond, when the command was issued manually. In my case the device took 6 seconds to respond to a query and the serial timeout was set to 2 sec. try increasing the serial timeout and see if that fixes the problem.
06-06-2012 03:47 PM
Thanks for the reply. I'm new at this so bear with me here. When you mean 'increasing the serial timeout' does that mean in my Serial Read with Timeout VI? I attached a .JPG file where I tried to change the time there. Did I have that correct? If so, then increasing the timeout did not affect it. I even went up to 12 seconds with no success.
06-06-2012 04:27 PM
It may be the same as with the Visa Serial Port Configuration, which has the timeout wired on top. Have you tried the command manually to see how the unit actually responds. When I have serial comm issues, I check everything manually to validate my assumptions about how the interface works. I assume nothing. In another case it won't respond unless the port gets only hex chars, others ASCII only. Terminations for command and queries don't always have common terminators. If the write command is not terminated properly, the read will never work. The serial "bytes at port" is a property node in the VISA Serial port section of the controls.
06-07-2012 09:13 AM
I'm trying to understand these termination characters and carriage returns. So since I am using windows would I need to change these to \r\n instead of '>' for the termination character and carriage returns for my write term char for both of my Serial Communication.VI and VISA Configure Serial Port.VI? And yes the commands are being sent to the instrument. Thanks.
06-07-2012 09:21 AM
The write and read termination characters are defined by the instrument vendor and have nothing to do with windows. It should be defined in the manual.
How do you know the commands are being sent to the instrument? If it is just because you don't get an error on the write, that is meaningless.
06-07-2012 09:28 AM
I am using a program that was being used before on the same instrument. So I have been able to send commands to the instruments. What I've had to do was just reconfigure the user inputs and movements in the TestLoops.vi. I hope that makes sense. Thanks.
06-07-2012 09:40 AM - edited 06-07-2012 09:45 AM
Sorry, I don't have the hardware or the manual so I can't really provide more specific help. Have you tried using a terminal emulation program such as Hyperterminal/Procomm/Putty? Since you say you inherited the program, at one time it must have done reads as well as writes. What changed since you took over? Same instrument, same cabling, same pc?
p.s. That top level test program called TestLoops is somewhat poorly written. No error checking except the automatic type and of course your execute button does nothing once the VI starts. In your subVI, you also reconfigure the serial port and close it. This should only be done once - at the top level VI.