Terminated for publisher and subscriber [message #1809722] |
Mon, 22 July 2019 07:16 |
joy woo Messages: 198 Registered: May 2019 |
Senior Member |
|
|
Through monitoring, I found the status of Subscriber_1 is terminated, i check the source code in forte:
EComResponse CRawDataComLayer::openConnection(char *){
switch (m_poFb->getComServiceType()){
case e_Client:
case e_Publisher:
if(m_poFb->getNumSD() != 1 || (m_poFb->getNumSD() > 0 && CIEC_ANY::e_STRING != m_poFb->getSDs()[0].getDataTypeID())){
return e_InitTerminated;
}
break;
case e_Server:
case e_Subscriber:
if(m_poFb->getNumRD() != 1 || (m_poFb->getNumRD() > 0 && CIEC_ANY::e_STRING != m_poFb->getRDs()[0].getDataTypeID())){
return e_InitTerminated;
}
break;
}
return e_InitOk;
}
}
that means when it is Subscriber_1 the output data ports shoud be 1, and the output data port should be linked to STRING TYPE, so i add a F_STRING_TO WSTRING to output data, deploy again, the the status is correct and not 'TERMINATED' any more, i am confused, if to use subscriber and publisher should be so restrict, too many rules make it difficult to the users, so if any special purpose here to set status to TERMINATED?
|
|
|
Re: Terminated for publisher and subscriber [message #1809730 is a reply to message #1809722] |
Mon, 22 July 2019 07:54 |
|
Hi,
this is a special rule of the raw data layer. Which allows only one input or one output and that has to be of type STRING. Normally most layers give additional information on the STATUS output. It looks like that this has not been implemented yet. However the the RAW layer is something that you have to explicitly use. Are you really explicitly using the raw layer?
In general the Communciation FBs have generic in and ouputs of type ANY. Without connecting them to a specific type the FB does not know what data you like to receive.
|
|
|
|
Re: Terminated for publisher and subscriber [message #1809737 is a reply to message #1809735] |
Mon, 22 July 2019 08:43 |
|
Unfortunately we don't have much documentation for our FBs. In general the same FBs should behave the same in both FBDK and Eclipse 4diac. We have a bit more advanced communciation blocks. But if you use them the same way as FBDK they behave the same. Please have a look at the communication protocols in our docs on the advanced behavior.
Yes we currently don't have current samples. This is something we haven't found time for that. Please not that our work on 4diac is mostly based on different research and industry projects. The goals there define what we can do. However we are happy for your support and contributions.
|
|
|
|
Re: Terminated for publisher and subscriber [message #1809791 is a reply to message #1809786] |
Tue, 23 July 2019 13:12 |
|
I think you missunderstood me. I definitly didn't recommend you to use the raw layer. As said the raw layer is a very special one, which I would recommend only if you are reallly knowing what you are doing. Did you had a look on our communication documetnation?
|
|
|
Re: Terminated for publisher and subscriber [message #1810480 is a reply to message #1809791] |
Mon, 12 August 2019 15:16 |
joy woo Messages: 198 Registered: May 2019 |
Senior Member |
|
|
another question, for example, there are three output data values in cutsom fb of traffic light, red, yellow and green, if connect to the publish_1 which allows only one parameter, i want to transfer them to HMI, i tried concat strings(yellow,green,red) in ST,
but it seems to not support.
|
|
|
|
|
Re: Terminated for publisher and subscriber [message #1810491 is a reply to message #1810489] |
Mon, 12 August 2019 16:51 |
|
ah yes this is the problem of the rawdata sample layer and the crappy MQTT. I'm not so deep into MQTT design. But you always need to weigh of between topic vs. content. the advantage of 3 different publishers would be that in the MQTT model you have three topics. combining everything into one topic has the draw back that you loose that. you now have several options. One is that you write your own layer which handles more then one input. You could take the raw as starting point. i know that someone put even a json layer into the forum. Maybe that is what you need. Or you write your own basic/simple FB which is utilizing the IEC 61131-3 string functions to generate an apropriate string for the raw layer.
|
|
|
Powered by
FUDForum. Page generated in 0.02372 seconds