LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA communication with Serial/USB device

Hi,
    I'm trying to connect to an industrial wireless modem that responds to the standard AT modem command set.  I've had no trouble whatsoever communicating with this device using Windows HyperTerminal connection; however, when I try to communicate with the device using LabVIEW I continuously get an error when writing to the device (sending commands).  The device is a USB device; however, the manufacturers drivers configure it to be seen as a serial device in Windows.  As a result, I've been using the VISA serial vi's. 

To give a easy example, if I use the example vi "Basic Serial Write and Read.vi" as found in the LabVIEW help, I can open a serial connection using the following settings:

    baud rate:     230400
    data bits:      8
    parity:           NONE
    stop bits:      1.0
    flow control: NONE
    delay:         500 ms

The error is returned when I try to send a basic command to the device.  The returned error is "-1073807298" which occurs at the error out of the "VISA write" vi.  If I monitor the activity at the serial port while running this vi, everything works as expected and I see the connection open; however, when LabVIEW writes to the port the following error is displayed in the port monitor "IRP_MJ_FLUSH_BUFFERS" immediately after the string is sent to the port.

To test the communications more fully, I also looked at the com port/serial device status in MAX and using the same setting, MAX validates that it works correctly.  However, if I open the VISA test panel in MAX, and test the write function in the test panel I get the following error "BFFF003E". 

My only idea is that part of the VISA write vi incorporates a buffer flush that HyperTerminal does not do and this buffer flush is not supported by the device.  If someone can provide even a little insight into a potential problem and how I can go about fixing it, it would be greatly appreciated.  Thank you very much for the help.

-Justin
0 Kudos
Message 1 of 3
(3,033 Views)
Howdy jtallent,

You've got the right idea regarding the flush VISA performs after each read/write call. The KnowledgeBase article here goes into more detailed explanation on the BFFF003E error and provides a technique you can use to prevent this from happening. Another document you may find pertinent discusses how serial communication via Hyperterminal differs from LabVIEW VISA commands: Why Does My Serial Instrument Work In Hyperterminal, but not in LabVIEW or MAX?
Warm regards,

pBerg
Message 2 of 3
(2,997 Views)
Thanks a ton!  That seemed to do the trick.  Seems so simple now.  Smiley Surprised  Thanks again.
0 Kudos
Message 3 of 3
(2,985 Views)