Tweet to @MicrolinkUK

Microlink Measurement and Control Systems

Windmill Manual

February 2004, WM-6

A new version of Windmill means a new version of the Manual.

August 99, WM-4.7

We've added new examples of how to use an Excel spreadsheet to acquire data and send out control signals. You do this with DDE (dynamic data exchange) and the new examples are in the Appendix of the manual. Two of the examples are also given below.

To try out data acquisition using Excel

  1. Load Windmill DDE Panel and select the hardware setup (your *.ims file).
  2. Load Excel with a clean sheet, and then select menu item Insert.Macro.Module (Excel 5-7) or Tools.Macro.Visual Basic Editor (Excel 97) to get to the VBA editor
  3. Create the code to either read data or send data.

To read data from one channel connected to the Windmill DDE Panel and place it into a cell in the spreadsheet, create this code.

Sub DDEread()

 'Read data value from channel "Chan_00" in Windmill DDE

 'Panel and write the result in cell A1

 'Opens a DDE conversation with the Windmill DDE
 'Panel using the Service Name "Windmill" and the 
 'Topic Name "Data"

ddeChan = Excel.DDEInitiate("Windmill", "data")

 'Requests data from a channel called Chan00.

myData = Excel.DDERequest(ddeChan, "Chan_00")


Cells(1,1).Value = myData

 'Closes the DDE conversation.

Excel.DDETerminate (ddeChan)

End Sub

To send data to an analogue or digital output channel, create this code.

Sub DDEpoke()

 'Send data in Sheet1.Cell.A1 to channel "Blackb_1" in

 'Windmill DDE Panel

 'Opens a DDE conversation with the Windmill 

 'DDE Panel using the Service Name "Windmill"

 'and the Topic Name "Data"

ddeChan = Excel.DDEInitiate("Windmill", "data")

 'Now send the data.

 'Note the 3rd parameter MUST be a cell or range of

 'cells which contain the data
Excel.DDEpoke ddeChan, "Blackb_1", Range("a1")

 'Closes the DDE conversation.

Excel.DDETerminate (ddeChan)

End Sub

Technical Support

Measurement News Feed (RSS) Tweet
Copyright Biodata Ltd 1996-2004
10 Stocks Street, Manchester, M8 8QG, UK
Tel: +44 161-834 6688
Fax: +44 161-833 2190