Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Failed read from Extech sound meter

I am attempting to communicate with an Extech 407764 sound level meter via RS232. The manual contains the instruction set on the last page (see here under User Manual). I also have a stand-alone software application they sent with the device, but I want to create my own. I am able to write to the device and change setting on it, for example. However, I cannot read from the device. I attempted to debug my problem using portmon, and there are some differences between my program and the stand-alone one, but I'm not sure what might be causing the problem, or how to change it. Below are two portmon logs: one from their program, and one from mine. I have portmon set to output HEX instead of ASCII. The noticable differences to me are the FLUSH after the WRITE request, and the XOnLimit/XOffLimit settings, but maybe those are red herrings. Also, I don't know how to change that from within LabVIEW. There seems to never be any bytes available at the port to read. I'm hoping someone can point me the right direction. I have also attached my simple VI which is a modification of the Serial Read/Write example with a loop added. I'm writing a space each time (Hex 20) because their program appears to be doing it as well.
Download All
0 Kudos
Message 1 of 8
(5,004 Views)

You use flow control none, that is ok with LabVIEW

but maybe the instrument is waiting for Xon before it sends anything

greetings from the Netherlands
0 Kudos
Message 2 of 8
(4,982 Views)

Thanks for the idea. I tried changing to XON/XOFF, and that didn't seem to help. I went through all 4 different flow control options and none of them appeared to fix the issue. These changes don't seem to appear in port monitoring logs. Is there an other way to determine the flow control being implemented? Or even to determine if that might be my issue?

I also noticed that the XOnLimit and XOffLimit for the stand-alone software seems to be 10 (bytes?), but I cannot seem to set a value that low using the SetBufferSize VI under VISA; they seem to only go as low as 16.

I'm not sure if again I am pursuing a red herring with this or not. I appreciate the advice. 

0 Kudos
Message 3 of 8
(4,970 Views)

The only other thing I can think of is that you send an Xon as the first character after opening the VISA session.

Maybe the other side thinks it cannot send until an Xon is received.

greetings from the Netherlands
0 Kudos
Message 4 of 8
(4,955 Views)

You have the serial settings for the Extech Sound Meter set wrong. Use these settings:

Baude Rate: 2400

Data Bits: 8

Parity: None

Stop Bits: 1.0

Flow Control: None

You do not have to write to the meter to read an output. Instead use the "VISA Read" VI along with the VISA Serial (setup VI) to acquire data. A bit of cropping/formatting of the output should make the number display nicely and in the VISA Serial setup VI you do want a termination character of "A". This A stands for 0xA which is the equivalent to a '\n' character. This method is called "line feed"

0 Kudos
Message 5 of 8
(4,267 Views)

One difference I notice in the portmon logs is that the bad log shows a Flush Buffers immediately after the Write (20) while the good log does not flush.  Flushing after that write seems like it will eliminate any data - and that matches your results.

 

That manual seems to omit more than it specifies. Other than baud rate it does not indicate the required settings. The software protocol on the last page certainly does not seem to show any termination character. But it also does not show writing (20) either.  What did you do to write that character? Your VI shows *IDN?\r\n which clearly is not what the meter expects.

 

Lynn

0 Kudos
Message 6 of 8
(4,246 Views)

My bad, my instructions were specified for the Extech Digital Sound Level Meter Model 407750 which appears to behave slightly differently then the model number you are discussing. It is possible to post the serial protocol document for the sound meter you are working with? That protocol document should have some clues on how to adjust the program to properly work

0 Kudos
Message 7 of 8
(4,214 Views)

In case anyone still looking for solution, please find attached VI's.

 

Regards,

Balachandra K

Download All
Message 8 of 8
(2,510 Views)