From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA difference between pack cluster vs unpack cluster

Solved!
Go to solution

Hello Community, 

 

I used FPGA C API generator to export a header file, but it didn't show any message about the function called

 

(FPGA VI NAME)_IndiciatorCluster_UnpackCluster

 

(FPGA VI NAME)_IndiciatorCluster_PackCluster

 

what would those functions do and how would they be different?

 

0 Kudos
Message 1 of 2
(726 Views)
Solution
Accepted by topic author cshim31

When a cluster is instantiated on the FPGA it is "packed".  There are no padding bits because alignment doesn't matter on the FPGA.

 

We choose to represent clusters in C as structs.  Structs are padded and alignment of members can differ on different architectures.

 

The unpack and pack functions let you convert between the FPGA representation and the C representation.  When reading a cluster indicator from the FPGA you'll read it as the FPGA representation and convert it to a C struct to access the data in it.

 

C -> packCluster -> FPGA 

FPGA -> unpackCluster -> C

0 Kudos
Message 2 of 2
(672 Views)