04-12-2023 02:24 PM
Need help in understanding how to use a queue.
I have TIMEVALUE class has in its private data cluster:
time (timestamp)
value (numeric)
also a MEASUREMENT class that has in the private data cluster:
name (string)
ID# (numeric)
Description (string)
buffer (TimeValue object) - keep historical data that the user defines from a configuration file.
I'm having hard time understanding how to define the buffer in the private cluster.
As this is a buffer of TIMEVALUE class, I had to manually define the element type and then the queue out.
It appears that it only lets me create a reference in the private cluster.
So how do I correctly define a persistent buffer of initially zero size in the MEASUREMENT private cluster?
Solved! Go to Solution.
04-12-2023 02:51 PM
You already answered your own question. Your private data will contain a reference to a queue of TIMEVALUE objects. When you instantiate an instance of your MEASUREMENT class you initialize the reference with the reference returned from the Obtain queue. Basically, you need to have an initialize method for your measurement class.
04-12-2023 05:18 PM
Yeah, this is what I tried but it didn't work. what do I do with the output of obtain queue in my initialization?
04-12-2023 06:22 PM
disregard that last one. This following seems to work. So I noticed that for the element type, I can either choose control or constant.