CANOpen Communication NI cRIO 9022 (9853 CAN module) - MAXON EPOS2

I'm implementing a velocity control loop on two Maxon EPOS2 70/10 control units,  interfacing them with a NI cRIO 9022 (CAN module 9853). To this aim, I'm using the libraries from NI and they work quite well: for each EPOS2 I can read current, position and velocity using 2 PDO messages and set a desired velocity using 1 PDO message, all in a single timed loop on Labview Real-Time. My VI is based on a NI example included in the mentioned library. Even though the sampling time of the loop is set to 10 ms (as in the example file), I verified that all the operations were executed in about 30 ms.
My target is 1 ms sample time and I'd like to know if there is any chance to get this; are there some limitations in the software/communication protocol I'm using or is it possible to achieve 1 kHz control frequency? Based on the documentation, the EPOS2 CANopen driver is split as follows:
1.      Hardware Layer: VIs which interact with the CAN hardware (FPGA Interface folder).
2.      CAN Layer: VIs which construct/deconstruct CAN packets and handle communication between the Hardware Layer and the top level application (CAN folder).
3.      CANOpen Layer: Low level VIs which simplify the generation of the SDOs and PDOs used to communicate over the CAN bus (CANopen folder).
4.      EPOS2 Driver Layer: High level wrappers over the CANOpen Layer simplifying the control of EPOS2 drives (main folder).
It seems that the Layer that construct/deconstruct CAN packets is impelemented on the RT level. Is it correct? Do I need to move it to the FPGA level to improve performances?
I look forward to hearing any suggestions from you.
Best,
Nevio

Hi Nevio, 
I am trying to simply read encoder values from my EPOS2 24/2 control units into Lavbiew. I have been through all the documentation however I am unable to establish communication between the EPOS2 and labview.
I am connecting the two using a USB connection. I can connect to and control the motors in EPOS Studio, but nothing in labview.
I am very new to Labview so I am probably not putting the correct blocks down for initialization.
Could you please help me by suggesting some good examples to look at or linking me to labview sample of initializing communication with the EPOS2 units. 
Any help is greatly appreciated
Regards,
Kris

