From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, 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: 

Ni Visa Read Error

Hi, 

I am trying to perform simple serial communication between Labview and the spark concepts xpro v4 cnc controller (atMega328p). I have no problems using a standard serial communication terminal in TeraTerm to read and write to the device. However, when I try using the Simple Serial.VI example in LabView I get the following I/O error on the Visa Read function.

Error -1073807298 (Hex 0xBFFF003E) occurred at an unidentified location

Could not perform operation because of I/O error

I have tried the solutions offered online such as updating Visa drivers, changing the Visa buffer, and ensuring that no other processes are interfering with the I/O ports. The device appears on NI Max and I am positive the serial settings are correct. Labview successfully writes to the device but throws an error on Visa read. Strangely enough it will successfully read sometimes if the Visa read is put in a While loop and the input and output values are tunneled through but still has the error and this is not the implementation of the code I want to write.  Any help would be greatly appreciated. 

 

0 Kudos
Message 1 of 2
(2,121 Views)

Unfortunately, you (a) didn't post your code, (b) used a bad example (which NI should definitely replace!), and (c) haven't had proper instruction on the optimal use of serial communication using VISA.  This topic gets brought up at least once a month on this Forum, but Forum users often don't seem to "search the Forum" to find posted Solutions.

 

The more information you provide us up front, the more direct our responses can be, and the more likely we won't have to "guess" (as I'm about to do) about your situation.

 

You say you use TeraTerm to read and write to your device.  [It would be handy to see a log of successful communication].  I'm guessing you type a Command (followed by a terminator), and the device returns a response (also followed by a terminator).  If this is so, the solution is fairly simple:

  1. Start with a Configure VISA.  You need to specify Baud Rate if it is other than 9600, but the other inputs are probably correct.
  2. Pay attention to the two top inputs -- you really want your device (the controller) to use 0xA as a termination character, obviating the need for "Bytes at Port" (which you hope to not use).
  3. Sending a Command is easy -- do a VISA Write and terminate the string with the EOL character (from the String Palette).
  4. To read the response, do a VISA Read with a large Byte count (I use 1024, some use 1000).  Do not use Bytes at Port.  One of two things will happen -- you'll get the full Response, or VISA will "time out" (which usually means your connected Device has failed).
  5. Continue with further Command/Response cycles until done.

Please, next time attach your VI (please do not send screen shots of Block Diagrams!)

 

Bob Schor

0 Kudos
Message 2 of 2
(2,081 Views)