LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

variable dll

Hell,
 
As I call functions from a dll I'm having trouble with the "Pmca Get Data" subvi. According to technical support I am to set  the input buffer of the "Pmca Get Data" function to a variable. How do I do that? And what function of LabVIEW do i use to retrieve the buffer out, i'm assuming an array? I've made countless attempts to solve this problem.  I've attached the VI and "Get Data subvi" below.
 
The "Pmca Get Data" is the third subvi from left in the attached vi.
 

If you have set the device in 1024 channel mode for example (ADC Gain), then you ask for PmcaGetData(buffer(), 0, 1024) for example. This will return to your buffer() array variable the full channel spectrum. In each of the 1024 elements of that array will be the number of counts that registered in each channel.

 

hope you can help, thanks.

Download All
0 Kudos
Message 1 of 5
(3,076 Views)
Hello,

Depending on how the DLL is expecting to receive the buffers from the calling application, we may have to do different things in LabVIEW to get it to work.  Often a DLL will expect an pointer to an array (aka a buffer), generate data and update the array, then pass the pointer to the array back out for use in the calling application.  If this is the case, we can define and allocate an array in LabVIEW of the correct data type, configure the Call Library Function Node to accept an array as an input, and wire the two together. 

From the VI's you attached, it will be tough to tell you how to do it, since we don't have the DLL to look at (or it's header file, which would tell us what data types it expects).  You will need to find the documentation for the DLL you which to use.  A very handy reference is the example program Call DLL.vi, which ships with LabVIEW.  This VI gives LabVIEW code examples for calling DLL's with numerous data types, including arrays.  This will show you how to configure your application for the data type the DLL expects.  Give this a look and you may find what you're looking for!
Cheers,

Matt Pollock
National Instruments
0 Kudos
Message 2 of 5
(3,055 Views)

Hi

Could you please attach the connect sub vi I am trying to communicate with a third party device I am able to create the sub vi but the problem is I dont know how to put them togehter and access to the device.Thanks in advance

NAzli

0 Kudos
Message 3 of 5
(2,796 Views)

Your dll is not even the same according to your posts here and here. I know I advised you to post to the LabVIEW board but that does not mean posting mulitple times and especially to an old an unrelated thread. Doing so is just counter-productive.

Message 4 of 5
(2,787 Views)

Hello all,

I am pretty sorry for my mistake.:(

0 Kudos
Message 5 of 5
(2,765 Views)