CAPL Function Reference Manual
CANalyzer
CANoe
the art of engineering
CAPL Function Reference Manual
November 23, 2004
Second printing
the art of engineering
� � � �� � � �� ��� � � �� � � � �� �
Vector CANtech, Inc.
Suite 550
39500 Orchard Hill Place
Novi, MI 48375
USA
http://www.vector-cantech.com
Preface
© 2004, 2005 Vector CANtech, Inc
Novi, Michigan 48375 USA
The authors and publishers have used their best efforts in preparing this book. These
efforts include development, research, and testing of the theories, principles, and
programming sample code so as to determine their effectiveness. The authors and/or
publishers make no warranty, expressed or implied, with regard to the sample code
or to any other documentation contained in this book. The authors and/or publishers
shall not be liable in any event for incidental or consequential damages in connection
with, or arising out of, the furnishing, performance, or use of the sample code or any
of the contents of this book.
All rights reserved.
No part of this book may be reproduced, in any form or by any means, without
express permission in writing from Vector CANtech, Inc.
2
Preface
Table of Contents
CAPL Function Reference Manual ....................................................................1
Table of Contents ..............................................................................................3
Preface .................................................................................................................7
About This Book ................................................................................................7
Organization......................................................................................................7
Acknowledgments .............................................................................................7
Tell Us What You Think!....................................................................................8
Guide to the Use of This Book ..............................................................................9
The Main Entry Function ...................................................................................9
Obsolete............................................................................................................9
Syntax ...............................................................................................................9
Description ........................................................................................................9
Parameter..........................................................................................................9
Returns..............................................................................................................9
Availability .......................................................................................................10
Observation.....................................................................................................10
Recommendation ............................................................................................10
Branch Compatibility .......................................................................................10
Related Functions ...........................................................................................11
Example ..........................................................................................................11
The CAPL Functions...........................................................................................12
abs...............................................................................................................13
atol...............................................................................................................14
beep.............................................................................................................15
callAllOnEnvVar...........................................................................................16
cancelTimer .................................................................................................17
canOffline.....................................................................................................18
canOnline.....................................................................................................19
canSetChannelAcc ......................................................................................20
canSetChannelMode ...................................................................................21
canSetChannelOutput..................................................................................22
cos ...............................................................................................................23
elCount ........................................................................................................24
enableControl ..............................................................................................25
exp...............................................................................................................26
fileClose.......................................................................................................27
fileGetBinaryBlock .......................................................................................28
fileGetString .................................................................................................29
fileGetStringSZ ............................................................................................31
fileName.......................................................................................................33
filePutString .................................................................................................34
fileReadArray ...............................................................................................35
fileReadFloat................................................................................................37
FileReadInt ..................................................................................................38
3
Preface
FileReadString .............................................................................................39
fileRewind ....................................................................................................41
fileWriteBinaryBlock.....................................................................................42
fileWriteFloat................................................................................................44
fileWriteInt....................................................................................................45
fileWriteString ..............................................................................................46
getBusContext .............................................................................................47
getBusNameContext....................................................................................48
getCardType ................................................................................................49
getCardTypeEx............................................................................................50
getChipType ................................................................................................52
getDrift .........................................................................................................53
getFirstCANdbName....................................................................................54
getJitterMax .................................................................................................55
getJitterMin ..................................................................................................56
getLocalTime ...............................................................................................57
getLocalTimeString......................................................................................58
getMessageAttrInt........................................................................................59
getMessageName........................................................................................60
getNextCANdbName ...................................................................................61
getProFileArray............................................................................................62
getProFileFloat ............................................................................................64
getProFileInt ................................................................................................66
getProFileString ...........................................................................................68
getStartdelay................................................................................................70
getValue.......................................................................................................71
getValueSize................................................................................................72
halt...............................................................................................................73
inport............................................................................................................74
inportLPT .....................................................................................................75
inspect .........................................................................................................76
isExtId..........................................................................................................77
isStatisticAcquisitionRunning .......................................................................78
isStdId..........................................................................................................79
keypressed ..................................................................................................80
ltoa...............................................................................................................81
makeRGB ....................................................................................................82
mkExtId........................................................................................................83
msgBeep......................................................................................................84
openFileRead ..............................................................................................85
openFileWrite...............................................................................................86
outport..........................................................................................................87
outportLPT ...................................................................................................88
output...........................................................................................................89
putValue.......................................................................................................90
putValueToControl.......................................................................................91
4
Preface
random.........................................................................................................92
replayResume..............................................................................................93
replayStart ...................................................................................................94
replayState...................................................................................................95
replayStop....................................................................................................96
replaySuspend.............................................................................................97
resetCan ......................................................................................................98
resetCanEx ..................................................................................................99
runError......................................................................................................100
seqFileClose ..............................................................................................101
seqFileGetBlock.........................................................................................102
seqFileGetLine...........................................................................................103
seqFileGetLineSZ ......................................................................................104
seqFileLoad ...............................................................................................105
seqFileRewind ...........................................................................................106
setBtr .........................................................................................................107
setBusContext ...........................................................................................108
setCanCabsMode ......................................................................................109
setControlBackColor..................................................................................110
setControlForeColor...................................................................................111
setControlProperty.....................................................................................112
setDrift .......................................................................................................113
setFilePath.................................................................................................114
setJitter ......................................................................................................115
setLogFileName.........................................................................................116
setMsgTime ...............................................................................................117
setOcr ........................................................................................................118
setPortBits .................................................................................................119
setPostTrigger ...........................................................................................121
setPreTrigger .............................................................................................122
setStartDelay .............................................................................................123
setTimer.....................................................................................................124
setWriteDbgLevel ......................................................................................125
setWritePath ..............................................................................................126
sin ..............................................................................................................127
snprintf.......................................................................................................128
sqrt.............................................................................................................129
startLogging ...............................................................................................130
startStatisticAcquisition..............................................................................131
stop............................................................................................................132
stopLogging ...............................................................................................133
stopStatisticAcquisition ..............................................................................134
strlen..........................................................................................................135
strncat........................................................................................................136
strncmp......................................................................................................137
strncpy .......................................................................................................138
5
Preface
swapDWord ...............................................................................................139
swapInt ......................................................................................................140
swapLong ..................................................................................................141
swapWord..................................................................................................142
sysExit .......................................................................................................143
sysMinimize ...............................................................................................144
timeDiff.......................................................................................................145
timeNow.....................................................................................................146
timeNowFloat.............................................................................................147
trigger.........................................................................................................148
valOfId .......................................................................................................149
write ...........................................................................................................150
writeClear...................................................................................................151
writeCreate ................................................................................................152
writeDbgLevel ............................................................................................153
writeDestroy...............................................................................................154
writeEx.......................................................................................................155
writeLineEx ................................................................................................156
writeProFileFloat........................................................................................157
writeProFileInt............................................................................................158
writeProFileString ......................................................................................159
writeTextBkgColor .....................................................................................160
writeTextColor............................................................................................161
writeToLog .................................................................................................162
writeToLogEX ............................................................................................164
Compatibility Chart............................................................................................166
Availability Chart ...............................................................................................170
6