LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange VISA Read Synchronous I/O Issue

I'm using Labview 2012 V12.0. Somewhere back in 2014 I created a VI that uses the VISA Read function to parse an incoming serial stream from an external embedded system. It's been working perfectly since then, and I've occasionally modded the VI to add minor functionality, incrementing the version number of the VI every time (I have something like 5 or so older versions now). Every time I've modded it, it's gone back into use with no issues. The external embedded system has not changed at all in that time.

 

Well, a few days ago, this VI stopped working out of the blue. It was not ingesting the number of bytes I'd specified, but seemingly random numbers of bytes. Prior to this I hadn't used this VI in months, and it was working perfectly back then. I tried a whole bunch of different things to fix the issue, but nothing worked. I was out of ideas, so I just randomly switched the VISA Read Synchronous I/O Mode from asynchronous to synchronous, and suddenly it worked!

 

Mind you, the system I am interfacing with is asynchronous RS422, I don't think this should work! I went back and looked at all the prior revs of this VI, to check that maybe I had accidentally flipped the latest to async when it should have been sync, but no, ALL of the older VIs (that all worked) are also set to async and now will not work unless I set them to sync.

 

What the heck? Any idea what is going on here? This is the same version of Labview I've been using for years, have not updated. In the time I've had this version of Labview and have been working on this VI, I've switched Windows laptops 3 times and did not have any issues until this popped up. But this is the first Windows 10 system I've run it on, albeit it's been working fine for 1.5 years before this. Perhaps a Windows update reversed/broke the functionality of something here?

0 Kudos
Message 1 of 4
(1,601 Views)

Asked a decade ago on this forum here , and answered pretty thoroughly for Windows XP (or Windows 7?).  Who knows what is going on now, and whether or not NI has made some "better" implementation of VISA in "more modern LabVIEW" versions ...

 

Bob Schor

0 Kudos
Message 2 of 4
(1,536 Views)

Maybe I'm being dense, but I don't see how that link answers my question. Nothing in that link describes a sudden unexpected reversal of the functionality of the VISA synchronous I/O mode.

0 Kudos
Message 3 of 4
(1,488 Views)

I have no explanation about the problem you experienced, however I would like to point out that the (a)synchronicity of the VISA Read has nothing to do with the asynchronicity of the serial bus. A synchronous Read simply means that the calling thread is locked (as written in the LabVIEW help); the quoted old thread also informs that you cannot perform other Read operations until the current one is done. So, if your vi is not performing other communication or massive parallel processing, you can just go with synchronous VISA.

Nonetheless, I agree that the code should work with either synch or asynch modes.

Maybe sharing your vi could help us to better guess what could be go wrong.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 4
(1,473 Views)