Making structs for PS4000A API functions

Post your LabVIEW discussions here
Post Reply
Kapton
Newbie
Posts: 0
Joined: Sun Oct 04, 2020 9:45 pm

Making structs for PS4000A API functions

Post by Kapton »

Several of the API functions require a struct, or an array of structs, as an input. LabVIEW does not natively support structs, so what is the intended method for making them? I see two lines of thought: one is to use an array of clusters, and the other is to use a 2D array. With a little bit of testing, both methods produce data formatting errors and wiring issues. So which, or what, method is best to simulate structs in a way the functions will recognize.

I'm relatively new to LabVIEW, so there could be a glaringly simple solution to this problem, I don't know. Any help or guidance would be appreciated.

Kapton
Newbie
Posts: 0
Joined: Sun Oct 04, 2020 9:45 pm

Re: Making structs for PS4000A API functions

Post by Kapton »

upon further testing, it appears that an array of clusters in the way to go. The LabVIEW call function can set a parameter to "adapt to type". This should allow the function to translate an array of clusters into an array of struts, as long as the elements in the cluster are in the correct order.

Kapton
Newbie
Posts: 0
Joined: Sun Oct 04, 2020 9:45 pm

Re: Making structs for PS4000A API functions

Post by Kapton »

upon even further testing, I decided to stop using "adapt to type" with arrays of clusters. Instead, I went with what the advanced trigger examples use, which are 2D arrays of U8.

For the 4000A, here is a subVI i made that will handle making all of the 2D arrays needed. just plug in your inputs as arrays and select which type of 2D array you want to output.
Attachments
2d_array_converter (SubVI).vi
(20.76 KiB) Downloaded 343 times

Post Reply