Sample to send a String in C |
ULONG listener = 3;
ULONG handle = QAPIExtOpenCard(PCIGPIB,0);
if ( handle == NULL )
{
 handle = QAPIExtOpenCard(USBGPIB,0);
 if ( handle == NULL )
 {
  handle = QAPIExtOpenCard(GPIB,0);
 }
}
// The handle is != NULL if there is a GPIB Controller installed
if ( handle == NULL )
{
  MessageBox(NULL, "No QUANCOM GPIB Controller found!", "Error", MB_OK);
  return FALSE;
}
char s1[] = "Dies ist ein String";
if ( QAPIExtWriteString(handle, listener, (char*)&s1, strlen(s1),0))
{
 printf("Writing to device was successful\n", listener);
}
else
{
 printf("Writing to device failed\n", listener);
}
QAPIExtCloseCard(handle);
return 0;
|