NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Binary string from LabVIEW in TestStand

Solved!
Go to solution

I'm struggling with handling binary strings that I receive from LabVIEW module in TestStand.

 

A little bit of background:

One of my LabVIEW modules flattens an array of clusters to a string.

TestStand cannot handle this string as ASCII, obviously, so I select Binary String as an output mode.

According to this article the flattened string is encoded and compressed so that it can be used in TestStand. That's fine.

I can now send this data back to another LabVIEW module using the same way, by selecting Binary String type in LabVIEW Module inputs.

 

My case:

I would like to send that flattened array of clusters via Post UI Msg.

ActiveX module for Post UI Msg does not have selection between binary/ascii, so if I put this encoded and compressed string to Post UI Msg action I receive that encoded and compressed string in my callback VI. That's reasonable.

 

My question is: 

What should I do, to receive decoded and decompressed string in UI Msg callback VI?

 

One solution could be to use LabVIEW module to implement sending Post UI messages. But what if I can't/don't want to do it?

My current workaround is to use flatten to JSON and not use binary string in TestStand, but I want to know if I could do it with flatten to string function.



Download All
0 Kudos
Message 1 of 3
(2,217 Views)
Solution
Accepted by topic author pitol

Hello Pitol,

 

I don't know if it can be a solution for you, but I often pass the SequenceContext as activeXDataParam to my UIMessages. It allow me to programmatically retrieve data from the context. I find this method more flexible for complex structures (array of container, sometimes).

 

GetFromContext.png

 

On UI side, you need to convert activeXDataParamerer to SequenceContext using a Variant To Data VI. And then uses the API to do what ever you want from the context. Note, the UIMessage is always synchronous when I use this metod, And generally, my Event Callback is only retrieveing data from context and passing it to an other part fo the UI, to avoid locking the sequence because of UI display processing.

 

Without using the context, I guess you may want to pass the MyFlattenData (oups, my screenshot has a typo) and the same way, cast it as a PropertyObject (instead of Sequencecontext) and retrieve its binary value. Take care to close every reference you generate, especially the one using the Variant to data.

 

Hope this helps,

Message 2 of 3
(2,154 Views)

Hey Mathieu,

 

Thanks for reply!

I was thinking how can I pass SequenceContext or Local variable reference to this callback and use GetValBinary but I didn't figure out that I can use ActiveXData.

Your solution seems to meet my expectations. Thanks!



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