Hi there,
I am unable to initialize a QAction in a driver that I am building with an error message stating that the data is invalid. I am simply trying to log an error message with a button press as I am just figuring out how to use this functionality.
Here is the quick action in question:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;using Skyline.DataMiner.Scripting;
/// <summary>
/// DataMiner QAction Class: Test Button.
/// </summary>
public static class QAction
{
/// <summary>
/// The QAction entry point.
/// </summary>
/// <param name="protocol">Link with SLProtocol process.</param>
public static void Run(SLProtocol protocol)
{
try
{
protocol.Log("Testing button click");
}
catch (Exception ex)
{
protocol.Log("QA" + protocol.QActionID + "|" + protocol.GetTriggerParameter() + "|Run|Exception thrown:" + Environment.NewLine + ex, LogType.Error, LogLevel.NoLogging);
}
}
}
</QAction>
<QAction id="6" name="Test Button" encoding="csharp" triggers="55">
</QAction>
And here is the parameter that is triggering it:
<Param id="55">
<Name>Update Table</Name>
<Type>write</Type>
<Information>
<Subtext>Manually send out the request.</Subtext>
</Information>
<Interprete>
<RawType>other</RawType>
<Type>string</Type>
<LengthType>next param</LengthType>
</Interprete>
<Display>
<RTDisplay>true</RTDisplay>
<Positions>
<Position>
<Page>Schedule</Page>
<Column>0</Column>
<Row>0</Row>
</Position>
</Positions>
</Display>
<Measurement>
<Type width="110">button</Type>
<Discreets>
<Discreet>
<Display>Generate Table</Display>
<Value>Generate Table</Value>
</Discreet>
</Discreets>
</Measurement>
</Param>
Any help with this would be much appreciated as I am very new to this functionality.
Thank you
Hi Tyler,
Apart from one small thing here
</QAction>
<QAction id="6" name="Test Button" encoding="csharp" triggers="55">
</QAction>
which I am guessing the first line is just the ending of your previous QAction, otherwise you should have something like this
<QActions>
<QAction id="6" name="Test Button" encoding="csharp" triggers="55" >
</QAction>
</QActions>
But other than that I do not see anything wrong with your code.
Could you let us know what is the issue you are experiencing? Is it just that it does not trigger the QAction or do you see any errors in the element log file?
Hey Joao, thank you for your reply. The Qactions tag is in my code already thanfully. In terms of the error, in the protocol logs It is stating that my QActions have failed to initialize due to invalid data. I’m not sure what would be causing this.