LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial port failes after n init-calls?

I have an external device which communicates via serial port and which I need every now and then. When I need it, I initialize a serial port connection (serial port init-VI), send some bytes to the device, wait for an answer and read it. That's all communication so I leave it as there's no serial port close-VI.
After quite a while (let's say n communications cycles) I get the problem that I still can initialize the serial port, I still can send data to the device but I don't get an answer back (timeout). If I add a serial port monitor hardware (LEDs) into the cable, I see both RX and TX LEDs blink so the device actually does send it's answer and obviously LabVIEW cannot read it.
Now I close my application completely (built appli
cation) i.e. close the .exe and the run-time environment and restart it without any other rebooting and - it works again.

The system is already in use at a place quite distant from me so I unfortunately cannot simply go and try...

Can it be that I shouldn't init the port each time I want to use it and that some LabView-internal port-queue just gets an overrun or something like that? Or is there any other known problem to the serial port and the serpdrv?

Thanks a lot,
Daniel Troendle
0 Kudos
Message 1 of 2
(2,674 Views)
Hi Daniel,

There is a serial port close VI!

You should be able to find it in the same library that you found the serial VI's. I am guessing you are correct about to many opens an no closes.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 2
(2,674 Views)