Book contents
- Frontmatter
- Contents
- Preface
- Acknowledgments
- 1 Digital tools
- Laboratory exercise
- 2 Analog tools
- 3 Analog ↔ digital conversion and sampling
- 4 Sensors and actuators
- 5 Data analysis and control
- Appendix A Grounding and shielding
- Appendix B Experimental uncertainties
- Appendix C C programming tips
- Appendix D Numerical methods and C functions
- Appendix E Summary of Data Translation DT3010 PCI plug-in card
- Appendix F Using the digital oscilloscope to record waveforms
- Appendix G Electrical hazards and safety
- Appendix H Standard resistor and capacitor values
- Appendix I ASCII character set codes
- Glossary
- Index
Laboratory exercise
from 1 - Digital tools
Published online by Cambridge University Press: 04 August 2010
- Frontmatter
- Contents
- Preface
- Acknowledgments
- 1 Digital tools
- Laboratory exercise
- 2 Analog tools
- 3 Analog ↔ digital conversion and sampling
- 4 Sensors and actuators
- 5 Data analysis and control
- Appendix A Grounding and shielding
- Appendix B Experimental uncertainties
- Appendix C C programming tips
- Appendix D Numerical methods and C functions
- Appendix E Summary of Data Translation DT3010 PCI plug-in card
- Appendix F Using the digital oscilloscope to record waveforms
- Appendix G Electrical hazards and safety
- Appendix H Standard resistor and capacitor values
- Appendix I ASCII character set codes
- Glossary
- Index
Summary
Purpose
To use a compiler/editor to write and compile a simple C program. To investigate the 2's complement unsigned, and hexadecimal representation of 8-, 16-, and 32-bit numbers, to use the printf function for printed output, and the scanf function for interactive program control and data entry.
Equipment
IBM-compatible Pentium microcomputer with Windows NT operating system and Microsoft Visual C++ compiler
Printer (shared with other laboratory stations)
Additional reading
Appendix C: C programming hints
Section 1.3 Number systems
B. W. Kernighan and D. M. Ritchie, The C Programming Language, Prentice Hall, Englewood Cliffs, NJ, 1988.
Procedure
Microsoft Visual C++ programming environment
You will need a separate project file and folder for each laboratory exercise that requires programming. Rather than creating your own project folder from scratch, copy a “starter project” folder into your file storage area. The laboratory assistant or teaching associate will tell you where to find it on your local network. This folder contains a starter project file with all the library modules that your project will require, and C code files you may need, such as InitAll and fft.c.
Rename the starter project folder and the .dsw project file in it, but be sure to keep the .dsw extension. Start the Microsoft Visual C++ developer studio by double-clicking the shortcut on the desktop. Open the project by clicking on the “File: Open Workspace” command and select your project .dsw file. “File: Close Workspace” will close the project you are currently working on.
- Type
- Chapter
- Information
- Practical Interfacing in the LaboratoryUsing a PC for Instrumentation, Data Analysis and Control, pp. 53 - 74Publisher: Cambridge University PressPrint publication year: 2003