Operation Manual
27
5. Using Excel as DDE Client
5.3 Writing data from Excel into PLC
It is possible to write data from Excel into the PLC via T-PSV, using Excel's VBA code.
An example procedure to do is shown below.
(1) Go to the menu [Tools] [Macro] [Record New Macro] (in case of Excel 97).
(2) Enter the macro name. For example "Record1".
(3) Go to the menu [Tools] [Macro] [Stop Recording] (in case of Excel 97).
(4) Go to the menu [Tools] [Macro] [Macros] (in case of Excel 97).
(5) Select the macro name that you named (Record1), and click [edit] button.
(6) Enter the VBA code as an example shown on the next page.
(7) Return to the spreadsheet.
(8) To assign a command button to your VBA code, go to the menu [View] [Toolbars] [Forms].
(9) Select the button item from the Form Toolbar and paste it onto the Excel sheet.
(10) Assign Macro dialog is displayed. Then select the macro name that you created (Rtecord1),
and click [OK] button.
(11) Then, when you click the button, your VBA code will be executed.
(12) If your T-PSV is already started, the data will be written into the PLC.
Note that the data to be written into the PLC must be within the available range that is
determined by the data type specified by your configuration file.
Note) The sample code shown on the next page uses PlcPoke function. The PlcPoke function
is automatically installed in your computer together with T-PSV.
The standard DDEPoke function can also be used. However, when you write data using
the bit designation for register Tag, you must use the PlcPoke function.
Summary of Contents for T-PSV
Page 37: ...36 DDE Server T PSV ...