From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview driver for vitrek 4700

Solved!
Go to solution

Hi all

i am trying to write driver for Vitrek 4700 HV DMM, this DMM communicate through RS232.

When i send commands from NI max test panel i get respond from DMM but, when i try to

communicate from labview  VI  i get visa read error -1073807339 to *idn queryfor same communication settings 

my question is are any hidden setup in ni max test panel ?

0 Kudos
Message 1 of 26
(3,301 Views)

Most likely you need to init visa with enabled end characters.

 

Hard to say without any code...

 

It might be that max and LV are opened at the same time.

0 Kudos
Message 2 of 26
(3,293 Views)

here is my codevitrek4700.png

0 Kudos
Message 3 of 26
(3,285 Views)

@idans wrote:

here is my code


It is in fact (just) an image of your code... "ceci n’est pas une vi".

 

you might have better luck simply sending \n in the string. IIRC, visa uses the end characters for reading, but doesn't automatically attach the end character when sending data. Rational is probably that it doesn't know when you're message is complete. You could use multiple sends to send parts of one message.

 

I'd use "VISA Configure Serial Port.vi", as it's a bit less verbose...

0 Kudos
Message 4 of 26
(3,279 Views)

I attached my vi after adding configure serial port and a /n char after *idn, but no good

0 Kudos
Message 5 of 26
(3,273 Views)

@idans wrote:

I attached my vi after adding configure serial port and a /n char after *idn, but no good


There's no "/n" after "*IDN?" in that VI. And it should be "\n". And that will only work if the string is set to '\' code display mode. If not (normal display mode), simply add an enter.

0 Kudos
Message 6 of 26
(3,268 Views)

my typo \n after idn?

0 Kudos
Message 7 of 26
(3,265 Views)

@idans wrote:

my typo \n after idn?


You programmed the Serial port to use \r as an end character. Carriage Return (\r) should be Line Feed (\n). Probably, I didn't read the manual.

 

\r could be correct, but then you should also send \r. I think it should be \n though.

0 Kudos
Message 8 of 26
(3,260 Views)

ok i got some advancment ' i added a for loop around *idn? query and i let run twice, at first iteration i get read error but in second loop i get a respons from instrument. 

could someone explain me what is the problem? because i give the read vi long timeout ,5sec, but only at second attempt i get response  

0 Kudos
Message 9 of 26
(3,259 Views)

I'd remove the buffer flushing and changing the buffer size. This might be lagging (taking some time), spoiling the first send. I've never needed those.

 

A wait between the flushing\init and the send might fix the problem, but I'd avoid waits.

 

In general, I'd use the serial init VI.

0 Kudos
Message 10 of 26
(3,249 Views)