04-03-2013 12:54 PM
Hey,
I'm trying to create a c# program that will create a sequence, insert sequences into that sequence, and then insert steps into those sequences. So far, I've created the sequence like this:
String seqname = "Name001.seq";
String defaultPath = "C:\\Users\\Public\\Desktop\\";
Engine myEng = new Engine();
//Create a new sequence file
SequenceFile mySeqFile = myEng.NewSequenceFile();
mySeqFile.Path = defaultPath + seqname;
mySeqFile.AsPropertyObjectFile().WriteFile(WriteFileFormat.WriteFileFormat_Current);
This creates a sequence file on my desktop that is named "Name001.seq". What I want to do is to insert a sequence to this file. What I tried to do is this:
Sequence myseq = myEng.NewSequence();
myseq.Name = "My Sequence";
mySeqFile.InsertSequenceEx(1,myseq);
However, when I open up "Name001.seq" it shows a MainSequence sequence that is empty, and nothing else. Does anyone know what I'm doing wrong?
- Mike
04-04-2013 12:39 AM
Hi Mike,
just visit this thread
http://forums.ni.com/t5/NI-TestStand/Insert-SubSequence-Call-Step-using-TS-API/m-p/628857#M17591
To insert your sequence into the MainSequence you have to create a SequenceCall step and insert it.
// Create
stepSeqCall = engine.NewStep(AdapterKeyNames.SequenceAdapterKeyName, "SequenceCall");
// Paramenter stuff
--> See link
// insert
seqMain.InsertStep(stepSeqCall, nSeq,StepGroups.StepGroup_Main);
Regards
Juergen
04-04-2013 09:46 AM
Thanks for the help! My issue was that I wasn't saving the file, so the sequence that I inserted wasn't being saved. I've been able to add sequences and steps to my file, but the issue I'm running into now is populating the parameters of those steps. From the examples I've seen, normally you'd modify the parameter of a specific step using a SetValString command such as:
Step.AsPropertyObject.SetValString( lookupString, options, newValue)
However, I'm working with several custom steps that I didn't create myself, and the properties haven't been adjusted based on the parameters they added. Is there any way of adjusting the parameter values of these steps?
- Mike
04-11-2013 01:10 AM
Hi Mike,
that depends on the custom step type, normally step type stuff is stored in the step object.
Have you ever clicked in editors Variables pane on Step when your step type is selected ?
there you shoud see the your parameters. Maybe there where hidden, Configure->StationOptions->Preferences->ShowHiddenProperties
makes them visible.
Hope that helps
Juergen