LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to allocate the memory and to get the starting address of it

im just want to allocate a 8MB memory size and want to get the staring address of it, by getting the address i will be access the memory through driver call using the dll file.. so all i need to know is how to allocate memory and to get the starting address, if any one knows then pls tel me
0 Kudos
Message 1 of 11
(4,266 Views)
You can access memory with several labview.exe export functions (AZ... and
DS... functions), or with windows API's (heap functions).

In your case, you could simply initialize an array (with the initialize
array function) with a size of 8MB. Pass this array to the dll by
configuring it's input to accept an 1D array of u8's.

Regards,

Wiebe.


Message 2 of 11
(4,244 Views)
hi, see from lab view i have to allocate a memory of 8mb and i have to pass the allocated memory starting address by that the driver function make use of that memory. im not able to understand with array u hav said..
0 Kudos
Message 3 of 11
(4,222 Views)

Hi 2716jag,

see the attached example. I think this makes clear what Wiede said.

Mike



Message Edited by MikeS81 on 03-15-2008 07:49 PM
Message 4 of 11
(4,208 Views)

thanks mike,

do u hav any idea of interrupt handling.. from my driver side some interrupt will rise, that i should monitor from lab view application and do some coressponding things when the interrupt appear.. how the interrupt from driver side is noted in lab view,

0 Kudos
Message 5 of 11
(4,180 Views)
By interrupt, you mean callback?

In that case, search the forum for callback, and you will find that you have
to build a dll to handle these.

Regards,

Wiebe.


0 Kudos
Message 6 of 11
(4,167 Views)
Hi Wiebe
I dont know that's a call back.. the case is
 
how to create a thread here, is that making the VI as reentrant it will work as thread? if so we have to call that where we want intialize thread?  Im having a scenario that, i've to monitor with a thread whether an interrupt indication came or not in my dll. its a software interrupt driven by my driver through dll file.. tell me how can i handle this....can u get me?
0 Kudos
Message 7 of 11
(4,135 Views)
Hey 2716jag,

I'm somewhat confused by your question.

This KnolwedgeBase article talks a bit about how LabVIEW allocates threads, but I'm not sure if it will answer your question.

If you are using a Call Library Function node to call a DLL in your LabVIEW program, this node does not return a value until the function that was called finishes execution.  You will either need to call this DLL in a loop and poll it, or find some what to pass the interrupt handling to your VI (using an event structure, for example).
Eric V
National Instruments
Applications Engineer
Certified LabVIEW Associate Developer


"I'm a Ramblin' Wreck from Georgia Tech and a helluva (NI Applications) Engineer!"
0 Kudos
Message 8 of 11
(4,108 Views)


@2716jag wrote:
Hi Wiebe
I dont know that's a call back.. the case is
 
how to create a thread here, is that making the VI as reentrant it will work as thread? if so we have to call that where we want intialize thread?  Im having a scenario that, i've to monitor with a thread whether an interrupt indication came or not in my dll. its a software interrupt driven by my driver through dll file.. tell me how can i handle this....can u get me?


Interrupts are something that happen in the OS kernel and can only be handled there in any meaningful way. They have nothing to do in the application level of modern OSes unless you want to wreck your entire OS system beyond repair and consequently LabVIEW has no means of handling interrupts directly. The way this is passed to applications is usually through events or callbacks (and in the case of a callback it would be a fatal error for a kernel driver to directly invoke the callback funtion from within the interrupt handling routine). Callbacks require function pointers, an advanced C concept and also not supported by LabVIEW directly for various reasons. Events would be usually OS events. By calling directly into OS event APIs with the Call Library Node you could interface to a driver using them without an absolute need to write a wrapper DLL. However I recommend to write a wrapper DLL in any case.

Whatever you do, these are definitly no beginner topics for a starting C programmer. If you do not really know quite well what I have been talking about, you better would try to find a knowledgable programmer that can do this for you. The different techniques are definitely to complex to serve as a learning by doing exercise.

Rolf Kalbermatter


Message Edited by rolfk on 03-20-2008 07:50 PM
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 9 of 11
(4,100 Views)

Thanks Rolf

yeah its better to go for a Wrapper function.. but from that wrapper fn how we able to get  intimation to lab view function that a interrupt occured in dll wrapper function.. how to put an event to note that

0 Kudos
Message 10 of 11
(4,063 Views)