Issue 21: Using Windmill with Access; Visual Basic Resources
We've updated 2 sections of the Windmill web site with information to help you use your free Windmill software.
- Our library of instrument set-up files has been extended to include the ECOM flue gas analyser. (Our thanks to Fred Weeke for sending us the files needed for this addition.) To download the files from the library go to https://www.windmill.co.uk/serial_driver.html
- Another question and answer has been added to our FAQ, namely how to remove the free Software Signal Generator and work only with data from real instruments.
A new edition of the Windmill price list comes out next month. The prices in our on-line catalogue, however, will be held until June.
The Control & Instrumentation Exhibition, which was due to take place in May at the NEC (Birmingham) UK, has been cancelled. Centaur, the show organisers, are replacing next year's C&I with a new "Integrated Manufacturing Solutions" show.
Previously advertised as the UK's largest forum for industrial and process measurement, instrumentation and automation, C&I would have reached its 29th birthday this year. An undignified demise for a once popular event. However, as companies now proudly exhibit their products on their web sites, perhaps more large exhibitions will go the way of C&I.
Logging Data Continuously to a Series of Files
Windmill software reads data from instruments and devices connected to your PC. You can save the data with Windmill Logger, draw graphs of data with Windmill Chart, and display the data pictorially with Windmill Graphics.
However, you may want to use the data you get through Windmill in other applications like Microsoft Excel or Access. We've covered Excel in Issue 13 of this newsletter. This article concentrates on Access.
You establish links between Windmill and other applications using DDE (dynamic data exchange). Our Windmill DDE Panel acts as a gateway between your instrument and Microsoft Access. It's perhaps best to use the free Software Signal Generator to start with, so you can eliminate potential hardware connection problems. Start displaying data in DDE Panel before you start Access.
How to Update Data in Access Every Time you Click a Button
- Create a table with a text field called myField.
- Ceate a form based on that table, showing that field.
- On the form insert a button with an on-click event.
Private Sub Command7_Click Dim myDDE myField.SetFocus myDDE=DDEInitiate("WINDMILL", "Data") myField.Text=DDERequest(myDDE, "InputA") End Sub
- WINDMILL is the DDE Panel Service name (this is the default name)
- InputA is the name of the channel whose data you are acquiring.
Everytime you click the button in Access, the reading updates.
Displaying Information Other Than Data Readings
You can display other types of information, such as the units of the data, or whether the channel is in an alarm state or not. In the myDDE=DDEInitiate("WINDMILL", "Data") line, instead of Data simply type a different topic. Choose from
For more details on DDE topics open the DDE Panel on-line Help, and go to the section entitled "Types of Information: DDE Topics".
We hope this brief guide helps you get started with Windmill and Access. Once you've used the on-click button, you can experiment with different Access controls: for example using a Timer control to periodically update readings without your intervention.
For an example of how Windmill is being used with Access to capture data from a torque meter, see our Applications section.
Microsoft claim that Visual Basic is the world's most used programming language, regularly utilised by 3.2 million people. Statistics aside, it is a language growing in popularity, increasingly taught at universities. The package is easy to get to grips with and provides enough power to obtain significant results quickly, which makes it a favourite for newcomers to programming. Microsoft's stated intention is to make future releases of VB as versatile as Visual C++.
The number of web sites dedicated to VB, or which have VB issues as a significant part of their content, is staggering. If you are a regular programmer doubtless you will already have preferred sites and be subscribed to one or more of the many newsgroups. For comparative newcomers the following handful of suggestions may be interesting places from which to commence a web search. They are all well put together, are regularly updated and have been easy to access and download pages, even at peak times. A recurring feature is the tip of the week or month.
Since Visual Basic is a Microsoft product, that company decides
the course of the language's development. Unlike C there is no
umbrella organisation to influence the course of events. What
Microsoft decides is what goes, so the VB home page should always
be the most up-to-date location from which to obtain service
release packs, details of bug fixes or find development reports,
such as which packages will soon cease to be supported. There is
no excuse for information from this site to be anything other
than totally accurate, although it maybe unwise to expect
unbiased, warts and all, opinions.
- Carl and Gary's VB Web Site
- This site, by Carl Franklin and Gary Wisniewski, has been
referred to as the oldest VB site on the web. A firm favourite
with students it has a very informal feel to it and makes every
effort to cater for a wide range of VB users. Feedback and
technical questions are encouraged.
It is well worth a visit and has many links to other pages. Newbies are well catered for with tutorials on getting started: from producing the first form to methods and classes.
The newsgroup archive claims to have a third of a million entries. At the last glance access to this had been temporarily suspended while the host computer was being upgraded. But will it be worth wading through such a quantity of messages when it returns?
The about.com sites cover a number of programming areas. The one
dedicated to VB is excellent, positively oozing enthusiasm.
Of particular interest is a selection of exercises, including source code and documentation for a series of projects.
There is a considerable set of links for VB tutorial sites, forums and newsgroups. A page is dedicated to one important question, often asked by potential programmers: "Which language should I learn first VB, Java, Visual C++...?".
- VB Zone
- This site modestly declares itself to be the "Leading online
information service" for VB. It is certainly a large repository
of information. There are discussion groups concentrating on
particular aspects such as databases, VB7 or API (application
programmers interface). This site is probably more suitable for
intermediate or advanced programmers. Again, there are a large
number of links to other sites.
- VB Web Directory
- A site orientated towards providing: resources source code, tips
and tricks, tutorials for beginners, a comprehensive download
section, internet programming and a list of other VB sites.
The following sites offer to e-mail you newsletters with programming tips
Our other Visual Basic articles are in:
- Monitor # 13, Using DDE to get data from your instrument into your VB Program
- Monitor # 14, VB Programming Tools
- Monitor # 15, Controlling Windmill programs from Visual Basic code
- Monitor # 16, Using an HTML page to generate the user interface for your Visual Basic application
- Monitor # 18, Displaying data from Windmill in an HTML page
Recommended books for more experienced programmers:
Developing COM/ActiveX Components with Visual Basic 6, by Dan Appleman, ISBN: 1-56276-576-0, Sams Publishing
Available from Amazon.co.uk and Amazon.com.
Main research and article by John Bushby, Technical Author. John may be contacted at [email protected].
Additional material by David Quinlan, Senior Developer for PDMS (Professional Database Management Services).
* Copyright Windmill Software Ltd * Reprinting permitted with this notice included * For more articles see https://www.windmill.co.uk
We are happy for you to copy and distribute this newsletter, and use extracts from it on your own web site or publication, providing the above notice is included and a link back to our website is in place.
To receive Monitor every month please fill in your e-mail address below. We will not pass your address to any third parties, nor send you any unsolicited e-mail.