CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Mon Sep 16, 2019 3:04 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sun Jan 27, 2013 10:54 am 
Offline

Joined: Tue Oct 04, 2011 10:13 am
Posts: 80
This is a general CANopen master question.

In my CANopen network, a slave goes to pre-operational sometimes. And it's heartbeat status changes accordingly.
Currently, the CANopen master does NOT reset / re-init that slave.
Should the CANopen master do a reset / re-init of the slave?

Regards,
Edwin.

CoDeSys V3.5
CANopen Manager V3.4


Top
   
PostPosted: Sun Jan 27, 2013 12:46 pm 
Offline
Frequent User
Frequent User
User avatar

Joined: Tue Jun 06, 2006 9:03 am
Posts: 409
If the master is configured to detect heartbeat errors and the slave doesn't send them anymore, the master will change the status of the node (internal status) and try to connect to it again. When it finds the node, it will configure it again (default setting) and bring it to operational mode again.

What you should check is:
- Your heartbeat settings => Does the master detect it => is the time set correctly to detect errors?
- Add Function blocks to your application to detect the status of the node (does this change when your situation happens?). With this function block you can detect whether the node is in pre-operational state.


Top
   
PostPosted: Mon Feb 04, 2013 3:30 pm 
Offline

Joined: Tue Oct 04, 2011 10:13 am
Posts: 80
Thank you for your suggestions.

The master detects that the slave is in pre-op and in the CoDeSys GUI, the slave has a orange / red icon.
The slave keeps transmitting it's heartbeat (with status 0x7f = pre-op).

The question is:
Should the CANopen master re-init a slave that is in pre-op state?


Top
   
PostPosted: Mon Feb 04, 2013 9:50 pm 
Offline
Frequent User
Frequent User

Joined: Mon Jul 25, 2005 8:06 pm
Posts: 295
Should the Master Re-Init is based on the configuration of the Node and CAN master.

Since it appears you are using V3 here are a few thing to look at:

1. You can have the Master set to START ALL nodes which means that after configuring all the nodes at startup of each device the Master will send a global start all nodes command instead of starting each one individually.

2. Look at the bottom of the NODE configuration under the CAN master you will see check boxes for Check Vendor ID, Check Product Number , Check Revision Number , If any of those are checked then the CANopen Master stack will read these OD entries first and if they don't match with the value read from the node and the value in the eds file then it will not configure and start the node. Try unchecking all of them.

3. Can I assume you have more than one Node on this network? If so I would find out why only one of them is going from Op to Pre-Op. Do you have a CAN monitor? One thing to check as well is if this node was on another network and configured a different way, Like Node Guarding enabled, and then you took it to another network ( the one currently using V3) CoDeSys may not configure it correctly since it doesn't write all the SDO of the entire Node. It will only right a few of them and only ones that have changed from the EDS default. So what I am getting at is try a Node Reset OD 1011 then put it back on your network. You may have old setting enabled like both Nodeguarding and Heartbeat enabled at the same time.

4. Also you should as suggested below set your hearbeat time out of the node (heartbeat consumer) to at least 1.5 times the Heartbeat rate of the Master. Also if you changed the Master ID you need to change the heartbeat consumer Node ID of the Node as well other wise it will remain defaulted to 127. Press the button to "Change the Heartbeat Consumer Properties". I'm assuming you might be consuming the Masters heartbeat and not another nodes heartbeat.

_________________
Thanks,
Steve Pfeifenroth


Top
   
PostPosted: Wed Feb 06, 2013 3:29 pm 
Offline

Joined: Tue Oct 04, 2011 10:13 am
Posts: 80
1. I think, I cannot use START ALL nodes, because I have optional CANopen devices in the network.
2. Yes, we check the Vendor ID. And that is matching with the eds file.
3. We have more than 20 CANopen slaves in the network.
The manufacturer of the device that is going to pre-op, is investigating the issue currently.
At start up, the master initializes the slave with the mapping and comm. parameters only. And that is OK according to the manufacturer of the slave.
4. I checked the heartbeat settings (150%). And that is OK.

Again, thank you for your help.

Still the question remains: Should a CANopen master, re-init a CANopen slave that is in pre-op state?

Regards,
Edwin.


Top
   
PostPosted: Wed Feb 06, 2013 4:42 pm 
Offline

Joined: Tue Oct 04, 2011 10:13 am
Posts: 80
I think a CANopen master should supply the possibility to reset slaves that are 'not operational'. So the master can re-init the slave and get it operational.
CoDeSys V3.5 / CANopen Manager V3.4 does not supply such functionality, I think.

As a work-around, I'll make an application that (like TimvH suggested):
- Cia405.GET_STATE of slaves.
- Check if it is 'not operational' for some time e.g. 30 seconds.
- Reset a slave that is 'not operational' for some time, with Cia405.NMT.

Did somebody make such application, in ST, already?


Top
   
PostPosted: Wed Feb 06, 2013 6:44 pm 
Offline
Frequent User
Frequent User
User avatar

Joined: Tue Jun 06, 2006 9:03 am
Posts: 409
Personally I don't think the Master should just bring it into operational state. There must be something wrong with the slave when it suddenly goes into pre-operational state without reason. Normally this never happens. If it is caused by a reset (or something similar) it should stop sending heartbeats for some time for the Master to detect this. This is the normal error handling mechanism which the master can handle.

In you case I think the work-around is the only solution.

Below you can find some code which you could use as example. I just created it based on experience, but didn't test it, which means there could be some errors in the code, but I hope it helps.

Code:
PROGRAM PLC_PRG
VAR
   getStateNode1: CIA405.GET_STATE;
   tonNotOpNode1: TON;
   nmtNode1: CIA405.NMT;
END_VAR


Code:
getStateNode1(
   NETWORK:= 1,
   ENABLE:= NOT(getStateNode1.CONFIRM) AND (getSTateNode1.ERROR = CIA405.CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_NO_ERROR),
   TIMEOUT:= 1000,
   CONFIRM=> ,
   ERROR=> ,
   DEVICE:= 1,
   STATE=> );
   
tonNotOpNode1(IN:= getStateNode1.STATE <> CIA405.DEVICE_STATE.OPERATIONAL, PT:= T#30S, Q=> , ET=> );

nmtNode1(
   NETWORK:= 1,
   ENABLE:= tonNotOpNode1.Q,
   TIMEOUT:= 1000,
   CONFIRM=> ,
   ERROR=> ,
   DEVICE:= 1,
   STATE:= );
   


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 7 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited