Example: air traffic controller

CAPL Scripting Quickstart - Vector Informatik

| 2015-12-03 CAPL (Communication Access Programming Language) For canalyzer and CANoeCAPL Scripting Quickstart2uImportant information before getting started3 Visual Sequencer (GUI based programming (Subset of CAPL))7 Brief Introduction to CAPL11 Notes on Panel creation and use24 Where to find additional information28 Contact Information30 Agenda3 CANalyzerversus CANoeImportant information before getting startedSimulationTestAnalysisDiagnostics CANalyzerCANoeCANoeoffers significant additional capability beyond CANalyzerto:>Stimulate the network(s) with Interaction Layer knowledge>Run automated tests and generate test reports>Implement automated diagnostic testsCANalyzeris wholly contained within CANoeEthernetMOSTFlexRayLINCAN4 CANoeand the added value of the Interaction LayerImportant information before getting starteduThe CANoeI

CANalyzer versus CANoe Important information before getting started Simulation Test Diagnostics CANalyzer Analysis CANoe CANoe offers significant additional capability beyond CANalyzer to: > Stimulate the network(s) with Interaction Layer knowledge > Run automated tests and generate test reports > Implement automated diagnostic tests

Tags:

  Canalyzer

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of CAPL Scripting Quickstart - Vector Informatik

1 | 2015-12-03 CAPL (Communication Access Programming Language) For canalyzer and CANoeCAPL Scripting Quickstart2uImportant information before getting started3 Visual Sequencer (GUI based programming (Subset of CAPL))7 Brief Introduction to CAPL11 Notes on Panel creation and use24 Where to find additional information28 Contact Information30 Agenda3 CANalyzerversus CANoeImportant information before getting startedSimulationTestAnalysisDiagnostics CANalyzerCANoeCANoeoffers significant additional capability beyond CANalyzerto:>Stimulate the network(s) with Interaction Layer knowledge>Run automated tests and generate test reports>Implement automated diagnostic testsCANalyzeris wholly contained within CANoeEthernetMOSTFlexRayLINCAN4 CANoeand the added value of the Interaction LayerImportant information before getting starteduThe CANoeInteraction Layer (in short CANoeIL).

2 >Provides a signal-oriented means of accessing the bus>Map signals to their appropriate send messages>Controls the sending of these messages as a function of the (OEM) Send ModeluTransmission of messages and signals is described based on attributes in the databaseuCANoeILmodels the transmission behavior at run-time using those attributes5 Overview of canalyzer variantsImportant information before getting startedCAPL is available in CANalyzerPRO and all versions of CANoeCANalyzeris available in three different variants: uPRO:Professional variant: full functionalityuEXP: Expert variant: supports all applications up tocomplex analysis of heterogeneous systems.

3 Does not support CAPL programsuFUN: Fundamental variant: simple applications, does notsupport CAPL, diagnostic tester and panelsDetailed information about the variants of CANalyzeris available at our website: information before getting started3uVisual Sequencer (GUI based programming (Subset of CAPL))7 Brief Introduction to CAPL11 Notes on Panel creation and use24 Where to find additional information28 Contact Information30 Agenda7 GeneralVisual Sequencer (GUI based programming (Subset of CAPL))Available in both CANalyzerPRO and EXP>Intended to allow some automation within the EXP variantThe Visual Sequencer allows you to create automated command sequenceswith the purpose of>Stimulating the network>Controlling applicationsIn order to structurethe individual steps, loops and conditional command blocks can be used, such as >if, else if, end ifEach sequence is shown in a separate window, and can be edited at any time, even while a measurement is Sequencer (GUI based programming (Subset of CAPL))uSend messages (cyclically)

4 USet signals/variablesuIf, else, else if and repeat commandsuWait commandsuStart/stop replayuWrite text or valuesto write window or fileuGraphical debuguAuto complete for names9 See the with your installationVisual Sequencer (GUI based programming (Subset of CAPL))10 Important information before getting started3 Visual Sequencer (GUI based programming (Subset of CAPL))7uBrief Introduction to CAPL11 Notes on Panel creation and use24 Where to find additional information28 Contact Information30 Agenda11 GeneralBrief Introduction to CAPLF unctional blocks based on CAPL (Communication Access Programming Language) can be created to programuNetwork node modulesuSpecial evaluation programs for individual applicationsSome CAPL characteristics.

5 UC-like programming languageuEvent based, not interrupt driven uCAPL programs are created using an integrated development environment called the CAPL BrowseruDirect access to signals, system variables and diagnostic parametersuAble to link user created DLLs12 Field of Application CANoeBrief Introduction to CAPLuCreatingandextendingsimulationsuImp lementingfunctionsforanalysisinthemeasur ementsetupSimulation SetupMeasurement Setup13 Field of Application CANalyzerBrief Introduction to CAPLuCreatingsimulationsorreactivescript suImplementingfunctionsforanalysisinthem easurementsetupSend Loop of the Measurement SetupAnalysis Branches14 CAPL BrowserBrief Introduction to CAPL15 CompilingBrief Introduction to

