Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Olympus IX-81 VISA Read Problem

Solved!
Go to solution

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.

Download All
0 Kudos
Message 1 of 12
(6,607 Views)
Right click on the command string control and make sure it is set for '\´ Codes Display. With a VISA property node, you can only set a single termination character.
Message 2 of 12
(6,587 Views)

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? 

0 Kudos
Message 3 of 12
(6,584 Views)
You can enter both characters in the command string as you've done and written the correct display mode as I've said. You can concatenate both characters on the block diagram with the constants on your string palette. The serial end mode for writes is set with a property node.
Message 4 of 12
(6,519 Views)

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?

0 Kudos
Message 5 of 12
(6,396 Views)

Is there any more information I can provide to you that can help you aid me in troubleshooting this problem? 

0 Kudos
Message 6 of 12
(6,391 Views)
You need to troubleshoot this yourself by looking at the string control as I said.
Message 7 of 12
(6,224 Views)

 

To the right of you picture that you did not tell us about in the case structure is Remove Termination Character.vi

Olympus Remove Termination Character.png

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!

Omar
Message 8 of 12
(6,026 Views)
Solution
Accepted by topic author SeanNorbury

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"

Omar
Message 9 of 12
(6,015 Views)

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.

0 Kudos
Message 10 of 12
(5,996 Views)