Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

CANopen with IFM controllers CR7505 and CR2513

andrzey13
2009-05-18
2012-11-26
  • andrzey13 - 2009-05-18

    Hello

    I trie to make little network (CR7505 and CR2513) in CoDeSys. I have done: New from template ----> ifm_template_CR7505master_V______

    Then Append Subelement CR2513 in PLC Configuration. There is no error while Login. But CR2513 is only light green (there is no blinking 2Hz). What else should I do?

    I only want to controll from CR7505 some LEDs connected to outputs of CR2513.

    Help, please.

     
  • spfeif - 2009-05-22

    From my understanding of your post you only added the CR2513 IO module as a CANopen slave under the safety PLC CR7505.

    1. Do yo have a CAN adapter to read can buss traffic. If so use it to see what is happening.

    2. Do yo have 120ohm resistor in your CAN network? If it's on a bench you need at least one resistor connected between CAN_H and CAN_L. You have CAN_H of the CR7505 connected to the CR2513 CAN_H. The same for CAN_L?

    3. How did you configure the CR2513 NodeID? If you changed it via SDO in the nodes configuration section then you need to power cycle the module in order for the new node ID to take effect.

    3A. How did you configure the baud rate of each device? See 3 above.

    1. Make sure the Master PLC CR7505 has the CANopen Master configured to "automatically startup".

    Look in the global variable list for 5 and 6 below. Go online means monitor the PLC when the program is running.

    1. Go online with the CR7505 and look in the global variable list and find the array name pCanOpenMaster[0] look at the variable nStatus it should be equal to 5. This means the CANopen master is operational.

    2. Go online with the CR7505 and look in the global variable list and find the array name CanOpenDev[0], because you only have one device nStatus should be equal to 5 as well.

    Here is the definitions of the nStatus byte.

    nStatus : INT; (* Current status of the node. This status is the status of a node within the current library and is not at all concerned with the status

    defined by CANopen!:

    0: undefined.

    1: Node will be reset by the master and re-configured.

    Master waits on a bootup-message of the node (or on the

    expiry of the given guard time) and after that switches the

    state of the node to status 2.

    2: Master waits ca. 300 msecs before requesting object 0x1000.

    Then the status is set to 3.

    3: Master starts the configuration of the slave with a SDO-readrequest

    (index 0x1000) to the node. All SDOs generated by the

    configurator will be sent to the node in this status. The

    generated SDOs are packed in an array of SDOs, where the

    node knows its first SDO and the number of its SDOs. (Instance

    components „wFirstSDOIndex” and „wNummOfSDO“)

    4: If in the configuration of the Master “Auto startup” is activated,

    the node will get sent a „Start Node“ and change to status 5.

    5: Node receives/sends PDOs, Master also. Normal operation.

    97: Optional node has not been detected at start-up.

    98: Node has answered on a request for the device type

    (object 0x1000) with a different type.

    99: LifeTimer is exceeded, Nodeguarding error.*)

    The state of a node during the “normal” operation when I/O data

    are being exchanged, is 5.

    Sorry this was a copy and paste as to what the status numbers mean. So if CanOpenDev[0] nStatus = 97 the device was not found at all.

    nstatus = 98 means that the device that responded to the request from the master for OD 1000 was not the correct device type. ( I have seen this before with other IFM stuff)

    Those would be the two keys for you. Let me know how it goes and let us all know what you found.

     
  • andrzey13 - 2009-05-28

    Thank for help.

    Solution of my problem was node ID, the cr2513 should work on defalut ID which is 32.

     
  • Siavash-80 - 2012-11-26

    Hello
    I am using Ifm controller CR1055 with IO CR2016. I created a project with New from template but I got 13 errors. Could you help me how to solve these issues? Thanks a head.

    IMG: error1.png

    IMG: error2.png

     
  • Siavash-80 - 2012-11-26

    I forgot to mentioned that after creating the project based on " New from template" and selecting "ifm_template_CR1055master_V040002_03" as a controller. In the PLC configuration the PLC is "not_found". Therefore, I chose "Standard Configuration" in "Extras" menu and I got those errors you can see in the above photo.
    Thanks a lot.

    //Siavash

     
  • spfeif - 2012-11-26

    The second screen is telling you that the CAN_1_Master_Status is undefined on line 1 of PLC_PRG because you probably reloaded the libraries and the instance name is not declared. Look above the FB and see if there is a name above the box. If there is not you need to add the same name as the one defined in the VAR
    list. It will be defined something like

    Var
    MyMstrStatus :CAN_1_Master_Status;
    END_VAR

    Put what ever the variable instance name, in this case MyMstrStatus and put it above the FB. Click on the CANopenMaster library you have included and check that there is a FB named CAN_1_Master_Status. Typically CAN_1 means that is the first CAN port. If this has multiple can ports there will be others named CAN_2, CAN_3 etc..

    Second screen you show net variable being enabled. You can disable this for now by going to the Target settings and uncheck the box for use Net variables.

     
  • spfeif - 2012-11-26

    Also after you used a new configuration first try doing a Build-> Clean all. Then do a Build-> Build all and see if the errors disappear.

     

Log in to post a comment.