09-11-2013 06:34 PM
Hi all,
I have a power meter controlled by some VIs and driver software from newport. These files are installed on my local drive. I uninstalled all the newport software and installed the newer version.
Now my power meter control program isn't working and is throwing me The following error:
Error 1172
"Error calling method Newport.USBComm.USB.OpenDevices, (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Inner Exception: System.Security.SecurityException: System.Security.Permissions.SecurityPermission) <append><b>System.Security.SecurityException</b> in OnConnect.vi->20130904 measure power over time.vi"
My power meter control program is located on my network drive, not my local drive. I don't know if this is important or not.
Can anyone tell me how to fix this error?
Thanks for your help,
09-11-2013 06:59 PM
@edCubed wrote:
My power meter control program is located on my network drive, not my local drive. I don't know if this is important or not.
Yes, in fact that probably is important. See Running LabVIEW VIs or Executables That Use .NET Assemblies from a Network Drive.
09-12-2013 11:57 AM
I checked out the link you provided. And I attempted to open and edit caspol.exe, so I could set my network drive as a "trusted" drive. When I did a search on my computer for caspol.exe I found 6 executables, and when I tried to open any of them a command prompt appeared and then quickly disappeared.
Am I doing something wrong?
Is there another way to set my network drive as a "trusted" drive so that there won't be problems with labivew and .Net?
Thanks for your help,
09-12-2013 12:04 PM
@edCubed wrote:
I checked out the link you provided. And I attempted to open and edit caspol.exe, so I could set my network drive as a "trusted" drive. When I did a search on my computer for caspol.exe I found 6 executables, and when I tried to open any of them a command prompt appeared and then quickly disappeared.
Am I doing something wrong?
That's exactly what would be expected if you try to run a command-line tool by double-clicking it. Instead you need to open a command prompt (Start->Run and then enter "cmd") and then run the command-line as explained in the document. There might be other ways to do this too, I'm not an expert in how to modify Windows network access policies.
09-12-2013 04:24 PM
I don't think this problem is a system security problem. I think this problem is due to a cross linking error. Here are some screen shots of warnings I get when I open my program:
I think the problem is that I installed an updated version of the dll but the program is expecting the old version.
And since this warning is related to .NET assembly I get Error 1172 when I run the program.
How can I change the expected path of the dll so that the program knows where to go to look for the appropriate file?
I tried going into the labview project file that contains the power meter sub VIs that are not working and the project says there is a
dependency warning on the dll file. But I can't seem to edit this project, so maybe its locked?
Anyway. Do you guys have any ideas?
Thanks.
09-12-2013 04:52 PM
Opening and saving the VIs that use the .NET component should be sufficient to remove the warning. This shouldn't require modifying the project. However, if you cannot re-save the VIs, possibly they're marked read-only - are they in a source control system? Note that these warnings are harmless, though - it's just telling you it automatically loaded the new version in place of the old one.
I suspect that even if you re-save the VIs to update them, you will still get the same error, but that's just my guess.
Do you have the ability to copy everything - both the application, and the .NET assemblies if they're also on the network - to your local drive, and see if the error goes away when you run the application locally?
09-12-2013 05:10 PM
I can run the application locally. But I was able to run it from the network drive before I did my fatefull power meter driver update. I'd like to get back to being able to run it from
the network drive though because I have other labview programs saved on the network that use the same power meter VIs/drivers.
The power meter VIs and project file for them appear to be read only. So maybe this is part of the problem.
I'll continue to mess with it and see if I make any progress.
Thanks for your continued help,