Difference between revisions of "626"

From Sensoray Technical Wiki
Jump to: navigation, search
(Migrating to PCI Express)
(64-bit Windows: +S626_DLLOpen example)
Line 1: Line 1:
 
__FORCETOC__
 
__FORCETOC__
 +
 +
==C/C++ apps must call S626_DLLOpen==
 +
 +
Windows application programs written in C/C++ must call <code>S626_DLLOpen</code> before calling any other API functions. The following example shows how to do this:
 +
 +
#include <windows.h>
 +
#include "win626.h"
 +
 +
int main(int argc, char* argv[])
 +
{
 +
  S626_DLLOpen();    // Open the API. MUST CALL THIS FIRST!
 +
  S626_OpenBoard(0, 0, NULL, THREAD_PRIORITY_NORMAL);
 +
  if (S626_GetErrors(0)) {
 +
    printf("errors opening board\n");
 +
  }
 +
  else {              // Board was successfully opened, so ...
 +
    RunApplication();    // App can now call other API functions.
 +
    S626_CloseBoard(0);  // Close board before app terminates.
 +
  }
 +
  S626_DLLClose();    // Close the API.
 +
  return 0;
 +
}
  
 
==64-bit Windows==
 
==64-bit Windows==

Revision as of 10:24, 17 April 2017


Contents

C/C++ apps must call S626_DLLOpen

Windows application programs written in C/C++ must call S626_DLLOpen before calling any other API functions. The following example shows how to do this:

#include <windows.h>
#include "win626.h"

int main(int argc, char* argv[])
{
  S626_DLLOpen();     // Open the API. MUST CALL THIS FIRST!
  S626_OpenBoard(0, 0, NULL, THREAD_PRIORITY_NORMAL);
  if (S626_GetErrors(0)) {
    printf("errors opening board\n");
  }
  else {              // Board was successfully opened, so ...
    RunApplication();    // App can now call other API functions.
    S626_CloseBoard(0);  // Close board before app terminates.
  }
  S626_DLLClose();    // Close the API.
  return 0;
}

64-bit Windows

I successfully built a 626 program for my 64-bit Windows 7 system but it crashes when it executes. What could be the problem?

The 626 works with 64-bit Windows, but only with 32-bit applications. When building your application, make sure the CPU target is selected as 32-bit or Win32.

Encoder errors

The encoder interface misses some encoder clocks, especially at higher rotation speeds.

This can be caused by slow slew rates on the encoder signals. Examine the encoder clock signals with an oscilloscope. If you don't see sharp, fast rise and fall times, you may need to add external termination or pull-up resistance to the clock lines to speed up the edges.

Migrating to PCI Express

When upgrading your system to PCIe, we recommend Model 826 as a replacement for model 626. The following table compares the interfaces on the two boards:

Interface 626 826
Counters 6: 24-bit w/latch 6: 32-bit w/16-deep FIFO and timestamps
GPIOs 48: 1 Msps, 40 w/edge detection 48: 50 Msps w/edge detection, debounce & fail-safe outputs
Analog out 4: 14-bit @ 20 Ksps 8: 16-bit @ 900 Ksps w/fail-safe outputs
Analog in 16: 16-bit @ 15 Ksps 16: 16-bit @ 300 Ksps
Watchdog timer Single w/4 selectable intervals 3-stage w/programmable intervals
Fail-safe controller None Integrated
Personal tools
Namespaces

Variants
Actions
Toolbox