LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Read Error

Hi FireGiant,

 

Thanks for your response. I have been sending the IDN? command, amongst other listed in the manual but always encounter an error at read. Thank you for pointing me to the white page, I have included VISA Set I/O Buffer with a mask of 48 within my VIs but unfortunately with no resolution to my previous error (at least with my implementation). The parameters I am setting for baud rate, parity etc.  are, I believe, consistent with the instrument manual.

I wonder if there is more I can do with the buffer/flush setting though which might help, is a mask of 48 necessarily the best?

0 Kudos
Message 21 of 33
(2,293 Views)

I assume since you're using the mask 48 you are combining mask 16 and 32 to clear both the read ans write buffer. I will have to go back through the post to see if there is code because you may already be doing what I'm about to suggest. if you're putting 48 wired straight into the VISA Flush try explicity adding 16 and 32 with an addition node or using an OR statemetn to combine the two. Then plug them into the Flush VI.

 

Again I aplogize for essentially pointing you all over the place and perhaps recovering ground but I did find this which might be helpful. So it may be your combining your mask numbers in a way LabVIEW doesn't like.

https://forums.ni.com/t5/LabVIEW/Labview-VISA-Flush-I-O-Buffer-how-can-they-be-used/td-p/378452

Message 22 of 33
(2,287 Views)

Hi FireGiant,

 

Thank you for your patience with me. I am quite sure I do not understand the use of the buffer mask size and buffer flush. Perhaps you could comment on the attached VI I have just re-made. Perhaps a meaningful observation I have noticed with this iteration is that the TTI multimeter makes a little chirp only every third time the VI is run.

 

Thanks again.

0 Kudos
Message 23 of 33
(2,255 Views)

You do *not* want to flush the buffers *after* sending the command, otherwise you have justed flushed your response down the drain.

Have you verified that the defaults to the VISA serial port OPEN functions are correct for your instrument?

Also, wire up an error output indicator to see if there are any errors.

Include a close VISA after your read.

Manually check your instrument for errors. Most instruments will have a menu system that you can check for errors. Maybe it will give you a hint what is not working.

 

It really should not be this hard to get your instrument talking.

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
Message 24 of 33
(2,241 Views)
I can’t debug your “picture”, but I have an observation. You are sending the command “*IDN?\n”. Your return count is 7. To me that means you are sending a literal “\” and “n” and NOT a single New Line character. Right click the command string constant and turn on display \Codes then enter the termination character correctly.
Message 25 of 33
(2,233 Views)

Hi Frozen,

 

Thank for your comments. By VISA serial port OPEN functions do you mean those in the attached image, which I extracted from the manual? In which case, these are the same as what is set in the VI. I have added in the error indicators as you suggested and encounter the familiar 1073807298 error. I have included a close VISA command. I can't however see any errors reported on the instrument display.

 

Again I'm not sure if it is relevant but the return count after the Visa Read varies between 0 and 1 as I increase the input byte count.

 

Thanks for your help.

0 Kudos
Message 26 of 33
(2,212 Views)

Thanks jamiva, I've made the correction, the command contained an extra \.

0 Kudos
Message 27 of 33
(2,208 Views)

It really should not be this hard!

 

Try the following steps:

1) cycle power to the instrument
2) Reboot your computer
3) Run attached VI (Do not change anything)
4) Attach a screen shot of the front panel
5) Change Cmd String to "*OPC?" (do not include the quotes)

6) Power cycle the instrument
7) Run the vi and attach screen shot of the FP

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
Message 28 of 33
(2,184 Views)

Hi Frozen,

 

In each instance I receive the attached output on the front panel.

 

0 Kudos
Message 29 of 33
(2,157 Views)

I would add a Visa Open between the config and Write, a Visa Close at the end and ofcourse remove the Flush in the middle.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 30 of 33
(2,141 Views)