RS485 Display Board or TCP/IP Display Board บอร์ดแสดงข้อมูลต่างๆ







RS485 Display Board or TCP/IP Display Board
เป็นระบบที่ออกแบบมา เพื่อการแสดงผลข้อมูลในแบบต่างๆ โดยระบบ RS485 หรือ TCP/IP จะใช้เป็นตัวประมวลค่าต่างที่ส่งมาจาก PLC โดยรูปแบบ PROTOCOL จะมี ASCII และ MODBUS และอื่นๆ สามารถแสดงที่ BOARD ได้ทันที ทั้งนี้ชุดข้อมูลต่างๆที่ส่งมาจะมีทั้ง Standard และ Non-Standard ขึ้นอยู่กับทางลูกค้ากำหนดมาให้ โดยลูกค้าสามารถออกแบบ BOARD ให้ตรงตามความต้องการของลูกค้า และตรงตามการใช้งานจริง
การสื่อสารผ่าน Modbus Protocol – RS485 Display Board or TCP/IP Display Board
Modbus คือ โปรโตคอล (Protocol) การสื่อสารที่พัฒนาขึ้นโดย บริษัท Modicon Systems ด้วยรูปแบบง่ายๆ เป็นรูปแบบการส่งข้อมูลระหว่างอุปกรณ์อิเล็กทรอนิกส์ อุปกรณ์ที่ต้องการข้อมูลเรียกว่า Modbus Master (Client) ส่วนอุปกรณ์ที่ให้ข้อมูลที่ต้องการเรียกว่า Modbus Slave (Server) ใน Modbus Network ที่เป็นมาตรฐานนั้นจะมี Master ตัวเดียวแต่ Slave มีได้ถึง 247 ตัว โดยแต่ละตัวจะมี ID ระบุเหมือนเลขที่บ้านตั้งแต่ 1 ถึง 247 และ Master สามารถ Write ข้อมูลไปยัง Slave ได้
Modbus เป็น Open Protocol หมายความว่า บุคคลทั่วไปสามารถพัฒนาอุปกรณ์ที่ใช้การสื่อสารแบบ Modbus โดยไม่ต้องเสียค่าใช้จ่ายใดๆ Modbus จึงเป็น Protocol พื้นฐานและนิยมใช้อย่างแพร่หลายในทุกอุตสาหกรรม โดยใช้รับส่งข้อมูลจากอุปกรณ์ควบคุมกับ Controller หรือระบบประมวลผลข้อมูลต่าง
RS485 Display Board or TCP/IP Display Board
Slave อาจเป็นอุปกรณ์ต่อพ่วงใดๆ เช่น Input/Output Transducer, วาล์ว (Valve), Inverter, อุปกรณ์บันทึกข้อมูล (Data Logger) หรืออุปกรณ์เครื่องมือวัดอื่นๆ เป็นต้น ซึ่งประมวลผลและส่งข้อมูลไปยัง Master
Master สามารถติดต่อกับ Slave แต่ละตัวได้หรือสามารถส่งเป็น Message ถึง Slave ทุกตัวได้ในลักษณะของการ Broadcast และ Slave จะตอบสนองสิ่งที่ Master ต้องการเท่านั้น สิ่งที่ Master ส่งให้จะประกอบด้วย Slave Address, Function Code (คำสั่งหรือสิ่งที่ต้องการให้ทำ), Data และ Checksum ส่วนข้อมูลที่ Slave ส่งกลับมาจะประกอบด้วยคำสั่งที่สั่งให้กระทำหรือข้อมูลต่างๆ และ Checksum
Modbus แบ่งออกเป็น Modbus Serial: ASCII/RTU (เป็นพอร์ตการสื่อสารแบบอนุกรม RS232, RS485, RS422) และ Modbus TCP/IP (LAN) เพื่อให้สอดคล้องกับแนวโน้มการพัฒนาการสื่อสารในปัจจุบันและทุกอย่างที่สามารถเชื่อมต่อกับเครือข่าย Ethernet หรือ Internet เพื่อส่งข้อมูล
RS485 Display Board or TCP/IP Display Board
Modbus Serial เป็นการสื่อสารโดยการส่งข้อมูลไปตามสายสัญญาณ Serial ระหว่างอุปกรณ์ โดยวิธีการสื่อสารที่ง่ายที่สุดคือการต่อสายสัญญาณ Serial ระหว่าง Master หนึ่งตัวกับ Slave หนึ่งตัว (Point-to-Point) ซึ่งจะเป็นการสื่อสารผ่านพอร์ต RS232 หรือ RS422หรือการต่อ Master หนึ่งตัวกับ Slave หลายตัว (Point-to-Multipoint) ซึ่งจะเป็นการสื่อสารผ่านพอร์ต RS485
การรับส่งข้อมูลด้วยโปรโตคอล Modbus Serial สามารถเลือกได้ 2 โหมด คือ โหมด ASCII และโหมด RTU ซึ่งทั้ง 2 โหมดนี้มีความแตกต่างกันที่การกำหนดรูปแบบของชุดข้อมูลภายในเฟรม จะเลือกโหมดใดก็ได้แต่มีเงื่อนไขว่าอุปกรณ์ทุกตัวที่ต่อร่วมกันอยู่ในบัสหรือเครือข่ายเดียวกัน จะต้องตั้งให้เลือกใช้โหมดเดียวกันทั้งหมด รวมถึง Serial Parameter ต่างๆ เช่น Baud Rate, Data Bit, Stop Bit และ Parity Bit
RS485 Display Board or TCP/IP Display Board
Modbus TCP/IP ถูกพัฒนาขึ้นโดยมีวัตถุประสงค์เพื่อจะนำการสื่อสารแบบ Ethernet มาใช้กับอุปกรณ์จำพวก Ethernet Device ระยะในการใช้งานสำหรับการเดินสาย (สาย LAN) คือ 100 เมตร โดยสามารถขยายระยะในการสื่อสารได้โดยการใช้อุปกรณ์ Repeater หรือในระบบ LAN จะเรียกอุปกรณ์นี้ว่า Hub หรือ Switch ก็จะสามารถลากสายได้อีก 100 เมตร และยังสามารถต่อ Repeater ขยายระยะทางได้โดยไม่จำกัด ในการสื่อสารโดยทั่วไปมีความเร็ว 100,000,000 บิตต่อวินาที (100 Mbps) และเชื่อมต่ออุปกรณ์ได้ไม่จำกัดจำนวน
สำหรับอุปกรณ์ Modbus Serial ที่จะติดต่อสื่อสารกับอุปกรณ์ Modbus TCP/IP เพื่อให้ใช้งานในเครือข่าย Ethernet จะใช้ Gateway ติดต่อและแปลงรูปแบบการสื่อสารข้อมูล โดยการสื่อสารของ Modbus Serial จะถูก Gateway แปลงให้เป็น Modbus TCP/IP เพื่อใช้ในการติดต่อสื่อสารในเครือข่าย Ethernet
ตัวอย่าง Modbus Function Codes – RS485 Display Board or TCP/IP Display Board
การร้องขอข้อมูลของ Master จะต้องระบุถึง Function Code สำหรับการเข้าถึง Modbus Register ที่ Slave รองรับให้ถูกต้อง ถ้าระบุไม่ตรงกับที่ Slave กำหนดไว้จะทำให้ Slave ไม่ส่งค่ากลับไปยัง Master โดย Modbus Function Codes มีรายละเอียดดังนี้
| Function Code | Register Type | Descriptions |
| 01 | Read Coil | แสดงสถานะของ Digital Output (0 = OFF, 1 = ON) |
| 02 | Read Discrete Input | แสดงสถานะของ Digital Input (0 = OFF, 1 = ON) |
| 03 | Read Holding Registers | แสดงค่าของ Analog Output |
| 04 | Read Input Registers | แสดงค่าของ Analog Input |
| 05 | Write Single Coil | เขียนค่ากลับไปยัง Digital Output (เขียนค่าได้ทีละ 1 Register) |
| 06 | Write Single Holding Register | เขียนค่ากลับไปยัง Analog Output (เขียนค่าได้ทีละ 1 Register) |
| 15 | Write Multiple Coils | เขียนค่ากลับไปยัง Digital Output (เขียนค่าได้ทีละหลาย Register) |
| 16 | Write Multiple Holding Registers | เขียนค่ากลับไปยัง Analog Output (เขียนค่าได้ทีละหลาย Register) |
RS485 Display Board or TCP/IP Display Board
ตัวอย่าง Protocol Sample (Protocol Format 5 Digit)
“01” : Address – device address (1 bytes)
“10” : The Function Code 16 (Preset Multiple Registers, 10 hex – 16 ) (1 bytes)
“00 00” : Data Address of the first register. (2 bytes)
“00 02” : number of registers to write (2 bytes)
“04” : number of data bytes to follow (2 registers x 2 bytes each = 4 bytes) (1 bytes)
“00 01” : The value to write to register 40001 (2 bytes)
“86 9F” : The value to write to register 40002 (2 bytes)
CRC : CRC (cyclic redundancy check) for error checking LSB MSB (2 bytes)
Note:
– data must be send to board within 60 second else board will display “disc” message
– upper case only
01 10 00 00 00 02 04 00 01 86 9F CRC (LSB MSB)
DISPLAY SHOW “99999”
Response Message OK
01 10 00 00 00 04 CRC (LSB MSB)
Response Message NOT OK
01 91 00 00 00 04 CRC (LSB MSB)
RS485 Display Board or TCP/IP Display Board
ตัวอย่าง Protocol Sample (Protocol Format 4 Digit)
“01” : Address – device address (1 bytes)
“10” : The Function Code 16 (Preset Multiple Registers, 10 hex – 16 ) (1 bytes)
“00 00” : Data Address of the first register. (2 bytes)
“00 02” : number of registers to write (2 bytes)
“04” : number of data bytes to follow (2 registers x 2 bytes each = 4 bytes) (1 bytes)
“00 00” : The value to write to register 40001 (2 bytes)
“27 0F” : The value to write to register 40002 (2 bytes)
CRC : CRC (cyclic redundancy check) for error checking LSB MSB (2 bytes)
Note:
– data must be send to board within 60 second else board will display “disc” message
– upper case only
01 10 00 00 00 02 04 00 00 27 0F CRC (LSB MSB)
DISPLAY SHOW “9999”
Response Message OK
01 10 00 00 00 04 CRC (LSB MSB)
Response Message NOT OK
01 91 00 00 00 04 CRC (LSB MSB)
RS485 Display Board or TCP/IP Display Board
ตัวอย่าง Protocol Sample
PROTOCOL FORMAT
Address – device address (1 bytes)
Starting address (2 bytes)
Quantity of Coils (2 bytes)
Function Code (1 bytes)
Byte Count (1 bytes)
Data – 7-segments data row1 (2 bytes)
CRC – LSB MSB (2 bytes)
Note:
– data must be send to board within 60 second else board will display “disc” message
– upper case only
01 10 00 00 00 01 02 04 52 CRC (LSB MSB)
RS485 Display Board or TCP/IP Display Board
ตัวอย่าง Protocol Sample
PROTOCOL FORMAT M-3368
Address – device address (1 bytes)
Starting address (2 bytes)
Quantity of Coils (2 bytes)
Byte Count (1 bytes)
Data – 7-segments data (4 bytes)
CRC – LSB MSB (2 bytes)
Note:
– data must be send to board within 60 second else board will display “disc” message
– upper case only
01 10 00 00 00 02 04 00 00 21 3D CRC (LSB MSB)



