UDP help for communication with pc

Hello to all, i would like to ask for some help about UDP and ethernet shield with my Arduino Uno.
I want to read analog values from a sensor on the Arduino side, make some changes etc and send a string via UDP to the pc.

So the questions begin at the example here: Ethernet - Arduino Reference

void loop() {
   Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
   Udp.write("hello");
   Udp.endPacket();
}

What i have understood is that remoteIP and remotePort get values when the pc side sends a packet to the Arduino and it replies to this "address" with name and number. That is what i don't want to do, send any data from the pc to the Arduino. So i have commented it out in the example below.
(the example here http://arduino.cc/en/Tutorial/UDPSendReceiveString , sets the same IP and the same port in the processing script as in the arduino script [pc-arduino sides] ).

I have set a static IP on the pc side that i connect the ethernet [serverName] .
Lets see a specific example again , so i would be grateful if we could modify the codes so they fit my needs:

#include <SPI.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetUdp.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,3,3 };
byte serverName[] = { 192,168,3,2 };  //static IP

unsigned int localPort = 8888;      
float valFloat;
EthernetUDP Udp;

void setup()
{
  Ethernet.begin(mac, ip);
  Udp.begin(localPort); 
  Serial.begin(9600);
}
void loop()
{
    valFloat = ( analogRead(i) * 500.00) / 1024.00;
    //Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
    String STRING = "blablabla";
    Udp.beginPacket(udpIP, udpPort);  ////////// WHAT VALUES????????
    Udp.write(STRING);
    Udp.endPacket();
    delay(1000); 
}
/*
  Processing sketch to run with this example
 =====================================================
 // Processing UDP example to send and receive string data from Arduino
 // press any key to send the "Hello Arduino" message */
 import hypermedia.net.*;
 
 UDP udp;  // define the UDP object
 
 void setup() {
 udp = new UDP( this, 8888);  // create a new datagram connection on port 8888 (had 6000)
 udp.listen( true );           // and wait for incoming message  
 }
 
 void draw()
 {
 }
 /* THIS IS WHAT I DONT NEED AT ALL, PC SENDING DATA TO ARDUINO
 void keyPressed() {
 String ip       = "192.168.2.7"; // the remote IP address
 int port        = 3306;        // the destination port
 
 udp.send("Hello World", ip, port );   // the message to send
 
 }*/
 
 void receive( byte[] data ) {          // <-- default handler
 //void receive( byte[] data, String ip, int port ) {   // <-- extended handler
 
 for(int i=0; i < data.length; i++)
 print(char(data[i]));  
 println();  
 }

Thank you all in advance for the time spent and for any thoughts!

Change udpIP to the ip of the listener (target for the packet) and udpPort to the listener's port.

IPAddress udpIP(1,2,3,4);
int udpPort = 8888;

Udp.beginPacket(udpIP, udpPort);

This code is used on the listener end to return a udp packet to the sender.

Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());

I am a bit confused, can you please modify my code so the processing just reads what the arduino sends? Then i might be able to derive the meaning easier.
Thank you once more mrSurferTim : ) !

void loop()
{
    IPAddress udpIP(1,2,3,4);
    int udpPort = 8888;

    char msg[] = "blablabla";
    Udp.beginPacket(udpIP, udpPort);
    Udp.write(msg);
    Udp.endPacket();
    delay(1000); 
}

just came back,
i still got 2 questions:

  1. I want the listener to be the WAMP server on the pc. Does this mean 127.0.0.1 or serverName[] = { 192,168,3,2 }; //static IP ??
  2. how will this be interpreted by the Processing script? because the example http://arduino.cc/en/Tutorial/UDPSendReceiveString states it receives and sends. I need the receiving part clear..

Actually, a WAMP (Windows Apache MySQL PHP)server means a TCP connection, not a UDP packet exchange. It will neither receive nor respond to udp packets without another service running to listen for udp packets on a specific port.

Ok thats right and thanks for the insight surferTim, but lets forget the WAMP server etc, it was not a right question and irrelevant, but (you were expecting this : ) )
i need the listening part as stated in the example i have quoted by the arduino makers.
Simply , what i need is my arduino to send via udp a string that can be seen -and i will just do what i need with it- by a Processing script.
Can we do that according to that specific example?

Reply #3 is the Arduino end if the Windows box is not sending one back. Set the udpIP to the ip of the Windows server/listener.

Oh damn me, the line IPAddress udpIP(1,2,3,4); is literal ?!!
Or maybe i am still not getting something..
What does "Set the udpIP to the ip of the Windows server/listener." mean?

If the server is 192.168.3.2, then set that udpIP to that. It won't work set to 1.2.3.4.

I thought so, but i don't right now have my kit here, only coding, but i thought you saw at the first post that i said for the example and assumed you implied it was wrong "(the example here http://arduino.cc/en/Tutorial/UDPSendReceiveString , sets the same IP and the same port in the processing script as in the arduino script [pc-arduino sides] )."
If that settles the whole matter then once again i thank you very much mr surferTim and sorry for the confusion! When implemented i hope i won't need to come back : )
One last question:
How will Processing be able to receive the udp string sent by the arduino? Only by setting the same port to both scripts and same IP as you last stated?

That name of that sketch is misleading. It is called UDPSendReceiveString, and it really should be UDPReceiveSendString. It listens for a udp packet, and when it gets one, it sends a response packet back. But that is your PC's job in your case, right?

When you get the PC receiving the packet, then you can code up the Arduino to listen for a response packet from the PC. Is that what you want?

The Windows Processing side is not one of my specialties. I'm a Linux guy. But the Windows listener must be listening on the same port as you have set in udpPort in the Arduino code.

The biggest problem with Windows boxes is the firewall. Insure you have allowed the UDP port through the firewall, or it will be a no-go for sure.

Thats even better now, i am beginning to get this.
UDP port exceptions already there.
I dont want anything to be received by the Arduino, ONLY send FROM Arduino to my pc a string each time, only that, but through UDP,, I just need that string in my Processing.
So same ports and same IP as static ethernet IP,
but the issue with how in the world does processing receive the udp string is still somehow clouded to me