martin zhxie Posted August 20, 2008 Report Share Posted August 20, 2008 Hi, I am new to labview. Currently I am doing a automation romote control to a testing system through TCP/IP. The communication from teststand to labview has been done by using queue. It outputs some data. Now I need to pass these data back to teststand and do some caculation to them. Then loop them back to labview. anyone can help? thanks Martin Quote Link to comment
Tim_S Posted August 21, 2008 Report Share Posted August 21, 2008 QUOTE (martin zhxie @ Aug 19 2008, 03:51 PM) I am new to labview. Currently I am doing a automation romote control to a testing system through TCP/IP. The communication from teststand to labview has been done by using queue. It outputs some data. Now I need to pass these data back to teststand and do some caculation to them. Then loop them back to labview. You may want to look in the Code Repository and on NI's website. There are network communication schemes such as the Publish/Subscribe (http://forums.lavag.org/Publish-Subscribe-file122.html). I also recall running across a networked queue, but can't seem to locate where that was. Tim Quote Link to comment
martin zhxie Posted August 21, 2008 Author Report Share Posted August 21, 2008 QUOTE (Tim_S @ Aug 20 2008, 09:23 AM) You may want to look in the Code Repository and on NI's website. There are network communication schemes such as the Publish/Subscribe (http://forums.lavag.org/Publish-Subscribe-file122.html). I also recall running across a networked queue, but can't seem to locate where that was.Tim Thanks for your info. Eventhough, I use a TCP/IP connection, it acts both server and client on the same computer. I think that the problem is still between teststand and labview. (How to pass variable from labview to teststand where the variable initialized in teststand at first.) Martin Quote Link to comment
TobyD Posted August 21, 2008 Report Share Posted August 21, 2008 QUOTE (martin zhxie @ Aug 19 2008, 12:51 PM) I am new to labview. Currently I am doing a automation romote control to a testing system through TCP/IP. The communication from teststand to labview has been done by using queue. It outputs some data. Now I need to pass these data back to teststand and do some caculation to them. Then loop them back to labview. This may be more simplified than what you are trying to do, but if you send a reference to the Sequence Context from TestStand into LabVIEW, you can directly access the TestStand Variables. I have attached a small vi to demo this. You will have to create a Locals.Numeric variable in TestStand and then call this vi from TestStand. Setup the inputs as shown in the picture below. When you run it, it should increment the Locals.Numeric variable by one (you'll have to watch the variable in the watch window to see this happen). Download File:post-8758-1219255987.vi Quote Link to comment
martin zhxie Posted August 21, 2008 Author Report Share Posted August 21, 2008 QUOTE (TobyD @ Aug 20 2008, 02:14 PM) This may be more simplified than what you are trying to do, but if you send a reference to the Sequence Context from TestStand into LabVIEW, you can directly access the TestStand Variables. I have attached a small vi to demo this. You will have to create a Locals.Numeric variable in TestStand and then call this vi from TestStand. Setup the inputs as shown in the picture below. When you run it, it should increment the Locals.Numeric variable by one (you'll have to watch the variable in the watch window to see this happen).Download File:post-8758-1219255987.vi Right. This sounds close to what I need. The problem is that I am using a old version of labview. (7.1) could not open the 8.6 version vi. Is there a 8.6 version can be downloaded for free. Or do you have the sample vi in 7.1 version? Quote Link to comment
TobyD Posted August 21, 2008 Report Share Posted August 21, 2008 QUOTE (martin zhxie @ Aug 20 2008, 02:01 PM) Right. This sounds close to what I need. The problem is that I am using a old version of labview. (7.1) could not open the 8.6 version vi. Is there a 8.6 version can be downloaded for free. Or do you have the sample vi in 7.1 version? Sorry about that I can't save back to 7.1, but here is a screenshot (it's pretty simple) and a version saved in 8.0. Maybe someone else can save it back to 7.1 if the screenshot isn't enough for you to recreate it. Download File:post-8758-1219267020.vi Quote Link to comment
martin zhxie Posted August 22, 2008 Author Report Share Posted August 22, 2008 QUOTE (martin zhxie @ Aug 20 2008, 05:01 PM) Right. This sounds close to what I need. The problem is that I am using a old version of labview. (7.1) could not open the 8.6 version vi. Is there a 8.6 version can be downloaded for free. Or do you have the sample vi in 7.1 version? Oh, Thanks a lot. I've recreate the vi tried it. It works for me. Now I just need to convert it into my own program. Hope it will work in a loop and continously sends data between teststand and labview. Quote Link to comment
TobyD Posted August 22, 2008 Report Share Posted August 22, 2008 QUOTE (martin zhxie @ Aug 21 2008, 01:30 PM) Oh, Thanks a lot. I've recreate the vi tried it. It works for me. Now I just need to convert it into my own program. Hope it will work in a loop and continously sends data between teststand and labview. Can you describe the flow of your program and the interaction between TestStand and LabVIEW? Maybe post a flowchart if you have one. I'm curious what you are trying to do. There may be a better way to do it. Quote Link to comment
Michael Aivaliotis Posted August 23, 2008 Report Share Posted August 23, 2008 QUOTE (TobyD @ Aug 21 2008, 01:50 PM) Can you describe the flow of your program and the interaction between TestStand and LabVIEW? Maybe post a flowchart if you have one. I'm curious what you are trying to do. There may be a better way to do it. No, the solution TobyD presents is how you should pass data from LabVIEW to Teststand. It is the official NI party line sorta speak. Isn't that great? (that was sarcasm). One thing to note is that this solution is typically used to pass data from a LabVIEW operator interface into TestStand, not for VI calls in a TestStand step, however there is nothing preventing you from doing this. Now the other question still left is how do you pass data from Teststand to LabVIEW. Well instead of a Set Property, you do a Get Property. There is one more method not mentioned. You can use TestStand ActiveX Callbacks. This allows your LabVIEW operator interface to respond to a TestStand event and receive a payload of data via Custom UIMessages. Again, a best practice. See here. Quote Link to comment
martin zhxie Posted August 23, 2008 Author Report Share Posted August 23, 2008 Actually I am using a queue to pass script command from teststand to labview. Then in labview, it reads the output of the script. The whole purpose is to use this output to compare with the value of a variable in the teststand. Then adjust the command and send it back to labview again. I don't know how to attatch a screen shot here, so I paste it in the doc. "Local.Numeric In" is the one that I want to send to teststand. I know if I merge the sequence context part into my program, it is not gonna work since I can not call this vi directly by wiring the connect panel. How about sending this refference separetly? Quote Link to comment
martin zhxie Posted August 23, 2008 Author Report Share Posted August 23, 2008 I just found out that I can actually wire the connect panel for sequence context and the refference with IP address and port number at the same panel. That should solve my problem. Quote Link to comment
Michael Aivaliotis Posted August 24, 2008 Report Share Posted August 24, 2008 That diagram and your last reply makes no sense to me but the important thing is that it works for you and you can move on. have fun. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.