public static void WriteVariable(string variableName, double value)
    {
        // Store the paramters to be used in the asynchronous task
        sVariableName  = variableName;
        sVariableValue = new FloatValue(value);

        // Execute the task asynchronously so that CANoe is not blocked
        Execution.WaitForTask(WriteVariableTask);
    }
    public static int ReadVariableTask(TaskCancelToken tct)
    {
        // Read the variable's value
        try
        {
            sVariableValue = sMAPort.Read(sVariableName);
        }
        catch (Exception ex)
        {
            Output.WriteLine("XIL API read failed: " + ex.Message);
        }

        return(1);
    }
Exemple #3
0
 public void Write(string variableName, IBaseValue value)
 {
     if (variableName == VarNameAmplitude)
     {
         mAmplitude = (value as IFloatValue).Value;
     }
     else if (variableName == VarNameFrequency)
     {
         mFrequency = (value as IFloatValue).Value;
     }
     else if (variableName == VarNameTest)
     {
         mTestValue = (value as IFloatValue).Value;
     }
 }