How to create global counter
I want to create a global counter in a script so as every newly inserted VU as well as every already inserted VU while running in a loop will take a new/unique value. I have currently succeeded in having unique values per VU loop but all new VUs are using the same values as the first VU. Can you provide some hints on how to achieve this?
Thanks in advance,
Re: How to create global counter
You need to use a combination of global variables and local variables.
Integer Counter_global, global
integer Counter_local, local
ACQUIRE MUTEX "Getcounter"
set Counter_global = Counter_global + 1
set Counter_local = Counter_global
RELEASE MUTEX "Getcounter"
! The remainder of the script uses counter_local