Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Read

Hallo,
ich bin ziemlich neu bei LabView(Version 8.0) und muss über VISA (Version 3.2)mit eine RS232 arbeiten. Visa ist schon im PC (XP) installiert, aber leider jedes mal wenn ich mit Write und Read arbeiten möchte bekomme ich eine Fehlermeldung, dann habe ich hier im Forum gelesen, dass man eine Schleife mit eine Warte Zeit zwischen Write und Read einbauen muss. Aber jetzt bekomme ich eine Warnung mit der Fehlercode 1073676294. Und Visa Read Funktionniert offensichtlich nicht. was soll ich dagegen tun? Könnten es sein, dass der Treiber nicht richtig installiert ist?
Danke für jede nützliche Antwort.
0 Kudos
Message 1 of 4
(3,394 Views)
What kind of instrument is connected, or is nothing connected yet?
are baudrate etc correct,
maybe you can try first with the hyperterminal.
 
It is now about time that a better hyperterminal is written in LabVIEW, who starts this?
greetings from the Netherlands
0 Kudos
Message 2 of 4
(3,382 Views)
Hi,
there is a Power Supply controller connected at my PC trough the RS232 and the Baudrate, stopbits, parity and Databits are correct initialised.
What must I do whith the Hyperterminal?
Thanks
0 Kudos
Message 3 of 4
(3,376 Views)
Faqui,

wenn möglich ist es besser, hier in Englisch zu schreiben, dann können mehr Leute davon profitieren...

The error code 1073676294 as described means: 'VISA:  (Hex 0x3FFF0006) The number of bytes transferred is equal to the requested input count. More data might be available.'.
This is a result of a IMHO 'crossminded' approach in the VISA usage.
Finally this means that you got the requested number of bytes, but VISA is unsure if there are some more. I usually ignore this message as long as I got the result I expected.

What to do?
1. Check the result of VISA read if your expected answer was received. If so and if its error code is the above mentioned number, than use the result and replace the error cluster with a no-error constant. Else if there was an error, stop reading and return this error (result might be returned as well). If there was no error but not yet the complete expected answer was received, than your delay between write and read should be increased and you should retry the whole process.
2. If the expected answer of the device always has a kind of termination character (usually a /r or /n or /r/n in '/'-display mode; this is 0x0d, 0x0a or 0x0d0a in hex mode and represent the ASCII control characters for carriage_return CR and line_feed LF), you may set this termination character, enable it and always ask for the longest possible answer of your device. In this mode the VISA stops reading when the termination character was detected, so it reads one line of answer at a time.

You may want to search the examples, for instance 'Advanced Serial Write and Read.vi' in order to get a good starting point.

Alberts answer pointed you to using Microsoft's Hyperterminal HT to test the hardware connection.  This is probably easier to do than with LabVIEW, just to ensure the device, cable and port are operating as expected. If you are not familiar with HT you might either read its manual or skip this step completely.

Greetings from Germany!
--
Uwe

0 Kudos
Message 4 of 4
(3,373 Views)