01-18-2008 12:06 PM
01-19-2008 11:52 AM - edited 01-19-2008 11:53 AM
You really should change your architecture. I assume that your other controls also control the robot, so you will need more complex messaging.
I suggest you look at some of the examples and templates for queued message handler. Essentially, this will allow you to send message between two loops, which is probably what you want.
As for what your comm loop should actually look like, you should separate the opening part from the communicating and closing part. That way, you can send the Ready string immediately after connecting. The example code you used already handles the timeout error, which is the indication you want that the connection was lost.
Here's one (very bad) example of how this could be done:
You should note that this does not really do any error handling. If you use a queued message handler and actually turn the comm loop into a state machine (with states like Open,Comm and Close), it should be cleaner.
To learn more about LabVIEW, I suggest you try looking at some of these tutorials.
01-25-2008 05:21 AM
01-25-2008 05:26 AM
01-25-2008 07:28 AM
01-25-2008 08:11 AM
01-25-2008 08:16 AM
01-26-2008 11:55 AM
SCMAJA wrote:
if my server crashes then the read loop just keeps reading and giving me the 56 time-out instead of e.g. connection closed, refused or something like that.