NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the 'Property Object' Method 'SetValBinary' to directly edit Teststand Local with binary string.

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.

0 Kudos
Message 1 of 3
(4,823 Views)

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:

 

Capture.JPG

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

 

 

Andrea N.
Principal Applications Engineer - Semiconductor EMEA
National Instruments Italy
Certified LabVIEW Architect - Certified TestStand Architect
Message 2 of 3
(4,785 Views)

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.

0 Kudos
Message 3 of 3
(4,782 Views)