<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calling a  C Struct from a LV CallLibrary Function. in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1674656#M596759</link>
    <description>&lt;P&gt;And how does the according Call Library Node configuration look like?&lt;/P&gt;</description>
    <pubDate>Wed, 17 Aug 2011 22:05:09 GMT</pubDate>
    <dc:creator>rolfk</dc:creator>
    <dc:date>2011-08-17T22:05:09Z</dc:date>
    <item>
      <title>Calling a  C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1639482#M589502</link>
      <description>&lt;P&gt;I have a DLL called Canopen.dll.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have an example C-Code on how to use the functions in the DLL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have been able to call a few of the functions in LV using the Call Library Function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But one function is a problem as its arguments are from a Struct. It goes like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Function Call&lt;/STRONG&gt;&lt;BR /&gt;short CMA_ConfigCANChannel(&lt;BR /&gt;unsigned char usChannelHandle,&lt;BR /&gt;CMA_CAN_CONFIG stCANConfig);&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Parameter List&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;typedef struct&lt;BR /&gt;{&lt;BR /&gt;unsigned char ucBaudrate;&lt;BR /&gt;unsigned char ucPresc;&lt;BR /&gt;unsigned char ucSjw;&lt;BR /&gt;unsigned char ucTSeg1;&lt;BR /&gt;unsigned char ucTSeg2;&lt;BR /&gt;unsigned char ucAccCode;&lt;BR /&gt;unsigned char ucAccMask;&lt;BR /&gt;} CMA_CAN_CONFIG;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now how to convert this to be suitable fro CallLibrary Function ?? (&amp;nbsp; Actually there is one example in the NI site but that is in LV5.0 and my LV2009 cannot open it !!)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2011 12:27:15 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1639482#M589502</guid>
      <dc:creator>MogaRaghu</dc:creator>
      <dc:date>2011-07-19T12:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a  C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1639780#M589568</link>
      <description>&lt;P&gt;Create a cluster consisting of U8 integers. You will need to use 8 of them since the struct has 7 and you will need to make sure you account for alignment to memory locations. You can then just use "Adapt to Type" for the parameter type. LabVIEW comes with a very detailed example on calling DLLs. Open the Example Finder and search for "DLL".&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2011 14:52:26 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1639780#M589568</guid>
      <dc:creator>smercurio_fc</dc:creator>
      <dc:date>2011-07-19T14:52:26Z</dc:date>
    </item>
    <item>
      <title>Re : Calling a  C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1639782#M589569</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure but I suggest you use a cluster (a LabVIEW Cluster is equivalent to a C Struct).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So in your case, you may pass a 7 item cluster to your "call library function node"&amp;nbsp;(cluster containing ucBaudrate, ucPresc, etc...).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;J.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2011 14:52:53 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1639782#M589569</guid>
      <dc:creator>Julien_31</dc:creator>
      <dc:date>2011-07-19T14:52:53Z</dc:date>
    </item>
    <item>
      <title>Re : Calling a  C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1639792#M589572</link>
      <description>&lt;P&gt;Oups, smercurio answered before I post my answer. I think it's explanation is most complete than mine. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2011 14:54:22 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1639792#M589572</guid>
      <dc:creator>Julien_31</dc:creator>
      <dc:date>2011-07-19T14:54:22Z</dc:date>
    </item>
    <item>
      <title>Re : Calling a  C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1640264#M589675</link>
      <description>&lt;P&gt;Unfortunately I think smercurio's answer is incorrect in this case.&amp;nbsp; Rolfk answered this question &lt;A href="http://forums.ni.com/t5/LabVIEW/Interface-dll-function-with-struct-in-LabVIEW/m-p/1492294#M562268" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp; To pass a struct by value, create one parameter for each element of the struct.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2011 18:46:53 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1640264#M589675</guid>
      <dc:creator>nathand</dc:creator>
      <dc:date>2011-07-19T18:46:53Z</dc:date>
    </item>
    <item>
      <title>Re : Calling a  C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1640286#M589679</link>
      <description>&lt;P&gt;You know, I didn't even see it was being passed by value. Guess it's habit for me to always see it passed by reference.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2011 19:08:55 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1640286#M589679</guid>
      <dc:creator>smercurio_fc</dc:creator>
      <dc:date>2011-07-19T19:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1646532#M590927</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to&amp;nbsp;handle int array&amp;nbsp; and string array inside a C structure to call it from LV call library function?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Function:&lt;/P&gt;
