NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TS API GetValVariant with custom data type causing error

Solved!
Go to solution

Hello All,

 

I'm using TS2017 SP1, I want to make a ProjectConfig configuration entry point in the process model, which reads the values of a FileGlobal of a client sequence in editmode, and returns it after modification to the client sequence file.

The config parameter is a custom data type.

I get the reference of the client FileGlobals, and I managed to use the SetValVariable function, which writes the custom parameter to the client sequence without issues, but reading the values with the GetValVariant is causing and error: "-17308; Specified value does not have the expected type."

But the types are equivalent in both sequences.

Is this behavior known? Is there any workaround possible?

Thank you in advance.

 

bigyo

0 Kudos
Message 1 of 3
(1,849 Views)

Hi bigyo,

 

I see your post wasn't touched for quite some time, do you still experience -17308 error when using GetValVariant?

If you found a solution, could you share it with a community?

If you still experience the error, could you share a sequence file, where we could see the error happening?

 

Thanks.

Regards,

Patrik
CTA, CLA
Helping (sharing) is caring!

If the post was helpful - Kudo it.
If the post answered your question - Mark it as Solution.
0 Kudos
Message 2 of 3
(1,773 Views)
Solution
Accepted by topic author bigyo

Hello Ajskrim,

 

The solution was  provided with the help of NI specialist.

When getting the reference of the client FileGlobals, I needed to create a clone of this reference, so I can use the GetValVariant function to work locally on that object.

With that little tweak it is working perferctly.

bigyo

Message 3 of 3
(1,766 Views)