Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Using serial breaks makes the data unreadable

I am programming an application that sends out serial data (RS-232) streams with configurable timing between the messages.  When I experimented with a few different methods of transmitting data I found that setting the "Serial Settings -> End Mode for Writes" to "Break" with a property node after initializing the VISA resource and then setting the "Break Length" property before each write I got the best timing performance.  I did my timing testing while just sending out serial data and using tick counters to see that the appropriate time elapsed for the data to be transmitted and the breaks to occur between messages.

 

Now that I am trying to read the data in I am not receiving what I am sending out.  Instead of receiving the string I sent out I get a single byte (x00) and an error message on every other read:

 

Error -1073807298 occurred at VISA Read in Serial Receiver.vi

Possible reason(s):

VISA: (Hex 0xBFFF003E) Could not perform operation because of I/O error.

 

There are no errors on the writing side and the return count from the VISA write matches the amount of data that I am sending.

 

Is there something fundamentally wrong with using the break after write mode for controlling the timing of the message spacing on transmit?

 

Do I have to do something special on the reading side to be able to read messages with breaks between them?

 

I tested this with both the PXIe-8430 serial ports and a USB to serial adapter with a loopback connector.  I also tested sending from one port to another with a null modem cable and I get the same thing in all situations.  It works fine if I don't use the break after write mode, but I don't get the timing that I need.

 

Any suggestions will be greatly appreciated.

 

Thanks,

David R. Asher

 

Certified LabVIEW Architect since 2007
0 Kudos
Message 1 of 1
(1,619 Views)