6 CAPLuInordertogenerateanexecutableprogra mfilefromaCAPL program,theprogrammustbecompiledwiththeC APL compiler:uErrormessagesareshowninthelowe rMessageWindow:Whenyoudouble-clicktheerr ordescription,thecursorintheTextEditorau tomaticallyjumpstothepointinthesourcecod e, a CAPL programBrief Introduction to CAPLA dditional CAPL files that contain generic code that can be reused in other programsVariables defined here are accessible throughout the CAPL programMultiple pre-defined event handlers exist for your use within CAPL. The code in this handler will only be executed when the event can create your own functions (special handler) that contain related code to be executed frequently17 Adding an Event HandlerBrief Introduction to CAPLCAPL is a procedural language in which the execution of program blocks is controlled by events.

7 These program blocks are referred to as event procedures. 18 Important Event HandlersBrief Introduction to CAPLuStartofmeasurementuMessagereceivedu SignalchangeuTimeeventuKeypresson Start{write ("Start of CANoe");}on signal sigTemp{write ("Signal Temperature");}on timer tmrCycle{write ("within cycle");}on key 'a'{write ("Key >a< pressed");}on message 0x123{write ("CAN Message 123");}19On Key ProceduresBrief Introduction to CAPLon key 'a'// React to press of a keyon key ' '// React to press of spacebaron key 0x20// React to press of spacebaron key F1// React to press of F1 keyon key ctrlF12// React to press of Ctrl-F12on key PageUp// React to press of Page Up keyon key Home// React to press of Home keyon key *// React to any key press types for CANB rief Introduction to CAPLTypeNameBitNoteIntegersSignedUnsigne dintlongint64byteworddwordqword163264816 3264 Floating pointfloatdouble6464 Per IEEEPer IEEES ingle characterchar8 Message

8 Variablefor CANmessagefor CAN messagesTime variablesfor secondsfor millisecondstimermstimerfor Timer in sfor Timer in ms21 Variables in CAPLB rief Introduction to CAPLuCAPL code:int i = 100;// Declaration and initialization of an integerchar ch = 'a';// Declaration and initialization of a characterfloat x;// Declaration of a floating point numberwrite ("Hundred as decimal number: %d", i);write ("Hundred as hexadecimal number: %x", i);write ("Pi as floating point number: %f", pi);write ("The decimal ASCII code of %c is %d", ch, ch);write ("The value of x is %f", x);uResults:22 OperatorsBrief Introduction to CAPLO peratorDescriptionExample+ -Addition, subtraction-* /Multiplication, division-++ --Increment or decrement by 1a++; // increments a by 1%Modulo division (returns integer remainder of a division)a = 4 % 3; // a is 1< <=Less than; less than or equal toreturns TRUE or FALSE> >=Greater than; greater than or equal toreturns TRUE or FALSE== !

9 =Compare for equality or inequalityreturns TRUE or FALSE&&Logic ANDreturns TRUE or FALSE||Logic ORreturns TRUE or FALSE!Logic NOTchanges TRUE to FALSE and vice versa&Bitwise AND1 & 7 // yields 1 (0001 & 0111 0001)|Bitwise OR1 | 7 // yields 7 (0001 | 0111 0111)~Bitwise complement~1 // yields 14 (0001 1110)^Bitwise exclusive OR (XOR)01^11 // ergibt 10>> <<Bit shift to right or left1 << 3 // yields8 (0001 1000)23 Important information before getting started3 Visual Sequencer (GUI based programming (Subset of CAPL))7 Brief Introduction to CAPL11uNotes on Panel creation and use24 Where to find additional information28 Contact Information30 Agenda24 Creating a PanelNotes on Panel creation and useAsignalismappedtoeachdisplayorcontrol :Drag & Drop25 Creating a System Variable for use with in a configurationNotes on Panel creation and useSignalscanbeautomaticallyorusercreate d,saved,exported,andimportedviatheConfig uration|SystemsVariablesdialog.

10 26 Important information before getting started3 Visual Sequencer (GUI based programming (Subset of CAPL))7 Brief Introduction to CAPL11 Notes on Panel creation and use24uWhere to find additional information28 Contact Information30 Agenda27 Important information before getting started3 Visual Sequencer (GUI based programming (Subset of CAPL))7 Brief Introduction to CAPL11 Notes on Panel creation and use24uWhere to find additional information28 Contact Information30 Agenda28 OnlineHelpfile:UseIndex|CAPLI ntroductionWhere to find additional information29 Important information before getting started3 Visual Sequencer (GUI based programming (Subset of CAPL))7 Brief Int


Related search queries