06-03-2014 10:00 AM
I have the problem that i need to send data and get data from and to functions in a dll. However i having problems with getting the data, not sure if is arrays or not, from the manual the two are descrided as below.
--------------------------------------------------------------------------------------------------------
short CVICDECL MSA_read_data(short mod_no, unsigned long from,
unsigned long to, unsigned long * buf, short add);
--------------------------------------------------------------------------------------------------------
Input parameters:
mod_no module number (0 - 3)
from 1st address to read (0 – POINTS_NO - 1)
to last address to read (from – POINTS_NO - 1)
*buf pointer to data buffer to be filled
add 1 – add read values to the buffer, 0 – rewrite buffer contents
Return value: 0 no errors, <0 error code (see msa_def.h)
And.
--------------------------------------------------------------------------------------------------------
short CVICDECL MSA_fill_memory(short mod_no, unsigned long from, unsigned long to, unsigned short fill_value);
--------------------------------------------------------------------------------------------------------
Input parameters:
mod_no module number (0 - 3)
from 1st address to fill (0 – POINTS_NO - 1)
to last address to fill ( from – POINTS_NO - 1)
fill value value written to the MSA memory
Return value: 0 no errors, <0 error code (see msa_def.h)
The procedure is used to fill a specified part of the memory of the MSA module ‘mod_no’ with the value ‘fill_value’.
However i´m not sure if the *buf should be a U32 pointer to an array or if the U16 fill value should be an array or a just a number?
my dll sofare is attached.
Solved! Go to Solution.
06-03-2014 10:35 AM
In png format
06-03-2014 01:08 PM
@DK_AA wrote:
However i´m not sure if the *buf should be a U32 pointer to an array or if the U16 fill value should be an array or a just a number?
my dll sofare is attached.
*buf should be a pointer to an array (configure the parameter in the Call Library dialog as an array, passed by pointer). That array must already have been allocated in LabVIEW (for example using Initialize Array) to the correct size. You can wire an array constant on the input side and wire the output to an indicator; don't use a local variable.
The U16 fill value is a scalar, not an array.
There is no need for the local variables, and the sequence structures are probably unnecessary as well. Please post your entire VI (or set of VIs) if you want more detailed suggestions.
06-04-2014 03:09 AM
There is some more info on using pointers to DLL in LabVIEW here:
06-06-2014 08:36 AM
Thanks, Really helpfull, stange i didn't pop-up when i search ni.com home page and google. Should be put in content help in the program:)
06-06-2014 08:37 AM
That did the trick:) thanks