LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

storing labview TCP connection in TestStand object reference

I have a LabVIEW routine (GetFileGlobal) that uses the TestStand SequenceContext->FileGlobals to do a lookupString and determine the GetType if the string 'Exists'.  I have a LabVIEW case statement that captures values of '1' for GetValString, '2' for GetValBoolean, and '3' for GetValNumber.  I have a LabVIEW TCP connection that gets opened that we need to store in TestStand in a FileGlobal.  What type is necessary in TestStand to store a TCP Conn?  AND, given the (tbd) type in TestStand, what is the value I would need in my case statement to capture this new (tbd) type coming out of the GetType?  

0 Kudos
Message 1 of 8
(3,248 Views)

Hi mrbean,

 

Have you tried using LabVIEW IO Controls in TestStand to pass the references to and from LabVIEW? You can do this by clicking on Insert FileGlobal -> Type -> LabVIEW -> LabVIEW IO Control.

Raj
National Instruments
Applications Engineer
0 Kudos
Message 2 of 8
(3,223 Views)

I've asked this on another thread, but I'm just not understanding the exact implementation.  In TestStand, the LabVIEW IO Controls type is made up of a DeviceName and a SessionNumber, but in LabVIEW I have a TCP Network Connection.  I have routines that let me Get/Set TestStand File Globals if they are Boolean, String, or Number.  Now, if I use LabVIEW IO Controls in TestStand, what is the exact way I stuff a TCP Network Connection in there.  I've attached a VI that I use to GET the FileGlobal value from TS.  I need to grow it to allow me to get the TCP connection (i.e. LabVIEW IO Controls), but I'm not sure how to do that.  The types are messing me up.  Also, I'm not sure what the 'GetType' wants to see

0 Kudos
Message 3 of 8
(3,203 Views)

Hi mrbean,

 

I tested out a simple example and realized that to pass a TCP network connection between multiple steps in TestStand, we need to pass it as a U32 Number. I created a fileglobal variable as a "number". I then ran the TCP server example "Simple Data Server.vi". I created two Action steps in TestStand where I open a TCP connection to the port specified in the server and passing the "connection ID" back to TestStand and storing it in the fileglobal variable. I then pass the value in the fileglobal variable into the second Action step where I take the connection ID and close the TCP connection. This worked as expected. Can you attempt something similar on your end?

Raj
National Instruments
Applications Engineer
0 Kudos
Message 4 of 8
(3,172 Views)

I would like to not have to change all of my interfaces to pass in a TCP Connection (number).  That's why I created the FTW_ATE_UTIL_GetFileGlobal.vi (shown in my previous message).  It works great for the basic types (number, string, boolean).  I'm not sure, however, how to connect a U32 to a TCP Connection.

0 Kudos
Message 5 of 8
(3,143 Views)

I think I figured it out

 

 

0 Kudos
Message 6 of 8
(3,129 Views)

I have several questions

 

1) In your labview code, did you use a TypeCast to get from TCP Connection to U32?

 

2) did you specify 'localhost' for the server? 

 

3) what if I have this server on (let's say) PC1, and one client also on PC1, but another client on PC2.  How would I handle this situation?

0 Kudos
Message 7 of 8
(2,805 Views)

A type cast would certainly work to get from one data type to another. However it's important to know what type of number you're starting with. What type of number is your application providing? I am not immediately aware of a "TCP Connection" "type" of data. Are you wanting to connect to both of these PCs at the same time or just one after the other?

Product Support Engineer
National Instruments
0 Kudos
Message 8 of 8
(2,787 Views)