LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

passing a waveform to a dll

I'd like to create a dll with some functions that accept or return a waveform. This appears to be possible, although I haven't found an example of how to do it yet. So far, it looks the parameter on the C++ side is an HWAVEFORM, which appears in extcode.h mysteriously to me as:

/* forward definitions of HWAVEFORM and HWAVES for DLLs and CINs */
typedef struct IWaveform IWaveform;
typedef struct IWaves IWaves;
typedef IWaveform* HWAVEFORM;
typedef IWaves* HWAVES;


but I'm not seeing what an IWaveform would be. Does anyone know of a posted waveform example?
0 Kudos
Message 1 of 4
(3,685 Views)
You are right, extcode.h only gives a forward declaration. You can unbundle
the waveform and pass in the individual elements.

"mpmurphy" wrote in message
news:50650000000800000056A00000-1042324653000@exchange.ni.com...
> I'd like to create a dll with some functions that accept or return a
> waveform. This appears to be possible, although I haven't found an
> example of how to do it yet. So far, it looks the parameter on the C++
> side is an HWAVEFORM, which appears in extcode.h mysteriously to me
> as:
>
> /* forward definitions of HWAVEFORM and HWAVES for DLLs and CINs */
> typedef struct IWaveform IWaveform;
> typedef struct IWaves IWaves;
> typedef IWaveform* HWAVEFORM;
> typedef IWaves* HWAVES;
>
>
> but I'm not seeing what an IWaveform would be. D
oes anyone know of a
> posted waveform example?
0 Kudos
Message 2 of 4
(3,685 Views)
Same problem here. How kann I unbundle the structere. Where is the definition?
0 Kudos
Message 3 of 4
(3,243 Views)

This links migth help

http://forums.ni.com/ni/board/message?board.id=231&message.id=2256&requireLogin=False

 

Accessing the data of waveforms in a DLL is unsupported; therefore to read data from or to create a waveform in a DLL you actually need to build simply VIs into the DLL. The VIs should split the Waveforms into the dt, to, and the data array or to build the waveform up from those parts.

For more information select Help>>Search the LabVIEW Bookshelf. Take a look at the Using External Code in LabVIEW, which has a lot of information about passing data to and from DLLs. It was in this manual (p26) that I finally found this answer.

In addition there is a great example at "C:\Program Files\National Instruments\LabVIEW 7.0\examples\dll\data passing\Call Native Code.llb" This has examples of the VIs, the DLLs, and the source needed to pass all types of data between
LabVIEW and a DLL.

Evan
National Instruments 

0 Kudos
Message 4 of 4
(3,241 Views)