03-30-2007 06:33 PM
04-01-2007 07:47 PM
04-02-2007 10:48 AM
It is difficult to try it out on another COM port. But either way, I can establish a connection to my virtual COM port with any other terminal program (Hyperterm etc.), and as I said even MAX opens & closes my COM port when I run MAX and click on Devices & Interfaces. At that moment the Open & Close routines of my virtual COM port are called.
So why will viOpen not succeed when viFindRsrc does?
What does viFindRsrc do in order that the Open & Close routines are called?
NI please help me out here.
04-03-2007 01:23 PM
04-03-2007 01:40 PM
04-03-2007 07:35 PM - edited 04-03-2007 07:35 PM
When you call viClose() for a valid VISA session, it requires you already have the session (ViSession) acquired from a successful viOpen(). Passing an invalid session to viClose() just generates an error.
But there is another viClose() call concerning viFindRsrc(). If you have called viFindRsrc() and viFindNext(), you must close the "find list" session acquired from viFindRsrc(). Likely forgetting viClose() for this situation may prevent to open the COM port.
このメッセージは 04-04-2007 10:41 AMに Makoto が編集しています。
04-04-2007 10:56 AM
"Likely forgetting viClose() for this situation may prevent to open the COM port.".
Yes - and I had checked this especially.
So I can run my routine with the viFindRsrc in it over and over, and each time it will faithfully open and close my COM port.
When viFindRsrc is called, NI SPY logs this as viFindRsrc and the breakpoint for objVPort_OnOpened() is hit in my virtual COM port followed by objVPort_OnClosed(). This all takes places for one viFindRsrc call logged on one line of SPY.exe.
I'd love to know what the source code for viFindRsrc is, because I think it must not use viOpen to do it's "Open".
Does anyone know the inner workings of viFindRsrc? Could someone from NI shed some light on this please?
04-05-2007 06:02 PM