Discussion:
How to share notification step with LabView (Execute "Set" operation from LabView)
(too old to reply)
Virinco - Tom Lomsdalen
2007-08-31 13:40:19 UTC
Permalink
Hi,
 
Attached sequence file shows an example of the notification step. How can I execute the "Set" operation from LabView instead (Replace the "Set" step with an LabView vi)?
 
I want to do this in order to build my own "Identify UUT" in the parallel model using LabView. It seems that in the PreUUT of the ParallelModel file, the CVI dialog sets this operation.
 
(I use TS 4.0)
 
Thanks


TS Notification step.seq:
http://forums.ni.com/attachments/ni/330/16135/1/TS Notification step.seq
paulmw
2007-08-31 14:40:24 UTC
Permalink
You need to use the SyncManager.  Try this VI.  Pass the Runstate.engine to the vi allong with the name of the notification and it will set the notifier.
 


NotSet.vi:
http://forums.ni.com/attachments/ni/330/16137/1/NotSet.vi
Virinco - Tom Lomsdalen
2007-09-03 09:40:16 UTC
Permalink
Paul, thank you for the VI.
I implemented it in TS and it worked great if I use text for referance. Do you know if this will work using "Object Reference" as in the paralell model and the attached seq file? It seems that the referance name must be a text using the syncmanager API?
paulmw
2007-09-04 12:40:14 UTC
Permalink
If you are using references then pass the notifer reference into the VI and operate on it.  You won't have to get it from the engine.  Try this VI.  All I did was remove the part of the code that pick out the reference from the sync manager and made the notifier reference an input control.
 
 


NotSet2.vi:
http://forums.ni.com/attachments/ni/330/16159/1/NotSet2.vi
paulmw
2007-09-12 13:10:15 UTC
Permalink
Richard,
I am not quite sure what you are trying.  Are you using the parallel process model?  Are you referring to the WaitForControllerNotification notification wich is part of the parallel process model or do you have your own notification set up?
 



Then I noticed that the notifier ref change continuously, so I guess it is wrong to store the notifier refs into an array.

I am sure that by putting the notifier references in an array is not going to cause them to change.  The WaitForControllerNotification that I refered to is also in an array, one for each testsocket, and it has been working fine (see ModelData.TestSockets[].WaitForControllerNotification {granted it is an array of containers, one of wich is a notifier ref})
Give a bit more detail on your notifier (where it is initialized, set, read; and the mechanism that passes the reference, i.e. global, parameters ect) and I will try to help.
 
Paul
paulmw
2007-09-12 17:40:13 UTC
Permalink
Richard,
In your example you do not create a notification.  The part where you "init the ref array" only creates an array of empty references.  You sould create a notification either with a teststand step or with the synchronization manager.  Create X notifications, one for each socket, and put the references returned from the create step into an array.
Also, I realize that this is just an example, but if you don't plan on using the same notification for both teststand and labview I would stick to using the labview synchronization step alone.
Paul
paulmw
2007-09-13 13:40:13 UTC
Permalink
Richard,
Yes I missed that part.  I do see that you are using the WaitForControllerNotification and inserting that into the array.  I actually tried running it this time and I was getting an error on when I would set the notification with the statuswindow.vi.  I did trace through, and the reference that was put into the array was the same one that I got back when read.  I don't know why the set didn't work.  I actually only tried the solution I gave above the first time when the original question was posted(the "then pass the notifier reference into the VI and operate on it" one).  This was in TS 3.0.  I had to get TS4.0 eval version to test out your example.
My eval period for the day is up.  I would like to try my original test that I performed in TS3.0 when I gave the solution above but it looks like I will have to wait for tomorrow.  It was just a simple create notification by reference, pass the reference to a LV sequence (the one posted), and then wait on the notification.  If the wait-step doesn't wait I determined it was set.  To "prove" this I re-ran and skipped the set step and the wait-step did wait.  Maybe you can give this a try...
I'll see if I can figure out the problem, but from what I could tell (now that I looked at it much closer) I didn't see immediately what was wrong.
Paul
 
paulmw
2007-09-13 18:10:15 UTC
Permalink
Richard,
I have duplicated your example in TS 3.0 and I do see the references changing.  I also created a simpler example that exhibits the same problem.  I'll attach it so other can see the problem because I honestly don't know how it is happening.  It is almost as if the reference changes after the VI returns to teststand.  I created a LV global that passes the reference instead of the function global that you are using.  Once you store it in the global and then call the one that sets it they don't match anymore. (have the VI front panel open so you can see the references change)
The only solution I can think of at this moment is to not use the functional global to store the references but get them from TS directly when the start button is pressed.  Not exactly sure how to do this yet but it should be possible.
Any one else have some ideas?
Paul


SimpleNotTest.zip:
http://forums.ni.com/attachments/ni/330/16314/1/SimpleNotTest.zip
paulmw
2007-09-13 19:10:11 UTC
Permalink
Richard,
I was able to set a notification to kick of a parallel testsocket by modifying your example.  It actually will simplify it a bit.  Don't bother with storing the references in an LV array.  Just access the references from teststand when you need them.  What I did was to modify your example and you only need the PreUUT callback and a modified version of StatusWindow.vi.  Call the sequence that contains the StatusWindow.vi with it set to run in a separate thread as before but call it from the PreUUT sequence before the wait.  Set the sequence call with a precondition for testsocket index of zero so it only runs once.  Also, modify the sequence to have a parameter for the modelData container, same parameter as the PreUUT (copy and paste it from the PreUUT parameter).  Then you can get the notification references from the sequence context in that sequence.  If this is set up correctly you can modify the VI as shown in the picture and be able to set the notification.
<img src="Loading Image...">
I'll see if I can clean up my files so you can get those...
PaulMessage Edited by paulmw on 09-13-2007 01:51 PM


NotificationExample.JPG:
http://forums.ni.com/attachments/ni/330/16315/1/NotificationExample.JPG
paulmw
2007-09-13 20:10:21 UTC
Permalink
Here is my example code.
I deleted the last close reference that is shown in the picture in my last post...
Also, the VI needs to be open, it is not set to open the front panel on its own.
Issues: I don't know what will happen when TS 0's PreUUT runs again, nothing is preventing it from running the new-thread-sequence.&nbsp; I don't check to see how many testsockets are initialized. Plus I am sure there are other things that aren't being considered.


NotifierTS3.zip:
http://forums.ni.com/attachments/ni/330/16316/1/NotifierTS3.zip
Virinco - Tom Lomsdalen
2008-07-24 10:10:10 UTC
Permalink
Anyone who can give an answer to message 12 in this thread? NI?
<a href="http://forums.ni.com/ni/board/message?board.id=330&amp;thread.id=16135&amp;view=by_date_ascending&amp;page=2" target="_blank">http://forums.ni.com/ni/board/message?board.id=330&amp;thread.id=16135&amp;view=by_date_ascending&amp;page=2</a>
Thanks

Loading...