Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Watch Values in own application results in TCP reset
Watch Values in own application results in TCP reset [message #1840378] Tue, 13 April 2021 13:48 Go to next message
Thomas Wagner is currently offline Thomas WagnerFriend
Messages: 10
Registered: April 2021
Junior Member
Hi,

I wanted to watch values and using them in a own implemented application using Javas "PrintWriter" class:
String req =      "<Request ID=\""+(reqid++)+"\" Action=\"CREATE\">"
				+ "<Watch Source=\""+watchObj+"."+watchPort+"\" "
sockWriter.write(req);   /*sockWriter instance of PrintWriter */
sockWriter.flush();          /* send now as PrintWriter on default sends on gettin '\n' */
String answer = sockReader.readLine(); /* Buffered Reader: null on error */


I used the protocol defined in the documentation.

Sending
<Request ID="{0}" Action="CREATE"><Watch Source="{1}" Destination="{2}" /></Request>
was answered by a TCP package having set the "reset bit".

The application was deployed to the runtime using the 4diacIDE.
This seems to trigger the IDE permernently sending READ requests. Is that the reason? Is only one watcher allowed and my application is blocked by the IDE as the IDE is the first watcher?

Using Wireshark and adding a watch with the IDE, I noticed that different prefixes are set before XML, e.g.:
P\0\F SYSTEMNAME \0\X
<Request ID="339" Action="CREATE"><Watch ... /></Request>

The prefix always begins with "P\0". Mosttimes followed by the system name, but not always. After that a mixture of printable and -nonprintable characters.
Do they have a special meaning? Is this documented some where?
Re: Watch Values in own application results in TCP reset [message #1840387 is a reply to message #1840378] Tue, 13 April 2021 20:01 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Eclipse 4diac follows the IEC 61499 compliance profile for feasibility demonstrations: https://www.holobloc.com/doc/ita/index.htm

There it is defined how packets sent and recieved by 4diac FORTE have to be encoded. Furthermore there also the basis for the deployment is described. Please have a look in the section on configurability provisions. In short a configuration/monitoring client has to send two strings to the device and will get one string back. The strings are encoded following the definitions in the interoperability section of the compliance profile.

The commands for watching are extensions on top of that specification.

May I ask what the task is you like to achieve. If you want to read data for data analytics are very detailed debugging please be warned that the monitoring is very inaccurate and follows a polled model. It is mostly only sufficient for humans to watch. If you want to have more detailed high resolution data i recommend to use our OPC UA implementation. And on the client side then a java stack like Eclipse Milo.
Re: Watch Values in own application results in TCP reset [message #1840557 is a reply to message #1840378] Mon, 19 April 2021 10:08 Go to previous messageGo to next message
Thomas Wagner is currently offline Thomas WagnerFriend
Messages: 10
Registered: April 2021
Junior Member
Ok, THX.
Now it works.

The HOLOBOC-Pages says that a string length is given as unsigned short big endian. "P" or better "0x50" indicates that a string is send.

So assuming system name is "MY_SYSTEM" (string length 9=0x9) and request xml string has a length of 60(=0x3c) it would be:
0x50 0x00 0x09 MY_SYSTEM
0x50 0x00 0x3C <request>...



The purpose of doing this is to run a system with a NAMUR E177 Datadiode. The runtime will run in a secure environment represented by a PikeOS POSIX Partition with no access to the outside world. Data values are published to an other PikeOS Partition that serves the state to the outside world (Monitoring Partiton). The PikeOS Hypervisor will serve a one-direction-channel from the Partition running forte runtime to the monitor partition.

Therefor a publisher process has to be implemented that writes to the channel. This process together with the channel is the implementation of the datadiode.
In a productive system pulling the forte runtime is not a feasible procedure but its good for a first draft.

Once this will run I am going to analyze if I port OPC UA to PikeOS POSIX or if I implement a special PikeOS Datadiode function block.
Re: Watch Values in own application results in TCP reset [message #1840624 is a reply to message #1840557] Tue, 20 April 2021 20:34 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

You are welcome. Please not the first string (in your example MY_SYSTEM) needs to be the name of the resource where your FB is located.

Looking forward to hear of monitoring is the right element for you. The advantage (maybe also disadvantage) is that you can access all data inside a 4diac FORTE instance. With means like Publish FBs or OPC UA you have to define the data interface as part of your application. This needs work but also has some advantages for defining what is accessible.
Previous Topic:Cross-compiling from Ubuntu to arm32 for Raspberry Pi
Next Topic:IEC 61499 Programming Standard: Will it Become Mainstream?:
Goto Forum:
  


Current Time: Thu Apr 25 00:31:21 GMT 2024

Powered by FUDForum. Page generated in 0.02781 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top