LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange SV behavior

I have a work around for this based on posts here, but I thought I might pose this question anyway.  I have a shared variable that I use to initiate communication (a simple time stamp sent from the host).  The SV tells the server that it is listening and that it can commence execution.  As such, I have a wait on the SV set to wait forever (until a fresh value is found).  Now, regardless of whether I read the SV to clear the buffer and set up the subscription the wait only seems to execute properly in two cases:

 

 

  1. If the SV library is explicitly undeployed and then redeployed prior to execution
  2. If the SV is in a loop and the first value is ignored (i.e. it waits only on the second loop execution regardless if the SV is read prior to entering the loop)
Below is an example of how things might work if the library is not undeployed and redeployed explicitly.
21299iB03EFE7E9F8476F0

To get everything talking correctly, I do the former, but this is still irritating.  Can someone please explain to me if I am doing something incorrect or is this expected behavior?  It is a little disconcerting that I have to do this (and just a little cumbersome when I am in the process of trying to debug an application and hence having to due the first case over and over again).

 

Peace, Matt

0 Kudos
Message 1 of 3
(2,631 Views)

Have you tried writing to clientTime once (on both target and host) before using it? i.e. in an initialization routine on startup.

Richard






0 Kudos
Message 2 of 3
(2,585 Views)

Hey Arrow,

 

Thanks for the reply.  Soooo...

 

It is indeterminate ahead of time which will turn on before hand (stupid users Smiley Wink), so I can't rely on the host coming on before the target.  The variable clientTime is a heartbeat, so I need to be able to poll this value beforehand (it will tell the target whether the host is active).  The odd thing about this that it works if I undeploy and redeploy; and it works when I put the value in a loop; it just doesn't work as above.  Go figure.

 

One thing that I failed to mention above is that the variables are hosted on the target.

 

Peace, Matt

0 Kudos
Message 3 of 3
(2,548 Views)