Terminated for publisher and subscriber [message #1809722] |
Mon, 22 July 2019 03:16  |
Eclipse User |
|
|
|
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 #1810480 is a reply to message #1809791] |
Mon, 12 August 2019 11:16   |
Eclipse User |
|
|
|
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 12:51  |
Eclipse User |
|
|
|
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.25125 seconds