From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

C++: Create a SequenceContext Object

Solved!
Go to solution

Hello,

 

i wrote a C++ DLL for TestStand one of the functions has the parameter: "TS::SequenceContext *seqContext".

I also wrote a test application which loads the named DLL to debug and to see if the DLL works. But to call the DLL-function correctly I need a SequenceContext Object. How can I create this?

 

Frank

 

Here is a part of the function code:

 

 int __declspec(dllexport) DMM_Konfiguration(TCHAR* pResource , TCHAR* pZielVariable , int BufferSize, TS::SequenceContext *seqContext)
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState());
    

    int numprop;

   CString temp;

   numprop = m_TSProperty->GetNumSubProperties( "Locals" ) ;

    for (int i=0; i<numprop; i++)
    {
        temp.SetString(m_TSProperty->GetNthSubPropertyName("Locals",i,0));

        temp....
    }

   return 1;
}

 

0 Kudos
Message 1 of 4
(3,000 Views)

Hi frankne,

 

If if you just want to the debug your dll, you don't need to write a test app at all.

Just set a desired breakpoint in your code. Make sure at that your are using the right path and that there is the pdb file!

Set in your debug settings the path to your  local SeqEdit.exe

 

Now you can launch TS automatically by pressing F5 in VC++, select your seq-File or step  and let it run.

 

Your maschine will stop at your breakpoint.

 

Hope this helps.

 

juergen 

 

 

 

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

Hi juergen,

 

i added the Seqedit.exe in the debugger properties. But during debugging the breakpoints are disabled. Do I have to change something else?

 

I'm using VS2005 and writing a unmanaged C++ DLL. I also tried to attach my project to the seqedit.exe (Debugger -> Attach to process)

The pdb file exists and is in the same directory as the dll.

 

Frank

0 Kudos
Message 3 of 4
(2,974 Views)
Solution
Accepted by topic author frankne

Hi Frank,

 

I have written a small dll to test it.

Instead of Editor (Managed Code!!)  I have used MFC TestExec.exe (Unmanaged)

Add the path to the debugger:

C:\Programme\National Instruments\TestStand 4.0\UserInterfaces\NI\Simple\C++ using MFC\Release\TestExec.exe

In my VC8 it will work.

 

Greetings

 

Juergen

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
Message 4 of 4
(2,970 Views)