I am trying to communicate to a modbus device using node red. The modbus device can only handle one request every 500 ms. My logic is working ok but it has issue initiating communication in the begining. The only way I am able to initiate communication is by using inject node and injecting a timestamp. Once the communication is initiated then everything works ok as per my script. Now I was hoping to use a "connect" button to inject timestamp and initiate comms but its not working. I checked the payload of my "connect" button and its identical to the inject node. So I dont understand why I am having issues.
it seems the "socketid" format is quite different between the inject node (which is injecting timestamp) and the connect node (which is now connected to change node based on @zenofmud suggestion. I guess socket id would be different but dont know why they have different format of socket id.
Sorry I meant that in the output shown in the images above the inject node has a topic but the connect button does not, Try adding a topic to the connect button. As I said I cannot see how this would make a difference but...
@Colin That's it. This change did the trick! Thank you!
I basically added one more button. So I use one to set IP address for my modbus connector node and then second one for initiating connection. here is the solution.
Do you want to do it like that or do you want it automated? If you have something that has to run on startup then you can use an Inject node set to fire on startup.
Can't you set the IP in the getter node, or is it not always the same?
the device node-red will be talking to can have different IP. So I dont want it automated. Moreover, I am reading from different address location so managing that with a specific interval set within inject node is not ideal. Rest of my logic is working ok. I verified using wireshark!