' **************************************************************************************'' Mach3 / Cypress Enable script code to use the ELEKTOR Serial.dll Dynamic Link Library' for serial port communication and control from a Mach3 script.'' The Dynamic Link Library contains functions to pass Windows messages from the Windows API' to the calling application (this macro) when the status of the port changes but to my' knowlege there's no way to receive Windows messages directly in Cypress. Because of this' I have left the declaration of the functions in question out of this file. '' Henrik Olsson 2011.'' v1.0 - Initial version.' *************************************************************************************Declare Function OpenCOM Lib "Serial.dll" (ByVal Port As Integer) As IntegerDeclare Function CloseCOM Lib "Serial.dll" As IntegerDeclare Function GetHandle Lib "Serial.dll" As IntegerDeclare Function SendCharCOM Lib "Serial.dll" (ByVal ch As Integer) As IntegerDeclare Function ReadCharCOM Lib "Serial.dll" (ByRef ch As Integer) As BooleanDeclare Function COMPortExists Lib "Serial.dll" (ByVal Port As Integer) As IntegerDeclare Function GetPortNr Lib "Serial.dll" As IntegerDeclare Function ParitySet Lib "Serial.dll"(ByVal par As Integer) As BooleanDeclare Function BitsPerByteSet Lib "Serial.dll" (ByVal pbp As Integer) As BooleanDeclare Function BaudRateSet Lib "Serial.dll" (ByVal BaudRate As Long) As BooleanDeclare Function StopBitsSet Lib "Serial.dll" (ByVal stp As Integer) As BooleanDeclare Function SetTxD Lib "Serial.dll" As BooleanDeclare Function ResetTxD Lib "Serial.dll" As BooleanDeclare Function SetRTS Lib "Serial.dll" As BooleanDeclare Function ResetRTS Lib "Serial.dll" As BooleanDeclare Function SetDTR Lib "Serial.dll" As BooleanDeclare Function ResetDTR Lib "Serial.dll" As BooleanDeclare Function GetCTS Lib "Serial.dll" As IntegerDeclare Function GetDCD Lib "Serial.dll" As IntegerDeclare Function GetDSR Lib "Serial.dll" As IntegerDeclare Function GetRI Lib "Serial.dll" As Integer' *********** End of function declaration for the Serial.dll library ******************