welcome to kvaser trxwelcome to kvaser trx a light weight ide for developing t programs for kvaser...
TRANSCRIPT
Welcometo
KvaserTRXalightweightIDEfordevelopingtprogramsforKvaserdevices
ThishelpfiledescribestheKvaserTRXlightweightIDE,whichyoucanusetodeveloptprogramsforsupportedKvaserdevices.
Forinformationaboutwritingtprograms,pleaseseetheKvasertprogramminglanguagemanual,whichcanbefoundundertheHelpmenuinKvaserTRXoronKvaser.com!
GettingstartedwithtprogramdevelopmentinTRX
WhenyoustartTRXthefirsttime,youreditorwillhaveasingletablabeled<New>.Asafirstprogram,tryentering:
onstart{
printf("HelloWorld!\n");
}
ThisaverybasicprogramthatreactsonanonstarteventandprintsHelloWorld!intheDeviceOutput.Itistheactualdevicethatsendsthe"HelloWorld!"tothecomputerwhereTRXreads.
NowcompilethetprogrambygoingtoRun->Compileinthemenubar,orbypressingF9.Tobeabletocompileyoufirsthavetosavethetprogram.TRXwillpromptyouforthis,itwillalsopromptyoutosaveaprojectfile.Picksuitablenamesandsave.Notethattheprojectoverviewpaneltotherightoftheeditorisautomaticallyupdatedwhenyoucompile.
Next,connectatprogramcapableKvaserdevice.YoucanseethatTRXcanuseyourdeviceifthecomboboxjustunderthemenubarhasthenameofyourKvaserdevicelisted.
Totestthetprogram,justgotoRun->Download,thiswilldownloadthetprogramtothedevice.Nextstepwillbetoactuallyruntheprogram.Run->Runwillstartheapplication,andhopefullyyouwillseetheprintfprintoutintheDeviceOutputwindowDeviceOutputpanelbelowtheeditor.(NB:Ifyoudon'tseesuchapanelitmayhavebeenhiddenbyaccident.Ifso,thengotoWindow->ToggleLowerPaneorpressF7totoggleitsvisibility!)
Ifeverythingworked,youarenowreadytodevelopmoreadvancedtprograms!Goodluck!
RelatedtopicsThemenubarThetoolbarThetoolbarTheprojectoverviewTheoutputpanelKeyboardshort-cuts
Programoverview
InthischapteryouwillfindanoverviewoftheTRXuserinterfaceandfeatures.
Contents:
ThemenubarProgrampreferencesProjectoptions.txefileviewerEnvvarviewer
ThetoolbarThecodeeditorTheprojectoverviewTheoutputpanel
Themenubar
Themenubaratthetopoftheprogramletsyouaccessthefollowingfeatures:
File:Inadditiontobasicfileoperations(createnew,open,save,andclosetprogramfiles),theTRXPreferencesareaccessedthroughthismenu.Search:UsethismenuforFindandFindNext,orusetheshort-cutsCtrl+FandF3respectively.Project:Thismenuletsyoucreate,openandsaveprojects,aswellasinspectingthecompiled.txefile,andmanageProjectOptions.Run:Inadditiontorunningandstoppingtheprogram,thismenuisusedtoCompilethetprogram,toDownloadittothedevice,andfortellingthedevicetoGoOnlineandGoOffline.Window:UsethismenutotogglethevisiblityoftheoutputpanebelowtheeditorandoftheEnvironmentVariableswindow,orusetheshort-cutsF8andF9respectively.Help:Inadditiontothishelp,thismenugivesyoueasyaccesstotheKvasertLanguageManual,theKvaserCANlibHelp,andtotheAboutwindowwhereyouwillfindtheTRXversionnumberandalinktotheKvaserwebsite,shouldyouneedtocontactsupport.
RelatedtopicsThetoolbarProgrampreferencesProjectoptionsEnvironmentvariablesKeyboardshort-cuts
Programpreferences
Thiswindowisusedtosetthefollowingprogramprefences:
Environmentsettings-setupthepathsto:Compiler(scc.exe)DatabaseEditor(dbe.exe)KvaserCANlibSDKHelp(canlib.chm)
Fileassociations-decidewhetherthesefilesshouldbeassociatedwithTRX:
KvasertProjects(.tprj)KvasertPrograms(.t)CompiledtPrograms(.txe)
IDEsettings-decideiftheIDEshould:useautocompletionofcommandsintheeditordisplayerrormessagesfromrunningtprogramsinDeviceoutputdisplaydebugmessagesfromconnecteddeviceinDeviceoutput(requiresfirmwarewithdebuggingenabled)
RelatedtopicsGettingstartedProgramoverviewProjectoptionsEnvironmentvariables/Envvars
Keyboardshort-cuts
Projectoptions
Thiswindowisusedtosetdifferentoptionsfortheprojectcompiler.
Thefollowingoptionsareavailable:
VerboseOutput:Whenset,thecompilerwillprintmoreinformationtothebuildlog.IncludeSourceCode:Whenset,thecompilerwillincludethesourcecodeofthetprograminthecompiled.txe-file.TheincludedsourcecanthenbeinspectedfromtheView.txewindow,accessiblefromtheProjectmenu.Encryptprogram:Whenset,compilerwillencrypttheprogramusinganasymmetrickey.IfnoCustomKeyisprovided,thecompilerwillgenerateoneatcompiletime.DefaultSlot:Thislistletsyouselectwhichofthefouravailableslotstouseasdefaultwhendownloadingthetprogramtoadevice.Comment:Thistextfieldletsyouenteranoptionaldescriptionoftheproject.
RelatedtopicsGettingstartedProgramoverviewInspectingthe.txe-filePreferences
Keyboardshort-cuts
Envvarviewer
Thiswindowisusedforinspecting"environmentvariables"orEnvvars,whichinthecontextoftprogramsarespecialvariablesthataresharedbetweentheprogramsrunningonadevice.ByusingtheCANlibscriptAPI,theenvvarscanalsobeaccessedfromacomputerconnectedtoadevicerunningatprogram.
TostarttrackinganenvvarintheEnvvarviewer,addittothewatchlistbytypingitsnameintheboxatthetopandpress"AddEnvvar".Press"Refresh"toupdatethevaluesandstatesofthetrackedenvvars.Ifyoucheckthe"AutoRefresh"boxTRXwillkeepthetrackedenvvarsuptodateautomaticallyrefreshingatregularintervals.Ifyouselectanenvvarfromthelist,afieldwillappearatthebottomofthewindowwhereyoucaneditthevalueofthatenvvar,orremoveitfromthewatchlist.Formoreinformationabouthowtouseenvvars,pleaserefertotheKvasertLanguageManual,availableintheHelpmenu.
RelatedtopicsGettingstartedProgramoverviewPreferencesProjectoptionsKeyboardshort-cuts
.txefileviewer
Thiswindowisusedtoviewinformationreadfromthecompiled.txefile.UndertheDetailstabinformationsuchasFileSizeinbytes,theCompilationDate,theCompilerVersionused,andthedescriptiveCommentaddedunderProjectOptions.Iftheprojectwascompiledwithsourcecodeincluded,thecodecanbeviewedundertheSourcetab.Iftheprogramwascompiledwithencryptionenabled,theviewwillbefilledwithgiberishuntiltheuserhaspressedthebuttonlabeledDecryption...andenteredthecorrectkey.SeeProjectOptionsforfurtherdetails.
RelatedtopicsGettingstartedProgramoverviewPreferencesProjectoptionsKeyboardshort-cuts
Thetoolbar
Thetoolbarallowsquickaccesstosomeofthemostcommonlyusedfeatures:
Thesebuttonsareusedtocreateanewtprogramfile,andtosavetheorclosethetprogramfileintheactivetab.Alternativelyyoucanusetheshort-cutsCtrl+NandCtrl+Stocreateanewtprogramfileandtosavethefileintheactivetab.
ThesebuttonsareusedtoundoandredoactionsintheeditorAlternativelyyoucanusetheshort-cutsCtrl+ZandShift+Ctrl+Z.
Thislistshowstheconnecteddevicesandassociatedchannels.Useittoselectadeviceandadefaultchannelforthetprogram.PresstherescanbuttontoreinitializeCanlibandscanfornew/removeddevices.
PressthisbuttontoCompile,GoOnline,DownloadandRunthetprogramontheselectedKvaserdevicewithasingleclick.
PressagaintoStopexecution.
Thisbuttonshowstheon-/offlinestatusoftheselecteddevice,andcanbeclickedtoswitchbetweenonlineandoffline.
RelatedtopicsThemenubarKeyboardshort-cuts
Thecodeeditor
Ifyouhavemanytprogramsopenatonce,eachisgivenitsowntab.Selectwhichtprogramtoworkonbyclickingthecorrespondingtab.Forconvenience,theeditorofferssyntaxhighlightinganddisplaysrow-numbersinthelefthandmargin.Tomakenavigatinglongprogramseasier,codeblockscanbefoldedbypressingthesmall'-'inthemargin.Foldedblockinsteadhavea'+'inthemargin;pressingthisunfoldstheblock.Iftheeditorstillfeelscrampedafteryouhavefoldedawaythecodeblocksyoudon'twanttofocusonrightnow,tryhidingtheDeviceOutputbygoingtoWindow->ToggleLowerPaneorpressingF7totoggleitsvisibility!
RelatedtopicsThemenubarThetoolbarTheprojectoverviewTheoutputpanelKeyboardshort-cuts
Theprojectoverview
Theprojectoverviewpanelissituatedtotherightoftheeditor.Thispanelprovidesaschematicoverviewoftheprojectfiletree.Everytimeyoutheproject,the.tfilesareparsed,andanyincludedfilesareaddedtofiletree.
RightclickinginthepanelbringsupamenuwhichletsyouAddorRemoveDatabasesandaccesstheProjectOptions.Ifyourightclickonafileinthetree,youarealsogiventheoptiontoOpenthefileforediting.Programfiles(*.t)areopenedintheTRXeditor,whereasdatabases*.dbcareopenedintheexternalKvaserDatabaseEditor,providedthatthepathtodbe.exehasbeensetupinthePreferences.
RelatedtopicsProjectoptionsThecodeeditor
Lowerpanel
Thelowerpanelisusedtodisplaydeviceoutput,buildmessages,andforcommunicatingwitharunningtprogrambysendingkeyevents.Iftheeditorfeelscramped,tryhidingthelowerpanelbygoingtoWindow->ToggleLowerPaneorbypressingF7totoggleitsvisibility!
DeviceOutput
Thistabisusedforlisteningtotheoutputfromtherunningtprograms.Eachoutputisprintedonasingleline,andhasanassociatedNumber(#),SlotandTime.TheslotiseitherSystemorthenumberoftheslotoccupiedbythetprogramthatissuedtheprintfcommand.
Thebuttonsabovetheoutputviewhavethefollowingfunctionality:
UsethisbuttontoSubscribeandUnsubscribetoErrorMessages,executionerrorsreportedbytherunningtprogram.SubscriptioncanalsobetoggledunderPreferences.
UsethesebuttonstotoggleAutoscrollandClearDeviceOutput.WhenAutoscrollison,TRXwillalwaysscrolldowntothelatestmessage.
Thedevicescanrunuptofourprogramsconcurrently,eachinadifferentslot.Thisdrop-downmenuletsyouSelectwhichoftheactiveslotsto
listento,makingtheDeviceOutputlesscluttered.PleasenotethateachTRXsessioncanonlyrunandcontrolonetprogramatatime.Torunmorethanonetprogram,eachhastobestartedseparately,eitherfromtheirownTRXsession,fromthecommandline,orauto-startedonthedevice.
BuildLog
Thistabshowstheoutputfromthecompiler,includingthefullcompilercommand.Compiletimeerrorsarehighlightedinred.Onclickinganerrormessagetheeditorwilljumptothelineofcodewheretheproblemwasdetected.Fordetailedoutput,activateVerboseOutputintheProjectCompilerOptions.
Sendingevents
ThetprogramscanbemadetoreacttoKeyEvents.Sendbuttoncanbeusedtosendsinglecharactersenteredintheinputboxtotherunningtprogram,thatwillbeinterpretedasKeyEvents.TickingthecheckboxtotheleftoftheinputboxtellsTRXtoforwardallkeypressestothetprogram,withouttheneedforpressingSend.Thisisusefulforinteractivelycontrollingtheflowofthetprograms.
RelatedtopicsProjectCompilerOptionsThemenubarThetoolbarTheeditor
Listofkeyboardshort-cuts
Fileoperations:Ctrl+N:NewtprogramCtrl+O:OpentprogramCtrl+S:Savetprogram
Editing:Ctrl+Z:UndoeditShift+Ctrl+Z:RedoeditCtrl+X:CuttextCtrl+C:CopytextCtrl+V:PastetextCtrl+A:SelectalltextineditorCtrl+F:FindstringineditorF3:FindnextinstanceofsearchstringF9:Compileproject
Other:Ctrl+P:OpenProgramPreferencesF1:OpenthishelpF7:TogglevisibilityoflowerpaneF8:TogglevisibilityofEnvvarviewerCtrl+Q:QuitTRX
RelatedtopicsThemenubarThetoolbar
Furtherresources
ThefollowingdocumentsareaccessiblefromtheHelpmenuinTRX:
TheKvasertLanguageManual:Thismanualcontainsdetailedinformationaboutthetprogramminglanguage.TheKvaserCANlibSDKHelp:ThishelpcontainsdetailsabouttheKvaserCANlibfunctionalityandAPI.
Forfurtherinformationandsupport,seetheKvaserwebsite:
www.kvaser.comThereyouwillfindthelatestversionsofourdriversandSDK,aswellasinformationaboutKvaserproducts,developerblogs,supportanddocumentation.
RelatedtopicsGettingstartedProgramoverviewKeyboardshort-cuts