&lt;P&gt;short CMA_GetVersion( unsigned char ucChannelHandle, CMA_VersionStruct *stpVersion);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;C Structure:&lt;BR /&gt;typedef struct&lt;BR /&gt;{&lt;BR /&gt;unsigned long ulHWSerialNumber;&lt;BR /&gt;unsigned char ucHWMainRevision;&lt;BR /&gt;unsigned char ucHWSubRevision;&lt;BR /&gt;unsigned char ucHWIdentString[18];&lt;BR /&gt;unsigned char ucSWMajorVersion;&lt;BR /&gt;unsigned char ucSWMinorVersion;&lt;BR /&gt;unsigned char ucSWBuild;&lt;BR /&gt;} CMA_VersionStruct;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Function:&lt;/P&gt;
&lt;P&gt;short CMA_InstallPDO_E( unsigned char ucChannelHandle, CMA_PDOConfig, unsigned short *uspPDOHandle);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;C Structure:&lt;BR /&gt;typedef struct&lt;BR /&gt;{&lt;BR /&gt;unsigned char ucPDOType;&lt;BR /&gt;unsigned long ulCOBID;&lt;BR /&gt;unsigned char ucTransType;&lt;BR /&gt;unsigned char ucAccType;&lt;BR /&gt;unsigned char ucEventNotif;&lt;BR /&gt;unsigned char ucaDefVal[8];&lt;BR /&gt;unsigned short usEventTimer;&lt;/P&gt;
&lt;P&gt;unsigned char ucNrOfByte;&lt;/P&gt;
&lt;P&gt;unsigned char ucNoInitTrans;&lt;BR /&gt;} CMA_PDOConfig;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope someone helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kousy&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2011 10:19:20 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1646532#M590927</guid>
      <dc:creator>Kousy</dc:creator>
      <dc:date>2011-07-25T10:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1647090#M591031</link>
      <description>&lt;P&gt;This has been asked over and over again on this forum.&amp;nbsp; You need to replace the array in the C struct with a LabVIEW cluster containing the same number of elements.&amp;nbsp; For example, you would replace ucHWIdentString[18] with a cluster of 18 U8 values.&amp;nbsp; The easiest way to generate such a cluster is by wiring an empty array of U8 to "Array to Cluster" and setting the number of cluster elements appropriately.&amp;nbsp; Create a control or constant as necessary from the output of Array to Cluster.&amp;nbsp; To get a string into that structure, you can use String to Array of U8, followed by Array to Cluster.&amp;nbsp; The reverse operation will get the you the string out of that structure.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2011 16:47:16 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1647090#M591031</guid>
      <dc:creator>nathand</dc:creator>
      <dc:date>2011-07-25T16:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1649260#M591447</link>
      <description>&lt;P&gt;nathand,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried Adapt to Type and Handle by value for the above mentioned functions. Still Im getting LV Error 1097 when&amp;nbsp;trying out&amp;nbsp;GetVersion function call&amp;nbsp;and Functional Error of -110&amp;nbsp;when trying out InstallPDO_E. Im attaching the VI. Can you please look into it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kousy&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2011 08:53:36 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1649260#M591447</guid>
      <dc:creator>Kousy</dc:creator>
      <dc:date>2011-07-27T08:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1650558#M591714</link>
      <description>&lt;P&gt;Based on the random clusters floating around your block diagram, it looks like you tried everything except the one thing I suggested.&amp;nbsp; Create a cluster that matches your C structure, and replace the fixed-size arrays with equivalent clusters.&amp;nbsp; For the CMA_VersionStruct, that means that ucHWIdentString should be replaced with a cluster containing 18 U8 values (U8 is the same size as char).&amp;nbsp; Then pass the entire CMA_VersionStruct cluster as a single parameter set to Adapt to Type (the Data Format doesn't matter), because you want to pass it by reference, not by value.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2011 00:29:55 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1650558#M591714</guid>
      <dc:creator>nathand</dc:creator>
      <dc:date>2011-07-28T00:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1650990#M591801</link>
      <description>&lt;P&gt;Thanks nathand.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now the function call CMA_GetVersion is working. But the other function CMA_InstallPDO_E still throws a fault. Herewith Im attaching the debugging of dll's snapshot for reference with COBID of 202, &amp;nbsp;as you can see the COBID entry is garbled. Could you please look into it and clarify where the code is went wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kousy&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2011 11:27:17 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1650990#M591801</guid>
      <dc:creator>Kousy</dc:creator>
      <dc:date>2011-07-28T11:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1651144#M591832</link>
      <description>&lt;P&gt;ucaDefVal﻿ is defined as an array of 8 char values, and you are passing in an array of 9 elements.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2011 13:20:10 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1651144#M591832</guid>
      <dc:creator>smercurio_fc</dc:creator>
      <dc:date>2011-07-28T13:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1651530#M591911</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/33243"&gt;@smercurio_fc&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;ucaDefVal﻿ is defined as an array of 8 char values, and you are passing in an array of 9 elements.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm certain that this is not the problem.&amp;nbsp; LabVIEW will pass a native array by pointer, so the number of elements in it is irrelevant.&amp;nbsp; The C struct defines a fixed-size array and it is being passed by value.&amp;nbsp; Using a LabVIEW array is not an option at all, regardless of the number of elements in it.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2011 15:52:59 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1651530#M591911</guid>
      <dc:creator>nathand</dc:creator>
      <dc:date>2011-07-28T15:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a  C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1651590#M591923</link>
      <description>&lt;P&gt;I've got to stop jumping back and forth between LabVIEW, Excel, Matlab, C#, C, etc.. My brain is officially liquified this morning.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2011 16:20:24 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1651590#M591923</guid>
      <dc:creator>smercurio_fc</dc:creator>
      <dc:date>2011-07-28T16:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1653478#M592320</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Kousy wrote: &lt;BR /&gt;
&lt;P&gt;Now the function call CMA_GetVersion is working. But the other function CMA_InstallPDO_E still throws a fault. Herewith Im attaching the debugging of dll's snapshot for reference with COBID of 202, &amp;nbsp;as you can see the COBID entry is garbled. Could you please look into it and clarify where the code is went wrong?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It looks to me like you need to pass an additional 3 bytes of padding between ucPDOType and ulCOBID to maintain alignment.&amp;nbsp; This would be necessary if you were passing the cluster by reference so I wouldn't be surprised if it's required for passing by value as well.&amp;nbsp; The reason is that in C at least, a long needs to be aligned on a 4-byte boundary, whereas LabVIEW always packs structures as tightly as possible.&amp;nbsp; The first value in the cluster, ucPDOType, will be properly aligned because it starts the structure.&amp;nbsp; Another 3 bytes are then necessary to reach the next 4-byte boundary on which the unsigned long ulCOBID can start.&amp;nbsp; You can just add two dummy parameters - a U8 and a U16 - and pass null values to them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You also need to pass 8 separate U8 (char) values for ucaDefVal (again, due to passing by value) instead of passing an array by reference.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2011 20:25:50 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1653478#M592320</guid>
      <dc:creator>nathand</dc:creator>
      <dc:date>2011-07-29T20:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1653820#M592393</link>
      <description>&lt;P&gt;Nathand !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your continued support. We have tried all methods as suggested and still the CMA_Install PDO_E throws the same fault. While reading the device manual this is what it says about calling functions from Labview :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P align="left"&gt;&lt;EM&gt;The parameter structures must be defined as arrays and need&lt;/EM&gt;&lt;/P&gt;
&lt;P align="left"&gt;&lt;EM&gt;to be evaluated by bytes. The array size must fit or exceed the&lt;/EM&gt;&lt;/P&gt;
&lt;P align="left"&gt;&lt;EM&gt;size of the parameter structure. Otherwise, access violations&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;during operation may occur.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this throw any additonal light on the problem ??&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jul 2011 12:14:21 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1653820#M592393</guid>
      <dc:creator>MogaRaghu</dc:creator>
      <dc:date>2011-07-30T12:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1654168#M592476</link>
      <description>&lt;P&gt;I'm not sure exactly what you tried, so I'm posting what I'm pretty sure it should look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://forums.ni.com/t5/image/serverpage/image-id/49298iE0D1FCAEF1CCEDDC/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="CMA_InstallPDO_E.png" title="CMA_InstallPDO_E.png" align="center" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note the addition of 4 bytes of padding: 3 bytes&amp;nbsp;(one&amp;nbsp;U8 and one&amp;nbsp;U16)&amp;nbsp;before ulCOBID, and 1 byte&amp;nbsp;before usEventTimer.&amp;nbsp; The snippet creation seems to mess up cluster images; the ucaDefVal cluster is of course 8 U8 elements.&lt;/P&gt;
&lt;P&gt;If this is what you already tried, and you're still getting an error, please specify exactly what the error is and whether it's an error from LabVIEW or from your DLL.&amp;nbsp; Also, in the Call Library Node, try setting debugging to maximum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you and Kousy working on the same team, or just coincidentally trying to use the same DLL at the same time?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2011 02:14:07 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1654168#M592476</guid>
      <dc:creator>nathand</dc:creator>
      <dc:date>2011-08-01T02:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1654182#M592480</link>
      <description>&lt;P&gt;Nathan,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't use the snippeet creator built into LabVIEW.&amp;nbsp; Download the Code Capture Tool.&amp;nbsp; It works much better.&amp;nbsp; It also doesn't break property nodes the way the LabVIEW version does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2 class="lia-message-subject"&gt;&lt;FONT size="3"&gt;&lt;A id="topicMessageLink_13183327c40_e7cc" class="lia-link-navigation lia-message-read" href="http://forums.ni.com/t5/LabVIEW/Community-nugget-Code-Capture-Tool-2-0/m-p/1034265/highlight/true#M460545" target="_blank"&gt;Community nugget: &lt;SPAN class="lia-search-match-lithium"&gt;Code&lt;/SPAN&gt; &lt;SPAN class="lia-search-match-lithium"&gt;Capture&lt;/SPAN&gt; &lt;SPAN class="lia-search-match-lithium"&gt;Tool&lt;/SPAN&gt; 2.0&lt;/A&gt;&lt;/FONT&gt;&lt;/H2&gt;
&lt;P class="lia-message-subject"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2011 02:41:29 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1654182#M592480</guid>
      <dc:creator>RavensFan</dc:creator>
      <dc:date>2011-08-01T02:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1654432#M592527</link>
      <description>&lt;P&gt;Nathand,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tried as you suggested. Its not working out. And Im getting the same dll error.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Just to make matter simple we are trying another functionality called ConfigSyncMan. We tried to send the syncID(0x80) as simple U32 datatype as well as in both endian formats , neither worked out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Raghunathan and self are working on the same project.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What else can I try?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kousy&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2011 10:41:04 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1654432#M592527</guid>
      <dc:creator>Kousy</dc:creator>
      <dc:date>2011-08-01T10:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a C Struct from a LV CallLibrary Function.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1654960#M592653</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/47443"&gt;@Kousy&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tried as you suggested. Its not working out. And Im getting the same dll error.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Could you be more specific - is the error that you're getting a LabVIEW error, or an error from the DLL?&amp;nbsp; If from LabVIEW, is it 1097 or something else?&amp;nbsp; If from the DLL, consult the DLL documentation for the meaning of the error code - I can't help debug that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you run the Install_PDO_E call exactly as I suggested and then watch the call in the debugger, like the screenshot you posted, do the right values go to the right places?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the prototype of the ConfigSyncMan function?&amp;nbsp; If this is another case of passing a struct by value, then you probably need two bytes of padding to align ulSyncID.&amp;nbsp; There is no need to flatten and unflatten your parameters - LabVIEW will take care of the endianness﻿.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2011 16:33:36 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Calling-a-C-Struct-from-a-LV-CallLibrary-Function/m-p/1654960#M592653</guid>
      <dc:creator>nathand</dc:creator>
      <dc:date>2011-08-01T16:33:36Z</dc:date>
    </item>
  </channel>
</rss>

