LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create Registry Access VI

Follow up of this post here :

http://forums.ni.com/ni/board/message?board.id=170&thread.id=445552

(in a new topic beacuse it is slightly off topic, and I want to see if anyone responds to the other one)

 

Could someone please check my code in the VI is correct before I try and run it. I'm not sure I understood the MSDN page correctly, and I'm just trying to create a function that does a RegCreateKey on a mobile Device in LabVIEW.

 

Function here:

http://msdn.microsoft.com/en-us/library/aa911940.aspx

 

VI attached. - Not complete because I didn't understand enough, but am I going in the right direction?

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 1 of 14
(4,868 Views)

Examples for Reg entries can be found in the example finder.

 

Example Finder.png

 

Here is a screen shot for each of the vi's

 

Delete Reg.png

 

Read Reg.png

 

Write to Reg.png

 

Be careful in the registry. You also need to make sure that you have access to the registry to add and delete the entries. If you are planning to move this software to a customer be aware that they may not have full access to the registry if the IT group has locked them out of the registry.

Tim
GHSP
0 Kudos
Message 2 of 14
(4,847 Views)

Thanks for the feedback aeastet.

 

I knew this already.

 

The problem is that these VIs only access the Windows Registry, and are not supported on Windows Mobile 6 (PDAs).

Windows Mobile 6 uses a different registry style, which it might be possible to access with DotNet code, but again, this is not in the Mobile Module as NI do not support Mobile 6 yet.

 

Hence my need to create my own Registry access function suite from scratch using the info provided by Microsoft.

(I'm happy to post them on the forums when done as this is only for fun that I'm doing this for my own use)

 

So my question still stands...

to any GURU

Am I heading in the right direction with my VI?

 

(Kudos for a helpful answer - amount depends on helpfulness of answer)

 

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 3 of 14
(4,835 Views)
Can you back-save the VI(s) to 8.2? I don't have my 2009 virtual machine running right now.
0 Kudos
Message 4 of 14
(4,827 Views)

here is the VI in 8.2

 

Thanks for offering to help smercurio_fc.

 

(I used the ring in the Call DLL example to try to work out the data types)

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 5 of 14
(4,804 Views)
OK... What exactly do you want checked? Your CLFN isn't set up with a DLL to call, or a function selected. Also, for Windows API functions you should be using the "stdcall (WINAPI)" calling convention. With respect to the function itself, the HKEY parameter is a handle, not a string. You also have most of the parameters not even wired to values.
0 Kudos
Message 6 of 14
(4,796 Views)

What I was trying to do was to creat a function that access the Windows Mobile 6 registry according to the coding guidelines on the MS site. As a Mech Eng by training (and therfore not origninally a software deveoler) I understand LabVIEW up to the CLAD level, and I'm hoping to sit my CLD exam soon. Unfortunatley for me this task requires knowledge of software programming outside of the LabVIEW environment and what things mean in order to integrate with it.

My backgound in programming came from software testing originally.

I'll be honest I'm terrible with text based programming languages unless we are talking BASIC (as in BBC), I've never really understood DLLs, APIs and Registrys too much apart from in a general sense from what I have been taught by great C Programmers around me in my last company, but I have none of them to lean on now.

 

The reason the Parameters are not wired I because I'm not even sure if the are the correct type.

 

I belive to perform the function in the MS document I need to use a Call by reference node. I'm not sure how I need to configure it, so that's where I'm looking for pointers.

I don't intend to put this anywhere near H/W until it's totally error free on the simulator. Unfortunately due to the modular nature of the task here I'm not sure I can get away with making stubs for testing. I need to be able to respond to the OS and debug and know what I'm doing.

 

some pointers would be very much appreciated. I know "you can lead a horse to water but you can't make it drink" - but I'm thirsty for the knowledge that will enable me to understand the how and why so I can do this on my own without annoying too many people.

 

It's the use of .h files and where they go etc that I forget from my training courses.

 

Thanks

 

Will change to use stdcall WINAPI in th CbRef node.

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 7 of 14
(4,784 Views)

Well, you did pretty good for being "just" a mechanical engineer, and not understanding DLLs. Smiley Wink

 

There's one thing that I still don't understand. aeastet had pointed out the examples that ship with LabVIEW. Did you take a look at them? The registry functions that ship with LabVIEW are just wrappers around calling the Windows API. In fact, if you open the Create Registry Key VI you can see it has a CLFN in there to call the RegCreateKeyExA function, which is what you're trying to do. It also shows you what values to wire up to the various parameters.

Message 8 of 14
(4,762 Views)

As I'm unable to open your VI..  What are you trying to do to the registry?  Read or Write or both?

 

I'm sure the access restrictions to the registry for PDA cannot be any more stringent than for Vista.

 

If you're trying to write to the registry then that is a bad idea and you should find another way (location) to store your data. 

 

If you're trying to read - that's no problem, so long as you get your access permission setting right.

 

Cheers,

 

Battler.

0 Kudos
Message 9 of 14
(4,758 Views)

I believe smercurio to be right here.

 

Note, that I'm not doing LabVIEW for Mobile at all, but the Windows Mobile API is in large parts compatible with the standard Windows API, although the semantics of the underlaying system and implementation can vary sometimes quite a bit.

 

This means that as far as the calling setup of the Call Library Node for many Windows APIs you should not really have to modify the standard VI that is shipping with LabVIEW. If the function will behave in exactly the same way and with the same rights and restrictions is an entirely different story (usually they don't Smiley Mad ) but that has nothing to do with what you are trying to do here.

 

So why do you believe the standard registry VIs that come with LabVIEW won't work here? What sort of errors do you get when you try that?

 

Rolf Kalbermatter

Message Edited by rolfk on 10-09-2009 08:35 AM
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 10 of 14
(4,753 Views)