LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared memory between LV and a DLL

Hello
I am building a DLL in Visual .NET. It is called by LV in a .vi
The DLL is counting some stuffs over a network, and I d'like to see the counter status in the vi, dynamically. This means that when the variable is changed is the DLL, the LabView variable changes too.
I tryed to do this using shared memory, and passing a pointer to the DLL. Unfortunately, it seems that the value isn't updated while the DLL is running.
Please tell me the way to do this. I read about global variable, but it isn't much better.

Thanks versy much !
Fabien

PS: I am using LabView 7.1 and VisualStudio .NET 7.0.9500  in C language.

Message Edité par faquin le 08-02-2005 07:45 AM

0 Kudos
Message 1 of 5
(2,896 Views)

Since you say the DLL does not finish executing, you will need some method where both programs can communicate.

Here are a couple of suggestions (haven't tried any of them):

You can try using TCP (search the example finder and this site for examples and tutorials).

You can try opening a connection to the LV VI server from the DLL to set the value of the indicator.

If the DLL is threadsafe, maybe you can have another DLL which will serve as a buffer - your DLL will call it to put the data in and LV will call it to extract the data (assuming LV can call 2 threadsafe DLL functions at the same time).


___________________
Try to take over the world!
0 Kudos
Message 2 of 5
(2,886 Views)
Actually, I wanted to do exactly the same as in the topic:
http://forums.lavausergroup.org/index.php?showtopic=1514

Thanks anyway.
Fabien
0 Kudos
Message 3 of 5
(2,880 Views)
Isn't that basically the same as my third suggestion, only backwards?
(I don't really deal with DLLs, so I can't say.)

___________________
Try to take over the world!
0 Kudos
Message 4 of 5
(2,871 Views)
Yes, it is something like that. But in the solution I found, I use only one DLL. So it's easier to access to the variables, because ht memory is the same for each function call.
Thanks
0 Kudos
Message 5 of 5
(2,870 Views)