This app is working well, but I am going to receive xfer.rxBuf[i] data on node-read in real time while app is running.
I have studied exec node and daemon node for it, but I have not found the solution for it.
Hopefully I want to implement using stdout.
What's the best method for it?
Have you thought about rather than read/write to/from stdout with the app/node-red, to utilise MQTT and send data from your app to Node-RED over MQTT? You would then run each as separate processes, and can start/stop both without having to keep the other process in mind, nor forking.
If you're not familiar with MQTT, here's a good getting started manual to understand the concept behind it. https://www.hivemq.com/mqtt-essentials/
On top of that, there are good C++ libraries available for MQTT.
Depending on where you run your application, either use one of the standard Paho MQTT libraries (regular / embedded), or when running on Arduino or ESP8266/ESP32 that deploy through the Arduino IDE, use Nick's PubSubClient.
I am really not sure if a Pi Zero will be able to manage this on "every 20 ~ 50ms", while also running other applications on it. That equals between 20 and 50 times a second. The Pi zero series is remarkably slower than other raspberry models, as is to be expected.
I am considering to IPC(Inter Process Communication) for communication between app and node-red.
I have found node-red-contrib-ipc node for it.
But I have some troubles to create & open the fifo.
Also I am not sure if I can use node-red-contrib-ipc node on my application.
Please let you check my new solution and give me your suggestion.