Herunterladen Diese Seite drucken

Optelec ClearNote HD Bedienungsanleitung Seite 63

Vorschau ausblenden Andere Handbücher für ClearNote HD:

Werbung

char cBufWrite[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
char cBufReceive[100];
AnaInt32 hHandle = 0;
AnaInt32 nRC = 0;
AnaInt32 nRC = SPIOpenDevice(&hHandle, "192.168.1.254", 5000);
if ( nRC == 0 )
{
// send 1 byte and receive 1 byte
nRC = SPIDataReq( hHandle, cBufWrite, 1, cBufReceive, 1 );
// send 1 byte and receive 5 byte
nRC = SPIDataReq( hHandle, cBufWrite, 1, cBufReceive, 5 );
// send 2 byte and receive 1 byte
nRC = SPIDataReq( hHandle, cBufW2ite, 2, cBufReceive, 1 );
SPICloseDevice(hHandle);
}
return 0;
}
Rückgabewert
Die Funktion gibt im Erfolgsfall Null zurück, andernfalls einen Fehlercode (Anhang A,
Rückgabewerte aus den API-Funktionen ).
SPI API Funktionen
54
© 2007-2015 Analytica GmbH

Werbung

loading