LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Read- error -1073807339?

I think that VISA is not reading anything from my serial port. I am using the Polhemus via serial, yet I have not been able to read ANYTHING from the device. Do I have to write a driver before I will be able to read? I am using VISA open, read, close and I am trying to use timeout, but I don't think I am doing that properly. Please help! Thank-you!
0 Kudos
Message 1 of 9
(4,114 Views)
Hi Ibahka,

Don't despair.. Serial communication is typically simple.

From your description, it appears that you are implementing correct steps.

First question is what version of LV are you using?
What OS are you using.

I will assume Windows. If so, are you able to communicate with the device using HyperTerminal or some sort of communication software outside LV?

If you were successful, are you using the identical configuration for the way you setup the port in LV?

If you are using LV6.1 and older... I seem to remember that the reference to COM1 was 0 (zero) and COM2 was 1. That was a bit confusing.

I am trying to remember what else could prevent communication...

As far as having to write drivers, not from LV point of view. Typica
lly, whoever designs the product and offers the serial communication port already has their drivers and set of commands available.

The 1st thing is to be able to communicate with the device using someting like HyperTerminal. Once that works, the rest is simple.

Other possibilities could be the RS-232 cable.. verify the cable.

Good luck,

JLV
Message 2 of 9
(4,114 Views)
You are creating a LV driver when you use the VISA functions. Joe's suggestion to try it in Hyperterminal is a good one. I noticed that you do not mention either VISA Configure Serial Port or a VISA Write. Once you verify baud rate, stop bits, etc. and the cable with Hyperterminal, you should put in a VISA Configure Serial Port with the same settings as Hyperterminal. If the instrument sends out a constant stream of data (which you can confirm in Hyperterminal), then you don't need a VISA Write to tell the instrument to send something. If it doesn't, you'll have to first write that command and then do a read.
Message 3 of 9
(4,114 Views)
Thanks for answering. I am using LV 7 and Windows. I was able to communicate with Hyperterminal successfully, so I think I am applying the correct conditions. I am still having troubles with my VISA Read terminal. If you have time, please look at my file which I have attached. I would be extremely grateful! IBAHKA
ps- I placed a write terminal, however I am still not sure what I should be typing in the write command.
0 Kudos
Message 4 of 9
(4,114 Views)
You would enter into the write string whatever you type at Hyperterminal in order to get data. You do have to append a carriage return to each command. This is something that Hyperterminal does for you when you hit the enter key. In LabVIEW, you can set your write buffer string to show slash codes and enter \r after a command or use and append string function on the diagram with the carriage retrun constant. Here is a modified version that you can try. I also put a small delay after the write and then used a VISA Bytes at Serial Port to determine exactly how many bytes to read.

p.s. Joe's earlier comment about Com1 being 0 and Com2 being 1 is incorrect. In VISA, Com1 has always been ASRL1 and Com2 has always been ASRL2.
0 Kudos
Message 5 of 9
(4,114 Views)
Cool! It's reading! And in ASCII! Thanks- what a great help! So now I should add a while loop in order to collect data continuously? Also could you tell me how you get the indicators to be a smaller shape- I usually right click>>create>>indicator and that gives me those big ones.
Again, thanks so much!
Ivanka
0 Kudos
Message 6 of 9
(4,114 Views)
Yes, a while loop would be the next step. Looking over the documentation on the instrument, I noticed that it's possible to set it up to transmit continously without the need to do a write requesting data but you may want to hold off implementing that for a while until you gain a bit more experience. It can be troublesome trying to synchronize the instrument transmission with the serial port read in your program.

If you mean the large icons on your block diagram, you can go to Tools>Options>Block Diagram and uncheck the box that says "Place front panel terminals as icons". For any that you already have, right click on the icon and the View As Icon will show as checked. Selecting it will uncheck it and make it display
as a small terminal.
0 Kudos
Message 7 of 9
(4,114 Views)
Thanks for all your helpful answers. I posted another question about splitting up strings into elements when each string has 7 elements, which are divided with a \s or \r\n at the end of a string. How would I do that? Thanks!
0 Kudos
Message 8 of 9
(4,114 Views)
Thanks Dennis for keeping me on my toes..

🐵
0 Kudos
Message 9 of 9
(4,114 Views)