Hi, I'm running a script to connect a matrix crosspoint and my info event below is working as expected, but then the set isn't working and I get the following error..
Script Failure EXIT: "Error initialising script inputs|Set Parameter ('xxx':1000/) Failed: 0x80004005"
Script:
if (isRouting)
{
if(finalRouterChosenInputLocked)
{
engine.GenerateInformation($"SETTING {router.ElementName}, In:{currentRouterInput} to unlocked");
sb.AppendLine($"-{router.ElementName} In:{currentRouterInput}, Unlocked-{Environment.NewLine}");
router.MatrixSetInputLockMode(1000, currentRouterInput, false);
}
if(finalOutputLocked)
{
engine.GenerateInformation($"SETTING {router.ElementName}, Out:{finalOutput} to unlocked");
sb.AppendLine($"-{router.ElementName} Out:{finalOutput}, Unlocked-{Environment.NewLine}");
router.MatrixSetOutputLockMode(1000, finalOutput, false);
}
sb.AppendLine($"-SET {router.ElementName} In:{currentRouterInput}, Out:{finalOutput}-{Environment.NewLine}");
engine.GenerateInformation($"SETTING Final Router {router.ElementName} (1000, {currentRouterInput}, {finalOutput})");
router.ConnectMatrixCrosspoint(1000, currentRouterInput, finalOutput);
My info event as follows
SETTING Final Router myRouter (1000, 2, 9)
But then I get the error when it's setting to the Element.
What does '0x80004005' mean exactly? Is there anything I can do to get this working?
Thanks,
Ross
Hello Ross,
What I would suggest is to try and perform a direct set to the Output table of the corresponding matrix. That's similar to what the "ConnectMatrixCrosspoint" method does in the background.
You can use the SetParameterByPrimaryKey method for that.
Make sure to put the correct parameter ID as the first method param - that would be the column which is probably named "Connected input label/port". Setting that cell manually will also reflect in the matrix.
Your code would look something like this:
...
int columnPidConnectedInputLabelPort = 1005; // Put in your column PID here.
router.SetParameterByPrimaryKey(columnPidConnectedInputLabelPort, Convert.ToString(finalOutput), Convert.ToString(currentRouterInput));
Note: currentRouterInput can be a port or a label of the input you want to set, make sure to double check what you are setting.
Hope this helps. Let me know if you need any further help!

Hi, thanks for your answer it's very much appreciated. There's no column IDs defined for the matrix array. I'm not sure which parameter you're referring to. It's the SLC driver Pro-Bel SW-P-02 v2.1.1.3.
<Param id="1000" trending="false">
<Name>Matrix</Name>
<Description>Matrix</Description>
<Type options="dimensions=1024,1024;columntypes=1001:0-1023">array</Type>
<Information>
<Subtext><![CDATA[Contains the crosspoint information from the router.]]></Subtext>
</Information>
<!–
help on options:
the different options are separated with a ';'
– dimensions: row,column
– columntype: 2:0-20,35|3:21-34,36
where the number before the : specifies the parameter id and the numbers behind the columns (0 based)
–>
<Interprete>
<RawType>other</RawType>
<LengthType>next param</LengthType>
<Type>double</Type>
</Interprete>
<Display>
<RTDisplay>true</RTDisplay>
<Positions>
<Position>
<Page>Matrix</Page>
<Row>0</Row>
<Column>0</Column>
</Position>
</Positions>
</Display>
<Alarm>
<Monitored>true</Monitored>
</Alarm>
<Measurement>
<!– Sequence for matrix options Number Inputs/Number Outputs/COMin/COMax/CIMin/CIMax –>
<Type link="labels.xml" options="matrix=1024,1024,0,1,0,1024,pages;tab=lines:20,filter:false">matrix</Type>
<Discreets>
<Discreet>
<Display>Input 1</Display>
<Value>1</Value>
In this case there is no separate table. There's only the matrix component.