NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand Debugging of CVI

I have a CVI 7.1 project (.prj). I also have a TestStand 3.1 sequence that calls numerous functions within the various CVI source files. Without TestStand, I cannot run my CVI project (I think). But when I load my seq in TestStand and select Test UUT, I get an error that says

Error loading Step Pass/Fail Test ...
Unable to get Standard CVI Step Module address for DepotInitialize.

DepotInitialize is the routine I'm trying to call in the Setup tab of TestStand's sequence editor.

What I'm wondering is, how can I debug to see where the problem is occurring? Within CVI, I can either create a Release or Debug executable, but if my project consists only of files that perform specific tests, and therefore (the .prj) contains no main, how do I step into the code and test it.

What I've been trying to do is deploy using TS. I created a TS workspace that contains two TS .tpj files. The first points to my app .prj, .lib, .seq. The second points to TestStand's .exe, .ico, .uir files. I'm not sure if this is correct.

I'm confused on the relationship between TS and CVI .prj files. If I open my seq in TS, how does it know if I've built the CVI project as debug or release.

I just want to be able to step through my code. How do I do that.
0 Kudos
Message 1 of 11
(4,988 Views)
Hi,

Follow this process link

"Debugging a LabWindows/CVI DLL
You should start by opening project file (.prj). From the "Project" window, select Run » Select External Process. In the resulting dialog box you must specify the location of the "TestStand Sequence Editor" for the "Program Name" parameter. Unless you have changed it, the location of the Sequence Editor is C:\teststand\bin\seqedit.exe. Leave "Command Line Arguments" empty and click "OK". As long as a project file is loaded in the CVI project window and as long as the project is set to build a DLL, you will notice an item in the "Run" menu called "Debug SeqEdit.exe...". Selecting this item will compile the DLL and launch the TestStand Sequence Editor. You can now open the sequence file that uses this DLL as a module and when you run the sequence file, it will honor breakpoints that are set in the CVI source code. Once paused at any breakpoint, you can then use CVI's debugging tools to step through the source code."


Hope this helps
Regards
Ray Farmer
Regards
Ray Farmer
Message 2 of 11
(5,000 Views)
Ray,

I am finally trying to debug my app, and I'm running into problems. I opened my LabWindows/CVI project and changed the Build::Configuration to Debug (from Release). I then went to Run::Specify External Process and entered the C:\teststand\bin\seqedit.exe (although for me it's in a slightly different location). When I select Run::Debug seqedit.exe, the TestStand sequence editor opens. I browse to the location of my sequence. When I select OK, a second TestStand and CVI instance open. In the second TestStand, my sequence steps appear. I select F5 to Test UUTs and I receive an error saying
----------------------------
Sequence 'MainSequence' in the file 'LMBSU_TestStand.seq' could not be executed.

Error loading step 'Pass/Fail Test' of sequence 'MainSequence' in the file 'LMBSU_TestStand.seq'. Unable to connect to tscvirun.dll in the CVI project. Make sure that tscvirunn_supp.c is in your project and that the project is runnable. Error Code -17711. Source 'TSAPI'.
-----------------------------

My CVI project has tscvirun_supp.c in the project. I ran this two ways - once without rebuilding the DLL and once with. The second time, the DLL created had a different name (it had dbg in the name). Any suggestions?
0 Kudos
Message 3 of 11
(4,974 Views)
hi mrbean,

In the LabWindows/CVI Adapter do you have the Step Execution 'Execute Steps In-Process (CVI is not Required for this Mode) selected. if not select this option.

that should sort you out.

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 4 of 11
(4,966 Views)
I selected 'Execute steps in process' and then, I clicked on the box 'Configure Auto Loading of support libraries'. It then said it would have to unload all modules, and eventually came to a browser asking me to locate my app's dll. The problem, however, is that in the filename, it has my previous dll filename, and for filetype it gives the entire filename once again. It doesn't let me change the filetype (I thought I could tell it *.dll). It lets me change the filename, but when I click ok, it appends the filename and file type (big long file name) and says I can't have a file ending like that.
0 Kudos
Message 5 of 11
(4,962 Views)
Hi mrbean,

Not sure what's going on there, can you attach some jpg of the screen shot with the problem.

Dont think it should have asked you where your dll is?

regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 6 of 11
(4,957 Views)
Ray,

Here is the screen shot. It didn't let me save it as .jpg - I hop .gif is ok(I'm just having all sorts of file extension errors today). Anyway, as you see in the drop down, my selections are few (one).

Another question. When I'm not debugging, is it true that I would un-check the "Execute Steps in Process" and check the Execute steps in an external instance of CVI?
0 Kudos
Message 7 of 11
(4,956 Views)
"Unable to get Standard CVI Step Module address for DepotInitialize"


This message indicates that that function does not exist in the dll or has not been exported. Please make sure your have it spelled exactly the same with the exact same case in both the dll and in the step module dialog. Also make sure you are exporting the function from the dll. You can use the keyword __declspec(dllexport) in your function prototype after the return value and before your function name as follows in order to export it:


void __declspec(dllexport) ExampleFunction(void);


-Doug
0 Kudos
Message 8 of 11
(4,942 Views)
Several clarification questions:

When/why would I want to use __declspec vs __stdcall vs DLLSTDCALL.

Do all functions that I export for the DLL have to have this calling convention

I created a .h that contains all the functions I want to export. Is there a way to
have CVI do it so as to not miss any needed functions
0 Kudos
Message 9 of 11
(4,935 Views)
Ray,

I'm not sure what I did differently, but things are working a little better. After (In the LabWindows/CVI Adapter) I selected the Step Execution 'Execute Steps In-Process, I ran the seqedit.exe. I'm not sure, however, how to step into
my code. I set a couple of breakpoints then re-built a debug version of the DLL. I browse to the seq, I enter the UUT ID, but I never see any source code. I know when I was having problems, it was at least asking me what DLL to reference. That's when it wouldn't let me select/modify the filetype. Now it doesn't ask me what DLL to use. I'm wondering how it's supposed to recognize my breakpoints.
0 Kudos
Message 10 of 11
(4,708 Views)