LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing to Shared variables parallely

Hi,

 

I have the following in my application:

 

  1. cRIO 9074
  2. Host #1 having application monitoring VIs
  3. Host #2 having VIs similar to the Host #1 and monitoring the same application running on the cRIO

I am using Shared variables published on Host #1, to communicate with cRIO. Some of these commands are paralley given from Host #2.

 

When it comes to analog values, I am having problems here!

 

I want Host #1 and Host #2 to be able to change the value of the same shared variable(ex: set the value of a setpoint parameter either from Host #1 or Host #2).

 

When I tried this, the value I was reading from the shared variable kept toggling between the values set from the Host #1 and Host #2

 

After this I read a litreature on ni.com suggesting using the RT FIFO and N/w bufferring properties of the Shared variables to avoid this toggling of values.

 

I have tried almost all possible combinations of these properties, but am getting the same result (toggling).

 

Has anyone faced the same situation?

 

How do we get over it?

 

Any suggestions are welcome

 

Thanks in advance,

 

Regards.

0 Kudos
Message 1 of 2
(2,378 Views)

Perhaps you only want to write to the shared variable in the event the value changes.  Put the shared variable write in a case structure.  Store the host's setpoint value in a shift register.  If the setpoint control changes between iterations, then the SV write in the True case will execute.

 

Now do you want the setpoint control in host #1 to get updated if host #2 does the update?  If so, you may want to read the SV immediately afterwards so it can detect the change occuring in the other host.

 

The attached image should give you ideas, you may need to play with it to tweak it.

Message Edited by Ravens Fan on 05-21-2009 09:31 AM
0 Kudos
Message 2 of 2
(2,349 Views)