<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anatolii Antonenko on Medium]]></title>
        <description><![CDATA[Stories by Anatolii Antonenko on Medium]]></description>
        <link>https://medium.com/@markorestism?source=rss-d23383269bf6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-pfcQe7Njgjip5W37RlBiA@2x.jpeg</url>
            <title>Stories by Anatolii Antonenko on Medium</title>
            <link>https://medium.com/@markorestism?source=rss-d23383269bf6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 17:40:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@markorestism/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Schneider VSD control with the help of Node-Red]]></title>
            <link>https://medium.com/@markorestism/schneider-vsd-control-with-the-help-of-node-red-5feb67bdb293?source=rss-d23383269bf6------2</link>
            <guid isPermaLink="false">https://medium.com/p/5feb67bdb293</guid>
            <category><![CDATA[industrial-automation]]></category>
            <category><![CDATA[modbus]]></category>
            <category><![CDATA[node-red]]></category>
            <category><![CDATA[variable-speed-drives]]></category>
            <category><![CDATA[schneider-electric]]></category>
            <dc:creator><![CDATA[Anatolii Antonenko]]></dc:creator>
            <pubDate>Wed, 30 Sep 2026 22:06:12 GMT</pubDate>
            <atom:updated>2026-09-30T22:11:37.681Z</atom:updated>
            <content:encoded><![CDATA[<p>Here’s what I built and the weird issues I discovered along the way.</p><p><em>Please ignore my English grammar, it was 11pm and I hate using AI for grammar corrections.</em></p><p>Aims:</p><p>I. To have fun.</p><p>II. To build and demonstrate a simple Modbus Master (Client) tool for fieldbus commissioning of Schneider ATV600 VSD, with user-friendly interface, not overloaded with settings.</p><p>III. To avoid coding as it is far beyond the scope of an automation engineer on site, as a rule.</p><p>IV. To use open-source development tools to make it possible for everyone to get into industrial automation practises without buying expensive proprietary licenses.</p><p>These notes are not a guide on how to use Node-Red, but a demonstration of this exact application, like <strong><em>hey, here’s what I built and the weird issues I discovered along the way.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N_cXFS0-JPvzx6zOPGrr5g.png" /><figcaption>Flows that I built</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/1*AooNG9lPeSN9Wa2Uc5zVmw.png" /><figcaption>Dashboard appearance</figcaption></figure><p>The cases I faced during the play that interested me:</p><p>I. No mater how successfully you <strong>write</strong> registers into Modbus Server, you`ll get Modbus timeout error if no data is continuously <strong>read from</strong><em> </em>the Server. In other words it needs a node to repeatedly poll the VSD to “keep the VSD comms alive”, otherwise, the Write nodes are useless, leading to Modbus timeout.</p><p>II. The bit order read from right to left, but when using binary to decimal converter, the first bits in mind appear to be the last bits typed into the calculator, consider this when assembling a Command register. Example:</p><p>You want to write the bits 0,3 and 7 as high into Command Register (Scheider VSD commands memory): 0000000010001001. Convert binary code into decimal by means of a calculator. When typing, you might want to start with bit No 0, then 1…..15. In this case you`ll type 10010001000000 instead of 0000000010001001. To avoid this mistake, start with bit No16 and go backward.</p><p>Then, open the flow and add a button node with message payload as a number and paste there the decimal number you got after the conversion: 0000000010001001 is <strong>137</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U71VT8L8jRyn_QM74Igl-Q.png" /><figcaption>RUN button node will inject decimal value of 137 into the Modbus-Write node</figcaption></figure><p>III. With a Command Register being a 16-bits Word, the Status Register is Enumeration and must be treated as an Array with the <em>n</em> possible states:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DBqxeeNQKe-rZSa4ZuHT3A.png" /><figcaption>HMIS — Device state enumeration</figcaption></figure><p>For a simple test bench , the most commonly used ones can be chosen:</p><pre>let hmis = Array.isArray(msg.payload) ? msg.payload[0] : msg.payload;<br>const states = {<br>    2: &quot;READY&quot;,<br>    3: &quot;FREEWHEEL STOP&quot;,<br>    4: &quot;RUNNING&quot;,<br>    5: &quot;ACCELERATING&quot;,<br>    6: &quot;DECELERATING&quot;,<br>    7: &quot;CURRENT LIMITATION&quot;,<br>    8: &quot;FAST STOP&quot;,<br>    13: &quot;CONTROL STOPPING&quot;,<br>    15: &quot;OUTPUT CUT&quot;,<br>    17: &quot;UNDERVOLTAGE WARNING&quot;,<br>    23: &quot;FAULT&quot;,<br>    30: &quot;STO ACTIVE&quot;,<br>    35: &quot;IDLE&quot;<br>.....</pre><p>IV. If the VSD is power cycled, the communication between the Master and Slave is interrupted, Node-Red doesn&#39;t automatically save and re-initiate the speed reference injection into the Modbus-Read node. However, the Speed Ref slider visualize some value, but the value doesn`t yet exist in the Node-red memory. Solution is to either add a node to inject some speed ref value (0 Hz is recommended for safe start-up) after the VSD transitioned from state 0 to state 1, State machine in this case can be easily represented by the DC voltage level as it transitions from zero to some value straight after the power is ON (for a simple drive without DC pre-charge logic) . Or an easier solution that came to my mind afterwards: repeatedly inject 0 into Modbus-Write Speed Reference node unless the slider is moved, then send whatever value is represented by the slider.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hZdIkceGFKw4AXBRc1RmeQ.png" /><figcaption>Speed Ref initial value of zero</figcaption></figure><pre>msg.payload = flow.get(&quot;speedRef&quot;) ?? 0;<br>return msg;</pre><p>V. There are parameters that have the same name (e.g. DC Bus Voltage) but different addresses. Address 7270 appeared to be the last saved DC Bus voltage value before the Fault, but 7271 is the actual one. Confusing that both are named as History parameters. <strong>Schneider, Why???</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZWCd4_9IoHrT_XmVr_8x3w.png" /><figcaption>easy to miss!</figcaption></figure><p>VI. Should had been obvious to me, but it hadn`t: once the Node-Red Modbus client is active, the com port is occupied, therefore SoMove software won`t see a VSD until the Command Prompt is closed and Node-Red Off. Is it first-come-first-served concept? I`m not good at this stuff so idk, but I`m pretty sure it is.</p><p>VII. Poll rate must be smaller that the Timeout. Timeout has to be identical on both Master and Slave devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*76lGUCw0nR1mm4mjFGgzuw.png" /><figcaption>Poll rate (Connection delay) vs Timeout</figcaption></figure><p>Overall, I enjoyed this simple project for quick Modbus simulation. Hopefully the notes above give others a few useful ideas for learning basic industrial communications.</p><p>Regards ;)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5feb67bdb293" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Siemens G120 — Profibus — ABB AC800M. Long story  ̶s̶h̶o̶r̶t̶ long.]]></title>
            <link>https://medium.com/@markorestism/siemens-g120-profibus-abb-ac800m-long-story-%CC%B6s%CC%B6h%CC%B6o%CC%B6r%CC%B6t%CC%B6-long-a185681a20c9?source=rss-d23383269bf6------2</link>
            <guid isPermaLink="false">https://medium.com/p/a185681a20c9</guid>
            <category><![CDATA[abb]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[siemens]]></category>
            <category><![CDATA[plc]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Anatolii Antonenko]]></dc:creator>
            <pubDate>Thu, 28 Nov 2024 11:54:24 GMT</pubDate>
            <atom:updated>2024-11-29T08:56:04.419Z</atom:updated>
            <content:encoded><![CDATA[<p>Siemens G120 — Profibus — ABB AC800M. Long story ̶s̶h̶o̶r̶t̶ long.</p><p>“The industrial automation industry has always had a fairly high barrier of entry. Those seeking to learn various platforms (both hardware and software) will often find themselves restricted by licenses, expensive hardware, and a lack of ways to simulate for learning purposes.” <strong>© </strong><a href="https://www.linkedin.com/in/vladromanov/">Vladimir Romanov</a>.</p><p>I am very glad that the company I work for provides educational resources — this is how the AC800M, a powerful device with a retail price of over £xxxx, ended up on my desk for a few weeks of play.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cirs_0zwDXEGYJm4p45fiw.jpeg" /></figure><p>My initial goal was to establish a simple communication setup between the Siemens G120 and the AC800M CPU over Profibus. Here are the main steps involved, aside from selecting the hardware:</p><p>Hardware components:</p><ul><li>AC800M PM866K01</li><li>G120 CU230P-2 DP</li></ul><p>Software components:</p><ul><li>TIA Portal v19 (Stardrive)</li><li>Compact Control Builder AC800M 5.1.0</li></ul><p>The main steps to configure the project, after selecting the hardware, are as follows:</p><ol><li>Adding a GSD file</li></ol><p>Since the G120 is not native to the ABB DCS, I downloaded the Siemens G120 CUxxx GSD file and added it to the project as a new library. The file was then inserted into the Hardware CI854 Profibus DP communication module. I configured the GSD file according to the specifications of both the variable speed drive (VSD) and the CPU:</p><p>2. Selecting the Telegram module</p><p>The Telegram Module in the GSD file must match the configuration of the VSD in Siemens Startdrive software.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7zBEcUn6EblVt53upkbk_A.png" /><figcaption>Free Telegram in both</figcaption></figure><p>I faced challenges with this, realizing that the AC800M CPU uses DINT as a standard data type for monitoring hardware and I/O status. In the GSD installation settings, I had to define mapping rules to convert bytes and words in the GSD file into specific data types.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*vtyP_pKPhe20s0g_ydUBxQ.png" /><figcaption>Defining rules to map numbers of bytes/words in GSD-file into specific data types</figcaption></figure><p>Q: Why map 1 Byte to 1 DINT (signed) and 1 Word to 1 DINT (signed)?</p><p>The G120 telegrams use 16-bit integers (signed or unsigned). For the program, signed integers were chosen for better representation of negative values, like negative speed, torque, and frequency. Although data is mapped as Words, byte mapping rules are essential for scenarios involving partial word interpretation, such as reading specific bits.</p><p>3. Handling Variables and Data Type Mismatches</p><p>Add variables to the program, as per the Telegram specification, which are :</p><ul><li>SW(Status Word),</li><li>CW (Control Word)</li><li>Speed feedback,</li><li>Speed reference</li></ul><p>SPOILER: choosing signed integer as the main data type for the program, we will experience data type mismatch when reading Status word from the VSD (which is unsigned integer). To eliminate the mismatch, the following approach can be used:</p><pre>if (status_word &lt; 0) then<br>    corrected_value = status_word + 65536 <br>//unsigned integer range is 0-65535<br>//which gives us 65536 possible value incl.zero<br>else<br>    corrected_value = status_word</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bj-5gljldeRoO6hG08Hz3Q.png" /></figure><p><strong>Binary Conversion: </strong>I converted the Status Word into binary to read its bits.</p><p><strong>Speed Feedback: t</strong>o get the Speed_feedback in percentage: convert DINT to REAL and divide by a scaling factor which is 168.34 for the CU used and for Sinamic drives in general.</p><p><em>Speed % = Speed_feedback DINT/168.34</em></p><p>Examples: Speed_feedback is 16384:</p><p>16384 / 168.34= 100 %</p><p>Speed_feddback is 8417:</p><p>8417 / 168.34 = 50%</p><p>Q: Why 163.84?</p><p>163.84 is valid scaling factor for Speed feedback because the scalling factor is based on the range used by the G120 (0–16384 represents 0–100% speed for one direction of rotation*) and is independent of the data type. It’s simply a ratio derived from the maximum value to represent 100%.</p><p>*use range of (-16384) to 16384 for bidirectional rotation.</p><p>“ If the frequency change for 1/16384 is not enough resolution for your process, choose a different telegram, one with 2 words for speed setpoint. Then you have many decimal places to the RPM sent to the drive.” <strong>©</strong>0_Einstein from Siemens online support.</p><p>Q: Why do we operate INTs and DINTs if the instruction manual for G120 says that Actual speed, r0063, is 32-bit Floating point value?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*MmfnzV4RFdiYD7YzUuCVpg.png" /><figcaption>form G120 manual</figcaption></figure><p>32-bits Floating Point, so called REAL data type, is used within the VSD`s program for internal calculations/storage. REAL representation of values is <strong>not used</strong> for Telegram data transfer.</p><p><strong>Scaling Actual Speed:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ba_Dg8yLHIuQoFjBf9JY5g.png" /><figcaption>G120 manual. Note that NIST_A is I16(16-bit signed Integer) which is used to transfer the value over fieldbus and not FloatingPoint32 as it is mentioned in r0063.</figcaption></figure><p>NIST_A (Actual Speed, 16bit) is scaled as per p2000 which corresponds to 100% or 4000 hex (word). It is worth noting here that <em>“all the speeds or frequencies specified as relative value are referred to reference quantities”, </em>which means that actual speed is always a percentage of reference speed and not of the max VSD speed. So we work with normalized speed value (%) and can scale it to RPM if required.</p><p><strong>Control Word (CW) and Speed Reference:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QWGSNK123sRQJTmrdVwtHA.png" /></figure><p>I used Start and Reset bits of the CW as variables, the rest kept constants 1 or 0 to make the drive only dependant on Start and Reset bits.</p><p>Speed_reference percentage I multiplied by the scaling factor of 164.34 and converted to DINT to send the Speed_ref signal of 0–16384 (0–100% of the p1082 — maximum speed.</p><p>4. Integrating Variables</p><p>The program variables (SW, CW, Speed Reference, Speed Feedback) were added as Telegram variables using the “Insert Path From Tree” function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ewrkDvKmtr6I08VPERFPhA.png" /></figure><p>5. Finally, the devices were ready to go online and communicate successfully.</p><p>This project shows how small details, like scaling and data types, are key to making devices like the G120 and AC800M work together.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a185681a20c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How PLC program is structured. Functions, Function Blocks and Data Bocks.]]></title>
            <link>https://medium.com/@markorestism/how-plc-program-is-structured-functions-function-blocks-and-data-bocks-46178812f03b?source=rss-d23383269bf6------2</link>
            <guid isPermaLink="false">https://medium.com/p/46178812f03b</guid>
            <category><![CDATA[tia-portal]]></category>
            <category><![CDATA[siemens]]></category>
            <category><![CDATA[industrial-automation]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Anatolii Antonenko]]></dc:creator>
            <pubDate>Sun, 24 Mar 2024 00:29:36 GMT</pubDate>
            <atom:updated>2024-03-24T00:29:36.108Z</atom:updated>
            <content:encoded><![CDATA[<p>In my previous post ‘Device to Device comms…’ I covered the low-level principle of data transfer between devices. Obviously, it requires deeper investigation and real-life examples, so we will delve into it further posts. But what I`d like to start with is <em>How a program is structured</em> so that we are able to operate with correct terminology and see the perspective.</p><p>Imagine, we have a network of 15 drives which control 15 conveyor motors, VFDs connected via Profibus, all performing identical control algorithm. Do we need to create 15 individual Functions for each motor? Yes, we do. Can we facilitate this process? Yes, we can by creating a common Function Block for generic motor control.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VUEVPiktHvlUzeyk_ETOnA.png" /><figcaption>1-MotorCtrl Function block in the project tree; 2-Motor control algorithm in Ladder Logic; 3-Block Interface.</figcaption></figure><p>Note that variables in a Function block are not assigned to specific numerical addresses but are only stored by names (e.g. #SpeedOutput, #interlock, #ManualSpeed etc.).</p><p>Why I highlighted the Block Interface (3)?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2u2Q2-9n8io-Dnl3ZQVUWQ.png" /></figure><p>In Block Interface you can assign/change/see variables and their types grouped by Inputs, Outputs, Input/Outputs, Static variables, Temporary variables and Constants.</p><blockquote>Function blocks are code blocks that store their values permanently in instance data blocks, so that they remain available after the block has been executed.</blockquote><p>Then we can create as many Functions (FC) as we need — 15 FCs for 15 motors. Drag-and-drop MotorCtrl Function Block into each FC. And now it`s time for addressing. Instant Data blocks will be created to keep data of each FB enclosed in FCs. Define variables for each motor. Profit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*dqBOCYQJIM3du1xGMZUNDA.png" /><figcaption>MotorCtrl Function block which we created earlier, added into a Function for motor M1.</figcaption></figure><p>Fair question to ask: why do the addressing look so complex in the example above? Why each variable in the block is addressed as %DBn.DBX0.0?</p><p><strong>The shortest answer is</strong>: Addressing is a specific topic to be discussed separately and in details. No worries for now.</p><p><strong>A short answer for those who are curious: </strong>each variable of the block, in our case, is a component of the STRUCT data type. How to read such the addresses:</p><p>%DB5.DBX0.0 “Control Var”.Motors.M1.Off” means: DB5 — Data Block 5 named Control Var; Motors — name of a struct; M1— name of a user defined data type; Off — name of the bit; DBX — means bit data type; 0.0 — bit number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*zJTHn4hJTzWeTq9e95xI7w.png" /><figcaption>1-name of DB; 2-Struct data type named Motors; 3- a component of the Struct named M1 of user defined data type “Motors”; 4- component of M1 which is called Off of Bool data type; 5- address of the Off bit in M1.</figcaption></figure><blockquote>The STRUCT data type represents a data structure that consists of a fixed number of components of different data types.</blockquote><p>In my previous post I covered communication between devices implemented by Telegram1: 2 Words In, 2 Words out. Now we change the scenario and use Free Telegram which is defined by user. It is now the user who decides how many words to transfer and their consent.</p><p>In the same function FC1, except MotorCtrl function block, we add SiemensVSD function block which is to be controlling the PLC-VFD communication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*9loe0wUwuffTETpn2pxIPQ.png" /><figcaption>You see that FB2 “Siemens VSD” has many PZDs (Status Words) inputs &amp; 2 CWs (Control Words) accompanied with some data from certain structure (struct data type)</figcaption></figure><p>Each PZD and CW are described by the Telegram specification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UqyW5xdjXFVnUEDGg96UvA.png" /><figcaption>Open communication properties window by clicking on the drive`s Profinet connection (green square).</figcaption></figure><p>Looking at the Partner data area in properties, we see the addresses reserved for Send and Receive words: I 314…327 (Send), Q 314…317 (Receive). If you have read my previous post where I mentioned Sina_Speed block for VFD control, you may ask a fair question: Do we need Sina_Speed as the only way to control a drive? The answer is: No, we can control the drive by using appropriate telegram addresses which can be found and changed in Properties. Sina_Speed just simplifies the assigning variables to the addresses.</p><p>Despite we have created FCs, FBs and accompanied DBs, the program code won`t be executed until we add code blocks (e.g. FCs) to the so-called OB (Organization Block) for cyclic program processing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rTpgUD5cMNxMvk77xvNrjA.png" /><figcaption>An example of FCs added in Main OB</figcaption></figure><p>Now, the program is ready to run, but an HMI is to be installed and programmed to allow an operator to interact with the system. Creation of the Human-Machine Interface for such a system will be covered in separate post.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46178812f03b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Device-to-device communication in a Process Control System. Siemens and not only. Part 1.]]></title>
            <link>https://medium.com/@markorestism/device-to-device-communication-in-a-process-control-system-siemens-and-not-only-part-1-00a8af8e179f?source=rss-d23383269bf6------2</link>
            <guid isPermaLink="false">https://medium.com/p/00a8af8e179f</guid>
            <category><![CDATA[plc]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[siemens]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[industrial-automation]]></category>
            <dc:creator><![CDATA[Anatolii Antonenko]]></dc:creator>
            <pubDate>Wed, 21 Feb 2024 09:17:23 GMT</pubDate>
            <atom:updated>2024-03-25T11:06:58.044Z</atom:updated>
            <content:encoded><![CDATA[<p>Rare Process Control System goes without implemented Communication Protocols which provide robust and safe signal transfer between smart devises throughout a site`s network. Despite of this fact, lack of basic understanding of communication protocols still persists between machinery operators. In the following examples we will look at the inner part of certain program blocks to see how data transfer is established between a VFD and a PLC.</p><p>We will use Siemens TIA Portal, but the principle is applicable to any software and almost any protocol. The idea is the same.</p><ol><li>PROFINET as an example of Acyclic data transfer.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kf4TI06SCNUrCnDG1VmheQ.png" /><figcaption>PLC, HMI and 3 VFDs connected via PROFINET</figcaption></figure><p>What is important?</p><ol><li>Unique device name (can be assigned automatically)</li><li>Common Subnet (Subnet Mask)</li><li>Unique IP address (to match the commissioned drive)</li><li>MAC address</li></ol><p>PLC sends to VFD a stack of signals which are called Words <em>(Siemens keeps many German abbreviations in their software, so Word is named as PZD): </em>Control Word (<em>STW)+ </em>a word of a speed Setpoint value <em>(NSOLL_A)</em></p><p>VFD sends to PLC a responds which is called Status Word or (<em>ZSW) + </em>a word of motor speed value <em>(NIST_A)</em></p><p>So 2 Words from PLC to Drive and 2 Words from Drive to PLC. Each Word consists of 16 bites or 2 bytes. But how do Words look like and how we can encrypt messages in form of bytes?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*kBsJ7Pzfo9Y9cLZUw9JqxQ.png" /><figcaption>16 bytes for PZD1 and 16bytes for PZD2 = 32Bytes or 2 Words</figcaption></figure><p>Let`s refer to a case with another machinery maker which I found very straightforward for understanding. Danfoss Drives provide an option to see the Ready status of the drive, like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2PGBgUfPGa0vGE41DFIXbQ.jpeg" /></figure><p>Value of 127 here is represented in Decimal. To make it a good example, we assume that the shown Ready status is equal to 126. Let’s convert it to Binary by means of an online calculator:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*7DUd0VJaErZNjq7eFBuOlQ.png" /><figcaption>Seven bits : 1111110.</figcaption></figure><p>According to the Danfoss instruction for the exact drive model, we see that bits from 0 to 6 (7 bits total) are corresponding to certain statements, such as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*081ptVa-SVBufZDsIwNLxw.png" /></figure><p>So, in our case status 1111110 means that Bit6 Start Allowed is Low (0) which means that Start IS NOT allowed by the Software. Very handy feature for quick drive diagnoses.</p><p>The same feature exists in Siemens G120 Drives, where Actual Status Word 1 (r0052.0…15) represents the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*Zg2JpaYvP7ZJQXSJFdwbuw.png" /></figure><p>Coming back to PLC-Drive communication in TIA Portal we observe the same scenario — each bit of a Word represents certain state or command. Sum of bits build a general message (a.k.a. Telegram) of the Status or Control Word.</p><p>Words which are transferred back and forth between devices are called Telegrams. For Simple drive control, usually, Telegram No1 is used.</p><p>How does it look like in a Program Code?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*zkIbWZupv3anYZpXcM1v-g.png" /></figure><p>1.Do not be confused by HWIDSTW and HWIDZSV: they are just Hardware identifiers which are system constants for each interface, you can check them in PLC Tags submenu.</p><p>2.Why do we need RefSpeed input? Because Speed setpoint value must be within a range (e.g. 0–1800), with that said the program block scales the Set Point value before sending a value to the VFD. Below is a piece of code of the Sina_Speed block which reflects SpeedSP and RefSpeed relation:</p><pre>IF #RefSpeed &lt;&gt; 0 THEN<br>  // Scale SpeedSp to be in range of 0-100% (16384)<br>  #prVelocity := #SpeedSp * (16384.0 / #RefSpeed);<br>  // Limit REAL - Variable to INT - Limits<br>  IF #prVelocity &gt; 32767 THEN<br>    #prVelocity := 32767;<br>  ELSE #prVelocity &lt; -32768 THEN<br>    #prVelocity := -32768;<br>  END_IF;</pre><p>Why 16384? Many drives use 4000 Hex (16384 decimal) as a 100% scale, as 14-bit resolution of the Analogue Module.</p><p>Since I mentioned analogue modules, here are few words about Analog signal scaling: In the PLC, <em>Norm_x</em> and <em>Scale_x</em> are used to convert a processed value into engineering units.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vcZCcr_3VMirlBMH4a4bDQ.png" /></figure><p>For speed, let’s say Speed Setpoint = 1100 rpm. Set 0 to +16384 for the NORM_X min/max. Output of NORM_X goes to input of SCALE_X, with min=0.0, max = 1500 (reference speed)</p><p>Same process for torque, current, voltage etc. Analogue Signal Scaling should be discussed separately in more details.</p><p>2.1. RefSpeed may be a maximum motor speed. So, you may refer to motor`s nameplate. Reference and maximum speeds are not required to be the same values, but they should be at least as big as the large possible value for the exact machinery.</p><p>For example, max rpm might be 4000, but reference speed might be 4500 or 5000 rpm.</p><p>3. How do you create Sina_Speed block? So-called Sina_Speed block is a part of Siemens Drive library. Already created by Siemens and available for users within the software.</p><p>Now we can use Sina_speed inputs and outputs in our logic to be able to control the drive: create drive operation sequence, design and configure HMI etc.</p><p>But what if we are not fluent in programming but we need to perform a VFD and Profibus function tests? For testing purpose Watch and Force tables are used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aUlE2dm-Arc4B_JfZUPpsA.png" /><figcaption>You can Modify and Monitor actual values in real time</figcaption></figure><p>Coming back to Sina_Speed, you can see an input called ConfigAxis which is set 16#003F. This value is set in Hexadecimal representation to facilitate reading and modifying of this parameter. Before going into ConfigAxis meaning, we should briefly go through the Hexadecimal values in TIA Portal. In my LinkedIn profile I posted (in December 2023) some thoughts about Hex, so I add it in here:</p><p>“The Importance of Hexadecimal Representation.</p><p>ABB Variable Frequency Drives (VFDs) offer a handy feature that I use frequently: the ability to view I/O status on the display in the form of binary code.<br>The concept of binary representation of discrete data is familiar to professionals. However, when delving into VFD-PLC communication, questions arise. For instance, if there are 10 Digital Inputs or 10 discrete alarms, should one create 10 individual Boolean-type tags in the code? How can such a waste of time be avoided?<br>Let’s consider the scenario of creating an HMI to visualize VFD alarms. To simplify programming and save time, we use a Word data type, grouping 16 bits together. We can assign 16 different alarms to bits 0 to 15 within this Word.<br>Let’s name our Word %MW300. Each bit in this Word is represented as %M300.0, %M300.1 …%M300.15.<br>Assume we have 12 different alarms. Alarm No1 is assigned to trigger bit No0 of the Word, alarm No2 to bit No1, and so on.<br>As a result, if alarms 2, 3, and 5 are active, %MW300 will appear as: 0000000000010110. Using a converter, we find that in Hex it is 16, and in Decimal, it is 22. But what if more alarms are programmed?<br>Then 0110110001011011 in Hex is 6C5B, and in Decimal, it is 27739.<br>You can observe the trend: by using Hexadecimal representation, you can easily divide 16 bits into groups and obtain 2 bytes (in our case, 6C and 5B). The utility becomes even more apparent for DoubleWord data consisting of 4 bytes or 32 bits: 8D1E617C versus 10001101000111100110000101111100.<br>We create an alarm trigger tag in the PLC where we can store 16 alarms for a Word or 32 alarms for a DoubleWord. Now, the transfer of alarm data between the Drive and HMI (via PLC) will occur via this trigger tag instead of 16 or 32 individual Boolean-type tags.<br>Time saved. No waste of memory. Easy to convert back to Binary if required.”</p><p>With that said, the standard assignment <em>16#003F</em> of the input parameter “configAxis” is designed in such a way that only the existing input parameter “EnableAxis” must be set to move the axis (to start the VFD). It means that we are free to create custom configuration for moving the axis, obviously referring to the maker`s specifications.</p><p>If we move away from Siemens and imagine that we work in another software (e.g. Schneider Machine Expert or any), we might find out the absence of Sina_Speed or similar block. But with understanding of the comms principle , it will result in less challenging issue.</p><p>To be continued.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=00a8af8e179f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>