LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple use of a shared variable - buffers?

 Hi all,

 

I have an application on a RT target that measured data (around 60 variables stored in a big cluster) in a TCL, sends it via RT-FIFO

(a modified U8-Array buffer that contains the data converted into string and then flattened to U8-Array) to the NTCL which then

writes the data to a file and sends it via TCP/IP to the user interface on a PC.

This is slow. I know that strings should be avoided on RT and especially extensive formatting of variables into strings. I want to

switch over to shared variables now and write files on the PC only.

Problem: I need the data on the RT target as well for control purposes (PID regulation of a cooling system). Can I read the same shared

variable twice, once in the control sub-vi and once on the PC? How does that affect the buffeing of the shared varaible. Does each

"subscriber" gets its own read buffer?

Or should I use a global variable (this will again be a 60 element cluster) on the RT for communication between the read-data-vi, the

control-vi and the send-shared-variable-to-host PC-vi. As I've read, big global variables should be avoided as well on RT-systems.

Or can I use a queue instead of the global variable for the data-cluster? 

 

Cheers,

 

Olaf

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

Hey,

 

Transfering data from a TCL to a NPL (Normal Priority Loop) via RT FIFOs and then via TCP/IP to a Host System has a better performance then a shared variable.

So using shared variables instead of your actual architecture wont result in a better performance. I would suggest to optimize your code.

 

According to the shared variables behaviour: yes, you can read it at your Host and the RT System at the same time without loosing data when configured as RT FIFO.

 

Christian

0 Kudos
Message 2 of 2
(2,127 Views)