NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample Code to access TestStand 4.0 variables/properties through ActiveX COM Object from a VC++ application

Hi,
I need to access (read and write )TestStand variables/properties from a VC++6.0 based application.
I understand that TestStand is an ActiveX Server, so I am looking for a VC++ based sample code/project where TestStand 4.0 is accessed/controlled through ActiveX COM Object.
Any pointer/help will be appreciated.
Setup Details:
TestStand v4.0
VC++ 6.0
Windows XP
Thanks
Subhash
0 Kudos
Message 1 of 11
(4,510 Views)
Hi,
 
There are a number of examples within the Teststand examples folder and on the NI website that would be a useful source of help you.
eg look at accessing properties and variables. The is a Visual Studio example.
 
A bit more information on what you are trying to achieve would help the community to target there efforts to help you.
 
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 11
(4,507 Views)

Hi Ray,

Thanks a lot for this pointer. I am having difficulties in opening these project files as they are based on newer VC++ version (I have v6.0).

Please let me know if somebody has older version of these examples might work with VC++ 6.0.

Thanks

Subhash

 

 

 

0 Kudos
Message 3 of 11
(4,497 Views)
Hi Subhash,

Which example is it that you are looking at exactly?  By default, all of the TestStand 4.0 examples were written for VC++ .NET, however, if you can tell me exactly which example you are using, we may be able to find an equivalent VC++ 6.0 example.  Are you looking at the TestStand UserInterface examples, such as the Simple or Full Featured user interfaces, that are installed with TestStand by default in the C:\Program Files\National Instruments\TestStand 4.0\UserInterfaces\NI directory?
0 Kudos
Message 4 of 11
(4,484 Views)

Hi Subhash,

I have some VC6 samples but at the moment i do not understand what your application and Teststand is doing ?

Just for clarfiy when i read your header i can "find" 3 possibile topics:

1.) You just want to read/write a variable in TS with VC6. Then i recommend the Dll code module adapter instead activeX

2.) You want to write your own UI interface in VC6. Take a look into the old TS2.0 all the C++ examples are done in VC6. Maybe this version is still to download ??

3.) You have a application that uses the TS.engine object in a single process (maybe you want to write a SequenceFile generator).

So send us some details.

Greetings

juergen 

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 5 of 11
(4,477 Views)

Hi Jonathan,

Thank you very much for your response.

I think following application could be helpful (VC++ 6.0 Version) and closest to my requirement.

C:\Program Files\National Instruments\TestStand 4.0\Examples\AccessingPropertiesUsingAPI

C:\Program Files\National Instruments\TestStand 4.0\Examples\AccessingArraysUsingAPI etc.

I do not see any example folder present for VC e.g. "UsingVC" there, however "UsingMFC" still could be good starting point.

 

Thanks for the help.

Regards

Subhash

 

0 Kudos
Message 6 of 11
(4,474 Views)
Hi Subhash,
 
As i see you are trying to use the DLL Code module adpter
 
Feel free to use this link: http://zone.ni.com/devzone/cda/epd/p/id/3289
 
greetings
juergen
--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 7 of 11
(4,471 Views)
Hi,
Thanks for this link.
I have already downloaded these files and tried compiling them.
I was having following error:
"c1xx : fatal error C1083: Cannot open source file: '\api\mfc\tsapimfc.cpp': No such file or directory".

\202709\AccessingPropertiesAndVariables.cpp(5) : fatal error C1083: Cannot open include file: 'tsapimfc.h': No such file or directory

Looks like in new TestStand , this file is no longer present. I think, if I could compile these application, it could provide very good reference.
 
Thanks
Subhash
0 Kudos
Message 8 of 11
(4,467 Views)

Hi

This error(s) are clear.

1. Have to add the TS. h-Folder files to your VC environment settings
in my case this is
C:\Programme\National Instruments\TestStand 4.0\API\VC

2. You have to rename .cpp link if it is not relativ
C:\Programme\National Instruments\TestStand 4.0\API\VC\tsapivc.cpp

This should help.

if not on monday i can post a small vc6/ts4.0 sample

 

juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 9 of 11
(4,458 Views)
Hi,
 
I have created a new wrapper class for TS4.0
I manullay addes or better copied all enums and defines from the old TS2.0 as NI did in mfcapi.h
 
Try this:
 
Greetings juergen
--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 10 of 11
(4,425 Views)