NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use property object with dequeue

I tried to do following steps in Labview7.1 and Teststand3.1:
- Create a named Queue in Teststand
- Get the named Queue reference in Labview (GetQueue)
- Enqueue an property of type NI_BatchControllerRequest into the Queue in Teststand
- Dequeue the element in Labview by using a Fileglobal of type NI_BatchControllerRequest as destination property object

At the first Enqueue, the object is correctly dequeued and stored in the Fileglobal. But at the next enqueue, I get the error -17300 (Exception occured in TSSync, Unable to set a top-level property object to another object) at the dequeue operation.
When I use flat datatypes like string or bool, there are no errors, also at multiple enqueue operations.

Can anyone help?
0 Kudos
Message 1 of 8
(6,033 Views)
LVFan -
Questions:
Are you storing the value by reference?
Are you dequeuing the element to a non-reference object location?

In your Enqueue, I assume that you are storing the element by reference and not by value. In your Dequeue, I assume that the location that you are using is a property that has a matching type.

TestStand does not allow an object to have more than one parent, i.e a Locals.MyNumber can only have one parent, Locals. So if you stored Locals.MyNumber into the queue by reference, the only way to dequeue the element is to store it into a reference object variable. And then you must access the value from there.

Scott Richardson (NI)
Scott Richardson
0 Kudos
Message 2 of 8
(6,033 Views)
I have tried to reproduce the problem and cannot.
What version of TestStand are you using?
Are you removing the element from the queue for your dequeue?
Can you post a simple example of this problem?

Scott Richardson (NI)
Scott Richardson
0 Kudos
Message 3 of 8
(6,033 Views)
I'm working with Teststand3.1 and LabView7.1 .
I tried several solutions without success:
- enqueue by reference
- enqueue by value
- new property object of named type as dequeue destination
- new property object of reference typ as dequeue destination
- fileglobal of named type as dequeue destination (this works on the first run, but at the next enqueue the error -17300 appears)

The same VI works, if I enqueue simple datatypes like string, num, bool, but not named types.
Download All
0 Kudos
Message 4 of 8
(6,033 Views)
LVFan -
I did not realize that you are using the SyncManager low level API. The low-level API has a few restrictions that the step type does more work to hide from the user.

If you look at the dequeue API function it takes an input parameter which is the destination object. Internally the dequeue operation uses the SetPropertyObject method to do the assignment. This method requires that the object that you assign a value to has a parent so that the engine can go to the parent, delete the child, and add the new child in its place. Even if the destination property object that you supplied had a parent, your reference to the "destination" would not be the new object because your reference is pointing to the old property a
nd not the new one. You would be required to go to the parent and ask for the child again.

A simple change to make this work for you is to use a reference object as the destination and then use GetValInterface on it to get the element from the queue. I have updated your VI to illustrate this.

Scott Richardson (NI)
Scott Richardson
Message 5 of 8
(6,033 Views)
Thank you very much.
0 Kudos
Message 6 of 8
(6,034 Views)

Hi, I've a question about the example: how can I add new elements to the queue from Labview? I've tried the Enqueue operation but I obtained errors...

If someone has already done this kind of example...

 

Thanks

0 Kudos
Message 7 of 8
(5,398 Views)
Hi Bixente,

I modified and re-attached the above Queue.vi to perform an Enqueue instead of a Dequeue.

Regards,

Message Edited by James M on 06-01-2007 12:36 PM

0 Kudos
Message 8 of 8
(5,369 Views)