11-05-2013 01:43 PM
I have seen in older posts there is a vi named 'Computer Name.vi' (which is used in a LabVIEW project that I am trying to upgrade). When I try to run this I get an error code:
Error -604 occurred at Open Registry Key.vi
is there a solution to this error or does anyone have access to a newer version (I am using LabVIEW 2010 and have Windows 7 64 bit)
I am attaching the vi that I am having troubles with.
Solved! Go to Solution.
11-05-2013 01:46 PM
I used Help > Explain Error in LabVIEW to figure out that error -604 is a registry permissions error. I'm guessing you don't have sufficient (admin?) privileges on that machine to be able to read the registry. I ran the ComputerName.vi you attached in LabVIEW 2010 on my Windows 7 64-bit machine and it worked fine...but I have admin privileges on my machine.
11-05-2013 01:48 PM
Also, here's another way to get the name of the machine...this one doesn't require reading the registry:
11-05-2013 02:04 PM
Hello ncm,
As Darren said, the error indicates an access permission problem. The VI you provided works on my machine with the security access mask input on the open registry key VI set to KEY_READ.
Since the source version for the VI you provided appears to be LabVIEW 6 (probably developed on Windows 98/NT/ME), a number of things have probably changed with how Windows handles registry access that may have affected how this executes- there are a number of other ways to get the computer name and if you're in the process of bringing this project up to speed, it might be worth replacing this function while you're at it.
Regards,
11-05-2013 02:23 PM
Thanks everyone! I am looking forward to trying the simpler version posted (TY Darren). I will try an post later my results.
-ncm
11-05-2013 02:28 PM
Just tried it, SO much simpler and worked perfectly. Not sure why the other computer was using the other vi to acquire the address (unless the older versions didn't have those functions...)
Much appreciated!
-ncm
11-05-2013 02:55 PM
@ncm wrote:
Just tried it, SO much simpler and worked perfectly. Not sure why the other computer was using the other vi to acquire the address (unless the older versions didn't have those functions...)
Much appreciated!
-ncm
I used this trick at least back in the 8.x days, but it is a subtle feature and I've met plenty of people that didn't know you could do that. You don't even need to wire the localhost either. If it is unwired it assumes localhost.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
12-17-2013 02:56 PM
Nice Darren!
I just had to use this on a bit of code that broke migrating code from Win XP to Win7 and luckily I remembered your post!
Thanks
-AK2DM