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 Thu Sep 19, 2019 6:22 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
 Post subject: NMT Problems
PostPosted: Wed Feb 27, 2013 4:58 am 
Offline

Joined: Mon Jul 16, 2012 9:11 am
Posts: 75
When calling the CIA405.NMT function block,I met prblems.

PLC_PRG
CanopenNMT:CIA405.NMT;
tmr:TON;
ENDVAR


tmr(IN:=TRUE,PT:=t#1s);
IF tmr.Q THEN
CanopenNMT(NETWORK:=1,ENABLE:=TRUE,TIMEOUT:=1,DEVICE:=0,STATE:=CIA405.TRANSITION_STATE.START_REMOTE_NODE);
END_IF

I want the Canopen manager to send the message of "0x000 01 00" every second,but I faild.
If there is no remote canopen device added to bellow the Canopen manager, then only 2 piece of such message is sent but not cyclicly per second.

If there are remote canopen devices added to bellow the Canopen manager, then there is no shch message as "0x000 01 00" sent with the Error of "CANOPEN_REQUEST_ERROR".

and I don't know why.


Top
   
 Post subject: Re: NMT Problems
PostPosted: Wed Feb 27, 2013 7:34 am 
Offline
Frequent User
Frequent User
User avatar

Joined: Tue Jun 06, 2006 9:03 am
Posts: 409
I tried it and it works fine:
Code:
fbNmtStart(
   NETWORK:= 1,
   ENABLE:= xEnableStartAll,
   TIMEOUT:= 1,
   CONFIRM=> ,
   ERROR=> ,
   DEVICE:= 0,
   STATE:= CIA405.TRANSITION_STATE.START_REMOTE_NODE);

The way you have coded the timer function actually only functions once when 1 second has passed.
The enable is a trigger to send the message. In the code you should handle the confirm or error reply.


You do not have the required permissions to view the files attached to this post.


Top
   
 Post subject: Re: NMT Problems
PostPosted: Wed Feb 27, 2013 10:51 am 
Offline

Joined: Mon Jul 16, 2012 9:11 am
Posts: 75
Thanks,you are right.
I test,and find that the first NMT message should be sent several senconds after the PLC reboot,
if you send the NMT message too soon(no longer than 2s) after the PLC reboot,then you will get the Error of "CANOPEN_REQUEST_ERROR".
Our target is Wachendorrf Display.


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

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 6 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