11-24-2021 09:54 AM
Wondering if anyone has a quick example implementation of this working. The demo file works fine.
I am having issues getting the modbus server portion working. Here are the steps I am taking in this order
Single run
I open the TCP Connection
I initialize the listener
In the loop
Then I take the listener_ID created and listen_for_connections with that ID
Then listen for requests
It seems to have an issue with the listener_ID created because that is the only variables I am taking into the "listen_for_connections"
Attached the error, initialize, and running code
Initialize Code
Running Code
Error
Solved! Go to Solution.
11-30-2021 04:54 AM
Hi,
In the modbus server code, you must use the "Initialize Listener" and the "Listen Connections" functions (see attachment).
The port number must be connected to the first input of the function "Initialize listener"
Hope this helps!
Mathilde
11-30-2021 09:10 AM
I really appreciate the help and your example worked. I can't figure out why when I try to organize it a little differently it stops working. Looks like it gets hung up after the initialize listener. I can work around it since you helped me get the basic connection code but have other reasons for organizing it this way and can't see the difference between what you sent and the execution of the other code. Thanks again in advance
11-30-2021 09:21 AM
The second case structure must be executed after the first, otherwise the local variable is not initialized.
In your code, the 2 structures are not sequenced.
11-30-2021 10:24 AM
Thank you. I did try that previously in my main code and did not work using a flat sequence structure wrapped around the case structures. I revised this example to include as well and still gets hung up with error 56 like previously.