Hi there,
Do you have a reference anywhere of the return codes from the MIAC to the ECIO_Transmit function?
Regards,
Ben
ECIO_Transmit return codes
-
- Posts: 22
- Joined: Fri Jun 20, 2014 4:41 pm
- Location: England, UK
- Has thanked: 10 times
- Been thanked: 7 times
- Contact:
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: ECIO_Transmit return codes
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 22
- Joined: Fri Jun 20, 2014 4:41 pm
- Location: England, UK
- Has thanked: 10 times
- Been thanked: 7 times
- Contact:
Re: ECIO_Transmit return codes
Hi Benj,
Yes we have been referring to that page.
Specifically we were after the return codes from the functions ECIO_Open and ECIO_Transmit. They return an int based on the result of the function but we have no idea what that int means. For ECIO_Transmit we have received 0, 1, 5, and 31 at different times. From what we can determine 0 is when there is no MIAC connected, 1 is OK, but we have no idea what rturn values 5 and 31 mean.
For example in the VB examples, Example 1, Form1_Load there is the following code:
ECIO_Open is declared as:
But the value assigned to lRetVal is never checked, and we have no idea what the different return values can be. Sometimes when we transmit using ECIO_Transmit...
...we receive different values as lRetVal, normally it is 1, which we take means OK, and any other value we handle as error, but it would be good to know what the different values actually mean so we can handle them accordingly rather than as a generic error.
Is there a reference for this anywhere?
Yes we have been referring to that page.
Specifically we were after the return codes from the functions ECIO_Open and ECIO_Transmit. They return an int based on the result of the function but we have no idea what that int means. For ECIO_Transmit we have received 0, 1, 5, and 31 at different times. From what we can determine 0 is when there is no MIAC connected, 1 is OK, but we have no idea what rturn values 5 and 31 mean.
For example in the VB examples, Example 1, Form1_Load there is the following code:
Code: Select all
Dim lRetVal As Integer
lRetVal = ECIO_Open(0, sID(0))
Code: Select all
Private Declare Function ECIO_Open Lib "ECIO_api.dll" (ByVal index As Integer, ByRef pVID_PID As Byte) As Integer
Code: Select all
Private Declare Function ECIO_Transmit Lib "ECIO_api.dll" (ByRef pDataOut As Byte, ByVal dwLenOut As Integer, ByRef pActualLenOut As Integer, ByRef pDataIn As Byte, ByVal dwExpectedLenIn As Integer, ByRef pActualLenIn As Integer, ByVal dwTimeout As Integer) As Integer
Is there a reference for this anywhere?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: ECIO_Transmit return codes
Hello,
This document has a lot of information, mostly towards the end of the document.
http://www.matrixtsl.com/datasheets/LK8 ... ontrol.pdf
ECIO_Open attempts to establish a connection to the hardware, return of 0 represents a fail and 1 represents the hardware has been connected correctly.
ECIO_Transmit is a send and receive function, the return value I think gives you the number of bytes actually received but if not then this can also be collected via the pActualLenIn parameter.
This document has a lot of information, mostly towards the end of the document.
http://www.matrixtsl.com/datasheets/LK8 ... ontrol.pdf
ECIO_Open attempts to establish a connection to the hardware, return of 0 represents a fail and 1 represents the hardware has been connected correctly.
ECIO_Transmit is a send and receive function, the return value I think gives you the number of bytes actually received but if not then this can also be collected via the pActualLenIn parameter.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 22
- Joined: Fri Jun 20, 2014 4:41 pm
- Location: England, UK
- Has thanked: 10 times
- Been thanked: 7 times
- Contact:
Re: ECIO_Transmit return codes
Hi Benj,
That document is useful thanks.
That is interesting that the return value is the length, we were using pActualLenIn for length.
Regards,
Ben
That document is useful thanks.
That is interesting that the return value is the length, we were using pActualLenIn for length.
Regards,
Ben
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: ECIO_Transmit return codes
Hi Ben,
To be sure we based our ECIOAPI.dll on the Microchip MPUSBAPI.dll example. There should be documentation for this lying around somewhere on the web.
We basically took their source code under license, did a couple of very minor changes to simplify the interface and that was that.
To be sure we based our ECIOAPI.dll on the Microchip MPUSBAPI.dll example. There should be documentation for this lying around somewhere on the web.
We basically took their source code under license, did a couple of very minor changes to simplify the interface and that was that.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel