Olupo
Olupo

Reputation: 420

configure library function node parameter for an array of strings

How to configure the library function node parameter in LabView for a C function declared like this:

char listPorts(cust_struct *cust, unsigned char *pPort, char (*pSer)[16])

I don't know how to configure the parameter char (*pSer)[16]. I've tried it as Type Adapt to Type(with a cluster consisting of strings). But this will raise Error 1097.

This pointer will write strings to an array. How do I have to configure this parameter?

Upvotes: 1

Views: 186

Answers (1)

srm
srm

Reputation: 3163

There is no mechanism in LabVIEW to directly pass a LabVIEW array of strings to a C-style array of strings parameter, particularly not one with fixed size. You will need to write a wrapper DLL around that function that can translate the LabVIEW data structure into a C data structure (or vice versa), managing the memory transformation along the way.

This document will help you understand the memory layout.

Using Arrays and Strings in the Call Library Function Node

Upvotes: 1

Related Questions