Page 1 of 1

EB023-00-02 socket status

Posted: Tue Dec 04, 2012 9:17 pm
by yannr
Hello,

I try to make TCP IP communication.
When I make it with the EB023-00-01 It works,
but with the new EB023-00-02 there is problem.
When I try the macro GetSocketStatus
It return 20 and sometimes 23.
When I look for this numbers in the help files,
it's written that the value can only be from 0 to 19...?

If someone has an idea?

thanks,

Yann

Re: EB023-00-02 socket status

Posted: Wed Dec 05, 2012 9:49 pm
by benp
I can't find a code example for this V2 on the matrix website.
We want to use UDP.
Is the only thing to do is check the EB023-02 fot migration from v1 to v2?

Re: EB023-00-02 socket status

Posted: Sun Dec 09, 2012 2:21 pm
by yannr
HI Benp,

the probleme seems not to be with UDP, I have success to make transsmission between a PC and e-blocks
with both EB023-00-2 and EB023-00-1
I put you the 2 files I have try without problem.
the only thing to do is check the EB023-02 fot migration from v1 to v2 and to make a new connection.

but for TCP IP you have to know if you are connected or not and without
the macro GetSocketStatus, it's still difficult...

bye,

Yann

Re: EB023-00-02 socket status

Posted: Sun Dec 09, 2012 9:28 pm
by benp
I think I found the solution.
The Status codes in flowcodev5 help are valid for EB023V1 only.
You can find the status code for EB023V2 in the W5100 datasheet:
http://www.wiznet.co.kr/Sub_Modules/en/ ... Type=2#tab
See p28

Matrix staff should include this in next help.
The w5100 datasheet in the EB023 webpage would be a good idea too...

YannR, can you confirm the codes from your tests?

Here is a copy of the status codes from the datasheet:


0x00 SOCK_CLOSED
It is shown in case that CLOSE commands are given to
Sn_CR, and Timeout interrupt is asserted or connection is
terminated. In this SOCK_CLOSED status, no operation
occurs and all resources for the connection is released.
0x13 SOCK_INIT
It is shown in case that Sn_MR is set as TCP and OPEN
commands are given to Sn_CR. This is the initial step for
TCP connection establishment of a socket. In this SOCK_INIT
status, the command type (LISTEN or CONNECT) of Sn_CR
will decide the operation type – TCP server mode or Client
mode.
0x14 SOCK_LISTEN
It is shown in case that LISTEN commands are given to
Sn_CR at the SOCK_INIT status. The related socket will
operate as TCP Server mode, and become ESTBLISHED status
if connection request is normally received.
0x17 SOCK_ESTABLISHED
It is shown in case that connection is established. In this
status, TCP data is transmitted and received.
0x1C SOCK_CLOSE_WAIT
It is shown in case that connection termination request is
received from peer host. At this status, the Acknowledge
message has been received from the peer, but not
disconnected. The connection can be closed by receiving
the DICON or CLOSE commands.
0x22 SOCK_UDP
It is shown in case that OPEN commands are given to Sn_CR
when Sn_MR is set as UDP. As this status does not need the
connection process with peer , the data can be directly
transmitted and received.
0x32 SOCK_IPRAW
It is shown in case that OPEN commands are given to S n_CR
when Sn_MR is set as IPRAW. At the IPRAW status, the
following protocols of IP Header are not processed. Refer to
“IP RAW” for more information.
0x42 SOCK_MACRAW
It is shown in case that OPEN commands are given to S0_CR
when S0_MR is set as MACRAW.
At the MAC RAW status, there is no protocol process for a
packet. For more information, refer to “MAC RAW”.
0x5F SOCK_PPPOE
It is shown in case that OPEN commands are given to S0_CR
when S0_MR is set as PPPoE.

Re: EB023-00-02 socket status

Posted: Mon Dec 10, 2012 1:26 pm
by yannr
THANKS BENP,

yes I've success to make TCP-IP with the nex EB023-00-2.

How to poceed?

do the same as with the EB023-00-1, but
in connection connect CS to the good pin.
in properties select EB 023-2(WIZ810MJ) and HW channel to 1
In your flowcode program change all the former channel O to channel 1
and because the Status codes in flowcodev5 help are valid for EB023V1 only
you have to change it :
EB023-00-1 status SOCK_INIT 14 becomes 19 for EB023-00-2
EB023-00-1 status SOCK_CLOSE_WAIT 7 becomes 28 for EB023-00-2
EB023-00-1 status SOCK_ESTABLISHED 6 becomes 23 for EB023-00-2
EB023-00-1 status SOCK_LISTEN 2 becomes 20 for EB023-00-2

I Hope Matrix multimedia will change the help file for the 2 E-blocks in a new version of flowcode.

Re: EB023-00-02 socket status

Posted: Tue Dec 11, 2012 10:36 am
by DavidA
Hi,

Thanks for this, i will try and make sure these changes are reflected in the Help file.