R024 UDP Adapter


Outline

The UDP adapter (User Datagram Protocol) acts as a UDP client. The received data is forwarded to a configurable reader. Scripts are used to send datagrams and activate the streaming environment (stimulation). The adapter can be combined with other adapters using a multi-adapter port.

Platforms
32/64bit 32/64bit 32/64bit
Requirements
  • None
Known limitations
  • None.
Status
  • Stable
Operations
  • Connect
  • Read
  • Sync
  • Stimulate
Parameters:
  • Enable: Enables/disables the port adapter.
  • Socket: Select the socket number.
  • Mode: Normal (feeds all datagrams into the input stream), Manual Feed (use stimulation script to feed the input stream).
  • Reader: Select the reader to parse the raw data stream.
  • Configuration: Optionally, a serialization configuration can be selected (depending on the reader).
  • Insert as root: If the adapter is included in a multi adapter port, the flag will force the adapter to add its signal hierarchy into the root of the combined record.
  • Write input to file: Select a file to log the input stream.
  • Synchronisation: Allows to define a script to do adapter synchronisation.
  • Stimulation: Allows to define a script to stimulate the connected server.


Video

Screen Cast: Using the UDP Adapter



Modes

  • In "Normal" mode, the adapter feeds the input stream (that is parsed by the reader) with the incoming datagram packets.
  • If "Manual Feed" mode is chosen, the stimulation script need to handle incoming datagram packets and insert them into the input stream.


Source Configuration

  • Socket: Socket number
  • Write input to file: Select a file to log the input stream.

You may specify a file "Write input to file" to store the raw input for debugging purpose.



Serializer

Configure the serializer by selecting a reader and optionally a reader configuration (some reader require a configuration, e.g. the CSV reader).
You may use the buttons '+' and '...' to add and manage existing reader configurations (Preferences).
You may use the "Test Line Reader" (extracts lines from the raw input) and "Test Block Reader" (extract fixed size byte blocks) for debugging purpose.


Synchronization

Using a multi adapter port, you can combine an unlimited number of different input adapters. The synchronization section of the adapters allows you to synchronize inputs with different domain bases (e.g. each input has its own time base).

11 Synchronisation


Stimulation

There may be cases where the server need to be stimulated to make the source data available. In this case, enable the "Enable Script" check and extend the stimulation script according to your needs.

The script is executed after connecting (background thread).

If "Manual Feed" mode is chosen, the stimulation script need to handle incoming datagram packets and insert them into the input stream. In the below example, all incoming packets are just forwarded to the input.

	// socket      : Socket object (java.net.DatagramSocket)
	// feed        : Feed output (java.io.OutputStream)
	// log         : Log output (java.io.OutputStream)
	// progress    : Progress control (de.toem.impulse.cells.ports.IPortProgress),
	// console     : Console output (de.toem.impulse.scripting.IScriptConsole)
	
	// example for manual feed
	var ByteArray = Java.type("byte[]");
	var bytes = new ByteArray(0x10000);
	var packet /*:DatagramPacket:*/ = new DatagramPacket(bytes, 0x10000);
	while (true) { 
	    socket.receive(packet);
	    if (packet.getLength() > 0) {
	    
	        console.println( "written"+packet.getLength());
	        feed.write(packet.getData(), 0, packet.getLength());
	    }
	}

	

toem

technical software and tooling

Company

Contact Us

This email address is being protected from spambots. You need JavaScript enabled to view it.