Jump to content

Passing a data buffer to C++ dll which will fill values and return


Recommended Posts

i wish to send a empty data buffer (Byte array consisting of all zeros )

i have a dll tat will update the contents of the buffer ... i wish to recieve it and show it on the front Panel..

i m using call library function node.. but the data tat i recieve at the out buffer is same as i give it as the input...

Also any other pointer types give out same value tat i give at the input ..

i have attached the jpg of block diagram where i have pasted the methods prototype in dll and in call lib function node...

also same is the problem with one more int type.. i have declared long * xyz and i wish tat the dll should return some value in it .. but i m unsuccessful

Regards,

Madhav

post-18500-0-30906500-1294406933_thumb.j

Edited by Madhav
Link to comment

I m not developing the dll but what i want to do is pass the address of the starting location of the buffer (with all zeros) Dll is supposed to update the values at the same location and i wish to show it on screen...

I cannot post the complete vi here... but basically what i want to do is pass the address of any variable or buffer.. it will be updated in dll n i have to show it back on screen

how can this be achieved???

Link to comment

Well I was asked for some kind of demo code because I can't figure out your "prototype" and the options inside the Call Library Function Node. (CLFN) Passing the pointer to anything is fairly easy if you use the right options in the CLFN. If the dll returns only after updating the values, then life is simple. If the dll returns immediately, then continues to update the values, life gets more complicated. When this sub-vi terminates, LabVIEW will un-reserve the memory for the constant/control used and will then reuse that memory space. This can cause lots of problems as your dll overwrites LabVIEW memory. From what I can see in the picture, your prototype/options for the CLFN are a little messed up, but can't put my finger on it.

Link to comment

Well from the pic there is no obvious reason why it shouldn't work. But there is only so much a pic says. It tells us nothing about the actual Call Library Node configuration and even less about what the function expects to do with the buffer. This is however very crucial information.

The problem you pose to us is a bit like presenting us a picture of a car in a seemingly perfect condition and asking us why the engine doesn't work. Is gas in the tank? Is the engine in there? You see?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.