_13th_Dragon napisał(a)
Sądzę że problem w strukturze:
TmyRawItem = record
// tutaj coś ...
end;
Masz ją odpowiednio uzupełnić.
Nie... to jest ok..
bo ten sam tym miałem wcześniej zadeklarowany i wykorzystuje go inna funkcja pojedynczego odczytu.
Mam funkcje, która dokonuje pojedynczego odczytu danych i ona działa poprawnie (tltmReadSingleRawItem) i wykorzystuje właśnie TmyRawItem.
Natomiast funkcja którą przedstawiłem na forum dotyczy odczytu ciągłego... i dlatego zadeklarowana jest ta wewnętrzna procedura, która wywoływana jest np. gdy odebrano nowe dane. Tak przynajmniej jest napisane (tak zrozumiałem) w dokumentacji.
Ja natomiast w prozaiczny sposób nie potrafię jej poprawnie wywołać.
Dołączam fragment dokumentacji:
7.5.1.1 Starting a read process
int __stdcall tltmStartReadingRawItems(HANDLE hHandle, unsigned int uiFieldsMask, BOOL
boSetEAS, void (__stdcall *lpfnRawCallBack)(HANDLE hHandle, int iReasonForCall, tltmRawItem
*myRawItem, void *pParam), void *pParam);
Description :
Call this function to start a reading process using the “Raw Memory Mapping”.
Parameters :
hHandle : Handle to the connection obtained from tltmOpenXxx() functions.
UiFieldsMask : The “Raw Mapping” fields that the DLL must try to read. This is any “ored”
combination of TLTM_RAWITEM_EAS, TLTM_RAWITEM_LOCKING,
TLTM_RAWITEM_BLOCK(n).
boSetEAS : For C320 only, TRUE to activate the EAS bit while reading.
lpfnRawCallback: Pointer to a callback function that the DLL will call each time an event
occurs (ie reading started,reading stopped, item read, etc..)
pParam : A user defined parameter that will be passed to the callback function each time it
is called.
7.5.1.2 Stopping a read process
int __stdcall tltmStopReadingRawItems(HANDLE hHandle);
Description :
Call this function to stop a “Raw” reading process.
Parameters :
hHandle : Handle to the connection obtained from tltmOpenXxx() functions.
7.5.1.3 Reading callback
void __stdcall fnRawCallBack(HANDLE hHandle, int iReasonForCall, struct tltmRawItem
*myRawItem, void *pParam);
This is the way the callback function passed to tltmStartReadingRawItems(…) must be declared. It
is called each time an event occurs (see iReasonForCall) and receives the following parameters:
hHandle : The handle to the connection that triggered the event.
iReasonForCall : The reason for this call. It is either TLTM_READING_STARTED (the
reading has just begun), TLTM_READING_STOPPED (the reading was interrupted) or
TLTM_READING_NEW_DATA ( a new chip was read. Its contents is pointed by myRawItem).
myRawItem : Pointer to a tltmRawItem structure representing the item that was read. This
pointer is meaningful only when iReasonForCall is TLTM_READING_NEW_DATA. This pointer is
temporary and should never be used outside the callback function.
7.5.2 Reading of One Single Chip
Int__stdcall tltmReadSingleRawItem(HANDLE hHandle, unsigned int uiReadTime, unsigned int
uiFieldsMask, BOOLboSetEAS, tltmRawItem*myRawItem)
Description :
Call this function to read one single chip using the “Raw Memory Mapping”. This function will verify
that only one chip is present in the field.
Parameters :
hHandle: Handle to the connection obtained fromtltmOpenXxx() functions.
uiReadTime: The time in milliseconds the function will spend reading the chips.
uiFieldsMask: The “Raw Mapping” fields that the DLL must try to read. This is any “ored”
combination of TLTM_RAWITEM_EAS, TLTM_RAWITEM_LOCKING,
TLTM_RAWITEM_BLOCK(n).
boSetEAS: For C320 only, TRUE to activate the EAS bit while reading.
myRawItem: Pointer to a tltmRawItem structure that will receive chip data.