09-30-2015 05:39 AM
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?
09-30-2015 05:43 AM
09-30-2015 05:45 AM
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.
09-30-2015 05:49 AM
This is from the compact RIO design guide
09-30-2015 05:49 AM
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.
09-30-2015 05:53 AM
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.
09-30-2015 06:14 AM
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.
09-30-2015 06:19 AM
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).
09-30-2015
07:10 AM
- last edited on
12-10-2021
04:25 PM
by
NI_Community_Su
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
09-30-2015 07:23 AM - edited 09-30-2015 07:24 AM
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