NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I pass a variable length string from a LabVIEW DLL?

Hello again all.
 
I have a requirement to package my LabVIEW step as a DLL, to ease deployment and version issues etc.  It's an action, which passes back a string.  This string is of variable, unlimited length.  It will never contain any null characters.
 
How do I build my DLL in LabVIEW 8.20, and how do I configure TestStand 3.5 to interface with it?  I've tried loads of different options with various types of errors and/or empty strings as a result.
 
And also... The VI also passes back a standard error cluster.  I've broken this down into its components so that it only uses standard data types.  I know that there is a problem with booleans, so I've turned the boolean into a U8 with a value of 0 or 1.  How can I tell TestStand to set the value of Step.Result.Error.Occurred according to this numeric value?
 
Any ideas?  If it's easier then I can just do it the olde-fashioned way and pass in the Sequence Context and get the VI to populate the TestStand variables programmatically.  I'd prefer not to though.
0 Kudos
Message 1 of 3
(3,234 Views)
Hi Sean,

I have been looking at your issue, and it does not look like an easy thing to do. I am following 2 lines of investigation at the moment.

1) You say the string can be unlimited in length, but you must have some idea of what the longest return string is going to be. You could put that in as the number of characters to read. (Not the best solution, but an easy one).

2) I am also looking at using the string length function in LabVIEW and passing the length data of the string to Teststand and then using that as a variable in how many chars to read. (So far no luck but I have not been trying this approach for long.)

I will keep you infomred on my progress, but maybe you would like to try step 2 yourself, and we'll see if together we can get you a solution.

Regards
JamesC
NIUK and Ireland

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

Thanks for the reply.

The LabVIEW app builder does automatically add a "len" output where there is a string output, which does contain the length of the string.  By default, this value follows after the string.  I think I'm right in saying that I can juggle the parameter order so that the "len" value comes before the string itself.  In TestStand, I can then output this value to, say, Locals.StringLength.  The length of the string can then be set by using this value.

I've yet to try it, so it's possibly a no-hoper. (as ever, I've been dragged into doing something else now), but this might possibly be a solution...

0 Kudos
Message 3 of 3
(3,189 Views)