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!