UsingLXIDevicesinCANoeVersion1.12017-03-09ApplicationNoteAN-IND-1-016AuthorVectorInformatikGmbHRestrictionsPublicDocumentAbstractIntroductiononhowtocreateamodule-to-moduleLXIconnectionwithCAPL.TableofContents1.0Overview........................................................................................................................................21.1UseCase/Motivation..........................................................................................................22.0Module-to-modulecommunicationwithLXI..............................................................................22.1Creatinganetworknode......................................................................................................42.2IncludingtheIPaddresses...................................................................................................42.3Initiliazingasocket...............................................................................................................42.4Closingasocket...................................................................................................................42.5Receivingdatamessages....................................................................................................52.6Sendingdatamessages......................................................................................................53.0Contacts.........................................................................................................................................6UsingLXIDevicesinCANoeCopyright©2017-VectorInformatikGmbH2ContactInformation:www.vector.comor+49-711-80670-01.0OverviewCANoeprovidesthepossibilitytocontrolexternaldeviceswithanLXIinterface.TheLXIcommandscanbesentasdatapacketsinTCPmessagesusingCAPL.ThisapplicationnotedescribeshowtocommunicatewithLXIdevicesinCANoe.1.1UseCase/MotivationPowersuppliesandmeasurementdevicesoftenhaveanLXIinterfaceforremotecontrol.Tousethosedevicesinanautomatedtestsetup,itisnecessarytohaveaccesstotheLXIinterfaceinCANoe.ThecommunicationwithCANoeandanLXIdevicecanbeimplementedusingmanuallywrittenCAPLcode.Theextentandcomplexityofthecodedependsontheusecase.Typicallyafewlinesofcodearesufficientasdescribedinthisapplicationnote.2.0Module-to-modulecommunicationwithLXIThisapplicationnoteexplainshowtoestablishamodule-to-moduleconnectionbetweenaPCandanLXIpowersupply.Akindofa“devicedriver”isdefinedinCAPL.ThisCAPLnodemaybeaddedtothetestsetupandprovidesaninterfacebetweenthetestapplicationinCANoeandtheLXIdevice.SystemvariablesaretypicallyusedastheinterfacemechanisminCANoe.ToimplementanLXIcommunicationinthe“driver”node,aTCPsocketmustbecreated.ThissocketisusedtoestablishaconnectionbetweenCANoeandthedeviceandforhandlingthedataprotocols.TheCAPLcodebelowshowsasimpleconnectionbetweenCANoeandaLXIpowersupply.Theoutputvoltageofthepowersupplycanbesettoaspecificvaluewiththesystemvariable‘var_Voltage’.Theoutputitselfcanbeactivatedordeactivatedbypushingthekey‘o’.Inadditiontheidentificationofthepowersupplycanberequestedbychangingthesystemvariable‘var_ID’tothevalue1.ImportantNoteForthisexamplethepowersupplyCPX400SAfromTTiwasused.Someofthecommandsaredevice-dependentandcanbedifferentforotherpowersupplies.Pleasereadtheappropriateusermanualofthedeviceforthecorrectcommands.variables{dwordaddress_canoe;dwordaddress_power_supply;dw...