NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

SequenceFileLoad causing System Level Exception

Hi,
 
I created a process model with a SequenceFileLoad Callback. I use this process model to run a sequence file (created by customer). The sequence file can be executed and can run correctly. The problem is that I cannot open or run any Windows application (e.g. My Computer) while executing the main sequence. Otherwise a System level exception error will occur and terminate my execution. I tried to empty the SequenceFileLoad (without any step) but this problem still occured. However, If I remove the SequenceFileLoad callback, everything is OK. I need this callback to Load the sequence file dynamically before going to the Entry Point.
 
FYI I'm not having this problem if I'm using NI SequentialModel. But once I add in an empty SequenceFileLoad callback to the NI SequentialModel, this problem occured. 
 
I tested my process model with other sequence file and I don't experience this problem. The sequence file that cause this error is calling a lot of C# DLL. There is also a lot of threading done inside the DLL.
 
1. I like to know if there is any issue with multi threading or C# that can cause this error.
2. Is there any other way to load sequence file (I'm using PostUiMsg(OpenWindow)) to load the sequence file.
3. Is there any callback that will be executed before the EntryPoint. I'm using the SequenceFileLoad since it will be executed prior to EntryPoint. Or this there any other way to do this?
 
Thanks   
 
 
 
     

Message Edited by Support on 06-20-2007 05:16 PM

0 Kudos
Message 1 of 19
(6,066 Views)
Hi caviars,

There shouldn't be any issues with multithreading that display the type of behavior you are seeing. As far as other ways of doing this would be to use either the SequenceFilePreStep or ProcessModelPreStep but both will involve a lot of overhead in doing so. You could also try running this in the CVI or LabVIEW OIs to see what effect that has on the behavior.

I also really want to see this behavior you're seeing so if its possible could you post the sequence file and supporting modules? Also what version is this occurring in?
Test Engineer - CTA
0 Kudos
Message 2 of 19
(6,016 Views)
Thanks for the response. First of all there is some misinformation in my previous post. The DLLs are written in Visual C.NET and not C#. It also has some DLLs dependency (one DLL is calling another DLL). But I don't think this is the problem since I have experience working with DLLs
 
I believe that the threading issue is causing this error since there are at least 3 threads running at one time inside the MainSequence. If I open any Windows application the system level exception error will occcur 
 
I tried a different approach on how to autoload my sequence file. Now I using mApplicationMgr->OpenSequenceFile( Path ) inside simple MFC OI (under OnInitDialog  window) to load my sequence file. The problem still occured even while I'm using a Default SequentialModel (without any modification). If I erase this mApplicationMgr->OpenSequenceFile( Path ) the problem will not occur. Does this means I cannot specify my sequence file automatically and need to did it manually?.
 
I'm really sorry that I cannot post the sequence file since it was written by customer. Moreover the sequence require some hardware in order to run properly.
 
FYI I'm using Pentium 4 HT(multithread disabled), Windows XP and TestStand 3.5  
 
 
0 Kudos
Message 3 of 19
(6,001 Views)
I need a little bit of clarification on the behavior after reading your last post. When you programmatically load the sequence into the OI using the mApplicationMgr->OpenSequenceFile( Path ), run the sequence and then during execution of the sequence you launch any other app you get the System Level Exception, right?

However if you manually load the sequence into the OI, run it and during execution you launch any other app it does not throw the exception. And by Visual C .NET I'm assuming you mean Visual C++ .NET (managed C++) as the former does not exist.

Could you also post a screenshot of the error as well to see if it is the TestStand environment that is throwing the error or if the OS itself throws the exception? Thanks!
Test Engineer - CTA
0 Kudos
Message 4 of 19
(5,992 Views)
[I need a little bit of clarification on the behavior after reading your last post. When you programmatically load the sequence into the OI using the mApplicationMgr->OpenSequenceFile( Path ), run the sequence and then during execution of the sequence you launch any other app you get the System Level Exception, right?]
Yes. If I use select it manually from the OI (e.g. using the open sequence button) this error will not occurs. This is only true if I dont have and sequence file load in my Process Model 
 
The DLLs was written in Visual C++.NET 2003 (also called Visual C++ 7.1).
 
As for the attchment please refer to the attchment for error message screenshot. If I choose run cleanup it will display error pop-up and go to the next UUT
 
I also find out that if I load the sequence file programmatically it will load the sequence file but there are some DLL dependency issue (some DLL cannot be found if it is called by another DLL). I solved this by changing some setting in Windows environment variables [Path]. I add in the path for folder where all the DLL is located.
 
Another question is that if I load the sequence file programmatically my relative path (.\) will refer to where the OI.exe program is located(i.e C:\OISimple). But if I manually load the sequence File from the OI my relative path will refer to where the sequence file is located (i.e C:\\TestSequece). Is this correct? If so is there any way to load the sequence file programatically and change my relative path to where the sequence file is located. I want to make the OI  and sequence file in a different folder to make it easy to manage the any changes in the sequence file released by customer   
  
0 Kudos
Message 5 of 19
(5,984 Views)
A couple other questions I had for you was about the location of the mApplicationMgr->OpenSequenceFile( Path ) call in the MFC OI. Are you placing the call directly before the call to mApplicationMgr->Start()? If not that might be the source of the error.

Also, if you don't launch another application during the execution of the sequence does it hang at any point or does it finish successfully?

Some other steps you could try would be try the C# OI and see if the equivalent call to programmatically open the sequence file gives the same behavior as the MFC OI.

The search paths should be configured by default to look for dependencies in the same path as the location of the sequence file. I'm not aware of programmatically loading the sequence file affecting the default search paths for other files.

Message Edited by Jon M on 06-22-2007 01:38 PM

Test Engineer - CTA
0 Kudos
Message 6 of 19
(5,965 Views)
Hi
 
I add the mApplicationMgr->OpenSequeceFile(Path) after mApplicationMgr->start. If i placed it before mApplicationMgr->start an error "Application is not running" will appear. Is there any way to avoid this?
 
I tried all the NI OI with the NI SequentialModel (+SequenceFileLoad) but the error still occured.
 
As for the relative path issue please refer to the attachment.
 
1. After extracting place the GetDir folder into the C: drive. The path will be C:\GetDir
2. Run the GetDirSequence.seq using OI or editor. The pop up will indicate the C:\GetDir. This is the relative path of the sequence file
3. Copy the OI Provied to desktop. Execute it and run the sequence file (GetDirSequence.seq) without opening the sequence file manually. The pop up path will be C:\Documents and Settings\User\Desktop.
4. Somehow the path change depending on where the OI is placed. Is this normal. Is there any way to change this back to C:\GetDir
 
The OI is simple MFC OI. I just add the mApplicationMgr->OpenSequeceFile(Path) after ->Start. Please let me know if you need the source code.
 
Thanks    
0 Kudos
Message 7 of 19
(5,924 Views)
I replicated the behavior with your example. Could you post the source as well?

As far as your first issue if you delete the step that the error is occuring out of the sequence and then try to dynamically load it does the error still occur? (You might want to use a copy of the original sequence file.)

I was wrong before when I mentioned placing the mApplicationMgr->OpenSequeceFile(Path) before the Start, it should be after. The odd part is that whether you manually load or dynamically load the modules are loaded into memory each time, so the manual vs dynamic shouldn't be the source of the error. With that said, this is obviously strange behavior you're experiencing. I'm curious to see if deleting the actual steps out of the sequence file affects the behavior.
Test Engineer - CTA
0 Kudos
Message 8 of 19
(5,906 Views)
Hi
 
Thank you  for looking the example I send.  I managed to solve the relative path issue. I do know that I changes depending on where the OI is located. So I just change the path back using SetCurrentDirectory  function inside the Kernel32.dll. By doing this I can change the path back to where the sequence file is located.  
 
As for the error it only occcured in certains steps. Unfortunately I cannot skip or delete them since each step is dependent to each other. Deleting or skipping a step may cause error to the next step or to the whole sequence. The step which failed is multiple numeric limit step calling a function from C++ DLL. This DLL function will called another DLL(s). The called DLL(s) will read data from another file(s) to get information. While this step execute, a rich text window (MFC dialog window) will display the updated readfile progress using a thread (AfxBeginThread). This is the rough idea based on limited information provided by the customer. I believe such dependency / thread may cause this error. It is confusing and complicated process. So in the end my process looks like this
 
OI --> Sequence FiIe --> VC++ DLL ---> VC++DLL ---> ExternalDataFiles
 
And at the same time there is a thread to display the step progress.
  
0 Kudos
Message 9 of 19
(5,897 Views)

Hi Again,

I managed to load the program dynamically and avoid the error. I use the Execution.SetClient(SeqFile) and placed it inside the Test UUT entry point. This is quite similar to TestStand Example "DynamicClientSequenceFile". By doing this I also changed the TestUUT entry point Model Property to allow it to be executed even without sequence file. 

The problem now is that my ProcessModelPostStep callback (inside the Process Model) is not being executed anymore. I'm using the ProcessModelPostStep to update my MainSequence progress bar. Is there any way to make my ProcessModelPostStep to run again? Or is there another way to update the progress bar?

 

0 Kudos
Message 10 of 19
(5,878 Views)