<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Siemen PLC S7 - HaiNH</title>
	<atom:link href="https://hainh.dev/tag/siemen-plc-s7/feed/" rel="self" type="application/rss+xml" />
	<link>https://hainh.dev</link>
	<description></description>
	<lastBuildDate>Wed, 16 Jan 2019 15:01:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://hainh.dev/wp-content/uploads/2025/10/cropped-logomyblog-32x32.png</url>
	<title>Siemen PLC S7 - HaiNH</title>
	<link>https://hainh.dev</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">249252746</site>	<item>
		<title>Sử dụng NetToPLCsim truyền thông PLCSIM qua mạng Ethernet</title>
		<link>https://hainh.dev/su-dung-nettoplcsim-truyen-thong-plcsim-qua-mang-ethernet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=su-dung-nettoplcsim-truyen-thong-plcsim-qua-mang-ethernet</link>
					<comments>https://hainh.dev/su-dung-nettoplcsim-truyen-thong-plcsim-qua-mang-ethernet/#comments</comments>
		
		<dc:creator><![CDATA[NGUYỄN HOÀNG HẢI]]></dc:creator>
		<pubDate>Wed, 16 Jan 2019 15:01:48 +0000</pubDate>
				<category><![CDATA[Công cụ hỗ trợ]]></category>
		<category><![CDATA[công cụ]]></category>
		<category><![CDATA[IoT]]></category>
		<category><![CDATA[S7.NET]]></category>
		<category><![CDATA[Siemen PLC S7]]></category>
		<guid isPermaLink="false">https://hainh2k3.com/?p=2309</guid>

					<description><![CDATA[<p>Hiện tại mình đang sử dụng win 10, lại cũng không phải lúc nào cũng có thiết bị plc thật để test việc kết nối truyền thông dữ liệu giữa plc và máy tính. Giải pháp của mình là sử dụng máy ảo cài win 7 để lập trình trên step7 đổ dữ liệu vào...</p>
<p>The post <a href="https://hainh.dev/su-dung-nettoplcsim-truyen-thong-plcsim-qua-mang-ethernet/">Sử dụng NetToPLCsim truyền thông PLCSIM qua mạng Ethernet</a> first appeared on <a href="https://hainh.dev">HaiNH</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Hiện tại mình đang sử dụng win 10, lại cũng không phải lúc nào cũng có thiết bị plc thật để test việc kết nối truyền thông dữ liệu giữa plc và máy tính. Giải pháp của mình là sử dụng máy ảo cài win 7 để lập trình trên step7 đổ dữ liệu vào plcsim sau đó sử dụng NetToPLCsim để có thể truyền thông PLCSIM sang máy thật hoặc sang một máy tính khác việc nhận và gửi dữ liệu. Các bạn có thể tham khảo và tải NetToPLCsim tại địa chỉ <a href="http://nettoplcsim.sourceforge.net/" target="_blank" rel="noopener">http://nettoplcsim.sourceforge.net/</a> . Chú ý chương trình yêu cầu .NET 4.0 để chạy.</p>
<p>Nếu port 102 được sử dụng thì nó sẽ thông báo như dưới đây, bấm Yes để chương trình kiểm soát được port 102, chú ý chạy chương trình với quyền Administrator nhé</p>
<p><img fetchpriority="high" decoding="async" data-attachment-id="2310" data-permalink="https://hainh.dev/su-dung-nettoplcsim-truyen-thong-plcsim-qua-mang-ethernet/plcsim1/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim1.png" data-orig-size="485,280" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="plcsim1" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim1-300x173.png" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim1.png" class="size-full wp-image-2310 alignnone" src="https://hainh.dev/wp-content/uploads/2019/01/plcsim1.png" alt="" width="485" height="280" srcset="https://hainh.dev/wp-content/uploads/2019/01/plcsim1.png 485w, https://hainh.dev/wp-content/uploads/2019/01/plcsim1-300x173.png 300w" sizes="(max-width: 485px) 100vw, 485px" /></p>
<p>Chương trình báo như này là OK</p>
<p><img decoding="async" data-attachment-id="2311" data-permalink="https://hainh.dev/su-dung-nettoplcsim-truyen-thong-plcsim-qua-mang-ethernet/plcsim2/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim2.png" data-orig-size="608,293" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="plcsim2" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim2-300x145.png" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim2.png" class="size-full wp-image-2311 alignnone" src="https://hainh.dev/wp-content/uploads/2019/01/plcsim2.png" alt="" width="608" height="293" srcset="https://hainh.dev/wp-content/uploads/2019/01/plcsim2.png 608w, https://hainh.dev/wp-content/uploads/2019/01/plcsim2-300x145.png 300w" sizes="(max-width: 608px) 100vw, 608px" /></p>
<p>Chạy NetToPLCsim bấm Add và cấu hình như hình dưới đây</p>
<p><img decoding="async" data-attachment-id="2312" data-permalink="https://hainh.dev/su-dung-nettoplcsim-truyen-thong-plcsim-qua-mang-ethernet/plcsim3/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim3.jpg" data-orig-size="1396,827" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="plcsim3" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim3-300x178.jpg" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim3-1024x607.jpg" class="aligncenter size-full wp-image-2312" src="https://hainh.dev/wp-content/uploads/2019/01/plcsim3.jpg" alt="" width="1396" height="827" srcset="https://hainh.dev/wp-content/uploads/2019/01/plcsim3.jpg 1396w, https://hainh.dev/wp-content/uploads/2019/01/plcsim3-300x178.jpg 300w, https://hainh.dev/wp-content/uploads/2019/01/plcsim3-1024x607.jpg 1024w, https://hainh.dev/wp-content/uploads/2019/01/plcsim3-768x455.jpg 768w" sizes="(max-width: 1396px) 100vw, 1396px" /></p>
<p>Tiếp theo thực hiện như hình dưới, chú ý nhớ chạy PLCSIM và chọn PLCSIM (<strong>TCP/IP</strong> )</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2314" data-permalink="https://hainh.dev/su-dung-nettoplcsim-truyen-thong-plcsim-qua-mang-ethernet/plcsim4/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim4.jpg" data-orig-size="1401,824" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="plcsim4" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim4-300x176.jpg" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim4-1024x602.jpg" class="aligncenter size-full wp-image-2314" src="https://hainh.dev/wp-content/uploads/2019/01/plcsim4.jpg" alt="" width="1401" height="824" srcset="https://hainh.dev/wp-content/uploads/2019/01/plcsim4.jpg 1401w, https://hainh.dev/wp-content/uploads/2019/01/plcsim4-300x176.jpg 300w, https://hainh.dev/wp-content/uploads/2019/01/plcsim4-1024x602.jpg 1024w, https://hainh.dev/wp-content/uploads/2019/01/plcsim4-768x452.jpg 768w" sizes="(max-width: 1401px) 100vw, 1401px" /></p>
<p>Bấm Start Server, ta để ý IP tại cột Network address chính là địa chỉ IP truyền thông qua mạng Ethernet</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2315" data-permalink="https://hainh.dev/su-dung-nettoplcsim-truyen-thong-plcsim-qua-mang-ethernet/plcsim5/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim5.jpg" data-orig-size="611,297" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="plcsim5" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim5-300x146.jpg" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim5.jpg" class="size-full wp-image-2315 alignnone" src="https://hainh.dev/wp-content/uploads/2019/01/plcsim5.jpg" alt="" width="611" height="297" srcset="https://hainh.dev/wp-content/uploads/2019/01/plcsim5.jpg 611w, https://hainh.dev/wp-content/uploads/2019/01/plcsim5-300x146.jpg 300w" sizes="(max-width: 611px) 100vw, 611px" /></p>
<p>Dưới đây là ví dụ về đoạn code mình viết bằng C# kết nối tới con PLCSIM trên kia từ máy thật tới máy ảo. Chú ý IP kết nối dưới kia là của máy 192.168.0.170</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2317" data-permalink="https://hainh.dev/su-dung-nettoplcsim-truyen-thong-plcsim-qua-mang-ethernet/plcsim6/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim6.jpg" data-orig-size="1303,749" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="plcsim6" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim6-300x172.jpg" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/plcsim6-1024x589.jpg" class="aligncenter size-full wp-image-2317" src="https://hainh.dev/wp-content/uploads/2019/01/plcsim6.jpg" alt="" width="1303" height="749" srcset="https://hainh.dev/wp-content/uploads/2019/01/plcsim6.jpg 1303w, https://hainh.dev/wp-content/uploads/2019/01/plcsim6-300x172.jpg 300w, https://hainh.dev/wp-content/uploads/2019/01/plcsim6-1024x589.jpg 1024w, https://hainh.dev/wp-content/uploads/2019/01/plcsim6-768x441.jpg 768w" sizes="(max-width: 1303px) 100vw, 1303px" /></p>
<p>Hãy thử kết quả dưới đây, kết nối giữa máy thật và máy ảo, hoặc có thể từ máy khác trong cùng hệ thống mạng.</p>
<p>Chương trình đếm số lần tín hiệu từ <strong>I</strong>0.0 set ON và đưa vào địa chỉ nhớ <strong>MW2, </strong>máy tính kết nối và đọc 2 giá trị đó.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2318" data-permalink="https://hainh.dev/su-dung-nettoplcsim-truyen-thong-plcsim-qua-mang-ethernet/net2plcsim/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/net2plcsim.gif" data-orig-size="1905,1015" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="net2plcsim" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/net2plcsim-300x160.gif" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/net2plcsim-1024x546.gif" class="aligncenter size-full wp-image-2318" src="https://hainh.dev/wp-content/uploads/2019/01/net2plcsim.gif" alt="" width="1905" height="1015" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p><p>The post <a href="https://hainh.dev/su-dung-nettoplcsim-truyen-thong-plcsim-qua-mang-ethernet/">Sử dụng NetToPLCsim truyền thông PLCSIM qua mạng Ethernet</a> first appeared on <a href="https://hainh.dev">HaiNH</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://hainh.dev/su-dung-nettoplcsim-truyen-thong-plcsim-qua-mang-ethernet/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2309</post-id>	</item>
		<item>
		<title>Tui học lập trình Siemen PLC–S7-300 truy cập vùng nhớ</title>
		<link>https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-truy-cap-vung-nho/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tui-hoc-lap-trinh-siemen-plc-s7-300-truy-cap-vung-nho</link>
					<comments>https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-truy-cap-vung-nho/#comments</comments>
		
		<dc:creator><![CDATA[NGUYỄN HOÀNG HẢI]]></dc:creator>
		<pubDate>Mon, 14 Jan 2019 11:33:03 +0000</pubDate>
				<category><![CDATA[Lập trình ứng dụng]]></category>
		<category><![CDATA[IoT]]></category>
		<category><![CDATA[Siemen PLC S7]]></category>
		<guid isPermaLink="false">https://hainh2k3.com/?p=2279</guid>

					<description><![CDATA[<p>Địa chỉ ô nhớ trong PLC S7-300 bao gồm hai thành phần: phần chữ và phần số. Truy nhập theo byte: Bao gồm các kiểu Byte (1 byte), Word (2 byte), Double word (4 byte) Quy cách: Tên vùng nhớ, kích thước, địa chỉ byte đầu tiên Vùng nhớ các đầu vào I: &#8211; Tại...</p>
<p>The post <a href="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-truy-cap-vung-nho/">Tui học lập trình Siemen PLC–S7-300 truy cập vùng nhớ</a> first appeared on <a href="https://hainh.dev">HaiNH</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Địa chỉ ô nhớ trong PLC S7-300 bao gồm hai thành phần: phần chữ và phần số.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2280" data-permalink="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-truy-cap-vung-nho/s7-truy-cap-vung-nho/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/s7-truy-cap-vung-nho.jpg" data-orig-size="262,45" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="s7 truy cap vung nho" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/s7-truy-cap-vung-nho.jpg" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/s7-truy-cap-vung-nho.jpg" class="aligncenter size-full wp-image-2280" src="https://hainh.dev/wp-content/uploads/2019/01/s7-truy-cap-vung-nho.jpg" alt="" width="262" height="45" /></p>
<p id="id5780333" class="para">Truy nhập theo byte: Bao gồm các kiểu Byte (1 byte), Word (2 byte), Double word (4 byte)</p>
<p class="para">Quy cách: Tên vùng nhớ, kích thước, địa chỉ byte đầu tiên</p>
<h3><span style="color: #339966;">Vùng nhớ các đầu vào I:</span></h3>
<p>&#8211; Tại thời điểm đầu tiên mỗi vòng quét PLC lấy tín hiệu từ các đầu vào và ghi các giá trị tương ứng vào vùng nhớ đầu vào.</p>
<p>&#8211; Truy nhập: Kiểu: Bit I[địa chỉ byte].[địa chỉ bit] I0.1</p>
<p>Byte, word, Double word I[kích thước][địa chỉ byte đầu tiên]</p>
<p>Ví dụ: IB4, IW1, ID2</p>
<h3><span style="color: #339966;">Vùng nhớ các đầu ra Q:</span></h3>
<p>&#8211; Trong quá trình thực hiện các công việc trong một vòng quét (bao gồm cả chương trình điều khiển), PLC sẽ ghi các giá trị tơơng ứng của các vào vùng nhớ này, cuối vòng quét PLC sẽ gửi các giá trị này đến các đầu ra tương ứng.</p>
<p>&#8211; Truy nhập: Kiểu: Bit Q[địa chỉ byte].[địa chỉ bit] Q0.0</p>
<p>Byte, word, Double word Q[kích thước][địa chỉ byte đầu tiên]</p>
<p>Ví dụ: QB2, QW1, QD4</p>
<h3><span style="color: #339966;">Vùng nhớ M:</span></h3>
<p>&#8211; Các ô nhớ thuộc vùng nhớ (M) dùng để lơu trữ trạng thái của quá trình hoạt động hoặc các thông tin điều khiển khác.</p>
<p>&#8211; Truy nhập:Kiểu: Bit M[địa chỉ byte].[địa chỉ bit] M10.1</p>
<p>Byte, Word, Double word M[kích thước][địa chỉ byte đầu tiên]</p>
<p>Ví dụ: MB20, MW8, MD6</p>
<h3><span style="color: #339966;">Vùng nhớ thời gian T</span></h3>
<p>&#8211; Mỗi bộ thời gian có hai giá trị được lưu trữ trong vùng nhớ T: Giá trị đếm thời gian hiện tại (16 bit), và giá trị bit timer (1 bit).</p>
<p>&#8211; Truy nhập: T [số thứ tự bộ timer] T3</p>
<h3><span style="color: #339966;">Vùng nhớ bộ đếm C:</span></h3>
<p>&#8211; Mỗi bộ đếm có hai giá trị được lơu trữ trong vùng nhớ C: Giá trị đếm hiện tại (kiểu BDC, 12 bit), và giá trị bit counter (1 bit).</p>
<p>&#8211; Truy nhập: C [số thứ tự bộ timer] C1</p>
<h3><span style="color: #339966;">Vùng nhớ các đầu vào, đầu ra Analog AI, AQ:</span></h3>
<p>&#8211; PLC chuyển đổi một giá trị điện áp (hoặc dòng điện) thành một số nhị phân (12 bit) lưu trữ trong vùng nhớ analog (hoặc ngược lại).</p>
<p>&#8211; Cách truy nhập với tín hiệu vào: PI[kích thước][địa chỉ byte đầu tiên]</p>
<p>Ví dụ: Truy nhập: Kiểu: Byte, Word, Double word</p>
<p>PIB20, PIW8, PID6</p>
<p>&#8211; Cách truy nhập với tín hiệu ra: PQ[kích thước][địa chỉ byte đầu tiên]</p>
<p>Ví dụ: Truy nhập: Kiểu: Byte, Word, Double word</p>
<p>PQB20, PQW8, PQD6</p>
<h3><span style="color: #339966;">Vùng nhớ của các khối dữ liệu DB:</span></h3>
<p>&#8211; Mở khối dữ liệu DB hoặc DI bằng lệnh OPN</p>
<p>Ví dụ: OPN DB 1 // Mở khối dữ liệu DB (Open data Block)</p>
<p>Hoặc OPN DI 1 // Mở khối dữ liệu DI (Open instance data Block)</p>
<p>&#8211; Mở một bít trong khối dữ liệu DBX</p>
<p>Ví dụ: A DB3.DB 0.5 // mở bit số 5 của byte 0 trong khối dữ liệu DB3</p>
<p>&#8211; Mở một Byte, một WORD hoặc một một DW trong khối dữ liệu DBx</p>
<p>Ví dụ: L DB3. DBB2 // chỉ tới Byte 2 trong khối dữ liệu DB3</p>
<p>L DB3. DBW2 // chỉ tới WORD 2 trong khối dữ liệu DB3</p>
<p>L DB. DBD2 // chỉ tới DWORD 2 trong khối dữ liệu DB3</p>
<h3><span style="color: #339966;">Vùng nhớ trong các khối chương trình OB, FBx và FCx</span></h3>
<p>&#8211; Chỉ 1 bit</p>
<p>Ví dụ: A L0.2// chỉ bít số 2 của Byte 0 trong miền dữ liệu địa phương</p>
<p>&#8211; Chỉ một Byte, Word hoặc DW</p>
<p>Ví dụ: L LB0 // chỉ byte 0 trong miền dữ liệu địa phương</p>
<p>L LW0 // chỉ Word 0 trong miền dữ liệu địa phương</p>
<p>L LD0 // chỉ DWord 0 trong miền dữ liệu địa phương</p><p>The post <a href="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-truy-cap-vung-nho/">Tui học lập trình Siemen PLC–S7-300 truy cập vùng nhớ</a> first appeared on <a href="https://hainh.dev">HaiNH</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-truy-cap-vung-nho/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2279</post-id>	</item>
		<item>
		<title>Tui học lập trình Siemen PLC–S7-300 các vùng nhớ</title>
		<link>https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-cac-vung-nho/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tui-hoc-lap-trinh-siemen-plc-s7-300-cac-vung-nho</link>
					<comments>https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-cac-vung-nho/#respond</comments>
		
		<dc:creator><![CDATA[NGUYỄN HOÀNG HẢI]]></dc:creator>
		<pubDate>Mon, 14 Jan 2019 11:21:48 +0000</pubDate>
				<category><![CDATA[Lập trình ứng dụng]]></category>
		<category><![CDATA[IoT]]></category>
		<category><![CDATA[Siemen PLC S7]]></category>
		<guid isPermaLink="false">https://hainh2k3.com/?p=2276</guid>

					<description><![CDATA[<p>Toàn bộ chương trình của Siemen PLC–S7-300 được lưu trong bộ nhớ dưới dạng các khối chương trình (OB, FC, FB..) và được thực hiện với chu kỳ quét. Vùng chứa chương trình ứng dụng: OB (Organization Block): chứa chương trình chính. FC ( Function): Chứa chương trình chính được tổ chức thành hành và...</p>
<p>The post <a href="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-cac-vung-nho/">Tui học lập trình Siemen PLC–S7-300 các vùng nhớ</a> first appeared on <a href="https://hainh.dev">HaiNH</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Toàn bộ chương trình của Siemen PLC–S7-300 được lưu trong bộ nhớ dưới dạng các khối chương trình (OB, FC, FB..) và được thực hiện với chu kỳ quét.</p>
<h3><span style="color: #339966;">Vùng chứa chương trình ứng dụng:</span></h3>
<ul>
<li><strong>OB (Organization Block)</strong>: chứa chương trình chính.</li>
<li><strong>FC ( Function)</strong>: Chứa chương trình chính được tổ chức thành hành và có khả năng trao đổi dữ liệu với bất kỳ 1 khối chương trình nào khác. Các dữ liệu này phải được xây dựng thành một khối liệu riêng.</li>
<li><strong>FB ( function Block)</strong>: chứa chương trình chính được tổ chức thành hàm và có khả năng trao đổi dữ liệu với bất kỳ 1 khối chương trình nào khác.Các dữ liệu này phải được xây dựng thành 1 khối dữ liệu riêng.</li>
</ul>
<h3><span style="color: #339966;">Vùng chứa tham số hệ số điều hành và chương trình ứng dụng:</span></h3>
<ul>
<li><strong>I ( process image input)</strong> : Miền dữ liệu các cổng vào số, trước khi bắt đầu thực hiện chương trình, PLC sẽ đọc giá trị logic của tất cả các cổng đầu vào và cất chúng trong 1 vùng nhớ I. Thông thường chương trình ứng dụng không đọc trực tiếp trạng thái logic của cổng vào số mà chỉ lấy dữ liệu của tổng và từ bộ đệm I.</li>
<li><strong>Q (process Image Output)</strong>: Miền bộ đệm các dữ liệu cổng ra số. Kết thúc giai đoạn thực hiện chương trình, PLC sẽ chuyển giá trị logic của bộ đệm Q tới các cổng ra số. Thông thường chương trình không trực tiếp gần giá trị tới tận cổng ra mà chỉ chuyển chúng tới bộ đệm Q.</li>
<li><strong>M ( Miền các biến cờ)</strong> : Chương trình ứng dụng sử dụng những biến này để lưu giữ các tham số cần thiết và có thể truy nhập nó theo Bit, Byte, Word hay Double Word.</li>
<li><strong>T (Timer)</strong> : Miền nhớ phục vụ bộ thời gian bao gồm việc lưu trữ giá trị thời gian đặt trước, giá trị đến thời gian tức thời cũng như giá trị logic đầu ra của bộ thời gian.</li>
<li><strong>C (Counter)</strong> : Miền nhớ phục vụ bộ đếm bao gồm việc lưu trữ giá trị đặt trước, giá trị đến tức thời và giá trị logic đầu ra của bộ đệm.</li>
<li><strong>PI</strong>: Miền địa chỉ cổng vào của các module tự. Các giá trị tương tự tại cổng vào của module tương tự sẽ được module đọc và chuyển tự động theo địa chỉ. Chương trình ứng dụng có thể truy cập miền nhớ PI theo Byte, từng từ PIW hoặc PID.</li>
<li><strong>PQ</strong>: Miền địa chỉ cổng ra cho các module tương tự. Các giá trị theo những những địa chỉ này sẽ được module tương tự chuyển tới các cổng ra tương tự. Chương trình ứng dụng có thể truy nhập miền nhớ PQ theo Byte( PQB) từng từ (PQW )hoặc theo từng từ kép (PQD).</li>
</ul>
<h3><span style="color: #339966;">Vùng chứa dữ liệu:</span></h3>
<ul>
<li><strong>DB (Data Block)</strong>: Miền chứa dữ liệu được tổ chức thành khối. Kích thước cũng như số lượng khối do người sử dụng quy định, Phù hợp với từng bài toán điều khiển. Chương trình có thể truy nhập miền này theo theo từng bit (DBX), byte (DBB), từ (DBW) hoặc từ kép (DBD).</li>
<li><strong>L (local data block)</strong>: Miền dữ liệu địa phương, được các khối chương trình OB, FC, FB tổ chức và sử dụng cho các biến nháp tức thời và trao đổi dữ liệu của biến hình thức với khối lượng chương trình gọi nó. Toàn bộ vùng nhớ sẽ bị xóa sau khi khối khối lượng thực hiện xong. Có thể truy nhập theo từng bit( L), byte( LB), từ ( LW), hoặc từ kép (LD).</li>
</ul>
<p>&nbsp;</p><p>The post <a href="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-cac-vung-nho/">Tui học lập trình Siemen PLC–S7-300 các vùng nhớ</a> first appeared on <a href="https://hainh.dev">HaiNH</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-cac-vung-nho/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2276</post-id>	</item>
		<item>
		<title>Tui học lập trình Siemen PLC–S7-300 Hello word</title>
		<link>https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word</link>
					<comments>https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word/#respond</comments>
		
		<dc:creator><![CDATA[NGUYỄN HOÀNG HẢI]]></dc:creator>
		<pubDate>Mon, 14 Jan 2019 06:11:29 +0000</pubDate>
				<category><![CDATA[Lập trình ứng dụng]]></category>
		<category><![CDATA[IoT]]></category>
		<category><![CDATA[Siemen PLC S7]]></category>
		<guid isPermaLink="false">https://hainh2k3.com/?p=2261</guid>

					<description><![CDATA[<p>Mình là dân IT Software nên về điện đóm, tự động hóa hoàn toàn mù mịt, nhưng hiện tại mình lập trình các dự án liên quan nhiều đến việc nhận dữ liệu truyền thông từ plc lên máy tính. Bởi vậy mình bắt buộc phải biết cấu trúc dữ liệu của plc hay các...</p>
<p>The post <a href="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word/">Tui học lập trình Siemen PLC–S7-300 Hello word</a> first appeared on <a href="https://hainh.dev">HaiNH</a>.</p>]]></description>
										<content:encoded><![CDATA[<p style="text-align: justify;">Mình là dân IT Software nên về điện đóm, tự động hóa hoàn toàn mù mịt, nhưng hiện tại mình lập trình các dự án liên quan nhiều đến việc nhận dữ liệu truyền thông từ plc lên máy tính. Bởi vậy mình bắt buộc phải biết cấu trúc dữ liệu của plc hay các chương trình chạy như nào để còn nắm bắt được vấn đề. Hôm nay mình sẽ note lại cách mà mình tạo 1 project và hello word với thứ mới mẻ này nhé, bỏ qua cách cài đặt thì nó quá đơn giản rồi.</p>
<h3><strong>1. Khởi động Simatic Manager và chọn File -&gt; New. </strong></h3>
<p>Nhập tên project tại ô name: hello word -&gt; ok</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2262" data-permalink="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word/s7-helloword-1/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-1.jpg" data-orig-size="901,617" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="s7 helloword 1" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-1-300x205.jpg" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-1.jpg" class="aligncenter size-full wp-image-2262" src="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-1.jpg" alt="" width="901" height="617" srcset="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-1.jpg 901w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-1-300x205.jpg 300w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-1-768x526.jpg 768w" sizes="(max-width: 901px) 100vw, 901px" /></p>
<h3><strong>2. Khai báo trạm làm</strong> việc<strong> PLC</strong></h3>
<p>Vào menu Insert -&gt; Station -&gt; SIMATIC 300 Station</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2263" data-permalink="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word/s7-helloword-2/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-2.jpg" data-orig-size="902,620" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="s7 helloword 2" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-2-300x206.jpg" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-2.jpg" class="aligncenter size-full wp-image-2263" src="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-2.jpg" alt="" width="902" height="620" srcset="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-2.jpg 902w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-2-300x206.jpg 300w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-2-768x528.jpg 768w" sizes="(max-width: 902px) 100vw, 902px" /></p>
<p><img loading="lazy" decoding="async" data-attachment-id="2264" data-permalink="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word/s7-helloword-3/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-3.jpg" data-orig-size="901,620" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="s7 helloword 3" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-3-300x206.jpg" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-3.jpg" class="aligncenter size-full wp-image-2264" src="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-3.jpg" alt="" width="901" height="620" srcset="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-3.jpg 901w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-3-300x206.jpg 300w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-3-768x528.jpg 768w" sizes="(max-width: 901px) 100vw, 901px" /></p>
<h3>3. Thiết lập phần cứng cho trạm</h3>
<p>Bấm chọn Hardware để hiển thị danh sách các phần cứng.</p>
<p>Chọn SIMATIC 300 -&gt; RACK-300 -&gt; Rail</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2265" data-permalink="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word/s7-helloword-4/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-4.jpg" data-orig-size="973,622" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="s7 helloword 4" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-4-300x192.jpg" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-4.jpg" class="aligncenter size-full wp-image-2265" src="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-4.jpg" alt="" width="973" height="622" srcset="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-4.jpg 973w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-4-300x192.jpg 300w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-4-768x491.jpg 768w" sizes="(max-width: 973px) 100vw, 973px" /></p>
<p>Chọn nguồn PS-300 -&gt; PS 307 5A</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2266" data-permalink="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word/s7-helloword-5/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-5.jpg" data-orig-size="972,621" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="s7 helloword 5" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-5-300x192.jpg" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-5.jpg" class="aligncenter size-full wp-image-2266" src="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-5.jpg" alt="" width="972" height="621" srcset="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-5.jpg 972w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-5-300x192.jpg 300w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-5-768x491.jpg 768w" sizes="(max-width: 972px) 100vw, 972px" /></p>
<p>Chọn CPU -&gt; CPU &#8211; 300 -&gt; CPU 313C-2 DP -&gt; 6ES7 313-6CE00-0AB0 -&gt; ok</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2267" data-permalink="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word/s7-helloword-6/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-6.jpg" data-orig-size="969,616" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="s7 helloword 6" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-6-300x191.jpg" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-6.jpg" class="aligncenter size-full wp-image-2267" src="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-6.jpg" alt="" width="969" height="616" srcset="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-6.jpg 969w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-6-300x191.jpg 300w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-6-768x488.jpg 768w" sizes="(max-width: 969px) 100vw, 969px" /></p>
<p>Khai báo tham số cho trạm<br />
Chọn đầu vào, ra logic, khai báo<br />
Chọn AI/AO, khai báo<br />
Chọn Count,&#8230;</p>
<p>Click dub vào D/12/DO16 để cấu hình input, output tại tab Address -&gt; ok<img loading="lazy" decoding="async" data-attachment-id="2268" data-permalink="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word/s7-helloword-7/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-7.jpg" data-orig-size="971,618" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="s7 helloword 7" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-7-300x191.jpg" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-7.jpg" class="aligncenter size-full wp-image-2268" src="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-7.jpg" alt="" width="971" height="618" srcset="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-7.jpg 971w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-7-300x191.jpg 300w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-7-768x489.jpg 768w" sizes="(max-width: 971px) 100vw, 971px" /></p>
<h3>4. Lập trình PLC &#8211; OB</h3>
<p>Chọn S7 Program -&gt; Blocks , -&gt; Insert New Object -&gt; Organization Block</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2270" data-permalink="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word/s7-helloword-9/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-9.jpg" data-orig-size="901,616" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="s7 helloword 9" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-9-300x205.jpg" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-9.jpg" class="aligncenter size-full wp-image-2270" src="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-9.jpg" alt="" width="901" height="616" srcset="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-9.jpg 901w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-9-300x205.jpg 300w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-9-768x525.jpg 768w" sizes="(max-width: 901px) 100vw, 901px" /></p>
<p>Name: OB1, Created in Language: LAD -&gt; ok</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2269" data-permalink="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word/s7-helloword-8/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-8.jpg" data-orig-size="901,614" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="s7 helloword 8" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-8-300x204.jpg" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-8.jpg" class="aligncenter size-full wp-image-2269" src="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-8.jpg" alt="" width="901" height="614" srcset="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-8.jpg 901w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-8-300x204.jpg 300w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-8-768x523.jpg 768w" sizes="(max-width: 901px) 100vw, 901px" /></p>
<p>Tạo 1 network như dưới đây</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2271" data-permalink="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word/s7-helloword-10/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-10.jpg" data-orig-size="927,627" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="s7 helloword 10" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-10-300x203.jpg" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-10.jpg" class="aligncenter size-full wp-image-2271" src="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-10.jpg" alt="" width="927" height="627" srcset="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-10.jpg 927w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-10-300x203.jpg 300w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-10-768x519.jpg 768w" sizes="(max-width: 927px) 100vw, 927px" /></p>
<h3>5. Chạy chương trình giả lập PLC-SIM</h3>
<p>Giờ code đã có, chỉ cần máy ảo để chạy thử xem thế nào. Tích vào biểu tượng giống hình mình đã đánh giấu dưới đây hoặc vào menu Options -&gt; Simunate Modules.</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2272" data-permalink="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word/s7-helloword-11/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-11.jpg" data-orig-size="902,619" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="s7 helloword 11" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-11-300x206.jpg" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-11.jpg" class="aligncenter size-full wp-image-2272" src="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-11.jpg" alt="" width="902" height="619" srcset="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-11.jpg 902w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-11-300x206.jpg 300w, https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-11-768x527.jpg 768w" sizes="(max-width: 902px) 100vw, 902px" /></p>
<h3>6. Download chương trình xuống PLC-SIM</h3>
<p>Bấm vào biểu tượng Download để đổ chương trình xuống PLC, và bấm biểu tượng Monitor để theo dõi giá trị tại cửa sổ OB1 và chọn RUN tại PLC-SIM, Bấm F2, F3 để hiển thị cửa sổ Input -&gt; Output và xem kết quả:</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2273" data-permalink="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word/s7-helloword-12/" data-orig-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-12.gif" data-orig-size="1207,737" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="s7 helloword 12" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-12-300x183.gif" data-large-file="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-12-1024x625.gif" class="aligncenter size-full wp-image-2273" src="https://hainh.dev/wp-content/uploads/2019/01/s7-helloword-12.gif" alt="" width="1207" height="737" /></p>
<p>OK, Vậy là đã hoàn thành việc hello word ! Mình sẽ tìm hiểu thêm về ngôn ngữ LAD sau vậy.</p>
<p>&nbsp;</p><p>The post <a href="https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word/">Tui học lập trình Siemen PLC–S7-300 Hello word</a> first appeared on <a href="https://hainh.dev">HaiNH</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://hainh.dev/tui-hoc-lap-trinh-siemen-plc-s7-300-hello-word/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2261</post-id>	</item>
	</channel>
</rss>
