LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i make a array of user defined structure and creat a pointer for the same

Solved!
Go to solution

Function

The prototype of the dll function is

unsigned long PassThruIoctl(unsigned long A, unsigned long B, void *pvar1, void *pvar2);

 

 

"void *pvar1" and "void *pvar2" are pointers to different Structures. The value of  "unsigned long B" will determine what kind of Structure the pointer will represent.

One sample structure is given below when pvar1 is the pointer to SCONFIG_LIST.

 

 

typedef struct

{

      unsigned long ParameterID;    // this an input to the dll

      unsigned long Value;          // this is an output from dll

} SCONFIG;

 

 

typedef struct

{

      unsigned long NumOfParams;    // the no. of elements(SCONFIG) in array

(input)

      SCONFIG *ConfigPtr;           // the pointer to array of SCONFIG

(input)

} SCONFIG_LIST;

 

 

The function is supposed to get the values of configuration parameters (from an external interfacing device).

When I tried to run the function as shown in the attached VI, I always end up with error. The error I get is saying something about DLL corrupting the memory of Lab View.

0 Kudos
Message 1 of 7
(3,912 Views)
Solution
Accepted by topic author vinoth.ponnusamy@mahindra.com
Attachment mising. Can you post it again?
------

"A VI inside a Class is worth hundreds in the bush"
യവന്‍ പുലിയാണു കേട്ടാ!!!
0 Kudos
Message 2 of 7
(3,903 Views)
please find the attachement
0 Kudos
Message 3 of 7
(3,879 Views)

What will be the structure for pVar2?

 

One issue that I can see in you code is, for pvar1 instead of passing an array of clusters, you are passing a cluster of SCONFIG. Also you need to initialize the numbr of elements in the array before passing it to the DLL (see attached code). In this I have assumed that pVar2 is also expecting a similar input.

 

I was not able to run the code here becasue the dll is not there. So please try and let me know.

------

"A VI inside a Class is worth hundreds in the bush"
യവന്‍ പുലിയാണു കേട്ടാ!!!
0 Kudos
Message 4 of 7
(3,870 Views)
i am not able to open it as the labview ver compatability is not there i am using labVIEW 8.2.1.
0 Kudos
Message 5 of 7
(3,860 Views)
LabVIEW 8.2 VI attached.
------

"A VI inside a Class is worth hundreds in the bush"
യവന്‍ പുലിയാണു കേട്ടാ!!!
0 Kudos
Message 6 of 7
(3,856 Views)

kikiduu wrote:
Attachment mising. Can you post it again?

vinoth.ponnusamy, you should NOT mark this as "accepted solution", because it is not. Please untag it.

 

Right now, the thread is marked as solved and nobody will look at it ever again. I don't think it is solved yet! 😄

0 Kudos
Message 7 of 7
(3,841 Views)