<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to CANopen DSP 402 State machine</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/32d9b937b4/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/32d9b937b4/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/32d9b937b4/</id><updated>2020-02-27T21:31:29.047000Z</updated><subtitle>Recent posts to CANopen DSP 402 State machine</subtitle><entry><title>CANopen DSP 402 State machine</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/32d9b937b4/?limit=25#0f3b" rel="alternate"/><published>2020-02-27T21:31:29.047000Z</published><updated>2020-02-27T21:31:29.047000Z</updated><author><name>Rolf-Geisler</name><uri>https://forge.codesys.com/u/rolf-geisler/</uri></author><id>https://forge.codesys.comf559156ce613811a8bb58c97040a5cf012d63b52</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Strange ...&lt;br/&gt;
I had it running on a Beckhoff TwinCAT PLC via CANopen. However, it is long ago, and I do not remember the details just now. The CAN bus is not our standard.&lt;/p&gt;
&lt;p&gt;Since you can move the drive via PCan, the wiring and supply are OK indeed. So it seems to be a CoDeSys and/or mapping issue. Unfortunately each PLC maker has a different philosophy to arrange external communication; TwinCAT experience will not help on other PLCs.&lt;/p&gt;
&lt;p&gt;Does your bus monitor support telegram filters? If yes, you could trigger control words PLC to drive and analyze the answer. This way you also should be able to detect byte swaps.&lt;/p&gt;
&lt;p&gt;Rolf&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANopen DSP 402 State machine</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/32d9b937b4/?limit=25#f999" rel="alternate"/><published>2020-02-27T21:31:27.587000Z</published><updated>2020-02-27T21:31:27.587000Z</updated><author><name>asifdip</name><uri>https://forge.codesys.com/u/asifdip/</uri></author><id>https://forge.codesys.com64f497e2750aa21ea756e87bcb61b8e70a001e61</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks all for ur info.&lt;br/&gt;
I can call a timer to delay every state (example: T#2s) but still just go to&lt;strong&gt; Bit6: Switch on Disabled&lt;/strong&gt;.just when i run codesys,  device Enable voltage is gone. &lt;br/&gt;
Actaully EncoTrive 24Vdc voltage is ok. As I can run the Drive via Pcan View all time by following.&lt;/p&gt;
&lt;p&gt;604    8       2B 40 60 00 06 01 00 00                       Response:  584   8  4B 41 60 00 21 06 00 00&lt;br/&gt;
604    8       2B 40 60 00 07 01 00 00                       Response:  584   8  4B 41 60 00 23 06 00 00&lt;br/&gt;
604    8       2B 40 60 00 0F 00 00 00                       Response:  584   8  4B 41 60 00 37 06 00 00&lt;/p&gt;
&lt;p&gt;So I just run that means EncOTrive Drive has no problem so power or elctricity connection of drive is ok and also canopen connection. I think,there is a mismatch between CoDeSys  SP PLC or PDO mapping. &lt;/p&gt;
&lt;p&gt;But i dont sure or know that if addition code is needed to communicate between CodeSys to CANopen node like ENCOTrive. I have just write a state_machine code 0x0106, 0x0107, 0x000f with Case..of statement with difineing control word &amp;amp; status word, and also done the mapping of the PDOs.&lt;/p&gt;
&lt;p&gt;Thanks&lt;br/&gt;
Asif&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANopen DSP 402 State machine</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/32d9b937b4/?limit=25#3fd9" rel="alternate"/><published>2020-02-27T21:31:23.537000Z</published><updated>2020-02-27T21:31:23.537000Z</updated><author><name>Rolf-Geisler</name><uri>https://forge.codesys.com/u/rolf-geisler/</uri></author><id>https://forge.codesys.com5162cd961bcec0d5d2fd423996ff99d2edfc2efa</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Your state machine maybe is too quick. The EncoTRives need some time to switch from one state to another. The "&amp;gt;=" can be the reason ...&lt;/p&gt;
&lt;p&gt;Did you apply all needed voltages to the drive (electronics supply, motion supply)?&lt;/p&gt;
&lt;p&gt;With the EncoTRives I some years ago had a little problem. When enabling the drives, the power supply voltage dropped to zero and came back prettty slowly. This caused the drives to wait for a INIT telegram again.&lt;/p&gt;
&lt;p&gt;No more ideas. Check the manual and ask the manufacturer. &lt;/p&gt;
&lt;p&gt;Rolf&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANopen DSP 402 State machine</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/32d9b937b4/?limit=25#8783" rel="alternate"/><published>2020-02-27T21:31:22.052000Z</published><updated>2020-02-27T21:31:22.052000Z</updated><author><name>asifdip</name><uri>https://forge.codesys.com/u/asifdip/</uri></author><id>https://forge.codesys.com12fd0df7f7f6fd101bfabf3ea554af1dc127db55</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
I have used in PDO mapping: &lt;strong&gt;asynchronous-device profile specific.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #0040FF;"&gt;CASE state_machine OF&lt;br/&gt;
0:&lt;br/&gt;
controlword:=WORD#16#0106;&lt;br/&gt;
IF  statusword&amp;gt;=WORD#16#0621 THEN state_machine:=1;&lt;br/&gt;
END_IF;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;1: controlword:=WORD#16#0107;&lt;br/&gt;
IF  statusword&amp;gt;= WORD#16#0623 THEN state_machine:= 2;&lt;br/&gt;
END_IF;&lt;/p&gt;
&lt;p&gt;2:&lt;br/&gt;
controlword:=WORD#16#000f;&lt;/p&gt;
&lt;p&gt;IF  statusword&amp;gt;= WORD#16#0637 THEN state_machine:=3;&lt;br/&gt;
END_IF;&lt;/p&gt;
&lt;p&gt;3: Velocity:=300;&lt;br/&gt;
END_CASE;&lt;/p&gt;
&lt;p&gt;Still my machine go to Statusword=1600 ( Word#16#0640) that means &lt;strong&gt;Bit6: Switch on Disabled&lt;/strong&gt;.&lt;br/&gt;
can anybody tell me where is the problem because anyway machine have to go "Enable Operation Word#16#0637" but it goes to "Switch on Disabled  word#16#0640"&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[NB]&lt;/span&gt;: I have used &amp;gt;= sign in Machine program as = is not working sometimes. ( If I have put = sign then it does not change the State from 0 to 3)&lt;/p&gt;
&lt;p&gt;Thanks &lt;br/&gt;
Asif&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://forum.codesys.com//download/file.php?id=265" rel="nofollow"&gt;canopen codesys.zip &lt;span&gt;&lt;span&gt;[126.77 KiB]&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANopen DSP 402 State machine</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/32d9b937b4/?limit=25#7566" rel="alternate"/><published>2020-02-27T21:31:20.593000Z</published><updated>2020-02-27T21:31:20.593000Z</updated><author><name>Rolf-Geisler</name><uri>https://forge.codesys.com/u/rolf-geisler/</uri></author><id>https://forge.codesys.com8ee65c02dd23743fdb90c05f30bf35d8c3ce5547</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi again,&lt;br/&gt;
just a quick question: on inspecting your Friday screenshots I saw, that the controlword is at %QB5, but it's expansion shows QX2.8 and up. Maybe that's the problem ...&lt;br/&gt;
Rolf&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANopen DSP 402 State machine</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/32d9b937b4/?limit=25#d8aa" rel="alternate"/><published>2020-02-27T21:31:16.552000Z</published><updated>2020-02-27T21:31:16.552000Z</updated><author><name>Rolf-Geisler</name><uri>https://forge.codesys.com/u/rolf-geisler/</uri></author><id>https://forge.codesys.com007ed2b9b2399bfb40a1c77fc34cc7ae092ed823</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;the EncoTRive is available either with CANopen, Profibus or with Profinet. From that point of view - communication should be choosen correctly (otherwise you would have different connectors).&lt;/p&gt;
&lt;p&gt;But I wonder why you can write to the drive control word, but the telegrams do not follow the changes (the values you gave in your yesterday's post are out of traffic monitoring, don't they?). Seems, there's a mismatch between PLC and PDOs, PLC seems to write to another address than the PDOs are read from.&lt;/p&gt;
&lt;p&gt;I would suggest to check the matching of addresses again. I know, some of the PLCs have a pretty awkward PDO configuration ...&lt;/p&gt;
&lt;p&gt;Rolf&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANopen DSP 402 State machine</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/32d9b937b4/?limit=25#eb3d" rel="alternate"/><published>2020-02-27T21:31:15.097000Z</published><updated>2020-02-27T21:31:15.097000Z</updated><author><name>spfeif</name><uri>https://forge.codesys.com/u/spfeif/</uri></author><id>https://forge.codesys.comc7e38d8cbf4ee67383981cbdac14a70dd70838ae</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Make sure your drive control source is CAN. Some drives allow multiple control sources. I have Altivar drives that can work from IO, CAN, MODBUS, LOCAL KEYPAD. Do you have a keypad? Maybe if you operate directly from the local keypad see if the status word changes.  My email address should be under my profile?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANopen DSP 402 State machine</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/32d9b937b4/?limit=25#ec79" rel="alternate"/><published>2020-02-27T21:31:11.025000Z</published><updated>2020-02-27T21:31:11.025000Z</updated><author><name>asifdip</name><uri>https://forge.codesys.com/u/asifdip/</uri></author><id>https://forge.codesys.com8775ed801cc2a52c3bc2c6b5f4e51a5d49568f9d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi;&lt;br/&gt;
In Rx_PDO Mapping in CodeSys:&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #0000FF;"&gt;0x1400(Id:$NODEID+0x200)-&amp;gt;Controlword (2 Byte) + opeartion Mode (1 Byte) + traget velocity(4 Byte) &lt;/span&gt;&lt;br/&gt;
I have used these 3 parameters  of total 7 byte in 0x1400(Id:$NODEID+0x200) (total capacity 8 byte)&lt;/p&gt;
&lt;p&gt;In Tx_PDO mapping:&lt;br/&gt;
&lt;span style="color: #0000FF;"&gt;0x1800(Id:$NODEID+0x180)-&amp;gt;Statusword (2 Byte) + Actual opeartion Mode (1 Byte) + Actual velocity(4 Byte)&lt;br/&gt;
&lt;/span&gt;&lt;br/&gt;
St Program editor:&lt;br/&gt;
&lt;span style="color: #0000FF;"&gt;controlword := WORD#16#0106;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;But it has no effect on Status wors. It all time statusword = &lt;span style="color: #0000FF;"&gt;WORD#16#0640&lt;/span&gt;. Where as It should be &lt;span style="color: #0000FF;"&gt;statusword = WORD#16#0621. &lt;/span&gt;&lt;br/&gt;
I have also tries in &lt;br/&gt;
controlword := WORD#16#0107 but same Statusword=WORD#16#0640. actualy i dont understand why my Status Word is fixed on WORD#16#0640.&lt;/p&gt;
&lt;p&gt;Thanks by,&lt;br/&gt;
Asif&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANopen DSP 402 State machine</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/32d9b937b4/?limit=25#202a" rel="alternate"/><published>2020-02-27T21:31:09.394000Z</published><updated>2020-02-27T21:31:09.394000Z</updated><author><name>asifdip</name><uri>https://forge.codesys.com/u/asifdip/</uri></author><id>https://forge.codesys.comed29ae5566ca5a7b3648a65ecf7dc261cdd270dd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello Rolf &amp;amp; Steve,&lt;br/&gt;
Thanks for your info. I will trying with your distation.&lt;/p&gt;
&lt;p&gt;@Steve: How can I send you my Archive Proejct. I dont find your email address or is it possible to share message or document in Codesys forum?&lt;br/&gt;
It will be helpful to know about pdo mapping and sample program as I am very new in canopen &amp;amp; codesys.&lt;/p&gt;
&lt;p&gt;Thanks you all again for informatic info.&lt;/p&gt;
&lt;p&gt;Asif&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANopen DSP 402 State machine</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/32d9b937b4/?limit=25#b156" rel="alternate"/><published>2020-02-27T21:31:05.122000Z</published><updated>2020-02-27T21:31:05.122000Z</updated><author><name>spfeif</name><uri>https://forge.codesys.com/u/spfeif/</uri></author><id>https://forge.codesys.coma80a662a5ad6952163c11d425773c026f10784bf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Yes Rolf gave better detail then myself. The drive company should have a very basic block that handles the state machine for you. You should never have to deal with this yourself. At a minimum it should have a type of stop input (Quick, Ramp,) direction input (fwd/rev) cmd output, velocity output and status input. Follow Rolf and the DSP402 if you have to make it yourself otherwise I can give you a FB that should work for you. It is from another VFD MFG as long as they are not using any MFG specific bits to control the state machine in the CMD and Status it should put your drive into the READY state.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>