LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subvi randomly not working

Solved!
Go to solution

Hi Norbert,

 

thanks for all your effort, but the DLL I/O seems to not be included in the NI I/O Trace. It is done through "CallExternalLibraryNode", not a VISA. Not even a USB-traffic scanner would help me, I guess, because the data does not seem to "reach" the USB interface.

 

I feel the strong urge to throw not only the PC out of the window, but also light it on fire^^

 

Regards,

 

Pedro

0 Kudos
Message 11 of 26
(1,160 Views)

Pedro,

 

i think you would get lots of kudos for that video on youtube 😄

 

Well, obviously we have the following situation:

a) The DLL does not return an error to the calling code, in your case the wrapper VIs

b) The USB port does not send out anything

c) You have no tool available to make sure if the command was put on the output buffer of the USB port at all

d) Using other callers than LV seem to work quite stable

e) Testing different setups of the CLFN (UI thread/any thread) and timings did not change the behavior

 

This is indeed an aweful situation.

Just for brain storming:

- What about encapsulating the given code in a wrapper DLL (ANSI C)?

- What if the DLL gets unloaded after "Connect" and before "Write"? Could this result in such an issue? Does "Write" have any error information available if the connection is valid at all?

 

Norbert

 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 12 of 26
(1,154 Views)

Hi Norbert,

 

The DLL I'm using is already a wrapper of a C++ DLL, sorry if that didn't come out clearly. Or do you mean a wrapper for the wrapper?

 

header file excerpt from the write definition: Returns: Nonzero, if data has been successfully written to the device; otherwise zero. , so yeah, that's my return value.

 

What do you mean with the DLL getting unloaded?

 

Thanks heaps for your help so far!

 

Regards,

 

Pedro

0 Kudos
Message 13 of 26
(1,152 Views)

I hope GetVersionAnswer isn't updated in the sub vi's?

 

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 14 of 26
(1,145 Views)

Hi Yamaeda,

 

I'm not quite sure as to what you mean with GetVersionAnswer being updated. Can you please explain this a little more in detail?

 

Regards,

 

Pedro

0 Kudos
Message 15 of 26
(1,137 Views)

You use the GetVersionAnswer in the loop, but if it's changed in some of the sub-vi's you'll get the wrong value.

 

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 16 of 26
(1,134 Views)

Nope, that does not happen. Thanks for the input though. Any more suggestions?

 

Regards,

 

Pedro

0 Kudos
Message 17 of 26
(1,131 Views)

With visa i generally use a small wait between writing and reading, like 100ms, maybe you need it with the USB also?

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 18 of 26
(1,120 Views)

Already tried waiting, that did not work out. Funny fact: whenever it didn't work, it won't work until I restart LabView and then not everytime as well. But if it worked, it worked until I shut down LabView again. Some memory allocation problems maybe?

 

The programmer of the DLL and the wrapper DLL will look into this problem this week as well, I'll keep you updated, in case someone else encounters a similar problem.

 

Regards,

 

Pedro

0 Kudos
Message 19 of 26
(1,119 Views)

It sounds alot like the problems i had with an ActiveX object. If the program got errors so the object wasn't closed properly it got stuck in memory and required a restart of LV to clear out.

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 20 of 26
(1,116 Views)