ECIO_Transmit return codes

For MIAC users to discuss projects, applications, and any other issues related to the MIAC unit.

Moderators: Benj, Mods

Post Reply
singerinst_ben
Posts: 22
Joined: Fri Jun 20, 2014 4:41 pm
Location: England, UK
Has thanked: 10 times
Been thanked: 7 times
Contact:

ECIO_Transmit return codes

Post by singerinst_ben »

Hi there,

Do you have a reference anywhere of the return codes from the MIAC to the ECIO_Transmit function?

Regards,

Ben

User avatar
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

Post by Benj »

Hello Ben,

Are you referring to this?

http://www.matrixtsl.com/wiki/index.php ... _Module%29

singerinst_ben
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

Post by singerinst_ben »

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:

Code: Select all

		
Dim lRetVal As Integer
lRetVal = ECIO_Open(0, sID(0))
ECIO_Open is declared as:

Code: Select all

Private Declare Function ECIO_Open Lib "ECIO_api.dll" (ByVal index As Integer, ByRef pVID_PID As Byte) As Integer
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...

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
...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?

User avatar
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

Post by Benj »

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.

singerinst_ben
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

Post by singerinst_ben »

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

User avatar
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

Post by Benj »

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.

Post Reply