Chapter 4: PowerDAQ Software (SDK)
70
#
WaitForSingleObject(hEventObject, Timeout)
This function puts your program into a sleep mode and
gives processor time to other processes. It is activated when
the board signals an event or the timeout period has
expired. The timeout period should be long enough to fill
your buffer with samples. When it returns event from the
board you have to check what caused it
•
Check events
#
_PdGetUserEvents(…)
This function returns events for the subsystem specified
(AnalogIn). Your code should analyze them and make a
decision based on the result.
An Event word could contain following flags:
eFrameDone – get a frame of data
eBuff eStopped – acquisition is completed. All
data is stored in the buffer. Data is available for analysis.
eBuff eBufferWrapped – data has reached the
end of the buffer. The next frame to fill is located at the
start of the buffer.
eStopped – acquisition is stopped. The reason could be a
trigger pulse on external trigger line, software command or
buffer error. Also, if the application does not take data
fast enough from the buffer and there is no room to place
new incoming data. Check other bits to find what caused
acquisition to stop.
eBufferError – data integrity was compromised because of
lack of performance or system latency while serving
interrupts (see note about interrupts).
eStopTrig – acquisition was stopped because of the stop
trigger pulse or software command
•
Get data
#
_PdAInGetScans(…)
Retrieves information about position of unread frame in
the buffer
n scans
(ScanIndex) and the number of scans
available for the application (NumValidScans). If the
boundary of buffer has been crossed and data fills the
buffer from the beginning, the eFrameDone event will
come twice. The first time it comes to let the user
application retrieve data from the point of the last retrieval
to the end of the buffer and second time from the
beginning of the buffer to the latest complete frame.
During any _PdAInGetScans(…) call, the application gets the
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: ......