NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand Queue with LabVIEW (replacing Batch Dialog)

Hi,

 

I want to replace the default Batch dialog UI with one made in LabVIEW with as little change as possible in the original processmodel (BatchModel.seq).

To accomplish this, I want to use the "Create Dialog Request Queue" in the process model. I've attached a small example.

There are 2 issues I'm struggling with:

1: The process model use a type named "NI_BatchControllerRequest" and name the container "ControllerRequest" in the "ProcessDialogRequests" sub sequence. Can I pass this as a LV Cluster and Variant (see example).?

2: I can't seem to get the Queue reference in LabVIEW (see LabVIEW example). It works fine if I use a name (string) instead, but the Queue in the process model use Object Reference, and I would like to keep this setting. 

 

TestStand version: 4.2.1

LabVIEW version: 2009

(I would also like to implement this in TS 4.0 and LV 8.0)

 

I'd appreciate any help on this.

Regards
Tom Andres Lomsdalen, CTD
0 Kudos
Message 1 of 11
(5,481 Views)

Hello Tom,

 

I think it would be useful to take a look at a couple of examples. The first one is dealing with editing the serial number dialog. You can find this example by navigating to <National Instruments>\TestStand\Examples\ProcessModels\BatchModel. You can use one of the 2 process models located there. Also for using queues I would take a look at this example to see if it helps out. Let me know if this works out. Have a great day!

 

Best Regards,

 

Adam G 

National Instruments
Applications Engineer
0 Kudos
Message 2 of 11
(5,409 Views)

Adam,

 

Thanks for your reply.
I’ve looked at the LV example, but in this example a String variable is used to reference the queue, and this works fine.

Please have a look at my attached example. I’ve copied the original Queue steps and properties from the Batch process model. I would like to use the original model settings for the queue.

 

What I actually want to do is to restart a test socket from my LabVIEW dialog (if one socket has terminated), the same way the original dialog does it (a Restart button). I believe this is done in the “ProcessDialogRequests” sequence, with a queue element added from the original CVI dialog with a “Restart TestSocket” command in the “ControllerRequest” property.

Thanks.

Regards
Tom Andres Lomsdalen, CTD
0 Kudos
Message 3 of 11
(5,402 Views)

I am also trying to access an unnamed TestStand queue from within LabVIEW.  But I also can't figure out how to convert the propertyobject (the TestStand property that holds the queue reference) in LabVIEW to a TestStand queue object.  I tried to typecast the object to a Queue object and to a SyncManager object, but both fail.  I know this is an old thread, but does anyone have a solution?  Thanks!

 

Jeff

0 Kudos
Message 4 of 11
(4,885 Views)

@jsiegel wrote:

I am also trying to access an unnamed TestStand queue from within LabVIEW.  But I also can't figure out how to convert the propertyobject (the TestStand property that holds the queue reference) in LabVIEW to a TestStand queue object.  I tried to typecast the object to a Queue object and to a SyncManager object, but both fail.  I know this is an old thread, but does anyone have a solution?  Thanks!

 

Jeff


Where exactly are you getting the property object from?

 

You should be able to call GetSyncManager on the engine and then cast the return value to an ISyncManager. How exactly are you trying to do this and what exactly is failing?

 

-Doug

0 Kudos
Message 5 of 11
(4,878 Views)

I am getting the property object from Locals.ModelData.DialogRequestQueue from the sequence context of the top-level thread of the execution.  The problem with GetSyncManager is that it requires the name of an object (for which there is none).  I have the object itself.

Get Sync Manager from Engine

 

I have also tried to convert the object directly to a queue or a sync manager, but the conversion fails.

Cast Object to Queue

Cast to Sync Manager

0 Kudos
Message 6 of 11
(4,872 Views)

The object you get from Locals.ModelData.DialogRequestQueue is the IQueue interface itself. Just convert that to TSSyncLib.IQueue. You don't need a name for the queue. I see you tried to do this, not sure why it didn't work for you.

 

The second screen shot in your post looks the most correct. What exactly was the error you got in that case? Building the data correctly to put in the queue can be tricky so that might be where the problem is.

 

Hope this helps,

-Doug

0 Kudos
Message 7 of 11
(4,838 Views)

I agree, the second diagram is what I was expecting to work.  The error I get is in the Variant to Data node, which is

 

Error -2147467262 occurred at Variant To Data in Send Controller Request.vi->Send Controller Request (View Report).vi->View Report Button Pushed.vi->VIE 4UP GUI.vi

Possible reason(s):

LabVIEW:  (Hex 0x80004002) No such interface supported.

 

(The data type of the Queue to which I am trying to convert is TSSyncLib.IQueue.)

 

So the problem is not in the building of the data.  I don't think it's a problem with the Execution reference either, since I don't get an error reading the Locals.ModelData.DialogRequestQueue property.  I can't figure out what could be the problem.

 

 

Jeff

0 Kudos
Message 8 of 11
(4,833 Views)

I see what the problem is. Don't use the "TestStand - Get Property Value (object).vi". That is returning the variable itself for Locals.ModelData.DialogRequestQueue rather than the value it contains. Just do SequenceContext.AsPropertyObject then call GetValInterface on that. It seems like "TestStand - Get Property Value.vi" is missing the ability to get object reference values. I'll add a request to our tracking database to look into this.

 

Hope this helps,

-Doug

Message 9 of 11
(4,811 Views)

Hi, Doug,

 

Thanks, I think that's the problem.  Thanks!!!

 

This is a pretty subtle issue that I would have never thought of.  I guess I can see there would be a case where you would want the variable object itself rather than its value, but "TestStand - Get Property Value (object).vi" is definitely not consistent with the equivalent VIs for other data types.  Perhaps this VI should be named something like "Get PropertyObject", and a new VI with the old name "Get Property Value (object)", with the functionality I was looking for, should be added.

 

Jeff

0 Kudos
Message 10 of 11
(4,797 Views)