A new version of Windmill means a new version of the Manual.
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
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") Sheets("sheet1").Select 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