05-23-2016 05:33 AM
Hello,
i have a 2D array in TestStand that i want to read in labview using the SequenceContext and the GetPropertyValue.vi.
It seems as i can only read 1D arrays with this vi.
Is there a solution to also read 2D arrays?
Thanks for help
05-23-2016 06:25 AM
The GetPropertyValue.vi provides the block diagram.
I never tried it, but you could copy the Numeric Array version to your project and modify it to have a 2d array.
Two things to take care/consider:
1. As said, i never tried it. It is possible that 2d-arrays will not work for this transfer.
2. DISCONNECT THE MODIFIED 2D-VERSION FROM THE OTHER (POLYMORPHIC) API FUNCTIONS. Never alter the defaul TS API! Treat this VI as a complete stand-alone one.
Norbert
05-23-2016 06:40 AM
Solution 1. You can Create a variable with 2D array and Map this variable to Input Node of LabVIEW Vi where you need this 2D Array Value. Make sure you are passing the Values to 2D array before the sequence step calling LabVIEW Vi.
Solution 2: Basically the Get Property will access the Variable by its Name and using Invoke Node, a Reference datatype value will be passed to Variant to convert to expected type. So Changing the Reference datatype in get property vi fro, 1 D to 2D Array will solve your problem (Not yet tried in Real time but hoping that it needs to work)
05-23-2016 06:49 AM - edited 05-23-2016 06:51 AM
Solution 2 is working. (and saved under a complete new separate filename)
Thanks
05-23-2016 06:54 AM
What about the other way "SetPropertyObject.vi"?
Here it seems not so eays as in the Get vi.
05-23-2016 07:15 AM
No, setting a multi-dimensional array is not so simple with TS API.
Before digging more into this:
The recommended way to exchange data with a module is to pass it directly by parameter rather than using the TS API in the module. Is there a specific reason why you are not using parameters?
Norbert
05-23-2016 07:31 AM
I have about 20 parameters that i want to read and set. It is easier if there is only one sequencecontext parameter.
But then i will pass the 2D array separate in and out.
05-23-2016 08:05 AM
@OnlyOne wrote:What about the other way "SetPropertyObject.vi"?
Here it seems not so eays as in the Get vi.
Whats your Exact requirement on SetPropertyObject.vi?
As SetValVariant Function accepts variant as input it will take Multidimension array input so ypu can use the same for Set Function also.
Please provide your exact Requirement....
Kind Regards
Palanivel Thiruvenkadam
05-23-2016 08:10 AM
I have a 2D array in TestStand.
Now i want to read this array from labview via SequenceContext and display it in a window.
After viewing and modifying and want ti write it back to the StationGlobals and overwrite the existing data there.