Yokogawa JUXTA M Series Digital Limit Alarms MVTK User Manual

Page 35

Advertising
background image

<Toc> <Ind>

<3. PC Link Communication >

3-21

IM 77J04J11-01E 1st Edition : 2006.08.25-00

3.3.1

Example of Communication Program Created Using Visual

Basic

This subsection shows a sample program created using Microsoft Visual Basic 6.0.

Operation verification environment: PC/AT compatible machine + Windows NT 4.0
(SP4), Windows 95

PC/AT is a product of IBM Corporation.
Visual Basic is a registered trademark of Microsoft Corporation.

See Also

MSDN and commercially available documentation for information on Visual Basic programming.

The sample program reads the contents of D register D0002 using the PC link communica-
tion protocol. When you press the Command button, the commands sent and responses
received will be displayed in a form. If no response is received, a timeout will occur.

'==========================================================

' Program name: Sample

'

' RS-485 communication program for M series

'

'============================= YOKOGAWA Electric Corporation ===

'

'Definition of public variables

Public fSend As Boolean

'Sending flag

Public strSend As String

'Character string sent

Public strBuf1 As String

'Character (1 byte) received

Public strReceive As String

'Character string received

'When the Command button is pressed,

Private Sub Command1_Click()

strSend = "01010WRDD0002,01"

'Character string to be sent

'[stx]01010WRDD0002,01[etx][cr]

Advertising
This manual is related to the following products: