DAS  3.1.6 - 18/09/2017
Functions | Variables
De.c File Reference
#include <windows.h>
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include "mgui.h"
#include "DAS_Spatram.h"
#include "wsc.h"
#include "dxl.h"
+ Include dependency graph for De.c:

Go to the source code of this file.

Functions

int DE_Init (int mod)
 
int DE_InitMotor (int mod, int motor, int mswitch)
 
void DE_PWM (int mod, int channel, int value)
 
int DE_ReadAD (int mod, int channel)
 
unsigned int DE_ReadEP (unsigned int add)
 
unsigned int DE_ReadPort (int mod, int port)
 
void DE_SetMotor (int mod, int motor, int coppia, int step, int slope, int speed)
 
void DE_SetRelais (int mod, int channel, int value)
 
int DE_StepMotor (int mod, int motor, long step, int dir)
 
int DE_StsMotor (int mod, int motor)
 
unsigned int DE_WriteEP (unsigned int add, unsigned int data)
 
void DE_WritePort (int mod, int port, unsigned int data)
 

Variables

DXL_par DXL
 

Function Documentation

§ DE_Init()

int DE_Init ( int  mod)

Definition at line 22 of file De.c.

23 {
24  return 1;
25 }

§ DE_InitMotor()

int DE_InitMotor ( int  mod,
int  motor,
int  mswitch 
)

Definition at line 73 of file De.c.

References sleep().

74 {
75  sleep(200);
76  return 1;
77 }
void sleep(clock_t wait)
Pauses for a specified number of milliseconds. .
Definition: Load.c:1566
+ Here is the call graph for this function:

§ DE_PWM()

void DE_PWM ( int  mod,
int  channel,
int  value 
)

Definition at line 214 of file De.c.

215 {
216 
217 }

§ DE_ReadAD()

int DE_ReadAD ( int  mod,
int  channel 
)

Definition at line 243 of file De.c.

244 {
245  int c;
246 
247  c=channel;
248  switch(c)
249  {
250  case 0:
251  return 5;
252  break;
253  case 1:
254  return 5;
255  break;
256  case 2:
257  return 5;
258  break;
259  case 3:
260  return 5;
261  break;
262  case 4:
263  return 5;
264  break;
265  case 5:
266  return 5;
267  break;
268  }
269  return 0;
270 }

§ DE_ReadEP()

unsigned int DE_ReadEP ( unsigned int  add)

Definition at line 280 of file De.c.

281 {
282  return 1;
283 }

§ DE_ReadPort()

unsigned int DE_ReadPort ( int  mod,
int  port 
)

Definition at line 180 of file De.c.

181 {
182  return 1;
183 }

§ DE_SetMotor()

void DE_SetMotor ( int  mod,
int  motor,
int  coppia,
int  step,
int  slope,
int  speed 
)

Definition at line 57 of file De.c.

58 {
59 
60 }

§ DE_SetRelais()

void DE_SetRelais ( int  mod,
int  channel,
int  value 
)

Definition at line 229 of file De.c.

230 {
231 
232 }

§ DE_StepMotor()

int DE_StepMotor ( int  mod,
int  motor,
long  step,
int  dir 
)

Definition at line 92 of file De.c.

References DXL_par::add, AMS_DoPos(), DAS, DBDEMO, flag::exemode, das::Flag, Message(), MObjectSetText(), and MPixmapSetImageFile().

93 {
94 
95  char buf[80];
96 // char Dbuf[80];
97  int er = 0;
98  int c = motor, d = 0;
99 
100 
101 
102  switch(c)
103  {
104  //INPUT MIRROR
105  case 0: MPixmapSetImageFile(CPL.LedSM1, "SYS\\ledoff.bmp");
106  sprintf(buf, "%s", "Positioning");
107  MObjectSetText(CPL.Albl_LS[0], buf);
108  DXL.add = 0;
109  //AMS_MotorOn_Off(0, 1, 0);
110 // writelogmotor(0, c, er, dir, step, 0);
111  er = AMS_DoPos(mod, dir, 0, step, 0);
112  if (DAS.Flag.exemode != DBDEMO)
113  if(er) { Message("n Step not sent! 1", er); break; }
114 // writelogmotor(0, c, er, dir, step, 0);
115  //AMS_MotorOn_Off(0, 0, 0);
116  break;
117 
118  //GRATING
119  case 1: MPixmapSetImageFile(CPL.LedSM2, "SYS\\ledoff.bmp");
120  sprintf(buf, "%s", "Positioning");
121  MObjectSetText(CPL.Albl_LS[1], buf);
122  DXL.add = 0;
123  //AMS_MotorOn_Off(0, 0, 1);
124 // writelogmotor(0, c, er, dir, step, 0);
125  er = AMS_DoPos(mod, 0, dir, 0, step);
126  if (DAS.Flag.exemode != DBDEMO)
127  if(er) { Message("n Step not sent! 1", er); break; }
128 // writelogmotor(0, c, er, dir, step, 0);
129  //AMS_MotorOn_Off(0, 0, 0);
130  break;
131 
132  //FILTER WHEEL
133  case 2: MPixmapSetImageFile(CPL.LedSM3, "SYS\\ledoff.bmp");
134  sprintf(buf, "%s", "Positioning");
135  MObjectSetText(CPL.Albl_LS[2], buf);
136 
137  DXL.add = 1;
138 // writelogmotor(0, c, er, dir, step, 0);
139  er = AMS_DoPos(mod, dir, 0, step, 0);
140  if (DAS.Flag.exemode != DBDEMO)
141  if(er) { Message("n Step not sent! 1", er); break; }
142  DXL.add = 0;
143  break;
144 
145  }
146 
147 
148  return 1;
149 }
DXL_par DXL
Definition: De.c:14
void MPixmapSetImageFile(MOBJECT pixmap, const char *fname)
flag Flag
Structure for different flags.
#define DBDEMO
execution in demo mode
das DAS
Definition: Chktemp.c:26
void MObjectSetText(MOBJECT obj, const char *text)
int add
Peripheral address.
Definition: DXL.H:19
void Message(char *str, int er)
Create a message shell for the AMS errors (Debug Use). .
Definition: Dxl.c:1085
int AMS_DoPos(int id, int dira, int dirb, unsigned long stepa, unsigned long stepb)
Execute Positioning Execute Stepper positioning. Make all the control on the status of the selected m...
Definition: Dxl.c:644
int exemode
Set the Execution MODE (Execution modes)
+ Here is the call graph for this function:

§ DE_StsMotor()

int DE_StsMotor ( int  mod,
int  motor 
)

Definition at line 166 of file De.c.

167 {
168  return 1;
169 }

§ DE_WriteEP()

unsigned int DE_WriteEP ( unsigned int  add,
unsigned int  data 
)

Definition at line 294 of file De.c.

295 {
296  return 1;
297 }

§ DE_WritePort()

void DE_WritePort ( int  mod,
int  port,
unsigned int  data 
)

Definition at line 196 of file De.c.

197 {
198 
199 }

Variable Documentation

§ DXL

DXL_par DXL

Definition at line 14 of file De.c.

______________________________________________________________________________________
Generated on Mon Sep 18 2017 11:44:53 for DAS - Rel. 3.1.6 - 18/09/2017.