Chapter 4: PowerDAQ Software (SDK)
75
Method G. Combining Analog and Digital
subsystems
See SDK Examples
SimpleTest.dpr
The tricky part of combining digital and analog operations is the event
handling. The PowerDAQ API has two sets of function to solve this.
The first way is to set up all subsystem operations in a one thread and
create an event using _PdSetPrivateEvent(…). This function creates a
single event that is set when any subsystem needs attention. Note that
each active subsystem events should be sequentially retrieved and
processed. To release a event object use _PdClearPrivateEvent(…).
The second way is to set up each subsystem operation in a separate
thread. You can create separate event objects for each subsystem using
_PdAInSetPrivateEvent(…), _PdAOutSetPrivateEvent(…),,
_PdDInSetPrivateEvent(…),,_PdUctSetPrivateEvent(…),.
When one or another subsystem needs an attention, the appropriate
event is set. Subsystem thread wake up on WaitForSingleObject(…),
,Win32 API calls and processes event as described above. To release
event objects use appropriate _PdxxxClearPrivateEvents(…).
Averaging and inertial filters
. Use averaging to
increase resolution and reduce noise. For applications
where the DC value is crucial, consider using an inertial
filter. This filter can be better described as an averaging
window over an array of averages. Each time you
calculate the average value of the frame you put it into
an array of averages replacing the oldest one. Then your
program calculates the average value of the array of
averages and uses it as a final value.
TIP
Summary of Contents for PD2-MF
Page 5: ...Table of Contents iii Index 137 ...
Page 11: ...1 1 Introduction ...
Page 18: ......
Page 19: ...9 2 Installation and Configuration ...
Page 34: ......
Page 35: ...25 3 Architecture ...
Page 63: ...53 4 PowerDAQ Software Development Kit PD SDK ...
Page 106: ......
Page 107: ...97 5 Calibration ...
Page 109: ...99 A Appendix A Specifications ...
Page 110: ...Appendix A Specifications 100 ...
Page 112: ......
Page 113: ...103 B Appendix B Accessories ...
Page 118: ......
Page 119: ...109 C Appendix C Application Notes ...
Page 125: ...115 D Appendix D Warranty ...
Page 128: ......
Page 129: ...119 E Appendix E Glossary ...
Page 152: ......