12-11-2014 07:21 AM
Hi,
I want to run CANoe TestCases in LabVIEW using ActiveX.
Handling envVars and sysVars in CANoe was not a big deal and there are a lot of examples here.
But handling TestCases is quite difficult. The CANoe help file shows this way in the object hierarchy:
Application |
Configuration |
TestSetup |
TestEnvironments |
TestEnvironment |
TestModules |
TSTestModule |
But I didn't find any way to realize it. I ended up in the following:
IApplication3 |
IConfiguration4 |
ITestSetup |
ITestEnvironments |
ITestEnvironment |
ITestSetupItems |
ITestSetupItem |
|
ITestSetupItem is an object without any methods. I don't know how to access the TestCases without the linking objects in between.
Greetings,
Ludwig.
Solved! Go to Solution.
01-12-2015 02:20 AM - edited 01-12-2015 02:21 AM
I've solved the problem with the help of Vector Support. They send me the following C# Example:
CANoe.Application mApp = new CANoe.Application(); CANoe.Configuration mConf = (CANoe.Configuration)mApp.Configuration; CANoe.TestSetup mTestSetup = (CANoe.TestSetup)mConf.TestSetup; //Test SetUp Window CANoe.TestEnvironments mTestEnvs = (CANoe.TestEnvironments)mTestSetup.TestEnvironments; CANoe.TestEnvironment mTestEnv = (CANoe.TestEnvironment)mTestEnvs[1]; // Test Environment (*.tse File) Console.WriteLine("Name " + mTestEnv.Name); CANoe.TestSetupFolders mTestSetupFolders = (CANoe.TestSetupFolders)mTestEnv.Folders; CANoe.TSTestModule mTSTestmodule = (CANoe.TSTestModule)mTestEnv.TestModules[1]; Console.WriteLine("Name " + mTSTestmodule.Name); CANoe.TestSequence mTestSequence = (CANoe.TestSequence)mTSTestmodule.Sequence; Console.WriteLine("TestSequence Count " + mTestSequence.Count); CANoe.TestCase mTestCase = (CANoe.TestCase)mTestSequence[1]; Console.WriteLine("Testcase Name " + mTestCase.Name); mTestCase.Enabled = false; // deactivate testcase - XML and structured NET module only. //CANoe.TestReport mTestReport =(CANoe.TestReport) mTSTestmodule.Report; // Access To report CANoe.Measurement mMeasurement = (CANoe.Measurement)mApp.Measurement; if (!mMeasurement.Running) mMeasurement.Start(); mTSTestmodule.Start();
I've realized that you can cast ActiveX object references to another child class in the following way:
This was the correct solution and I want to share it with you.
10-04-2019 02:11 PM
Hello Ludwig72,
I know this post is very old but i'm very new to active X with LabVIEW. Can you please share me some sample code.It will be so helpful.
Thanks
10-07-2019 01:33 AM
@sunny7569650 wrote:
Hello Ludwig72,
I know this post is very old but i'm very new to active X with LabVIEW. Can you please share me some sample code.It will be so helpful.
Thanks
Here you are:
10-07-2019 02:29 AM
Thank You @Ludwig72