LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Mark_Yedinak

Add an "Abort" event to VISA reads and writes

Status: New
The current VISA read and write primatives do not have the ability to abort early. Under many circumstances if the timeout values are short this is not an issue but it can be an issue if a long timeout is required. The current work around is to use a short timeout value and loop continually ignoring the individual timeouts until a threshold has passed and then pass the timeout error out. This apporach requires the extra code to "monitor" the process of the communication. It also requires shift registers and associated logic to maintain the data. It would be desireable to simply set the timeout for the desired value and have a separate VISA property that can be set cause the current operation to abort.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
13 Comments
Brian_Powell
Active Participant

Has anybody tried using a Call Library Node to call viTerminate() in the VISA DLL?  See the VISA help for the prototype.  I think you can pass the VISA session for the first parameter, and zero for the second (u16) and third (u32) parameters.  If somebody tries this, let us know if this meets your needs.  If so, it'll be easier for us to add to the next release.  If not, we'll have learned something.

rolfk
Knight of NI

I have tried it to make VISA work more similar to Queues. With Queues any waiting is aborted when the Queue refnum is closed elsewhere. With viTerminate() just before closing the refnum, you can in fact achieve a similar functionality to abort any blocking VISA Read.

 

It has worked for the limited testing I have done, but there might be some catchs with this in the rest of how LabVIEW wraps the VISA API.

Rolf Kalbermatter
My Blog
rolfk
Knight of NI

See here for a link to two VIs making use of this.

Rolf Kalbermatter
My Blog