收藏 分销(赏)

NI-Industrial Communications for CANopen帮助说明手册.pdf

上传人:曲**** 文档编号:230061 上传时间:2023-03-20 格式:PDF 页数:151 大小:5.07MB 下载积分:19 金币
下载 相关 举报
NI-Industrial Communications for CANopen帮助说明手册.pdf_第1页
第1页 / 共151页
NI-Industrial Communications for CANopen帮助说明手册.pdf_第2页
第2页 / 共151页


点击查看更多>>
资源描述
Nl-lndustrial Communications for CANopen2023-03-01Nl-lndustrial Communications for CANopenContentsNl-lndustrial Communications for CANopen Help.4Getting Started with Nl-lndustrial Communications for CANopen.5Getting Started with CompactRIO.6Using the LabVIEW Real-Time Module.11Error Codes.13Protocol Overview.20CANopen Object Dictionary.22Device Profiles.22Process Data Object.23Service Data Object.24Synchronization.24Emergency.25Heartbeat and Node Guarding.27Network Management.28CANopen Hardware.31Overview.31Cabling.33Configuring CANopen.37Basic Programming Model.37Configuring Attributes of CANopen Objects.39Creating Batch SDOs.43Previewing and Validating Batch SDOs.45Troubleshooting CANopen Applications.45CANopen Vis.49CANopen Create.51CANopen NMT Write.62CANopen SDO Read.65CANopen SDO Write.77CANopen SDO Batch Write.89CANopen RPDO Write.90CANopen TPDO Read.91CANopen TPDO RTR Request Send.93CANopen Error Control Read.93/Nl-lndustrial Communications for CANopenCANopen SYNC Send.99CANopen SYNC Reset.100Advanced Vis.100CANopen Start.103CANopen Stop.106CANopen Close.110CANopen Baudrate Change.114CANopen Node-ID Change.116CANopen CAN Frame Read.118CANopen CAN Frame Write.120CANopen Convert to Data.121CANopen Fetch from Data.131CANopen SDO Completion Code to String.138CANopen Emergency Convert.138Specifications.141PCI-CANopen Hardware Specifications.141PXI-CANopen Hardware Specifications.143C Series Nl CANopen Hardware Specifications.145Electromagnetic Compatibility.145CE Compliance.147Online Product Certification.148Environmental Management.150 National InstrumentsNl-lndustrial Communications for CANopenJ uly 2012,373254C-01Use this help file as a reference for information about CANopen Vis and tools.This help file also includes step-by-step instructions about how to use Nl-lndustrial Communications for CANopen.4 Nl-lndustrial Communications for CANopenGetting Started with Nl-lndustria Communications for CANopenThis topic helps you get started using Nl-lndustrial Communications for CANopen.This topic includes information about using Nl-lndCom for CANopen in a LabVIEW project,using the CANopen Vis to create applications,and finding examples of Nl-IndCom for CANopen.LabVIEW ProjectYou can use Nl-lndCom for CANopen in a LabVIEW project to interact with batch service data objects(SDO),device baud rates,device node-IDs,and electronic data sheet(EDS)files.Nl-lndCom for CANopen introduces the following menus and menu items to the Project E xplorer window.CANopen Batch SDOUse this menu item to display the Batch SDO General Settings dialog box.Display this menu item by right-clicking a target in the Project E xplorer window and selecting NewCANopen Batch SDO.You can configure an existing batch SDO by right-clicking this batch SDO and selecting proper items from the shortcut menu.Batch SDO shortcut menuUse the sub-items underthis menu to configure an existing batch SDO.Display this menu by right-clicking a batch SDO.CANopen UtilitiesUse the sub-items underthis menu to display the Online Test Panel,Change Device Baud Rate,or Change Node-ID dialog box.Display this menu by right-clicking a target in the Project E xplorer window and selecting CANopen Utilities from the shortcut menu.CANopen E DS File PathsUse this menu item to display the EDS File Path dialog box.Display this menu by selecting ToolsCANopen E DS File Paths.National InstrumentsNl-lndustrial Communications for CANopenCANopen VisUse the CANopen Vis to create CANopen applications.Use the basic programming model to create CANopen applications.You can find the CANopen Vis on the following palette:Industrial CommunicationsCANopen.ExamplesNl-lndCom for CANopen includes LabVIEW examples that demonstrate a wide variety of use cases.The examples build on the basic concepts to demonstrate more in-depth use cases.To view these examples,select HelpFind E xamples in LabVIEW.When you browse examples by task,Nl-lndCom for CANopen examples are under Hardware Input and OutputNI-lndustrial Communications.Getting Started with CompactRIOWhen you use a C Series Nl-lndustrial Communications for CANopen module in a CompactRIO chassis,the Nl-lndCom for CANopen features on the LabVIEW Real-Time Module are the same as other RT targets,such as PXI.The communication between the Nl-lndCom for CANopen RT driver and the module does not exist in the default FPGA VI that ships with CompactRIO.Prior to using Nl-lndCom for CANopen features,you must use the LabVIEW FPGA Module to compile and run an FPGA VI that contains the required communication logic.Complete the following steps to use a C Series Nl-lndCom for CANopen module in a CompactRIO chassis from the out-of-box configuration.Step 1.Install the Required SoftwareInstall the required software to the host computer in the following order:1.LabVIEW2.LabVIEW Real-Time Module3.LabVIEW FPGA Module4.NI-RIO5.Nl-lndCom for CANopen6 Nl-lndustrial Communications for CANopenStep 2.Install Nl-lndCom for CANopen to the CompactRIO RT controllerUse MAX to locate your CompactRIO controller under Remote Systems in the left pane.Right-click the Software item and select Add/Remove Software to launch the installer.You can install the required components in the following two methods:NI-RIO with Nl Scan E ngine supportAfter selecting this item,the next page displays a list of add-ons.Scroll down to the bottom of the add-on list to check Nl-lndCom for CANopen.If this selection is dimmed,refer to the explanation on the right pane to resolve the problem,or use custom installation.Custom software installationCustom installation can be useful on controllers with small memory because this method enables you to avoid installation of unused components.Select the Nl-lndCom for CANopen item.The installer selects the required dependencies(e.g.NI-RIO IO Scan).Step 3.Add Modules to a LabVIEW ProjectTo compile an FPGA VI with the required communication logic,you must add Nl-IndCom for CANopen modules to a LabVIEW project.1.Add the controller to the LabVIEW project.If the controller is online,you can right-click on the project item and select NewTargets and DevicesE xisting target or device,then select the controller under Real-Time CompactRIO.If the controller is offline,you can add the controller by selecting New target or device.2.Select programming mode for the chassis.When you add the controller,a dialog box appears and asks you to select the programming mode for the chassis.Although Nl-lndCom for CANopen uses the Nl Scan Engine components,you must select LabVIE W FPGA Interface as the chassis mode.This configures the chassis to support compilation of an FPGA VI.Note If the Discover C Series Modules dialog box appears,select theDo Not Discover button and proceed to step 5.National InstrumentsNl-lndustrial Communications for CANopen3.Ignore errors for discovered Nl-lndCom for CANopen modules.LabVIEW may report an error for Nl-lndCom for CANopen modules,stating that LabVIEW FPGA is not supported.Do not change the chassis to Scan Interface mode.Ignore this error message and select Continue.4.Add the FPGA target.Right-click the chassis item under the controller,and select NewFPGA Target.5.Add the Nl-lndCom for CANopen modules.Right-click the chassis item under the controller(not FPGA),and select NewC Series ModulesE xisting target or device.Select the plus sign to discover,and then hold the key to select all Nl-lndCom for CANopen modules in the list.Select OK to add the modules to the project.You can also add Nl-lndCom for CANopen modules offline by selecting New target or device,then select C Series Module,and in the next dialog select the appropriate Module Type(e.g.Nl 9881).When you use an Nl-lndCom for CANopen module in a project,you do not need to have that module installed physically.For Nl-lndCom for CANopen,the module in a project is simply a signal to the FPGA VI that Nl-IndCom for CANopen communication is required for the slot.Step 4.Compile and run the FPGA VIIf you are new to CompactRIO,you can use an empty FPGA VI in order to quickly get started with Nl-lndCom for CANopen tools and examples.Select the FPGA target in LabVIEW project,and then select NewVL When the front panel opens,select the LabVIEW run button(arrow)to compile and run the VI.Even though the VI is empty,it will load the required Nl-lndCom for CANopen support.When compilation completes and the VI runs the first time,you can close the front-panel and proceed to the next step.If you have an existing FPGA VI in your project,you must re-compile the FPGA VI in order to incorporate Nl-lndCom for CANopen support for the configured slots.Once the FPGA VI is re-compiled,you run it using the same methods that you used previously.This is typically done using the Open FPGA VI Reference from a host VI.Tables X-l and X-2 provide a detailed list of actions that cause Nl-lndCom for CANopen to load and unload.Nl-lndCom for CANopen must be loaded in order for 8 Nl-lndustrial Communications for CANopenits hardware to be detected.Within the tables,the term CANopen-enabled FPGA VI refers to an FPGA VI compiled with a project that contains at least one Nl-lndCom for CANopen module.The term CANopen-disabled FPGA VI refers to an FPGA VI compiled with no Nl-lndCom for CANopen modules.Table X-l:Actions that cause Nl-lndCom for CANopen to loadAction CommentInvoke Open FPGA VI Reference with a CANO Nl-lndCom for CANopen loads regardless ofwhe PEN-enabled FPGA VI.ther Run the FPGA VI is checked in the configuration dialog.Run CANOPEN-enabled FPGA VI using Interactiv e Front Panel CommunicationNote Nl-lndCom for CANopen does not load when the CompactRIO system powers up.Even if you configure a CANOPEN-enabled FPGA VI to automatically load on power up,you must perform an action from Table X-l prior to using Nl-lndCom for CANopen.Table X-2:Actions that cause Nl-lndCom for CANopen to unloadActionCommentInvoke Close FPGA VI Reference with shortcu t option Close and Reset if Last Reference(default).If the reference is not the last to close,Nl-lndCo m for CANopen remains loaded.Shortcut option s Close and Close and Abort without Refer ence Counting do not unload Nl-lndCom for C ANopen.Power down CompactRIORun CANopen-disabled FPGA VI.This applies to Open FPGA VI Reference or In teractive Front Panel Communication.Invoke Reset using the Invoke Method node of the FPGA Interface.Reset of an open FPGA reference causes Nl-lndC om for CANopen to unload,and then immediate ly load again.If you are using Nl-lndCom for CA Nopen interfaces during the reset,the interfaces will be invalidated.Other methods such as Abo rt do not unload Nl-lndCom for CANopen.National InstrumentsNl-lndustrial Communications for CANopenRun a different CANopen-enabled FPGA VI from the CANopen-enabled FPGA VI currently loaded.When you change FPGA Vis,the effect is the sam e as the reset method.Nl-lndCom for CANopen unloads,and then immediately loads again.Note When using FPGA Interactive Front Panel Communication,stopping the FPGA VI does not unload Nl-lndCom for CANopen.This applies to stopping the VI normally(e.g.from front panel button),or using the LabVIEW abort button(stop sign).Step 5.Wait for Interfaces to be DetectedAfter the FPGA runs with Nl-lndCom for CANopen support,it may take a few seconds for the new FPGA features to be detected,appropriate RT drivers to load,and Nl-IndCom for CANopen modules to be detected.This delay occurs only after the action from Table X-l is performed.In this loading process,after you use the Open FPGA VI Reference function to load the CANopen module,you must wait for a few seconds to use the CANopen Create VI and any other application based on the real-time CompactRIO controller.If you start an application on the real-time CompactRIO controller immediately after using the Open FPGA VI Reference function,an error occurs and Nl-lndCom for CANopen fails to run this application.Wait for a few seconds and create the CANopen interface.Note National Instruments recommends that you add a waiting period between the Open FPGA VI Reference function and the CANopen Create VI.This waiting period helps you avoid trying to open the interface before loading the CANopen module.You can use the options to detect Nl-lndCom for CANopen hardware:MAX Devices&InterfacesYou can detect the interfaces visually by opening the Devices&Interfaces tree underthe RT controller in MAX.Once the hardware is detected,you can see CANopen hardware information.System APIIf you need to detect interfaces programmatically within a running RT VI,National Instruments provides APIs for this purpose.The Nl System Configuration API can detect any Nl hardware product,including Nl-10 Nl-lndustrial Communications for CANopenIndCom for CANopen interfaces.Nl-lndCom for CANopen also provides a System API with properties specific to Nl-lndCom for CANopen hardware.Step 6.Use Nl-lndCom for CANopenOnce the interfaces are detected,you are ready to use these interfaces.Within your RT VI,you can use the Nl-lndCom for CANopen Vis to read and write data.Using the LabVIEW Real-Time ModuleThe LabVIEW Real-Time(RT)Module combines LabVIEW graphical programming with the power of a real-time operating system,enabling you to build real-time applications.The Nl-lndustrial Communications for CANopen provides features and performance specifically designed for the LabVIEW Real-Time Module.High Priority LoopsMany real-time applications contain at least one loop that must execute at the highest priority.This high-priority loop typically contains code to read inputs,execute a control algorithm,and then write outputs.The high-priority loop executes at a fast period,such as 500|is(2 kHz).To ensure that the loop diagram executes within the period,the node must meet the following two requirements:Low costThe average execution time of the node,such as read and write Vis,must be low.Low jitterThe execution time also must be consistent from one loop iteration to another.Most of the read and write Vis,except the CANopen SDO Read VI and CANopen SDO Write VI in the CANopen Vis provide fast and consistent execution time,and these Vis avoid access to shared resources.When these Vis execute for the first loop iteration,these Vis often perform tasks such as auto-start of the session,and so on.These tasks result in high cost for the first iteration compared to any subsequent iteration.When you measure performance of the Vis,discard the first iteration from the measurement.For Vis or property nodes otherthan the read and write Vis,you must assume the nodes do not support high priority loops.The property nodes are designed for National InstrumentsNl-lndustrial Communications for CANopenconfiguration purposes.Vis that change state,such as the CANopen Start VI,require time for hardware or software configuration.However,certain properties and Vis support high-priority use.Refer to the help for the specific node you want to use for information about whetherthis node supports a high priority loop.上 Nl-lndustrial Communications for CAN
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 管理财经 > 财经会计

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服