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
11-06-2025 04:54 AM
hello. Ludwing72,
do you know is there any method to load CANoe.RTCFG file with Labview programming?
the VECTOR device will work in standalone mode. I just want to load the .rtcfg file to device with labview.
could you please share any experiences if you know about it?
thank you.
11-07-2025 01:50 AM
Hello,
As you can see from the date of the last post, this thread is from 2019. Since then, I haven't been working with the CAN protocol anymore.
My experience back then was that NI couldn't keep up with the development of the CAN protocol. Unfortunately, there wasn't much support from NI's side on this matter.
I had to program most of the functionality myself - initially even the CAN interface itself, until NI caught up.
For this reason, it proved to be more practical to use the Vector CANoe API and control it remotely via ActiveX.
As for the current state of driver support for CAN, I'm afraid I can't say, as I'm now working on different topics.
Best regards Ludwig.