01-05-2010 07:01 AM - edited 01-05-2010 07:02 AM
Hi Folks - this is just a feeler, to see if this is feasible in LV 8.5.1 Devel.
I've been asked to fulfill a small institute requirement to pull data collection PC's off the corporate network while collecting data. I would like to programmatically disable the onboard NIC when an application instance in the task bar is detected (the offending ACQ program - NOT LabVIEW based). I suspect the easiest way to do this is simply by Title Bar name.
Any thoughts on if this is possible? Can LabVIEW access hardware resources through windows in this manner? I'm not intimately familiar with DLL calls and likes, but I'll learn what I need to in order to accomplish this. Just looking for some pointers.
*Ideally*, this LV program would act as a TSR, (and reside in the notification area), but this to me is an implementation issue (and not necessary to accomplish the above task). I think I've encountered a few TSR-like labview examples anyway...
Best Regards,
Jamie
01-05-2010 09:53 AM
8bitbanger wrote:Hi Folks - this is just a feeler, to see if this is feasible in LV 8.5.1 Devel.
I've been asked to fulfill a small institute requirement to pull data collection PC's off the corporate network while collecting data. I would like to programmatically disable the onboard NIC when an application instance in the task bar is detected (the offending ACQ program - NOT LabVIEW based). I suspect the easiest way to do this is simply by Title Bar name.
I would suggest checking the list of running processes. There have been posts in the past on how to do this.
Can LabVIEW access hardware resources through windows in this manner? I'm not intimately familiar with DLL calls and likes, but I'll learn what I need to in order to accomplish this. Just looking for some pointers.
Yes, but the issue that you most often run into is with datatypes and memory access. DLLs are often written using pointers and LabVIEW has no pointers per se. Thus, you sometimes have to create wrapper DLLs to act as an interface between the LabVIEW datatypes and the more "esoteric" datatypes that you see in C.
*Ideally*, this LV program would act as a TSR, (and reside in the notification area), but this to me is an implementation issue (and not necessary to accomplish the above task). I think I've encountered a few TSR-like labview examples anyway...
There have been examples and posts on how to do this. See, for example, Running a LabVIEW Application as a Windows NT/2000/XP User-Defined Service. The typical problem you run into are Windows-related (like with permissions).
01-05-2010 12:30 PM
As for disabling the network adapter, you might be able to use Microsoft's Netshell command-line tool, provided you are running with admin priviledges.
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/netsh.mspx?mfr=true
somewhere along the lines of: netsh interface set interface "name" disabled
but be careful, like many windows CLI tools, it works differently on different versions. google around.