Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

I am looking to replace the hyperterminal with labview code

I am trying to replace the hyperterminal with labview code. I am getting visa read error. Please provide me the sample code or let me know where I can find the sample code?

Thanks

Jey
0 Kudos
Message 1 of 10
(4,849 Views)
I don't see anything really wrong with your program. All it does is read continuously from whatever instrument is connected to your serial port. Now, if your instrument isn't transmitting all the time, you'll get a timeout error. Also, instead of using a fixed byte count to read, you could try using VISA Bytes at Serial Port to determine how many bytes are actually there.
0 Kudos
Message 2 of 10
(4,844 Views)
Yes, My board is not transmitting all the time, That's why I am getting time out error. How can I fix this?

Thanks

Jey
0 Kudos
Message 3 of 10
(4,836 Views)
Is it supposed to transmit all of the time or just when you send a command requesting data? If it's neither and just transmits periodically, use the function I mentioned (VISA Bytes at Serial Port), and only do a read when there are actually bytes to read.
0 Kudos
Message 4 of 10
(4,831 Views)
Jey,

here is my hyperterm replacement, I use it for first serial tests on new devices.
It's maybe more than you need and not even documented.
It's in LabVIEW 7.1 now (was 6.1), and this new serial assistant looks even more powerful than this, however I haven't used the assistant (started with LV3.1 😉
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 5 of 10
(4,824 Views)
Thanks, Now I don't get the Visa Error. But I don't see the output on read buffer. How can I fix this?

Thanks for your support.
0 Kudos
Message 6 of 10
(4,821 Views)
I don't know. You didn't answer my other questions. If the instrument requires you to send a command first, you'll need to do a VISA Write of that command before you get anything back. It's also possible that you don't have the com parameters set correctly or your cable is wrong. Have you tested communication with it with Hyperterminal? What's the instrument? Is there a manual that you can post or provide a link to?
0 Kudos
Message 7 of 10
(4,817 Views)
Actually I am running a diagnostic test on my communication board. There is no need to send the command to read anything. In hyperterminal, Just configure the com and the power up the board. The status will show in the hyperterminal window. After I changed the serial bytes at port only I don't see anything. But if set to byte count to something, I will see the output then after I get visa error message.
0 Kudos
Message 8 of 10
(4,814 Views)
Okay, I think I understand now. Try modifying it per the attached example. It's possible that you're reading the data and then it's getting overwritten with an empty string when there is no more data to be read. Another way is to put your VISA Read and string indicator inside a case statement. If bytes available is greater than 0, do the read. If the board stops sending any info once it has booted, then that would account for your seeing the output once and then getting an error. If that's the case, just get rid of the while loop.

Message Edited by Dennis Knutson on 04-27-2005 10:16 AM

Message 9 of 10
(4,813 Views)
Thanks Dennis, Now I am all set and It works fine.
0 Kudos
Message 10 of 10
(4,802 Views)