Hello Anshul,
There are a couple of different ways to access TestStand local variables within LabVIEW depending on how the VI and TestStand are related. First of all, it is important to understand what a Sequence Context is. The TestStand helps defines it as: "... an object in the TestStand API that represents the execution state of a sequence. For each active sequence, TestStand maintains a sequence context you can use to access all the objects, variables, and properties that relate to the execution of the sequence." So you cannot create a sequence context yourself (in fact, the only API reference that you can create is a reference to the TestStand engine). The Context refers to the state of a particular execution at a particular time. Therefore, to access TestStand variables within a Sequence Context, you must pass that context into LabVIEW.
If the LabVIEW VI is called from a step in TestStand as a code module, you can simply pass "ThisContext" as an input. "ThisContext" is a variable within the context that is a reference to the Sequence Context itself. You could also just pass the variable of interest itself into the VI as an input.
If the LabVIEW VI is the Operator Interface (OI), it is a little more difficult. Although you are able to get access to a sequence file from LabVIEW, the only way to get reference to variables in a currently executing sequence are to have a reference to the Sequence Context (which I have already said, you cannot create). You must somehow pass the context from the executing sequence into LabVIEW. The way to accomplish this is to use UIMessages. There is an API method (an execution method specifically) that you can call that enables you to pass any type of data from an executing sequence into the OI. It gets handled by the OI's event handler. For information on UIMessages and for example code, go to www.ni.com/support and search using the keyword, "uimessage".
I hope that this helps. Take care and have a great day!
Sincerely,
Aaron B.
National Instruments