I am trying to create an automation script for Lexi so that our operators can use the scheduler to schedule times the Lexi encoder automatically turns on. Is it possible to create the script this way so that it requires the operators to select the channel themselves when they schedule it or would that require a C# script? I wanted to create one script instead of 20-30.
Hi David,
In this case you could use a script parameter to pass the display key of the table (in your example, the channel) to the set action. However, I noticed that (using a 'set' action) is not possible to pass the value of the script parameter to the index (the drop-down list in your image). I believe that the only option is to perform this action via C# script. The script should look like as follows:
The C# action:
Script dummyElement = engine.GetDummy("EEG Lexi");
Script spChannel = engine.GetScriptParam("channel");
dummyElement.SetParameterByPrimaryKey(3002,spChannel.Value,"1");
where:
- 3002 is the parameter ID of the parameter 'Switch State On (Instances)'
- '1' is the value that represents the value 'On'. You can visualize this in the connector definition:
Hope it helps.
Hey Miguel,
Thank you so much for your answer. This has been very helpful. I attempted to test this and it keeps failing. Also, is it possible to have a drop down of channel names instead of having to manually enter the channel index?
As this question has been inactive for a long time, we will now close it. If you want further assistance, could you post a new question?