LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

structure

Hi, I need some help here. I have 2 structures, the second one is used in the first one. How can I get the elements of the second structure.

 

typedef struct tagLayer3LongLatencyInfo
{
unsigned long ulMinimum; /
unsigned long ulMaximum; /
U64 u64Total; /
unsigned long ulFrames;

} Layer3LongLatencyInfo;


 

typedef struct tagU64
{
unsigned long high;
unsigned long low;
} U64;

 

 

 

How can I specify or get u64Total here

Here is what I tryied.

 

void getLat(int x,int y, int z)
{

 Layer3LongLatencyInfo INFO;
 U64 ELEMENT;
 
 INFO.ulMinimum =0 ;
 INFO.ulMaximum =0 ;
 // how can I specify u64Total
 INFO.ELEMENT.u64Total; // NOT SURE HERE
 

// Some codes....... 

}

0 Kudos
Message 1 of 3
(2,955 Views)

Elements in nested structures can be accessed with the selection operatore in the same way as other element structures.

In your case, you do not need to declare a U64 variable in the function: "nephew" elements are accessed by using INFO.u64Total.high and INFO.u64Total.low



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(2,948 Views)

Thank you.

0 Kudos
Message 3 of 3
(2,935 Views)