LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending heartbeat to check comms

Hi.
As part of an assignment I have to produce a petrol station simulation in
labview. Two computers will be used one being the kiosk and one being the
pumps.

One important feature of the application is that it must detect, and
continue from a communication failure - where the serial link between the
two PC's is broken.

Is a heartbeat the best approach to this - where a heartbeat signal is sent
every x seconds, and if it is not detected, something is wrong and an alert
triggered ?

If this is the best way, can anyone offer me and pointers or guidance on how
this should be implemented as I am clueless.

Thanks in advance
Jason
0 Kudos
Message 1 of 2
(2,861 Views)
Your idea of a heartbeat message sounds right to me, but there are a
few simple things you might want to include also.
If this is serial, you can "invent" your own protocol hopefully. This
would not be hard, just set up 2 or 3 different messages you would
need.

I would suggest the following 2 messages in addition to normal use
messages, use whatever numbers or data you want to for the messages,
but lay these out before you start coding.
1. A Reset Notice message. Sent only after powerup of either device,
because you really don't know if someone reset either computer, or we
just got disconnected. This will let the system know someone was
reset, and it needs to reinitalize.
2. A Heartbeat message. Some people prefer a challenge response type,
and others just use
1 simple message. A challenge respose would be
something like MSG:Are you there Pump, and the Pump responds with an
answer that is different than the message you sent (so you don't
mistake your own message for the response). This allows both sides to
know if the other accidentally got disconnected. As a general rule,
make your timeout for hearing the heartbeat at least 2 times the
normal repitition rate (meaning you need to miss 2 heartbeats)
3. The rest of the message activity can be status messages (busy,
running, cancel current operation) which are really up to you
0 Kudos
Message 2 of 2
(2,861 Views)