Top Banner
Welcome 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 use to develop t programs for supported Kvaser devices. For information about writing t programs, please see the Kvaser t programming language manual, which can be found under the Help menu in Kvaser TRX or on Kvaser.com!
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

Dec 27, 2019

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
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

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

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

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

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

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

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

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

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

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

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

.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

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

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

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

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

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

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

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

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

Furtherresources

ThefollowingdocumentsareaccessiblefromtheHelpmenuinTRX:

TheKvasertLanguageManual:Thismanualcontainsdetailedinformationaboutthetprogramminglanguage.TheKvaserCANlibSDKHelp:ThishelpcontainsdetailsabouttheKvaserCANlibfunctionalityandAPI.

Forfurtherinformationandsupport,seetheKvaserwebsite:

www.kvaser.comThereyouwillfindthelatestversionsofourdriversandSDK,aswellasinformationaboutKvaserproducts,developerblogs,supportanddocumentation.

RelatedtopicsGettingstartedProgramoverviewKeyboardshort-cuts