This repository has been archived by the owner. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c72012f
commit 111f4b3
Showing
2 changed files
with
201 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
#include "Definitions.h" | ||
|
||
HANDLE VCS_OpenDevice(char deviceName[], | ||
char protocolStackName[], | ||
char interfaceName[], | ||
char portName[], | ||
DWORD *errorCode) | ||
{ | ||
WORD handle = DEVICE_ID; | ||
void *pHandle = &handle; | ||
std::cout << "VCS_OpenDevice" << std::endl; | ||
std::cout << "\t" << deviceName << std::endl; | ||
std::cout << "\t" << protocolStackName << std::endl; | ||
std::cout << "\t" << interfaceName << std::endl; | ||
std::cout << "\t" << portName << std::endl; | ||
*errorCode = 0; | ||
return pHandle; | ||
} | ||
|
||
BOOL VCS_CloseDevice(HANDLE deviceHandle, DWORD *errorCode) | ||
{ | ||
std::cout << "VCS_CloseDevice" << std::endl; | ||
|
||
if (deviceHandle) { | ||
*errorCode = 0; | ||
} | ||
|
||
return TRUE; | ||
} | ||
|
||
BOOL VCS_GetFaultState(HANDLE deviceHandle, WORD nodeId, BOOL *isFaultState, DWORD *errorCode) | ||
{ | ||
std::cout << "VCS_GetFaultState " << nodeId << std::endl; | ||
|
||
if (deviceHandle) { | ||
*errorCode = 0; | ||
*isFaultState = TRUE; | ||
} | ||
|
||
return TRUE; | ||
} | ||
|
||
BOOL VCS_GetErrorInfo(DWORD errorCode, char errorInfo[], WORD errorInfoSize) | ||
{ | ||
std::cout << "VCS_GetErrorInfo " << errorCode << std::endl; | ||
std::cout << "\t" << errorInfo << " " << errorInfoSize; | ||
|
||
return TRUE; | ||
} | ||
|
||
BOOL VCS_ClearFault(HANDLE deviceHandle, WORD nodeId, DWORD *errorCode) | ||
{ | ||
std::cout << "VCS_ClearFault " << nodeId << std::endl; | ||
|
||
if (deviceHandle) { | ||
*errorCode = 0; | ||
} | ||
|
||
return TRUE; | ||
} | ||
|
||
BOOL VCS_SetEnableState(HANDLE deviceHandle, WORD nodeId, DWORD *errorCode) | ||
{ | ||
std::cout << "VCS_SetEnableState " << nodeId << std::endl; | ||
|
||
if (deviceHandle) { | ||
*errorCode = 0; | ||
} | ||
|
||
return TRUE; | ||
} | ||
|
||
BOOL VCS_SetDisableState(HANDLE deviceHandle, WORD nodeId, DWORD *errorCode) | ||
{ | ||
std::cout << "VCS_SetDisableState " << nodeId << std::endl; | ||
|
||
if (deviceHandle) { | ||
*errorCode = 0; | ||
} | ||
|
||
return TRUE; | ||
} | ||
|
||
BOOL VCS_ActivateVelocityMode(HANDLE deviceHandle, WORD nodeId, DWORD *errorCode) | ||
{ | ||
std::cout << "VCS_ActivateVelocityMode " << nodeId << std::endl; | ||
|
||
if (deviceHandle) { | ||
*errorCode = 0; | ||
} | ||
|
||
return TRUE; | ||
} | ||
|
||
BOOL VCS_SetVelocityMust(HANDLE deviceHandle, WORD nodeId, int velocity, DWORD *errorCode) | ||
{ | ||
std::cout << "VCS_SetVelocityMust " << nodeId << " " << velocity << std::endl; | ||
|
||
if (deviceHandle) { | ||
*errorCode = 0; | ||
} | ||
|
||
return TRUE; | ||
} | ||
|
||
BOOL VCS_SetQuickStopState(HANDLE deviceHandle, WORD nodeId, DWORD *errorCode) | ||
{ | ||
std::cout << "VCS_SetQuickStopState " << nodeId << std::endl; | ||
|
||
if (deviceHandle) { | ||
*errorCode = 0; | ||
} | ||
|
||
return TRUE; | ||
} | ||
|
||
BOOL VCS_DigitalOutputConfiguration(HANDLE deviceHandle, WORD nodeId, WORD digitalOutputNb, WORD configuration, BOOL state, BOOL mask, BOOL polarity, DWORD *errorCode) | ||
{ | ||
std::cout << "VCS_DigitalOutputConfiguration " << nodeId << std::endl; | ||
std::cout << "\t" << digitalOutputNb << std::endl; | ||
std::cout << "\t" << configuration << std::endl; | ||
std::cout << "\t" << state << "\t" << mask << "\t" << polarity << std::endl; | ||
|
||
if (deviceHandle) { | ||
*errorCode = 0; | ||
} | ||
|
||
return TRUE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#ifndef EPOS_DEFINITIONS | ||
#define EPOS_DEFINITIONS | ||
|
||
#include <iostream> | ||
|
||
typedef void *PVOID; | ||
typedef int BOOL; | ||
typedef PVOID HANDLE; | ||
typedef unsigned short WORD; | ||
typedef unsigned long DWORD; | ||
|
||
const BOOL TRUE = 1; | ||
const BOOL FALSE = 0; | ||
|
||
const WORD DIC_GENERAL_PURPOSE_C = 1; | ||
const WORD DIC_GENERAL_PURPOSE_D = 2; | ||
const WORD DEVICE_ID = 1234; | ||
|
||
HANDLE VCS_OpenDevice(char deviceName[], | ||
char protocolStackName[], | ||
char interfaceName[], | ||
char portName[], | ||
DWORD *errorCode); | ||
|
||
BOOL VCS_CloseDevice(HANDLE deviceHandle, | ||
DWORD *errorCode); | ||
|
||
BOOL VCS_GetFaultState(HANDLE deviceHandle, | ||
WORD nodeId, | ||
BOOL *isFaultState, | ||
DWORD *errorCode); | ||
|
||
BOOL VCS_GetErrorInfo(DWORD errorCode, | ||
char errorInfo[], | ||
WORD errorInfoSize); | ||
|
||
BOOL VCS_ClearFault(HANDLE deviceHandle, | ||
WORD nodeId, | ||
DWORD *errorCode); | ||
|
||
BOOL VCS_SetEnableState(HANDLE deviceHandle, | ||
WORD nodeId, | ||
DWORD *errorCode); | ||
|
||
BOOL VCS_SetDisableState(HANDLE deviceHandle, | ||
WORD nodeId, | ||
DWORD *errorCode); | ||
|
||
BOOL VCS_ActivateVelocityMode(HANDLE deviceHandle, | ||
WORD nodeId, | ||
DWORD *errorCode); | ||
|
||
BOOL VCS_SetVelocityMust(HANDLE deviceHandle, | ||
WORD nodeId, | ||
int velocity, | ||
DWORD *errorCode); | ||
|
||
BOOL VCS_SetQuickStopState(HANDLE deviceHandle, | ||
WORD nodeId, | ||
DWORD *errorCode); | ||
|
||
BOOL VCS_DigitalOutputConfiguration(HANDLE deviceHandle, | ||
WORD nodeId, | ||
WORD digitalOutputNb, | ||
WORD configuration, | ||
BOOL state, | ||
BOOL mask, | ||
BOOL polarity, | ||
DWORD *errorCode); | ||
|
||
|
||
#endif /* EPOS_DEFINITIONS */ |