Jump to content

Passing Labview Cluster to Structure in DLL


Recommended Posts

Your data cluster contains 9 elements, but the prototype indicates it's only 8 elements. So, you've got one too many elements in your cluster. Also, have you changed the datatype for the NType element to U8, as well as the individual elements of the data cluster?

Link to post
Share on other sites

Your data cluster contains 9 elements, but the prototype indicates it's only 8 elements. So, you've got one too many elements in your cluster. Also, have you changed the datatype for the NType element to U8, as well as the individual elements of the data cluster?

It did't help.My problem is to pass Cluster to Dll structer (not pointer to structer)

Link to post
Share on other sites

But are you sure that you have to pass the parameter as pointer? Did you try to pass the cluster without converting it as pointer?

I am pass cluster (not pointer to cluster)from Labview to DLL ( function prototype in DLL is "uint32 Function_name(struct OutData)" ) but I think that I pass pointer to cluster from Labview to DLL by Call Library Function window (see attachment pic.)

post-9707-095888300 1279624696_thumb.jpe

Link to post
Share on other sites

Why are you trying to pass a pointer to a structure? The function prototype uint32 Function_name(struct OutData) clearly does not indicate that you're supposed to pass a pointer to a structure!

Also, you seem to be dealing with a C++ DLL, as the name mangling shows. Please review the articles on the NI site and in the LabVIEW Help regarding calling C++ DLLs and name-mangling issues. If you are trying to call other functions you may not be able to see them due to the name mangling that occurs with C++ DLLs.

Edited by Saverio
Link to post
Share on other sites

Why are you trying to pass a pointer to a structure? The function prototype uint32 Function_name(struct OutData) clearly does not indicate that you're supposed to pass a pointer to a structure!

Also, you seem to be dealing with a C++ DLL, as the name mangling shows. Please review the articles on the NI site and in the LabVIEW Help regarding calling C++ DLLs and name-mangling issues. If you are trying to call other functions you may not be able to see them due to the name mangling that occurs with C++ DLLs.

How I must configure Call Library Function Node in Labview for pass stuct OutData from Labview to DLL(The function prototype : uint32 Function_name(struct OutData) )?

I am try 2 option:

* 1 option:

I am pass cluster.

Call Library Function Node configuration:

Type: Adapt to Type

Data format: Handles by Value

I am bild cluster whith

u32 CobID;

u8 NByte;

u8 array [8];

u32Time;

The all data pass wrong

* 2 option:

I am pass 4 variable:

u32 CobID;

u8 NByte;

u8 array [8];

u32Time;

Call Library Function Node configuration:

CobID

Type: Numeric

Data type: U32 int

Pass: value

NByte

Type: Numeric

Data type: U8 int

Pass: value

array

Type: array

Data type: U8 int

Pass: array data pointer

Time

Type: Numeric

Data type: U32 int

Pass: value

The CobID and NByte were correct but array and Time were wrong.

I am can't change the DLL. I am start work with Labview 9.0 and now its did't crash.

Link to post
Share on other sites

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.