From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Who's timestamp is it (Shared variable)?

Solved!
Go to solution

I have a shared variable hosted on "My Computer" that I'm reading on a RT controller.  Is the timestamp that the RT controller reads referenced to the RT controller's clock or is it the time stamp from the host computer when the variable was updated by the host computer?

 

Thanks,

 

XL600

0 Kudos
Message 1 of 5
(3,119 Views)
Solution
Accepted by Ben

I guess I answered this for myself.  If I modify the clock of the host PC, the RT controller reads the time stamp as set on the host.

Message 2 of 5
(3,098 Views)

I asked because I wanted a reliable way to determine if my host is still active (So I can gracefully shut down my RT app on loss of the host).  I use NSVs for this since they are independent of VI operation (I could use a network message instead I guess).

 

Untitled.png

 

This is a snippet from my RT watchdog process.  Since the NSV timestamp isn't referenced to the RT clock, I have to get a RT timestamp along side each NSV read to determine when to check if the NSV value has changed.  I sure wish there was an optional error in to the timestamp VI.  I really hate having to use flat sequence structures like this.

 

The HOST vi is just an FGV that my RT main uses to determine if the host is alive.

0 Kudos
Message 3 of 5
(3,071 Views)

Thanks for closing the loop on this. Also, I haven't looked too much into it, but there are watchdog examples within LabVIEW. I am not sure if you built your project off of those, but that could help as well.

Help > Find Examples... > Search > "Watchdog"

Madison T
0 Kudos
Message 4 of 5
(2,995 Views)

I had written most of my watchdog process long ago (Before I was even using RT) so I never got a chance to use the Watchdog functions Smiley Sad.  They would have cleaned up the code quite a bit but would add the need for handling arrays of occurrences.  The nice thing about those functions is they are simple to configure (Just give it a time out and use whatever loop you want to 'whack' the dog.  NI should have called it 'kick', but we won't get into that right now...).  You can also generate multiple watchdogs (Their IDs are essentially global) to form arrays of watchdogs.

 

My watchdog process does pretty much the same thing using timestamps, shift registers, and case statements.

 

  • Monitors the heartbeats of each main task loop (I have 😎
  • Monitors the heartbeat of my host (The source of this particular topic)
  • Monitors the heartbeat of a connected data system (An external VME chassis that collects data via a non-LabView vxWorks exec)
  • Monitors RT loads (Provides overload alarm)

Had I implemented it with the RT watchdog as the base timing mechanism from the start, it would likely be a much cleaner and smarter design.

 

NI should make the watchdog VIs into general VIs useable on all versions of LabView (Not just RT).

 

Thanks,


XL600

0 Kudos
Message 5 of 5
(2,989 Views)