本篇文章仅做学习SOEM研究参考使用,不能做为商业。目前网上还没有windows版本的CSP模式控制。这里给出实际能运行的代码,以供有兴趣的同学参考。
#include <stdlib.h>
#include <sched.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <pthread.h>
#include <math.h>
#include "osal.h"
#include "ethercattype.h"
#include "nicdrv.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatdc.h"
#include "ethercatcoe.h"
#include "ethercatfoe.h"
#include "ethercatconfig.h"
#include "ethercatprint.h"
#define EC_TIMEOUTMON 500
#define NSEC_PER_SEC 1000000000
#define CYCLETIME 4000000U
#define SHIFTTIME 20000U
#define C