08-25-2020 06:19 AM
On the RT side, create the connection using TCP Listen.vi. For STM somebody has to state what the metadata names are, so replace the Read Meta Data with the Write Meta Data on the RT side. From there, it should work just fine.
08-25-2020 11:18 AM
Hello crossruiz,
Thank you for getting back to me. I have tried to implement your idea into my RT vi as follows
Is this what you mean for me to try? I have found that there is no longer an error, but the vi pauses indefinitely at the "Create Listener" subVI. If I put a "Open TCP Connection" after the "Create Listener", then it never reaches it. If I put the "Open TCP Connection" before the "Create Listener", then I get Error 63 before getting to it.
As for the PC vi, I tested what it was doing, and I now know that it does not pause, so it obtains an acceptable network connection at the port. To try things out, I have wired the RemotePort from "Create Listener" to the "Open TCP Connection" to see what happens, and I find that the remote port is not the same as the written port. Why may this be? Here is a snippet of the PC.
- Best regards, 2001J
08-25-2020 01:05 PM
When you create a listener, it is waiting for someone to connect to it. You do not need the TCP Open after that because the Create Listener outputs a connection reference. So when you start running the RT, you have to run the PC code since it is waiting for the PC to make the connection.
Now on the STM, only one side can write the metadata. I recommend that be the RT. So the PC should be using the Read Metadata.
08-25-2020 02:01 PM
Hello crossruiz,
I have changed the code as follows, but I now recieve Error 56. Error 56 entails that I have not received a Network response within the allotted timeframe. However, I had the RT running for a few seconds beforehand so that it could Write the metadata, but it still does not get passed the "Create Listener", so it does not get to "Write Meta Data".
The code in the left window is the PC, while the right window is the myRIO RT.
If I try to have the PC running before the RT, then I get the same Error 56. Should I explicitly provide my PC's IP Address as the Target IP? Also, I read "When a listen on a given port begins, you cannot use another TCP Listen VI to listen on the same port" on the documentation for the "TCP Listen" vi. Does this mean that I should have a single "TCP Listen" subVI on either the PC or the RT?
- Thank you, 2001J
08-26-2020 06:37 AM
One side needs to use the TCP Open Connection while the other uses the TCP Create Listener. My recommendation is that the RT uses the Create Listener (ie acts as the server) and the PC using the TCP Open Connection (ie acts as the client). Only the PC side will need to supply the address to connect to.
08-30-2020 12:22 PM
Hello again crossruiz,
After rewriting my program and implementing your suggestions, I was able to get my program to work. I have now replaced the shared variable system that was previously used.
- Thank you for your assistance, 2001J