View previous topic :: View next topic |
Author |
Message |
Sigma
Joined: 03 May 2004 Posts: 48 Location: Sg
|
2 UDP connections |
Posted: Thu Feb 08, 2007 5:09 am |
|
|
Hi, all,
Have anyone tried getting 2 UDP connections working simutaneouly with Siemens MC35i? One of my customers wants my PIC to open 2 connections with different ports to cater for TX and RX respectively. IS it doable?
Please advice.
Sigma |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Thu Feb 08, 2007 5:26 am |
|
|
I have not done anything with the Siemens device mentioned. However, from a generalized standpoint, every socket (or connection) is bidirectional. Therefore a single socket (connection) handles transmit and receive.
Now it may be that a specific application uses one direction for data and the reverse direction for control / status. In this scenario (at least) two sockets (connections) would then be required.
There are a couple of variations on this theme, use one socket for bidirectional data, and the other for bidirectional control. The other variation is to multiplex bidirection data and control on the same connection (conceptually using a port within a port).
Can you do it? That depends on you application and how you code it - it is simple enough to code. For most of my network applications, including my demos, I use one or both of the variations outlined above. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
Sigma
Joined: 03 May 2004 Posts: 48 Location: Sg
|
|
Posted: Thu Feb 08, 2007 7:31 pm |
|
|
Thanks, asmallri.
My customer tried 1 socket (TX and RX together) before. But they claimed that sometimes the TX data from the server was not sent to the embedded device (using MC35i). What will be the possible reasons?
regards
Sigma |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Thu Feb 08, 2007 7:55 pm |
|
|
Sigma wrote: | Thanks, asmallri.
My customer tried 1 socket (TX and RX together) before. But they claimed that sometimes the TX data from the server was not sent to the embedded device (using MC35i). What will be the possible reasons?
regards
Sigma |
Difficult (impossible?) to say without knowing your configuration but I assume you are sending and receiving UDP commands to this device over the serial interface. If you are using CCS as the tool you will, as a minimum require a receive interrupt handler and ring buffer to avoid loss of characters (and therefore receive packet corruption) while transmitting a PDU. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
|