11-25-2008 02:01 PM
Software: Teststand 4.1, Labview 8.5
Process Model: Parallel
I've been searching all the posts re replacing modelsupport2.dll with a Labview equivalent - without success.
I too want a dialog that shows all the socket serial number entries on one common form (like modelsupport2 does), but want some extra functionality that doesn't come with the default modelsupport2. I don't have the cvi compiler to change the original modelsupport2.dll code, so want to make a labview replacement. This appears quite complex due to the thread synchronisation between executions for the parallel model.
The two usual alternatives appear to be...
1/ Add serial number entry dialogs to the user interface code...... I definitely don't want to do this as I want the same serial number behaviour when using the sequence editor. This also goes against the recommendations in the "Best Practices for TS UserInterface Dev" whitepaper.
2/ Use a concept similar to that shown in the "OverrideSerialNumForParallelModel.seq" found on the NI website. Unfortunately this launches a new dialog box for each parallel execution, i.e. if you have four parallel executions running, four separate serial number entry dialogs popup (launched by the preuut and postuut callbacks).
I'm thinking of a third method that behaves like modelsupport2, but uses a Labview replacement. It would work like this....
3a/ Build a Labview VI that has a custom UI Message handler. Also add the ability to read/write teststand globals using the Teststand API GetProperty/SetProperty VIs, and the "TerminationMonitor" subvi so your VI knows when to shutdown.
3b/ Add any special functionality to your vi by placing code when your custom events fire, i.e. use the TS UI vis to modify global variables inside Teststand engine to set flags, statuses, statevars etc.
3c/ Set ParallelModel_ShowUUTDlg=false in your ModelOptions callback to disable modelsupport2 from popping up and ruining everything!!!
3d/ At the start of parallel testing when creating all your instrument handles etc, launch your new vi in a separate execution. The vi will then sit in its event loop waiting for custom UIMessages to fire. Using events here means no polling is required, hence the vi should be light on cpu resources but won't miss any requests from the process model.
3e/ Modify the PreUUT and PostUUT callbacks in your parallel process model to post custom user events to your waiting vi's event loop. I've picked these model callbacks because they will run during the "serial number entry" and "result display periods" for each socket respectively. The custom messages could be things like "WaitingForBarcodeEntry", "SocketPassed", "SocketFailed", "DisableThisSocket" etc.
So...... that's what I'm going to try. My approach gives me complete control of the serialnumber entry/result display on a single form (note that this complexity isn't required for the batch model). Has anyone attempted this approach and does it work????????
I'm hoping someone has achieved something similar so I don't waste hours trying a flawed concept.
Regards,
Tom
12-02-2008 03:39 PM
12-09-2008 01:08 PM
Tom,
I think I am wanting to do the same thing. It seems like you want to put all (or most) of the UI functionality into the process model (as part of the serial number display). If I can do that, then I wouldn't even need a regular UI, since I just want the operator to run a program that starts the Test UUTs execution and quits when the execution is complete. The client sequence files will be selected automatically based on the serial numbers. I'm surprised that I haven't been able to find examples of this.
The parallel process model synchronizes UUT executions with the SN interface from modelsupport2.dll via TS queues. Why not keep that infrastructure in the sequence and create a LabVIEW VI that writes to the queues, rather than writing to TS variables? This would adhere to the structure of the original process model a little better, and you could leave ParallelModel_ShowUUTDlg alone (and continue to use it as it was originally defined). You will need to replace calls to the Dll with equivalent VIs to communicate with the SN VI, probably like you say in 3e, but I think you wouldn't need to use UIMessages--perhaps a LV queue or notifier.
I don't know if you want this or not, but I think I would want each test socket to display sequence execution information, such as the current step. This is where an Application Manager event handler (including a UIMessage handler) and ExecutionView Managers would be necessary. But I'm not quite sure that these managers work well within code modules rather than in an external UI. Anyone else have any opinions?
12-09-2008 04:53 PM
12-10-2008 04:38 PM
12-10-2008 09:06 PM
I actually haven't really used TestStand notifications and queues within LabVIEW, but I did see those links, and they (along with this link: http://forums.ni.com/ni/board/message?board.id=330&message.id=11906#M11906) convinced me that it's easily doable.
One of my suggestions was to have your LabVIEW replacement for the modelsupport2.dll SN dialog put messages on a TestStand queue in order to basically duplicate the DLL dialog's behavior. But there are other calls to modelsupport2.dll in the parallel process model that configure the SN dialog. My other suggestion was to have the VIs that replace the other DLL calls communicate to the LabVIEW SN dialog VI via LabVIEW queues (not TestStand queues). You had proposed in your earlier post to have a custom UI Message handler--I had thought you meant TestStand UIMessages, but I think you were probably referring to messages to the UI in a more general sense, and LabVIEW queues are a good way to implement such a message handler.
By the way, there have been a few other threads discussing replacing modelsupport2.dll with LabVIEW, but I assume you have seen them.
12-11-2008 12:44 PM
12-12-2008 06:51 AM
I agree that the best way to send messages from a LV UI to TS is probably via a TS queue or notifier. The recommended way to send data from TS to the OI (external to TS and code modules) is via UIMessages. But I think communication between one TS step to another should not be done with UIMessages. That's where you should use a queue or notifier. I'm not sure if it is considered good practice to have a UIMessage handler in a code module, or to even use Manager controls in a code module (see http://forums.ni.com/ni/board/message?board.id=330&thread.id=22358).
Even if you set ParallelModel_ShowUUTDlg=false, you will still need a way to communicate back to your status/barcode entry VI from various locations in the process model (e.g., to tell it that it should send a new SN). In the parallel process model, that "communication" occurs via calls to different functions in the DLL. What I was suggesting is that you keep ParallelModel_ShowUUTDlg set to true, and replace each DLL function call with a VI call that sends a different message to the status/barcode entry VI. Each VI call would send a message (via, say, a LV queue) to the status/barcode entry VI. The messaging mechanism could be completely encapsulated in LV--no TS messaging mechanism necessary. However, the status/barcode entry VI would still have to put commands on a TS queue, because that is the parallel process model mechanism in the ProcessDialogRequests sequence expects to receive commands.
The dialog in modelsupport2.dll basically puts commands on the TS queue in response to button pushes, and updates its display based on the states of the testsocket executions. It seems like it wouldn't be too difficult to create an equivalent in LV. But then again, I'd have thought that someone would have done this already.
12-14-2008 07:14 PM
12-14-2008 08:47 PM