CTA Integration with External Systems 2 — Questions and Answers
Question 1: When integrating TestStand with a custom DLL, which calling convention must the exported functions use by default for compatibility?
- __fastcall
- __stdcall (Correct answer)
- __cdecl
- __thiscall
Correct answer: __stdcall
TestStand's DLL Flexible prototype adapter expects exported functions to use the __stdcall calling convention by default.
Question 2: Which TestStand feature allows you to call .NET assemblies directly without writing a wrapper DLL?
- ActiveX Adapter
- .NET Adapter (Correct answer)
- LabVIEW Adapter
- DLL Flexible Adapter
Correct answer: .NET Adapter
The .NET Adapter in TestStand allows direct invocation of methods in managed .NET assemblies without an intermediate wrapper.
Question 3: In TestStand, what is the purpose of the 'synchronization' resource when integrating with external instruments?
- It locks the test sequence to prevent re-entry
- It controls exclusive access to shared hardware resources across threads (Correct answer)
- It sends SCPI commands to instruments
- It manages TCP socket connections to remote devices
Correct answer: It controls exclusive access to shared hardware resources across threads
Synchronization resources (semaphores, queues, rendezvous) manage exclusive or coordinated access to shared instruments across parallel execution threads.
Question 4: What TestStand mechanism is used to pass data between a sequence and an external application using a named shared variable?
- FileGlobal variable
- StationGlobal variable
- NI Shared Variable via LabVIEW adapter (Correct answer)
- System Variable mapped to a network path
Correct answer: NI Shared Variable via LabVIEW adapter
NI Shared Variables published via the NI Variable Engine can be read/written from TestStand through the LabVIEW adapter, enabling data exchange with external applications.
Question 5: When using the TestStand ActiveX/COM adapter to call an external COM server, which threading model must the COM object support for reliable in-process execution?
- Single-Threaded Apartment (STA) (Correct answer)
- Both STA and MTA
- Multi-Threaded Apartment (MTA) only
- Free-Threaded model only
Correct answer: Single-Threaded Apartment (STA)
TestStand's ActiveX adapter marshals COM calls on the STA, so COM objects should be registered as STA to avoid marshaling overhead and threading conflicts.
Question 6: Which TestStand API function is used by an external application to retrieve the value of a sequence-local variable programmatically?
- SequenceFile.GetVariable()
- Execution.GetVariable()
- PropertyObject.GetValNumber() / GetValString() (Correct answer)
- Engine.LookupRunTimeType()
Correct answer: PropertyObject.GetValNumber() / GetValString()
PropertyObject methods like GetValNumber() and GetValString() are used to read variable values from TestStand containers in external applications via the API.
Question 7: When integrating an external Python module with TestStand using the Python adapter, where must the Python interpreter path be configured?
- In the sequence file properties
- In the TestStand adapter configuration under Configure > Adapters > Python (Correct answer)
- In the Windows registry under HKLM\Software\NI
- Directly in each step's module tab
Correct answer: In the TestStand adapter configuration under Configure > Adapters > Python
The Python adapter configuration dialog (Configure > Adapters > Python) is where you specify the interpreter path and version TestStand uses for Python steps.
When integrating TestStand with a custom DLL, which calling convention must the exported functions use by default for compatibility?