02-12-2010 01:26 PM
Hi All,
I'm trying to use the System.Net.WebClient asynchronous download method (so that I can get an indication of progress for my downloads) but seem to be running into problems getting the .NET event handling to work. My current attempt (see attached VIs) ends up with a rather ugly crash but I'm not sure what I'm doing wrong.
Could anyone point me in the right direction?
Thanks,
Shaun
Solved! Go to Solution.
02-12-2010 01:59 PM
Hi,
What Windows versions are you using? It sounds similar to the issue I'm having. Is the error message the one you see here?
http://forums.ni.com/ni/board/message?board.id=170&thread.id=474834
One thing I noticed between XP and 7 is that LabVIEW can't get the members in e. In XP, I could use a property node directly connected to e.
Thanks
John
02-12-2010 02:10 PM
It definately looks like something could be similar, my error (even with all code referencing e removed, so that my callback literally sets a Value (Signalling) to the boolean control) is as follows:
(I'm running LabVIEW 2009f3 on Windows Vista)
02-12-2010 02:18 PM
Hey John,
After some more searching, I came up with the solution to my problem (which might solve yours also):
http://digital.ni.com/public.nsf/allkb/2AF19EBDFA4AC82D862576B6006E7FE8
or in short, on your callback VI, make sure the Sender and e elements of the Event Data cluster are the proper data types for your event (ie Sender = system.object and e = whatever your event's arguement's data type is).
02-12-2010 02:29 PM
06-21-2012 09:23 AM
Hey Shaun and others,
Just stumbled upon thread. I'm now using a synchronous .NET HTTP client in LabVIEW 2010 / Win 7 and XP, want to change the client to asynchronous to be able to abort a request. I use the WebRequest class instead of the WebClient class.
Hope you can provide some help on this 2 years old thread.
The code posted in message 1 doesn't work at my side, no event is generated, the Download Complete Callback.vi is never fired and the VI never ends execution without abort button.
Are you able to share (parts of) your implementation?
My idea was to implement something similar to this example at MSDN.
Thanks,
Biggeveen