Similar Messages

  • CANOpen Communication NI cRIO 9022 (9853 CAN module) and MAXON EPOS2

    Hi all
    I am trying to implement a velocity control loop on my Maxon EPOS2 motor controller, by using PDOs sent through my real-time controller (NI cRIO 9022) with a CAN module (9853).
    I configured the PDO mapping in the object dictionary of the EPOS2, so that each new RxPDO1 contains the new desired velocity setting value, and I am trying to use the simple example contained in the National Instrument example directory criocanopenbaisc (freely downloadable here http://zone.ni.com/devzone/cda/epd/p/id/5474).
    I can change manually in the object dictionary the value of desired velocity by using the EPOS studio tool by connecting via USB the EPOS2 to my computer, but when I connect the EPOS2 to the CAN0 port of cRIO the newly sent values does not make effect.
    At the first try the .vi file hung on the Read PDO command, which is right after the Write PDO command. I suppose it means that no real PDO is sent over the CAN bus. However, I excluded the "Read PDO" from the diagram, now the file executes and terminates but no command is sent to the EPOS. I can verify through an oscilloscope that many similar digital waveforms are sent, just like if no ACK signal was received.
    Looking forward to receiving any hint
    Fabrizio 

    Some updates on the developments, since no one yet replied...
    At the current time the PDO sent is structured in the following way:
    COB-ID (4 bytes containing the U32 representation of the COB-ID for RxPDO1: 531)
    Updated value (4 bytes containing the representation of the desired velocity value, U32).
    0 in U32
    0 in U32.
    The last two U32 are sent so to be coherent with the example of the NI library nicanopenbasic.
    At the moment only one signal is sent (no more repetitive signals representing fault communication), but the values are not updated in the EPOS2...
    Cheers 

  • CANOpen Communicat​ion NI cRIO 9022 (9853 CAN module) and MAXON EPOS2

    Hi all
    I am trying to implement a velocity control loop on my Maxon EPOS2 motor controller, by using PDOs sent through my real-time controller (NI cRIO 9022) with a CAN module (9853).
    I configured the PDO mapping in the object dictionary of the EPOS2, so that each new RxPDO1 contains the new desired velocity setting value, and I am trying to use the simple example contained in the National Instrument example directory criocanopenbaisc (freely downloadable here http://zone.ni.com/devzone/cda/epd/p/id/5474).
    I can change manually in the object dictionary the value of desired velocity by using the EPOS studio tool by connecting via USB the EPOS2 to my computer, but when I connect the EPOS2 to the CAN0 port of cRIO the newly sent values does not make effect.
    At the first try the .vi file hung on the Read PDO command, which is right after the Write PDO command. I suppose it means that no real PDO is sent over the CAN bus. However, I excluded the "Read PDO" from the diagram, now the file executes and terminates but no command is sent to the EPOS. I can verify through an oscilloscope that many similar digital waveforms are sent, just like if no ACK signal was received.
    After various tentatives, I sent PDOs structured in the following way:
    COB-ID (4 bytes containing the U32 representation of the COB-ID for RxPDO1: 531)
    Updated value (4 bytes containing the representation of the desired velocity value, U32).
    0 in U32
    0 in U32.
    The last two U32 are sent so to be coherent with the example of the NI library nicanopenbasic.
    At the moment only one signal is sent (no more repetitive signals representing fault communication), but the values are not updated in the EPOS2... 
     Cheers  
    Solved!
    Go to Solution.

    Duplicated post

  • My cRIO (9022 , chassis 9113, module NI 9225)

    Hello, I hope you are doing great
    I create a new project that detects my cRIO (9022 , chassis 9113, module NI 9225) and I copied cRIO both the FPGA VI and Host of the original project NI but problem persists: there appeared another error message at the Host.VI (see attached file).
    I did not get to solve this problem can you help me to find a solution as soon as possible
    thank you for advance for your help
    Attachments:
    erreur1.jpg ‏276 KB
    erreur2.jpg ‏214 KB

    Hi basmasag,
    It looks like you need to specify a top level VI of the Build Specification you're trying to build. You'll need to select the Source Files Category on the left in the build specification properties menu. Then highlight your top level VI (in the example its called NI 9225 Getting Started (FPGA).vi) and select the blue arrow to set it to be the Top-Level VI. I've included and image to better illustrate what I mean. 
    I think the FIFO error your seeing may be due to the Type of FIFO you've configured the Data FIFO to be in your project. In the example it was Tartget to Host - DMA. Make sure that's set correctly by double clicking on the Data FIFO, and setting the type. The second picture I attached should better demonstrate what I mean. 
    It seems like you may be new to LabVIEW FPGA, I think you'll find a lot of useful information here: http://zone.ni.com/reference/en-XX/help/371599G-01/lvfpgahelp/fpga_getting_started/
    Applications Engineer
    National Instruments
    CLD Certified
    Attachments:
    Top-Level.png ‏59 KB
    fifo.png ‏48 KB

  • CRIO-9014 and 9853 CAN Module

    Hello folks,
    When trying to deploy a CAN Receive example from LabVIEW 8.6 onto the 9014 (VxWorks) controller, I keep getting a "shared libarary failed to load" error (nican.*).  Some investigating (i.e. searching and reading on ni.com) revealed that perhaps nican cannot be used with the 9853 and the 9014 combo.
    I still have many questions, that perhaps some of you can answer, please. 
    1. Is the following statement true? 
    The nican "driver" vis cannot be used for a 9853 card in a cRIO-9014 chassis.  Instead, it's necessary to use the 985x drivers.
    2. Do the 985x drivers have to be installed on the 9014?  If so, can it be done using MAX?
    3. Is there an FTP client running continously on the 9014?
    4. Is there a document explaining how/where to FTP software to on the 9014 controller if needed?
    5. Since the 9853 can only be used in fpga programming mode (i.e. scan interface mode is invalid), do I have to have an FPGA host vi running on the 9014 or can I leave the host on an "external" computer?
    This is my first attempt at using a cRIO for anything so please feel free to assume that I don't know anything that isn't explicitly stated in the "getting started with LabVIEW..." document.
    Thanks in advance.
    Chris

    chassan,
    1 - Yes, that's true, as confirmed here.
    2 - Yes, they must be present on the 9014. I believe you should add them via MAX as there are no special instructions in the readme of the drivers.
    3 - Here are a couple articles on ftp and cRIO:
    FTP Transfer of Files between Host and Real-Time Targets in MAX How Can I Use LabVIEW to FTP Files to and from My Real-Time Target
    4 - Same as above
    5 - I am not exactly clear on the quesiton.
    Hope this helps, post again if you have other inquiries!
    Peter Flores
    Applications Engineer

  • How can I set the timebase in the FPGA API for the NI 9853 CAN module?

    Hallo,
    is there anybody familiar with cRIO, especially the NI CAN 9853 Modul?
    When starting communication with a CAN Bus  you can get a receiving CAN Frames from the FPGA I/O Node with a timestamp.
    How can  I set  this  timebase in the CAN Controller, because the CAN communication starts every time with the same timebase.
    Compared to the CAN API  on a PC the timebase for the communication is set when the Open Frame API VI is used?
    From that time the CAN Contoller assume the timebase from the PC.
    Whats about the FPGA API?
    Martin

    Hallo Dirk,
    thanks you
    for your answerer regarding my question.
    The last
    question belongs to my intention, to get absolute Timestamps from the NI 9853
    CAN interface. As you said it always starts from zero when starting the
    application.
    For my application
    I would like to get a timestamp with the local time I start the CAN communication
    and every CAN Frame should be logged with the Timestamp it is actually send on
    the CAN BUS.
    How can I achieve
    it?
    My first
    thoughts were to add up the timestamp for every CAN Frame counted from zero to
    an absolute Timestamp when starting communication. But I have got some wrong values.
    Maybe I did something wrong using the high and low part of the Timestamps I got
    from the CAN API.
    Do you have
    a suggestion for me?
    MartinW      

  • NI 9853 C Series CAN module Synchronization

    OK, this is goning to be long to explain...First  of all Im using a CompactRIO 9004 system with 9104 Chassis and the NI9853 high speed CAN module. Ive been able to perform a loopback test between CAN0 and CAN1 ports of the 9853 module (with standard and extendend IDs). I also have a fully functional CAN network consisting of Microchip hardware, specifically two dsPIC30F4011's with the MCP2551 CAN transceiver and one 18f4553 with an MCP2515 CAN controller and a MCP2515 CAN transceiver, this network also works well within itself (I send messages through the CAN network and the PICs are able to control some servos). Im trying to interface the cRIO and NI9853 with this CAN network, but neither the NI9853 module will successfully transmit or recieve from any of the PICs. Funny thing is that I connect everything to the same physical bus (twisted pair cable with 120ohm terminators) and Im still able to transmit from CAN0 to CAN1 of the NI9853, and also the PICs are able to transmit/recieve within themselves. I think it all has to do with sync issues, the thing is; Ive gone as far as programatically writing the BTR0 and BTR1 registers of the NI9853 module (which has a Phillips SJA1000 CAN controller) to match those used by the Microchip hardware, and still no communication. Im trying to transmit at 1Mbit/s, using 20Mhz clocks on my external CAN network, for this Im using 10 time quantas to represent the nominal bit time, from what I understand from both CAN controller datasheets (MCP2515 and SJA1000) the definition of the segments and the sampling point for the bits is what is of importance (as well as the scaler value), Ive matched both to identical values by manipulating the BTR0 and BTR1 registers of the SJA1000 (NI's 9853) CAN controller. From what I know the FPGA on the cRIO runs at 40Mhz, with this a 20MHz clock for the NI9853 is possible. Here is the thing, when selecting the properties for the 9853 module and selecting a preset from the "Baud Rate" drop-list for any CAN port, if the "Advanced" button is pressed the "Specifiy Baud Rate as Bit Timing Registers" value changes accordingly to the preset value specified in the drop-list, that is, if I select 1000 kbits/s, BTR1 gets the value 0x14 and BTR0 gets 0x00; if I select 500 kbits/s BTR1 gets 0x1C and BTR0 gets 0x00. Also on the same properties window for the 9853, there is a "Module" tab, with a drop-list labeled "Module Clock" the values I can select here are 20Mhz and 10MHz. Turns out that the value of the baud rate as specified in the advanced tab by the bit registers is not affected if I select 10Mhz or 20Mhz; also in order to have a 1000 kbit/s speed with a 0x14 value on BTR1 a 16MHz clock speed should be used (according to the definitions of the SJA1000's datasheet for BTR1 and BTR0). The following images show what Im talking about:      
    Also all documentation I could find regarding nonstandard baud rates on the NI site apparently refers to the CAN controller NI hardware series 1 used (Intels 82527, which actually runs at 16Mhz) from what Ive been able to research this chip has identical Bit timing registers to the ones of the SJA1000 controller, proof of this is the document labeled "How to Configure CAN Ports for Custom Baud Rates" (http://zone.ni.com/devzone/cda/tut/p/id/4304), which shows a map of the registers of Intels chip, and is identical to the one found on the SJA1000s datasheet. On other document titled "How Can I Set Nonstandard Baud Rates in NI-CAN?" (http://digital.ni.com/public.nsf/allkb/CBA1FC627FFA0F8F862564DC0071B3A7?OpenDocument), the same information appears regarding the way the NI-CAN driver handles baud rates (again using Intels chip, which by the way is incorrectly specified to be running at 8Mhz). Using 20Mhz and the BTR1+BTR0 combination 0x1400, the SJA1000 yields 1.25Mbits/s, not even a possible speed on the CAN bus. Bottom line is, I think I cant interface my CAN network with the NI 9853, because of this strange issue. Im just wondering if anybody has any idea how to do this, or at least what is the speed the 9853 module runs on, with this I think I could at least try and find a value to match the 1Mbit on my network. Finally Ive attached the project Im running on the fpga target (Ive set the Module Clock on 20Mhz, disabled auto-start for both CAN ports and specified to run the Baud rate from the time registers using BTR1: 0x34 and BTR0: 0x00 values for the timing registers).   Any help will be appreciated, thanks in advance...
    Attachments:
    CAN Test.zip ‏194 KB

    One final thing, this is the only thing regarding external sync that Ive found so far....its the "NI CAN Product Compatibility and Feature Table" (http://zone.ni.com/devzone/cda/tut/p/id/5859#_ftn1) take a look at the footnote it says a digital module is needed, would it be a digital 9401 module? Ive also got one of those.

  • How can I use a USB camera with cRIO 9022. Please see my strange problem.

    Hi,
            I would like to use a USB camera with NI cRIO 9022. I used the same USB camera with NI USB 6216 DAQ device and developed a VI(within a PROJECT and outside it). So, It is working fine with NI USB 6216 device when I use the Vision Assistant Express VI and gets detected in its Initialization Window.  Please see JPEG File 3 where I get NO ERROR.
            I am facing a problem when I want to use it with NI cRIO 9022. What exactly I am doing in this case is:
    1) Create a NEW PROJECT
    2) Add Targets and Devices(NI cRIO 9022)
    3) Use the Scan Interface mode
    4) Create a NEW VI under the cRIO 9022 device 
    5) Use a Timed Loop(Synchronized with Scan Engine) for continuous Data Acquisition and Sending from the Analog I/O modules.
    6) Use the Vision Assistant available through the NI Vision Acquisition 2010 Module(I get STUCK HERE! The Express VI opens the Initialization Window, but I don't see the USB camera like in JPEG File 3)
    I am facing difficulties with this HOST COMPUTER, cRIO implementation differences. On my host computer I have the software packages as shown in JPEG File 1, and on my cRIO 9022 as shown in JPEG File 2.
    Can someone guide me how to overcome this and get the USB camera detected when I am using NI cRIO 9022?
    NOTE: If this is a problem with software mismatches on HOST and NI cRIO 9022 device, please see JPEG Files 1 and 2 for available software and Host and cRIO 9022.
    Thanks.
    Amar.
    Attachments:
    NI Vision Acquisition Express Error for NI cRIO 9022.JPG ‏39 KB
    IMAQ and dx Modules Installed on my NI cRIO 9022 hardware(No NI Vision Acquisition 2010 SP1).JPG ‏82 KB
    NI Vision Acquisition Express NO Error for NI cRIO 9022.JPG ‏48 KB

    Only GigE comms are supported on the cRIO Real Time OS. Have a look at the following:
    Machine Vision on NI CompactRIO and Single-Board RIO
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • How can I use USB camera with NI cRIO 9022, please see my strange problem.

    Hi,
            I would like to use a USB camera with NI cRIO 9022. I used the same USB camera with NI USB 6216 DAQ device and developed a VI(within a PROJECT and outside it). So, It is working fine with NI USB 6216 device when I use the Vision Assistant Express VI and gets detected in its Initialization Window.  Please see JPEG File 3 where I get NO ERROR.
            I am facing a problem when I want to use it with NI cRIO 9022. What exactly I am doing in this case is:
    1) Create a NEW PROJECT
    2) Add Targets and Devices(NI cRIO 9022)
    3) Use the Scan Interface mode
    4) Create a NEW VI under the cRIO 9022 device 
    5) Use a Timed Loop(Synchronized with Scan Engine) for continuous Data Acquisition and Sending from the Analog I/O modules.
    6) Use the Vision Assistant available through the NI Vision Acquisition 2010 Module(I get STUCK HERE! The Express VI opens the Initialization Window, but I don't see the USB camera like in JPEG File 3)
    I am facing difficulties with this HOST COMPUTER, cRIO implementation differences. On my host computer I have the software packages as shown in JPEG File 1, and on my cRIO 9022 as shown in JPEG File 2.
    Can someone guide me how to overcome this and get the USB camera detected when I am using NI cRIO 9022?
    NOTE: If this is a problem with software mismatches on HOST and NI cRIO 9022 device, please see JPEG Files 1 and 2 for available software and Host and cRIO 9022.
    Thanks.
    Amar.
    Attachments:
    Host Computer Image or Vision Acquisition Software Installed.JPG ‏91 KB
    IMAQ and dx Modules Installed on my NI cRIO 9022 hardware(No NI Vision Acquisition 2010 SP1).JPG ‏82 KB
    NI Vision Acquisition Express NO Error for NI cRIO 9022.JPG ‏48 KB

    When you select My Computer, you are running the program on the PC.  In this case, the camera works because it is connected to the PC.  The scan engine doesn't work because it needs to run on the cRIO, not the PC.
    When you create the program on the cRIO, you can use the scan engine because the program is on the cRIO.  You can't use the camera because it is back on the PC, and can't be found on the cRIO.
    The project is a wonderful tool, but it may be making the programming seem too simple.  It may not be clear to you that by moving a program to a different location (PC or cRIO), it is running in an entirely different environment on a totally different machine, even though it is just a little further down in the project.  You can't easily access the hardware on one machine while running the program on the other.
    So the summary is:  The camera is attached to the PC.  The scan engine runs on the cRIO.  Never the twain shall meet.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • Generate Square pulse Using DO module with cRIO 9022

    Hello,
    I want to generate square pulses of 400Hz using NI 9401 for cRIO 9022. I want to control the frequency from 1- 400Hz from PC using LAbview.

    Hi Mekel,
    most CompactRIO applications use three separate processors—a Windows PC, a real-time OS controller, and an FPGA. The CompactRIO controller uses the LabVIEW Real-Time OS instead of Windows. The FPGA does not use an operating system because the code is implemented directly in hardware.
    The common tasks for the Windows host VI include the following:
    • logging data to the PC
    • accessing databases
    • integrating with enterprise systems
    • providing a human-machine (user) interface (HMI) and display
    • supporting supervisory control.
    The RT controller VI tasks typically include the following:
    • processing data
    • control
    • logging data on the RT controller part of the CompactRIO system
    The FPGA VI tasks include the following:
    • I/O
    • hardware-based timing and triggering
    • low-level signal processing
    • control
    Communication between I/O modules and FPGA is digital because signal conditioning and ADC is done in the modules. Communication between the RT controller and FPGA uses the PCI bus in the CompactRIO. Communication between the Windows host VI and the RT controller VI normally occurs over the Ethernet.
    Serena

  • CRIO CAN Module and Bundle to/from U32Array conversion LV FPGA VI

    Ciao,
    I'm looking for a Bundle to/from U32Array conversion VI, running on LV FPGA with cRIO CAN module.
    This conversion has to take place within the FPGA, without leveraging the RT embedded processor
    I'd also like to suggest implementing such utility directly into the LV FPGA function palette, because it's quite common dealing with message contents (bundle is better!) and communicating frames to an external RT application (array is more effective)
    Thanks so much
    ciao

    LV FPGA does include the Cluster to Array and Array to Cluster functions which allow you to convert between these two data types assuming that all elements of the cluster are of the same data type.
    The CAN message cluster does contain elements of different data types (one array and a number of scalars) so it can not be converted directly using the Cluster to Array function.
    Using basic data handling functions you can build a subVI to convert from the CAN cluster to an array. I have attached an example of such a VI.
    Christian Loew, CLA
    Principal Systems Engineer, National Instruments
    Please tip your answer providers with kudos.
    Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
    or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
    to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense
    Attachments:
    cRIO CAN Cluster to Array.vi ‏40 KB

  • CANopen communication over TCP/IP

    The NI Modbus Library makes it possible to implement the MODBUS protocol through COMPORT or over the TCP/IP. I would like to implement the NI CAN or the NI CANopen communication through a COMPORT (VISA connection) or secondary through TCP.
    Can anyone purpose solutions to that challenging task?

    There are TCP-IP<->CAN converters that also support modbus, so you can talk modbus TCP towards these.
    The NI CAN does not hold any functions for the frames itself, this is all done through a call function library node, so creating the frames itself manually would be the only option I could think of.
    If anyone else has additional information, please answer, have recently actually stumbled upon the same issue.

  • Trouble saving images on cRIO-9022

    I'm having trouble saving images on my RT target cRIO-9022 (VxWorks). I get "error 53 occurred at Write GIF File.vi LabView: Manager call not supported" when running the code. What I'm trying to do is save periodic snapshots of front panel charts/graphs locally on the cRIO and download them at a later time.
    I've also tried some of the report generation VIs and had broken arrows and compile errors. from what I've read in help and online, It seems perhaps it is not possible to do what I'm trying to do with my particular target. Is there any reason that I shouln't be able to save images locally to the RT target? has anyone else had a similar problem generating reports or saving images on the cRIO-9022?
    Thanks for any help you can provide,
    truth204

    I've run into similar problem before... I was unable, at the time, to find a good workaround for saving front panel images to file on RT because the necessary report generation functions were unsupported on the RT environment. If you are just saving data from charts and graphs, you might want to consider saving the data as a binary file or a spreadsheet/.csv style file. This is ultimately what I did in my RT application, and then I created a separate desktop application that would read the data from those exported files and reproduce the charts/graphs that were created on the RT target.
    Here is a KB describing your error, for reference: http://digital.ni.com/public.nsf/allkb/39B5B135F32902388625723B00683B27
    Cheers!
    Logan

  • FPGA. Which xilinx tool for Crio 9022 & 9030

    Hi. I will be compiling fpga programs on the Crio 9022 & 9030. Do you need different xilinx compilers to do the task?
    Using LV ver14
    Crio 9022 requires xilinxs tool 14.7?
    Crio 9030 requires the xilinx tools vivado 2013.4?
    Thanks 
     

    Yes, this is because of the different series of FPGAs that are on the 9022's backplane and the 9030 cRIOs.  You can see this KB and this KB to further see why.

  • USB of cRIO 9022...

    Hello,
    I would like to use the USB port of my cRIO 9022 as a port to read a GPS or any other device. Is this possible or I can just use it for interfacing with USB -memories??
    If it is possible, how ??
    Thanks,
    Hector.

    Hello Hector,
    The USB drives of VxWorks controllers like your cRIO only have software for using the USB slot for storage devices.  It is possible to create a custom driver but you would need to develop this driver using a WindRiver VxWorks development seat.  This KnowledgeBase has more information on this topic.
    Regards,
    Jon S.
    National Instruments
    LabVIEW R&D

Maybe you are looking for