LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Where to find TCP VI and Functions

I am trying to follow some example code that includes a VI called "TCP listen".

 

As I dont seem to have it on the LabVIEW base package I am trying to find out where I can get it, but have only found it on the following link:

 

http://zone.ni.com/reference/en-XX/help/371361J-01/lvcomm/tcp_vi_descriptions/

 

This doesn't contain any download so where can I find this TCP VI and functions from so that I can access the TCP Listen VI?

 

 

0 Kudos
Message 1 of 16
(3,897 Views)

Did you try to search for it in the palettes?

2015-09-30_11-42-27.png

 


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 16
(3,895 Views)

Damn, I have just realised, it's because I am using FPGA module on the sbRIO-9651.

 

So this doesn't make any sense. 

 

I am using it for STM Ethernet communication, which was recommended in the compactRIO design guide.

 

So if I don't have access to the TCP palette then how am I supposed to do this?

 

Seems really difficult to do Ethernet comms on an FPGA device.

0 Kudos
Message 3 of 16
(3,892 Views)

This is from the compact RIO design guide

STM example in cRIO design guide.png

0 Kudos
Message 4 of 16
(3,881 Views)

You can't do ethernet comms on an FPGA device (read about FPGAs and you'll understand why - they're essentially reprogrammable logic blocks - more like an electronic circuit than a general purpose processor). You have to do it on the RT part of the sbRIO - that's the part that's connected to the network device.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 5 of 16
(3,879 Views)

Oh right, ok.

 

So if I wanted to do some basic comms from a terminal on my laptop to the FPGA, what form of communication would you recommend?

 

The sbRIO-0651 has 4 serial ports including RS-232, RS-485 and CAN-BUS.

 

My laptop only has ethernet and USB.

 

Should I acquire a USB to serial and try to do serial communication instead?

 

I am surprised I cannot simply send a signal along the ethernet cable to the FPGA.

 

WIth a PIC microcontroller I have created my own software UARTs in the past. Was quite simple. 

0 Kudos
Message 6 of 16
(3,870 Views)

A FPGA device consists of two very seperate parts:

 

1) The Realtime OS that you can write a LabVIEW program for mostly like on your desktop. In there you DO have TCP/IP functions. This is also the part that would most resemble the firmware you wrote for your PIC in the past.

 

2) The FPGA chip in the device which you can also program from within LabVIEW which however is really very different from the Realtime part in what you can do. You program a hardware chip on the board to directly perform the desired operations. This works great for digital logic but does not support a TCP/IP socket interface out of the box. In fact there is almost nobody who would even think about implementing TCP/IP in hardware as it is very complex to do and not cost effective.

 

Your PIC device certainly didn't even have this second option at all but you appear to be trying to create your code in that part of the sbRIO device.

 

In your project tree you really should see two different sections under the sbRIO device. One is the RT target (VIs that you place directly under the sbRIO device and the other is the "FPGA target". VIs placed underneath "FPGA target" will be considered to be compiled and deployed to the FPGA chip itself and only have functions available in the function palette that can work on the FPGA hardware. Network functionality definitely doesn't belong there.

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 16
(3,845 Views)

Why do you specifically want to communicate with the FPGA? If you want to communicate between a Host PC and the sbRIO, you would normally communicate with a VI running on the RT controller on the sbRIO (e.g. via TCP/IP) and then that would talk to the FPGA.

 

You can also open a reference to the FPGA on the PC directly (which happens over ethernet) to read/write front panel controls/indicators and use FIFOs for high-speed data transfer, thus bypassing the RT side entirely.

 

As far as I'm aware, the communication ports on the sbRIO all go through the RT side (except *perhaps* the CAN).


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 8 of 16
(3,840 Views)

I was set a 2 week mini project at work as a learning exercise and have to report back in two weeks with what I learned and achieved.

 

The exact wording of the task was as follows:

 

"

 

As agreed David’s labVIEW project over the next 2 weeks will aim to solve….  “Communicate data from labVIEW FPGA to RT to Windows using the cRIO SOM”.

 

Stretch goal would be to: “send control signal to cRIO embedded device from Windows PC”

 

Presentation/demo on 5/6th October to [names removed].  

 

"

 

 

Since my laptop doesn't have a serial port and we don't have USB to serial cables (And I wasn't sure if I would get problems using them), I figured ethernet was the only choice.

 

I guess the sbRIO-9651 does have a secondary USB port so that is also a possibilty.

 

 

I may have misinterpretted the problem or tackled it in the wrong way so would be interested to hear how you interpret this problem and what your approach would be as LabVIEW architects. Since you are the creme de la creme of LabVIEW programmers and are saying ethernet comms is borderline impossible with an FPGA then I will not continue to pursue that method. Doesn't leave me in a great position as I only have a few days left and am going back to the drawing board Smiley Sad

0 Kudos
Message 9 of 16
(3,820 Views)

Notice how your problem description says FPGA to RT to Windows. Those are the 3 components you have - an FPGA and RT (on the sbRIO) and a Windows PC.

 

If you look at the cRIO examples, you will need to create a VI for the FPGA (I/O, high-speed control), one for the RT (lower-speed control and communications) and one for Windows (the user interface/logging).

 

So for FPGA to RT, you can read/write front panel controls of the FPGA VI and/or FIFOs to transfer data.

For RT to PC, you can use Network Streams, TCP/IP, Serial etc. etc.

 

Look at page 6 of this guide: http://www.ni.com/pdf/products/us/criodevguideintro.pdf


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 10 of 16
(3,815 Views)