10-12-2008 01:28 AM - edited 10-12-2008 01:31 AM
Hi ppl,
I am using the Engine.NewExecution method in LabVIEW to execute a sequence using the sequential process model. I was succesful in this attempt.
Now when i tried to pass arguements to the Sequence through this method i couldn do it
From the help file i found that we have to pass a property object to the sequenceArgsParam in the Engine.NewExecution. I used the Engine.NewPropertyObject to create a new proprty object. My problem started here. I was not able to set the sequence parameters to the property object i created. when i created a container type property object , newExecuion method returned an error saying expected type is string eventhough the parameter for my sequence was a container. When i creatd a string type property object setValString method returned error saying unable to find parameters where the look up string was parameters.x
Please some body help me. I'm stuck up with this. can some one give me an example program which passes parameters to the sequence while executing through NewExecution method.
Solved! Go to Solution.
10-13-2008 08:37 AM
Hi,
it is not the method Engine.NewPropertyObject to pass parameters
I used sequence Method before to run sequence
try to replace the step Engine.NewExecution by this VI
the values are in an cluster array : parameter is the name of the parameter in your sequence, value is the value to pass
a2
remark 1 : there is only string in this VI, it is possible to change with integer, ....
remark 2 : if you have a container, the parameter name is "Container Name"."Parameter name"
10-14-2008 07:54 AM
The New Engine method creates a reference to the Execution, Should this reference be closed ?
Can i be closed immediately or should it be closed only after the Sequence Finishes Execution ?
12-02-2008 05:09 PM
lordsathish,
Yes you are correct, the reference should be closed. To be more specific, the reference should be closed after the sequence has finished executing. If you prematurely close the reference and something else tries access it, an error will occur.
07-17-2018 02:08 AM
Attached:
TSI Zip file contains :
My problem:
Expecting solution:
1. sample code to create a property object for sequence args which has args as a string (sequence parameters - 1 string i.e. a)
2. How to stop getting error:1 where am I going wrong.
08-01-2018 03:10 AM
How to stop getting error:1 where am I going wrong.
Shutdown the TestStand Engine in two pass as mentioned here. That will solve the issue of having property object leak and hence no dialog will be shown in the end. Also, in your code, you have 'self.Engine.UnLoadAllModules()'. The casing of 'L' is wrong and hence, that will give you error. Replace it with 'self.Engine.UnloadAllModules()'.
Note: You need to use UIMessages to do the two pass shutdown of Engine. To get the UIMessages, you might want to use win32com.client.DispatchWithEvents instead of win32com.client.Dispatch and register for UIMessageEvent from Engine.
sample code to create a property object for sequence args which has args as a string (sequence parameters - 1 string i.e. a)
As per help, you can pass the sequence arguments as 6th parameter for Engine.NewExecution method.
As you mentioned, for the case where a sequence has one parameter of type string and if the name of the variable is 'Parameter', use the following code in your file to create instance of PropertyObject in a variable named 'container' with required structure and use it in Engine.NewExecution as 6th parameter.
container = self.Engine.NewPropertyObject(0, False, "", 0)
container.NewSubProperty("Parameter", 1, False, "", 0)
container.SetValString("Parameter", 0, "Test Message")
Note: What you are doing will work properly for calling TestStand from Python. However, if you want to call Python from TestStand, check out Python Step Types.
-Shashidhar