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 » Sending commands to Forte over TCP; Header in Payload(Searching for the principle of creating the "header" in the TCP Payload. (Java Socket - Client))
Sending commands to Forte over TCP; Header in Payload [message #1848229] Thu, 25 November 2021 14:08 Go to next message
Eclipse UserFriend
Dear all,

I am currently working on sending management commands directly over TCP to Forte (on a Raspberry Pi).
To do this, I looked at the stream that 4Diac IDE sends to Forte and realized that the same content is being sent as what is in the forte-bootfile (except the query command).


In my own attempt to send the content, I run into a problem in the TCP payload. There seems me to be some kind of header included before the actual command. Can anyone tell me how the bytes come about?

In the pictures it is for example in the 1st request:
P (0x50) + null (0x00) + null (0x00) + P (0x50) + null (0x00) + @(0x40) -> Command (<Request...).

index.php/fa/41368/0/

For another request linked to a resource, the first 2 bytes are the same (0x50, 0x00), the third (0x07) is not. Between the resource and the command are another 3 bytes (0x50 0x00 0x93).

index.php/fa/41367/0/

I have already tried the Java socket as described on Holobloc. The sending works in principle in the same way. I use the ObjectOutputStream and tried different commands (writeBytes, writeObject...). However, the "header" of the payload does not fit properly.

Further attempts I have made also in Python and C, however by their Send function no "header" arises in the Payload, but starting from the 1.Byte the bytes are contained by the Command.

If I program e.g. the complete payload of 4Diac IDE as byte array in C and then use this in C as payload, I also get the response of Forte with the response ID as payload.

However, I would like to understand how the bytes - that are not part of the command - result.

I'm looking forward to your answers :)

Best,
Johannes
Re: Sending commands to Forte over TCP; Header in Payload [message #1848234 is a reply to message #1848229] Thu, 25 November 2021 17:33 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1589
Registered: January 2014
Senior Member

Hi Johannes,

the palyoad foramt that 4diac is using is defined in the "IEC 61499 compliance profile for feasibilty demonstrations" https://www.holobloc.com/doc/ita/index.htm There you should find all the information that you need.

in principle its two strings sent in one packet each string is prefixed with 0x50 and the two bytes with the length of the string in big endian format and the the bytes of the string.

I hope this helps.

Alois
Re: Sending commands to Forte over TCP; Header in Payload [message #1848420 is a reply to message #1848234] Wed, 01 December 2021 16:19 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alois,

thanks for your answer. With the 2nd hint i managed it.

Regarding the holobloc reference:
In which part of the table of contents should I find the prefix term 0x50 + string length?
In the IEC 61499-4:2013 I haven't found it there either.

Best,
Johannes

Re: Sending commands to Forte over TCP; Header in Payload [message #1848425 is a reply to message #1848420] Wed, 01 December 2021 18:13 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1589
Registered: January 2014
Senior Member

Hi Johannes,

Clause 6 of the compliance profile defines what data is to be sent to devices for configuring them and what data is returned. Clause 5 Interoperability Provisions defines how the data is encoded. There you find how strings are encoded with teh 0x50 + lenght + string content.

I hope this helps.

Cheers,
Alois
Previous Topic:4DIAC Forte Run In STM32
Next Topic:Error:Unreachable Function Block
Goto Forum:
  


Current Time: Thu May 09 19:58:26 GMT 2024

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

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

Back to the top