Valid for: CANoe DE • CANoe:lite DECAPL offers two different notations for calling the functions of the VT System. On the one hand they can be called as methods on the namespaces of the modules and channels. On the other hand it is also possible to call them as global functions. In this case the namespace of the module resp. channel is passed as a string argument. Both notations will be illustrated with two simple examples in the following.
This is the notation recommended in most cases. Its advantage is that the CAPL compiler can verify the namespace of the module resp. channel already at compile time.ExampleIn this example one channel of a VT1004 module is configured for PWM measurement.
For every method of the VT System there is a function with the same name. To allow differentiating these two each function starts with the prefix vts. The main difference to the methods is that the functions take the name of their target namespace as a string argument. Because of that the function notation is well suited for creating generic test functions.ExampleIn this example the code for PWM initialization is implemented in a generic way so that it can be reused for different channels.