03-28-2015 03:40 AM
Hi all,
Using TS 2014 and LabVIEW 2013 SP1.
I am failing to use the 'Property Object' Method 'SetValBinary' to edit a (flattened) binary string (stored in Teststand Locals).
I am elaborating more below, and attaching a simple example that shows what I was able to do and what not.
What I have succeeded :
1. Reading and Writing binary strings from LabVIEW to Teststand and Teststand to LabVIEW.
Where :
In LabVIEW - the String is in the VI's connector pane (input and output).
In Teststand - modifying the string (in/out) type to 'Binary String' from 'ASCII String'.
2. Reading the binary string From Teststand to LabVIEW.
Where :
In LabVIEW - the String is not an input of the VI's connector pane. but the Sequence Context In reference is.
So I was able to use the 'Property Object' Method 'GetValBinary', (converting variant to string and then unflatten)
What I have failed to succeed :
Witing the binary string From LabVIEW to Teststand. (without outputing the string in the connector pane).
I have tried to use the 'Sequence Context In reference' and the 'Property Object' Method 'SetValBinary' to edit the string (stored in the Locals in Teststand) . but with no success.
The sequence and3 vi's are attached.
(recommended see the simple VI's actions first and then to to run step by step and watch the Local Variable named 'number')
Does anyone knows what I did wrong ? or what settings am I missing ?
Amitai.
03-30-2015 06:23 AM
Ciao Amitai,
you did almost everything correctly, 99% is ok, you just missed one part.
In order to behave correctly the SetValBinary wants binary data, so when dealing with strings you need to convert them in byte arrays.
I've just added that function and now it works just fine:
Attached you find my modifications. I've used TS 2014 and created a version of the sequence for 2013 called 1_TS2013,.seq
Have a good one,
Andrea
03-30-2015 07:06 AM
Shalom Andrea,
Thanks a lot for your reply,
In fact, I’ve found a resource that explains that binary strings may contain null characters, so I have used this conversion but tried to write it to a INT array in Teststand…..
Your idea makes much more sense.