08-15-2015 03:40 PM
I am trying to control the Olympus IX-81 microscope with LabVIEW and cannot seem to communicate with the microscope. I just recently configured the settings in the VISA test panel, and was finally able to both read and write to the instrument through serial, but when I tried the same settings in the VI's provided by National Instruments, I get the same timeout error at VISA read. Each command needs to end with \r\n, but I cannot find the place where I can set each command to contain this. I put a probe in the spot right before the error occurs, and noticed that under the transfer settings tab in the probe watch window, there is a lit up indicator titled "Use TermChar on read", but the Termination character box below it contains "A" instead of \r\n. Also, the "Send end on write" indicator is lit up, however, the "Send end mode for writes" box below it says "none". I am new to LabVIEW and this is my first time posting to the forums, so please forgive me if I have not explained my situation in the best manner. I have spoken with LabVIEW tech support multiple times to no avail. I have attached a screen shot of what I am referring to and also a zip file containing the VI's I am trying to work with. Any help would be greatly appreciated. If there is any more information I need to provide, let me know. Thanks.
Solved! Go to Solution.
08-15-2015 04:39 PM
08-15-2015 04:53 PM
I need to set 2 termination characters, \r\n. Is there a way to do this without using the VISA property node? Should there be a serial end mode for writes?
08-15-2015 07:07 PM
08-15-2015 11:33 PM
So is the error in VISA Read caused by the command going to VISA Write not being closed properly? I have taken only one computer science course so far and it was java based. Would this be similar to not putting a semi-colon after a line of code in Java?
08-15-2015 11:51 PM
Is there any more information I can provide to you that can help you aid me in troubleshooting this problem?
08-16-2015 06:39 AM
08-18-2015 11:08 AM - edited 08-18-2015 11:10 AM
To the right of you picture that you did not tell us about in the case structure is Remove Termination Character.vi
That is stripping out the control codes that you entered in "Command string".
It will strip the first CR or LF and anything after it.
Also from your picture of the "Command string" we can not tell if you have entered codes correctly.
As Dennis has asked you before set the string control for '\' Codes Display so we can tell what you are doing.
We can not tell if the '\r\n' in your picture is entered correctly without knowing if we are looking at a "Normal Display" or a '\' Codes Display!!!
If the string control is set to "Normal Display" than you have entered the control codes incorrectly!
08-18-2015 11:50 AM
After eating some lunch and look at your picture better, I see that the Remove CR+LF is only from the reads and not before the VISA write.
BUT also looking over the "Olympus Command.VI" again, the "Command string" control is in "Normal Display".
So unless you have changed the version that you have to "'\' Codes Display" we are confident that you have not entered the CR and LN correctly.
Change the display setting of the Command string and reenter your command with "\r\n"
08-18-2015 01:25 PM
Dennis, Omar, thank you both for your help. I had to change the display settings to "\" as you said, and also manually type in \r\n to each command. I think I will try to concatenate \r\n into the code so it does it automatically with each command. I apologize for any attitude I may have had during these posts. I have many projects going on right now and this one was just absorbing too much of my time. Now that I have communication, I can actually write the program. Thanks again.