01-16-2014 03:11 AM
Hi All,
Is there a way to get the Number of test sockets when batchModel is configured by code before executing the batch?
01-16-2014 03:45 AM
The number of sockets is configured by the model options and later stored in the variable RunState.TestSocket.Count for the execution.
If no execution is running, you have to dig into the process model. There, you will find a variable with (depending in which sequence you are) a lookup-string containing "ModelData.ModelOptions.NumTestSockets".
Norbert
01-16-2014 04:06 AM
Hi Norbert,
I'm having troubles to find ContextSequence object or process model object
Can someone help me to find????
01-16-2014 09:05 AM
Please describe in more detail exactly what you are trying to do and in what part of the code.
-Doug
01-16-2014 09:11 AM
Hi Doug,
Well I'm looking for a way to get the number of sockets that had configured by the Model Option dialog box before executing the sequence.
I use BatchModel with 4 test sockets and I need to get the number of sockets if batchModel is configured programatically.
Tnx
01-17-2014 01:46 AM
01-17-2014 09:27 AM - edited 01-17-2014 09:31 AM
@NewSCRUser wrote:
Hi Doug,
Well I'm looking for a way to get the number of sockets that had configured by the Model Option dialog box before executing the sequence.
I use BatchModel with 4 test sockets and I need to get the number of sockets if batchModel is configured programatically.
Tnx
Where does the code (that you are writing) live that is doing this thing? From where is it called? What action initiates the code being called? Is it inside of an execution, an operator interface, a step code module? There are many possibilities and the answer to your question depends on the answer to these questions.
-Doug
01-20-2014 06:25 AM
Hi All,
I'm using simple interface example in c#
I understand how to find the number of sockets before execution
but where can I find "ModelData.ModelOptions.NumTestSockets". on which object ????
axApplicationMgr
axFileViewMgr
axExecutionViewMgr
01-21-2014 04:03 PM - edited 01-21-2014 04:05 PM
The number of sockets is persisted in TestStandModelModelOptions.ini. The model entry point (such as Single Pass) calls Initialize Execution Entry Point in ModelSupport.seq. The Read Model Option Defaults step in that sequence calls ReadModelOptionDefaults in ModelSupport2.dll. The source for ReadModelOptionDefaults is in ModelOptions.c.
If you breakpoint after that step, you can expand and view: Parameters>ModelData>ModelOptions>NumTestSockets.
You could also make the same dll call from another piece of code, or write a similar function that returns only the number of sockets.
05-18-2017 05:05 AM
@Norbert_B wrote:
The number of sockets is configured by the model options and later stored in the variable RunState.TestSocket.Count for the execution.
Just small remark, please - you have small mistype; variable name is RunState.TestSockets.Count, not RunState.TestSocket.Count. Small detail, but I've noticed it just from the third attempt of sequence running 😃
But anyway, kudo to your post, it was very helpfull for me now! Thanks a lot.