rkesmodel Posted November 7, 2006 Report Share Posted November 7, 2006 My customer wants to include the Windows login name of the current user in the report file for a unit under test. While talking with NI tech support we found http://sine.ni.com/apps/we/niepd_web_displ...source=External which works fine running under the development system, but won't as an executable. I put the required file in the same folder as the executable as instructed, but apparently it will not work without the LabWindows CVI runtime engine. The NI technician was able to get it to work in an executable, but admitted that she had CVI installed on her machine. Upon attempting to launch I get the following messages: "The application has failed to start because cvirt.dll was not found..." "LabVIEW: Resource file not found. The file 'sdk_project.dll' is not a valid LabVIEW file." "LabVIEW: Resource not found. An error occurred loading VI 'User Name (SDK call).vi'. LabVIEW load error code 3: Could not load front panel." "Missing subvi in User Name (SDK call).vi in ..." I am using LabVIEW 8.01FD under WinXP Pro, SP2. Any assistance GREATLY appreciated. Roy Quote Link to comment
Dirk J. Posted November 7, 2006 Report Share Posted November 7, 2006 My customer wants to include the Windows login name of the current user in the report file for a unit under test. Hey Roy, This works for me, good luck Download File:post-3523-1162935095.vi Quote Link to comment
Yair Posted November 7, 2006 Report Share Posted November 7, 2006 If I'm not mistaken, the property Application>>User Name should give you what you want. Another option might be to go to the MSDN and look for a Windows API function which returns this (or .Net) or maybe try the registry. Quote Link to comment
David Boyd Posted November 8, 2006 Report Share Posted November 8, 2006 My customer wants to include the Windows login name of the current user in the report file for a unit under test. I am using LabVIEW 8.01FD under WinXP Pro, SP2. Any assistance GREATLY appreciated. Roy Roy, The most reliable method I know (using the Windows API) is attached, it uses two CLNs and returns the login name and the NetBIOS computer name. I've used this since LV5. The attached VI is saved back to 7.1 format for the widest audience. Probably Dirk J.'s VI does the same thing, but his is in 8.2 format and I noticed that you're using LV8. The VI Server property that Yen mentioned may work, but it doesn't always give you the Windows logon name - LV options (tools->options->revision history) may cause it to retrieve the LV registration name, or a 'prompt at startup' name. And I'm not at all sure that it works in built applications. Hope this helps. Dave Download File:post-195-1162995389.vi Quote Link to comment
crelf Posted November 8, 2006 Report Share Posted November 8, 2006 My customer wants to include the Windows login name of the current user in the report file for a unit under test. ...at the risk of flooding you, here's another method: Download File:post-181-1162998310.vi Download File:post-181-1162998318.ctl Quote Link to comment
David Boyd Posted November 8, 2006 Report Share Posted November 8, 2006 ...at the risk of flooding you, here's another method: Chris, You may want to do a 'Save for Previous' and edit your post. The original poster doesn't have lAbViEw 8.20. Dang shift key... :laugh: Dave Quote Link to comment
crelf Posted November 8, 2006 Report Share Posted November 8, 2006 you may want to do a 'Save for Previous' and edit your post. The original poster doesn't have lAbViEw 8.20. Oops - here's a screen shot instead: My VI does heaps more than that, but the screen shot shows the only bit you're probably interested in. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.