From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Reading from Serial Port disconnects port

Hi All.

 

I am having an issue with my serial port connection. Whenever i read from the serial port the connection dies. It reads the data successfully but then it fails and I get Error code -1073807253 and I have to relaunch Labview to do again. I have tested it with terminal software and I can send the commands over and over again and the device will continue to spit out the device info upon start up so the hardware is ok. The serial read is somehow faulting after it does the read. Anybody know what may be causing this?

 

Thanks,

 

Mark.

0 Kudos
Message 1 of 11
(3,536 Views)

That's a framing error.

Double check your port settings and make sure your baud rates/ parity/ flow control/ stop bits/ etc. . . all exactly match what you're using in terminal.

Message 2 of 11
(3,531 Views)

Hello,

 

Here you can find some useful ideas about framing error:

 

http://digital.ni.com/public.nsf/websearch/F3E0621CB71AA16786256F970000FC57?OpenDocument

 

Marcin

              

Think Dataflow - blog.mtapp.tech
Message 3 of 11
(3,516 Views)

All the data is read in the correct format and settings are identical so its reading the frames correctly. Dont know why this would be giving a framing error when all the frames are fine.

0 Kudos
Message 4 of 11
(3,496 Views)

Try adding a delay after configuration as the whitepaper that mtwar linked shows. There's a chance the port is not fully configured when it starts doing the read. 

It may also help to configure the port for reading before the transmission from your device starts. (i.e. set up for read when the transmitting device is off, then turn on your transmitting device).

Message 5 of 11
(3,491 Views)

Have you tried VISA Flush I/O as it is shown in the previously attached webpage?

              

Think Dataflow - blog.mtapp.tech
0 Kudos
Message 6 of 11
(3,490 Views)

I have seen issue with the wiring of the serial port introducing framing errors.

 

Dumb question time!

 

Is the ground wired?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 11
(3,482 Views)

Oddly enough when I remove the error cluster from the read VISA read and configure the tunnel to use default if unwired it works perfectly. Now the error is still there but just not getting passed along. This is probably not best practice but it is giving an error when there is actually no problem. Thoughts??

0 Kudos
Message 8 of 11
(3,479 Views)

A framing error is telling us the hardware could not figure out where the data started or ended. The data recieved in that situation should considered corrupted.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 11
(3,475 Views)

@MarkGreally wrote:

Oddly enough when I remove the error cluster from the read VISA read and configure the tunnel to use default if unwired it works perfectly. Now the error is still there but just not getting passed along. This is probably not best practice but it is giving an error when there is actually no problem. Thoughts??


Ben meant the physical wire that is ground in the serial cable.  Not the virtual wire that is the error wire.

0 Kudos
Message 10 of 11
(3,468 Views)