Friday, October 27, 2006

[ProComp] Acquiring Live Data

The following steps outline a minimal set of functions required to acquire live data from a connected encoder.

To acquire live data:
1. Initialize the COM environment by calling CoInitialize or CoInitializeEx.
    • HRESULT hr = CoInitializeEx(NULL, COINIT_ APARTMENTHEREADED);
    • CheckHRESULT(hr);
    • SUCCEEDED(hr);
2. Create an instance of a TTLLiveCtrl object and query for its ITTLLive or ITTLLive2 interface.
    • HRESULT hr = g_TTLLive.CreateInstance(CLSID_TTLLive);
    • CheckHRESULT(hr);
    • SUCCEEDED(hr);
3. Detect and open encoder connection(s) using the OpenConnection or OpenConnections method.
    • g_TTLLive->OpenConnections(TTLAPI_OCCMD_AUTODETECT, 1000, NULL, NULL);
4. Close any unwanted connections using CloseConnection.
    • g_TTLLive->CloseConnections();
5. Optionally define the encoder enumeration order by calling AssignEncoderHND.
    • not sure yet
6. Create logical channels corresponding to all encoder physical channels using AutoSetupChannels.
7. Synchronously start all channels using StartChannels.
8. Retrieve data periodically using ReadChannelData or ReadChannelDataVT.
9. When finished, close all connections using CloseConnections.
10. Release queried ITTLLive or ITTLLive2 interface.
11. Match the previous call to CoInitialize or CoInitializeEx with a call to CoUninitialize

==
basic from the dacument of ProComp.

No comments: