Receive mod-bus command -- TCP nodes

Hi team,

i try to use a TCP nodes to send and receive data in the local network.

for this, i try a simple application to see the result.

i want to send a mod-bus command for an mod-bus flex getter using a function "the attached image", but i couldn't receive the same message sent.

any idea !?

Thanks !


Not entirely certain what you are doing here but you have misspelled address. Maybe that is the problem?

thanks for your reply !

I fixed "address" it wasn’t the problem.

To summarize, by sending a string with "TCP out "(example "hello") I receive "hello" in TCP in.

I want to send the mod-bus command using function and TCP out..... **msg.payload = { 'fc': 3, 'unitid': 1, 'address': 0 , 'quantity': 1 }** , but I receive numbers in TCP in (buffer) or a [ object Object] if i use template after the TCP in.

I think there’s a conversion to be made?

exept string, how I can receive any kind of messages in "TCP in"

set the TCP in node to string?

image

then feed that into a JSON node (assuming the text you receive is valid JSON) to get a proper JS object where you can access the values.

1 Like

wow ! thanks that's work :smiley:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.