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
Содержание PD2-MF
Страница 5: ...Table of Contents iii Index 137 ...
Страница 11: ...1 1 Introduction ...
Страница 18: ......
Страница 19: ...9 2 Installation and Configuration ...
Страница 34: ......
Страница 35: ...25 3 Architecture ...
Страница 63: ...53 4 PowerDAQ Software Development Kit PD SDK ...
Страница 106: ......
Страница 107: ...97 5 Calibration ...
Страница 109: ...99 A Appendix A Specifications ...
Страница 110: ...Appendix A Specifications 100 ...
Страница 112: ......
Страница 113: ...103 B Appendix B Accessories ...
Страница 118: ......
Страница 119: ...109 C Appendix C Application Notes ...
Страница 125: ...115 D Appendix D Warranty ...
Страница 128: ......
Страница 129: ...119 E Appendix E Glossary ...
Страница 152: ......