Industrial Communications

cancel
Showing results for 
Search instead for 
Did you mean: 

Tcp/ip Open Connection status

I'm totally new to LV but have managed to write a TCPIP client successfully. My only problem is that once my tcp OPEN Connection VI is running, how to check it status. I need to know this as I want to use the TCP ID if already opened, else create a new connection.

Thanks

Cape Town

Mogamad Amien Crombie
Senior Software Engineer,
iThemba Labs [TLABS]
Faure
Cape Town.
Western Cape,
South Africa
0 Kudos
Message 1 of 6
(7,160 Views)

Can you please explain what you mean by "check the status"? Also what module or VIs are you using to accomplish your task?

National Instruments
Applications Engineer
0 Kudos
Message 2 of 6
(7,143 Views)

Hi

 

I'm using LV 2009 with the "\Datacommunications\Protocols\TCP" palette function.

The "TCP  Open Connection" function is the one I'm enquiring.

I'm trying to rewrite a DotNet DLL with native LV. In the DLL, I create a TCP connection once. Then I create 7 classe instances using this connection. 

As I can query the TCP connection's status  in the DLL, it is important to do this in LV.

 

Thanks

 

 

Mogamad Amien Crombie
Senior Software Engineer,
iThemba Labs [TLABS]
Faure
Cape Town.
Western Cape,
South Africa
0 Kudos
Message 3 of 6
(7,124 Views)

Can you give me more details on what you are trying to do because I am little confused. You mentioned checking status of TCP connection, I am not sure what you mean there? Also, you mentioned editing a .NET DLL file within LV, which is possible.

 

Give me the big picture, and hopefully I can lead you the right way.

National Instruments
Applications Engineer
0 Kudos
Message 4 of 6
(7,113 Views)

Hi

 

Coming from C#, let me explain how the DLL works.

My hardware includes 2 Rabbits (MCU from RabbitSemiconductors), each of them running a TCPIP Server-based app.

Then I have 7 Harps (Cyclotron current measurement equipment), all housed with the 2 Rabbits, one serving the X-plane and the other the Y-Plane.

The Rabbits can switch between each Harp via a multiplexer.

Now the .NET DLL creates 2 TCPIP connections, one per Rabbit.

Then it creates the Harp classes, which will be 7. They are then linked to the socket connections.

When the DLL is called to create a Harp, it checks to see if there is 2 valid connections and if not , creates them, else it uses the existing connections.

We have written a working system using this .NET DLL inside LV. Now they want us to rewrite this functionality using LV's native TCPIP classes.

I have subsequently read about GOOP and general OOP programming in LV, hoping to somehow get a similar class hierarchy in LV.

But my inexperience in basic LV knowledge has been frustrating as I don't know how the check if a TCPIP connection exist and running or not.

I have attached the VI's and subVI's.

You can see in Test_Rabbit2.vi I'm calling subvi "Harp_Init2.vi", who calls subvi "LVRabbit.vi".

The problem is that I need to call "Harp_Init2.vi" seven times, which will call "LVRabbit" seven times. Therefore I need to check if the 'TCP Open connection' is already opened or not.

I hope this info will be sufficient to explain to you my problem.

Thanks.

Amien.

Cape Town

Mogamad Amien Crombie
Senior Software Engineer,
iThemba Labs [TLABS]
Faure
Cape Town.
Western Cape,
South Africa
Download All
0 Kudos
Message 5 of 6
(7,111 Views)

Hey,

 

I believe you could try testing whether there is a connection by checking the error cluster on an open TCP  connection, no timeout error  means that the device is available at that IP address.

 

I hope this helps!

 

National Instruments
Applications Engineer
0 Kudos
Message 6 of 6
(7,083 Views)