LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

parallel access to array in realtime

Hi,

my realtime-vi consists of several simultaneous running loops. The processes in all loops must write to the same array. My first intention was to use global variables. But somewhere I read, that you shouldn't use global variables in timecritical vis. Is there another way to write to one variable (array)? e.g. by accessing the memory?

Regards
foenig
0 Kudos
Message 1 of 2
(2,176 Views)

two ways:

first: the so called LabVIEW2 style global. No race condition and only one memory for the data. However, if two loops want to write at the same time, one has to wait (a very small amount of time, but depending on the the amount of replaced elements (if random placed)). Search the forum and KB for this powerful way of handling data.

my second approach would be the producer consumer construction: another independent loop with a shift register to hold the data and a queue to pass the data.

 

sorry, only some hints...

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


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