Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser...
Transcript of Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser...
![Page 1: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/1.jpg)
Welcometo
KvaserTRXalightweightIDEfordevelopingtprogramsforKvaserdevices
ThishelpfiledescribestheKvaserTRXlightweightIDE,whichyoucanusetodeveloptprogramsforsupportedKvaserdevices.
Forinformationaboutwritingtprograms,pleaseseetheKvasertprogramminglanguagemanual,whichcanbefoundundertheHelpmenuinKvaserTRXoronKvaser.com!
![Page 2: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/2.jpg)
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.
![Page 3: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/3.jpg)
Totestthetprogram,justgotoRun->Download,thiswilldownloadthetprogramtothedevice.Nextstepwillbetoactuallyruntheprogram.Run->Runwillstartheapplication,andhopefullyyouwillseetheprintfprintoutintheDeviceOutputwindowDeviceOutputpanelbelowtheeditor.(NB:Ifyoudon'tseesuchapanelitmayhavebeenhiddenbyaccident.Ifso,thengotoWindow->ToggleLowerPaneorpressF7totoggleitsvisibility!)
Ifeverythingworked,youarenowreadytodevelopmoreadvancedtprograms!Goodluck!
RelatedtopicsThemenubarThetoolbarThetoolbarTheprojectoverviewTheoutputpanelKeyboardshort-cuts
![Page 4: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/4.jpg)
Programoverview
InthischapteryouwillfindanoverviewoftheTRXuserinterfaceandfeatures.
Contents:
ThemenubarProgrampreferencesProjectoptions.txefileviewerEnvvarviewer
ThetoolbarThecodeeditorTheprojectoverviewTheoutputpanel
![Page 5: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/5.jpg)
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
![Page 6: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/6.jpg)
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
![Page 7: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/7.jpg)
Keyboardshort-cuts
![Page 8: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/8.jpg)
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
![Page 9: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/9.jpg)
Keyboardshort-cuts
![Page 10: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/10.jpg)
Envvarviewer
Thiswindowisusedforinspecting"environmentvariables"orEnvvars,whichinthecontextoftprogramsarespecialvariablesthataresharedbetweentheprogramsrunningonadevice.ByusingtheCANlibscriptAPI,theenvvarscanalsobeaccessedfromacomputerconnectedtoadevicerunningatprogram.
TostarttrackinganenvvarintheEnvvarviewer,addittothewatchlistbytypingitsnameintheboxatthetopandpress"AddEnvvar".Press"Refresh"toupdatethevaluesandstatesofthetrackedenvvars.Ifyoucheckthe"AutoRefresh"boxTRXwillkeepthetrackedenvvarsuptodateautomaticallyrefreshingatregularintervals.Ifyouselectanenvvarfromthelist,afieldwillappearatthebottomofthewindowwhereyoucaneditthevalueofthatenvvar,orremoveitfromthewatchlist.Formoreinformationabouthowtouseenvvars,pleaserefertotheKvasertLanguageManual,availableintheHelpmenu.
RelatedtopicsGettingstartedProgramoverviewPreferencesProjectoptionsKeyboardshort-cuts
![Page 11: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/11.jpg)
.txefileviewer
Thiswindowisusedtoviewinformationreadfromthecompiled.txefile.UndertheDetailstabinformationsuchasFileSizeinbytes,theCompilationDate,theCompilerVersionused,andthedescriptiveCommentaddedunderProjectOptions.Iftheprojectwascompiledwithsourcecodeincluded,thecodecanbeviewedundertheSourcetab.Iftheprogramwascompiledwithencryptionenabled,theviewwillbefilledwithgiberishuntiltheuserhaspressedthebuttonlabeledDecryption...andenteredthecorrectkey.SeeProjectOptionsforfurtherdetails.
RelatedtopicsGettingstartedProgramoverviewPreferencesProjectoptionsKeyboardshort-cuts
![Page 12: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/12.jpg)
Thetoolbar
Thetoolbarallowsquickaccesstosomeofthemostcommonlyusedfeatures:
Thesebuttonsareusedtocreateanewtprogramfile,andtosavetheorclosethetprogramfileintheactivetab.Alternativelyyoucanusetheshort-cutsCtrl+NandCtrl+Stocreateanewtprogramfileandtosavethefileintheactivetab.
ThesebuttonsareusedtoundoandredoactionsintheeditorAlternativelyyoucanusetheshort-cutsCtrl+ZandShift+Ctrl+Z.
Thislistshowstheconnecteddevicesandassociatedchannels.Useittoselectadeviceandadefaultchannelforthetprogram.PresstherescanbuttontoreinitializeCanlibandscanfornew/removeddevices.
PressthisbuttontoCompile,GoOnline,DownloadandRunthetprogramontheselectedKvaserdevicewithasingleclick.
PressagaintoStopexecution.
Thisbuttonshowstheon-/offlinestatusoftheselecteddevice,andcanbeclickedtoswitchbetweenonlineandoffline.
![Page 13: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/13.jpg)
RelatedtopicsThemenubarKeyboardshort-cuts
![Page 14: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/14.jpg)
Thecodeeditor
Ifyouhavemanytprogramsopenatonce,eachisgivenitsowntab.Selectwhichtprogramtoworkonbyclickingthecorrespondingtab.Forconvenience,theeditorofferssyntaxhighlightinganddisplaysrow-numbersinthelefthandmargin.Tomakenavigatinglongprogramseasier,codeblockscanbefoldedbypressingthesmall'-'inthemargin.Foldedblockinsteadhavea'+'inthemargin;pressingthisunfoldstheblock.Iftheeditorstillfeelscrampedafteryouhavefoldedawaythecodeblocksyoudon'twanttofocusonrightnow,tryhidingtheDeviceOutputbygoingtoWindow->ToggleLowerPaneorpressingF7totoggleitsvisibility!
RelatedtopicsThemenubarThetoolbarTheprojectoverviewTheoutputpanelKeyboardshort-cuts
![Page 15: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/15.jpg)
Theprojectoverview
Theprojectoverviewpanelissituatedtotherightoftheeditor.Thispanelprovidesaschematicoverviewoftheprojectfiletree.Everytimeyoutheproject,the.tfilesareparsed,andanyincludedfilesareaddedtofiletree.
RightclickinginthepanelbringsupamenuwhichletsyouAddorRemoveDatabasesandaccesstheProjectOptions.Ifyourightclickonafileinthetree,youarealsogiventheoptiontoOpenthefileforediting.Programfiles(*.t)areopenedintheTRXeditor,whereasdatabases*.dbcareopenedintheexternalKvaserDatabaseEditor,providedthatthepathtodbe.exehasbeensetupinthePreferences.
RelatedtopicsProjectoptionsThecodeeditor
![Page 16: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/16.jpg)
Lowerpanel
Thelowerpanelisusedtodisplaydeviceoutput,buildmessages,andforcommunicatingwitharunningtprogrambysendingkeyevents.Iftheeditorfeelscramped,tryhidingthelowerpanelbygoingtoWindow->ToggleLowerPaneorbypressingF7totoggleitsvisibility!
DeviceOutput
Thistabisusedforlisteningtotheoutputfromtherunningtprograms.Eachoutputisprintedonasingleline,andhasanassociatedNumber(#),SlotandTime.TheslotiseitherSystemorthenumberoftheslotoccupiedbythetprogramthatissuedtheprintfcommand.
Thebuttonsabovetheoutputviewhavethefollowingfunctionality:
UsethisbuttontoSubscribeandUnsubscribetoErrorMessages,executionerrorsreportedbytherunningtprogram.SubscriptioncanalsobetoggledunderPreferences.
UsethesebuttonstotoggleAutoscrollandClearDeviceOutput.WhenAutoscrollison,TRXwillalwaysscrolldowntothelatestmessage.
Thedevicescanrunuptofourprogramsconcurrently,eachinadifferentslot.Thisdrop-downmenuletsyouSelectwhichoftheactiveslotsto
![Page 17: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/17.jpg)
listento,makingtheDeviceOutputlesscluttered.PleasenotethateachTRXsessioncanonlyrunandcontrolonetprogramatatime.Torunmorethanonetprogram,eachhastobestartedseparately,eitherfromtheirownTRXsession,fromthecommandline,orauto-startedonthedevice.
BuildLog
Thistabshowstheoutputfromthecompiler,includingthefullcompilercommand.Compiletimeerrorsarehighlightedinred.Onclickinganerrormessagetheeditorwilljumptothelineofcodewheretheproblemwasdetected.Fordetailedoutput,activateVerboseOutputintheProjectCompilerOptions.
Sendingevents
ThetprogramscanbemadetoreacttoKeyEvents.Sendbuttoncanbeusedtosendsinglecharactersenteredintheinputboxtotherunningtprogram,thatwillbeinterpretedasKeyEvents.TickingthecheckboxtotheleftoftheinputboxtellsTRXtoforwardallkeypressestothetprogram,withouttheneedforpressingSend.Thisisusefulforinteractivelycontrollingtheflowofthetprograms.
![Page 18: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/18.jpg)
RelatedtopicsProjectCompilerOptionsThemenubarThetoolbarTheeditor
![Page 19: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/19.jpg)
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
![Page 20: Welcome to Kvaser TRXWelcome to Kvaser TRX a light weight IDE for developing t programs for Kvaser devices This help file describes the Kvaser TRX light weight IDE, which you can](https://reader033.fdocuments.net/reader033/viewer/2022041508/5e262ffe8788c21806765a70/html5/thumbnails/20.jpg)
Furtherresources
ThefollowingdocumentsareaccessiblefromtheHelpmenuinTRX:
TheKvasertLanguageManual:Thismanualcontainsdetailedinformationaboutthetprogramminglanguage.TheKvaserCANlibSDKHelp:ThishelpcontainsdetailsabouttheKvaserCANlibfunctionalityandAPI.
Forfurtherinformationandsupport,seetheKvaserwebsite:
www.kvaser.comThereyouwillfindthelatestversionsofourdriversandSDK,aswellasinformationaboutKvaserproducts,developerblogs,supportanddocumentation.
RelatedtopicsGettingstartedProgramoverviewKeyboardshort-cuts