09-19-2006 01:33 AM - edited 09-19-2006 01:33 AM
Message Edited by ramiyam on 09-19-2006 01:37 AM
09-19-2006 06:32 PM - edited 09-19-2006 06:32 PM
Message Edited by Ecleamus R on 09-19-2006 06:33 PM
09-21-2006 06:19 AM
Thanks,
but there is still problem.
Now I have the following code that builds and saves a sequence file with step:
public void CreateSquence(Engine engine)
{
SequenceFile sequenceFile = engine.NewSequenceFile(); Sequence sequence = engine.NewSequence();sequenceFile.InsertSequence(sequence);
Sequence mainSequence = sequenceFile.GetSequenceByName("MainSequence"); Step step = engine.NewStep("Sequence Adapter", "Label");step.Name =
"Bla bla bla";mainSequence.InsertStep(step, 0,
StepGroups.StepGroup_Main);sequenceFile.Save(
@"C:\newSwquence.seq");}
When I open the generated sequence its looks properly, with proper icons on each step and also if there is some "Edit" before the test execution option its runs properly.
But when i try to execute the built sequence i have the followin message:
--------------------------------------------------------------------------------------------------------------------------------
| Model enter point "Single passs" could not been executed |
| Error loading step 'blalbabla' on sequence 'MainSeques' in file 'z1.seq' |
| Attempted to load a module for a step whose module has not yet been specified. |
| Error code: -17601 |
| Source: 'TSAPI' |
--------------------------------------------------------------------------------------------------------------------------------
Please show me the way to solve the problem, I have spent a lot of time and have no solution.
Thank you,
Rami
09-21-2006 10:58 AM
Rami,
You are creating a new label step using the sequence call adapter.
Step step = engine.NewStep("Sequence Adapter", "Label");
You are getting the error because for sequence call steps you have to specify the module before executing it.
You would get the same error if you insert a sequence call step in teststand and try to execute the sequence without specifying the module.
I assume that in your example you just want to insert a Label step. Pass an empty string as the adapter name in order to use the adapter designated by the step type or, if the step ha no designated adapter, to use the default adapter.
Step step = engine.NewStep("", "Label");
For more information I would recommend you to check the TestStand Help.
Hope it helps.
Antonio Lie.
09-27-2006 12:29 AM
Thank you Antonio,
it was very helpful.
Rami.
09-22-2008 03:12 AM
Hello,
I tried that also in C#, now also in CVI. But i can't get the "InsertStep" command to work. I do it in the same way as described here. It returns always an error -17337: Step type 'Label' not found in type list. I tried to leave the adapterKeyNameVal empty and the "None Adapter". Any ideas? Maybe i forgot something to include?
09-24-2008 02:01 PM
Hi Thomas,
Attached is a code snippet to do what you desire. Perhaps there was a minor typo.
Attempt to run this piece of code, and let us know if you continue to have the same problem.
Note for a listing of Adapter Names and Step Types, please reference to the AdapterKeyNames and StepTypes, respectively, in the TestStand Help.
CAObjHandle TSEngine;
CAObjHandle SequenceFile;
CAObjHandle MainSequence;
CAObjHandle Step;
TS_NewEngine ("", &TSEngine);
TS_EngineNewSeqFile (TSEngine, NULL, &SequenceFile);
TS_SeqFileGetSequenceByName (SequenceFile, NULL, "MainSequence", &MainSequence);
TS_EngineNewStep (TSEngine, NULL, "None Adapter", "Action", &Step);
TS_StepSetName(Step,NULL,"Bla bla bla" ) ;
TS_SequenceInsertStep(MainSequence,NULL,Step,0,TS_StepGroup_Main) ;
TS_SeqFileSave(SequenceFile,NULL,"C:\\newSequence.seq" );
//Release
TS_EngineReleaseSeqFileEx (TSEngine, NULL, SequenceFile, 0, NULL);
09-25-2008 06:57 AM
Hi Ramiyam,
thanks for your help. But that was the way i tried already and it doesn't work. Please see the screenshot. The TS_EngineNewStep() function returns an error "Step type 'Action' not found.
Regards,
Thomas
09-25-2008 08:39 AM - edited 09-25-2008 08:39 AM
You need to load the type palette files first before the Label step will come into memory.
Use the Engine.LoadTypePaletteFilesEx method to do this.
Allen P.
NI
09-25-2008 08:55 AM
Hi Allen,
yeah, now it works. Thanks a lot!
Regards,
Thomas