Speak with authority, quality is trustworthy.

Using VB MSComm control PC and PLC of mitsubishi FX series communication programming

by:Coolmay     2020-08-21
The communication program of PC can use assembly language to write, or used in a variety of high-level language to write, or USES the industrial control configuration software, or the communication software of PLC manufacturer directly, Such as mitsubishi MELSE MEDOC, etc. ) Using VB6 below. 0 with a simple example to illustrate the main points of the written communication program. Assuming that the PC request read from the PLC controller from D123 four bytes of data ( D123 D124) , its transmission response process and message as shown in figure 7 16. Figure 7 - 16 transmission response process and command message message in 10 f6h address for D123, 04 h to read in the four bytes of data. Checksum SUM = 30 H + and H + 30 46 H + 36 H + H + 30 H + 34 H + 3 H = 174 H, overflow section, so the SUMH = 7, SUAIL = 4, corresponding ASC Ⅱ code for 37 'H', 'H'. Reply message 4 bytes in hexadecimal number, its corresponding ASC Ⅱ code is 8 bytes, so the reply message length is 12 bytes. According to the transmission response process of the PC and FX series PLC, VB MSComm control can be used to write the following communication program to realize serial communication between PC and FX series PLC controller, to complete the data read. MSComm control polling or event-driven method can be used from the port to get the data. In this example USES the polling method. 1) Communication port initialization Private Sub the Initialize ( ) PortOpen = True结束下标2) Request communication and confirm the Private Function MakeHandshaking ( ) 输出=空空的 h5) InputIf InPackage =空空的 类推) ThenMakeHandShaking = TrueElseMakeHandshaking = FalseEnd IfEnd Function3) Send a command message Private Sub SendFrame ( ) InBufferCount = 0 outstrin =空空的 h2) +″on″+″10F604″+Chr( &H3) 输出= OutstringEnd Sub4) Read the response message Private Sub ReceiveFrame ( ) InpultEnd子
Coolmay is the leading manufacturer of plc manufacturers and related products.
Shenzhen Coolmay Technology Co., Ltd. is a rapidly growing Manufacturing Company based in China. We offer a wide range of equipment that helps in programmable control systems which are safe, durable and economical. We provide plc manufacturers, plc controller price, programmable control systems,etc. more about and plc manufacturers solutions are covered in Coolmay PLC. Take a visit!
plc manufacturers also offers several other plc controller price that could potentially be useful for manufacturers.
Shenzhen Coolmay Technology Co., Ltd. expects to reach the desired profits in the first year and does not anticipate serious cash flow problems.
Chat Online
Chat Online
Chat Online inputting...
Sign in with: