Toshiba T-PSV Operation Manual page 29

Programmable controller prosec t-series dde server
Table of Contents

Advertisement

5. Using Excel as DDE Client
< Sample VBA code to write data into PLC >
' DLL
Public Declare Function PlcPoke Lib "PlcPoke" Alias "plc_poke" ( _
ByVal sValtagName As String, _
ByVal sData As String) As Long
'
' Record1 Macro
' Date : 2000/11/07 UserName : Sample
'
'
Sub Record1()
Dim lRet As Long
Dim szData As String
szData = Sheets("Sheet1").Range("A1").Value
lRet = PlcPoke("SWITCHI1", szData)
End Sub
This sample writes the data of cell "A1" into the Tag named "SWITCH1".
Above sample VBA code is included in the sample Excel file PlcBook.xls which is installed in
your computer together with T-PSV.
28
DDE Server T-PSV

Advertisement

Table of Contents
loading

Table of Contents