Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

DeviceNet .dll firmware integration into Labview

Hello all,
 
i have been charged with integrating DeviceNet on our new calibration system. Unfortunately, the company acquired a DeviceNet interface module from a vendor that does not include Labview interfacing VIs. I am therefore experiencing quite a lot of trouble integrating the firmware .dll. The vendor told me that it will take a while before they can help me.
 
I have succeeded at running some of simplest commands from the header file (ie open and close Api). However, more complicated commands, such as searching for nodes on the network, and explicit messaging are not working. This seem to be mainly caused by the way i input structures into the call library function node.
 
Can anybody tell me how to structure my inputs for these functions?
 
included are the header, the .dll and my own (clumsy) attempt at making the vi to call the functions.
 
thank you for your help
 
  

Message Edited by Nadsokor on 03-19-2007 08:16 AM

0 Kudos
Message 1 of 4
(4,526 Views)
Hi Nadsokor,
 
I have looked at your VIs, and I can see that some of your input data to the Call Library Function Node is not of the exact data type that is expected, but I am unable to tell, if it is causing your problems. If you look at Start Device.vi, you will see that the two first inputs are U8 and I32, and you are inputting I8 and I16. You may want to verify this throughout your VIs.
 
I am not entirely sure, what you mean by "structuring your inputs".
 
Best regards,
Peter Porsman | Applications Engineer | National Instruments
0 Kudos
Message 2 of 4
(4,514 Views)
Yes, you're right. Those inputs are not exactly what is expected.  However, where i encounter the most seriuos problems (up to and including Labview crashing) is when i have inputs consisting of structures defined in the header  file. One example is the GetNodeList method, which expects a pointer to a structure called TNodeList, defined as:
 
typedef struct
{
 
BYTE byCount;
TNodeDesc NodeDesc[64];
 
} TNodeList;
 
where NodeDesc[64] is an array with 64 entries where each entry consist of the following structure:
 
typedef struct
{
 
BYTE byMacId;
WORD wVendorId;
DWORD dwSerial;
 
} TNodeDesc;
 
I am unsure how such structures are defined in LabView for the "call library function" node.
 
regards,
 
Marc Fornes-Mora 
0 Kudos
Message 3 of 4
(4,513 Views)
Hi Marc,
 
The "struct" is usually a cluster in LabVIEW. You can use the functions in the Cluster & Variant group in the functions palette to create and modify clusters. Be very careful, when defining the BYTE/WORD/DWORD datatypes in the cluster. I think the Call Library Function Node should accept this.
 
Best regards,
Peter Porsman | Applications Engineer | National Instruments
Message 4 of 4
(4,510 Views)