LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement ethernet communication without TCP or UDP?

Solved!
Go to solution

I know there are blocks to transmit/recieve data through TCP or UDP protocol in Labview,

but I need to transmit data between a compactRIO and another device which is not NI device.

They communicate through Ethernet, BUT that device has its own protocol (not TCP or UDP), 

 

Thus I only need Labview to transmit a raw data through Ethernet without any header (such as TCP or UDP, etc) because I will process it by myself,

Which is the best function in Labview should I use for that?  

 

THANKS!!

0 Kudos
Message 1 of 6
(3,709 Views)
Solution
Accepted by topic author user48625

None! You have to call directly into the OS socket API to setup a raw network socket and then use read() and write() on it. Note that raw sockets are under all modern desktop OSes privileged resources that can only be opened by a process with according access rights. Under Windows this is restricted to processes with administrator rights. Under Linux there is a special access right that needs to be given to a process for this.

 

Under cRIO this access right is probably not an issue, but you may run into troubles that raw sockets are only partially supported there.

Rolf Kalbermatter
My Blog
Message 2 of 6
(3,696 Views)

Thank you,

Can I just use NI VISA to transmit raw data to Ethernet socket? (setting output to be ethernet socket?)

Because I don't know how to set API, I think it may be another problem for me......

 

0 Kudos
Message 3 of 6
(3,680 Views)

VISA doesn't implement access to raw ethernet sockets either but only TCP/IP. Would be also not practical as on all desktop systems raw sockets are only accessible from privileged processes.

 

The way I would go about that is to write some shared library in C that accesses the system socket API and then interface to that shared library with the Call Library Node. Interfacing directly from LabVIEW to the system API is way to cumbersome, although in principle possible.

Rolf Kalbermatter
My Blog
Message 4 of 6
(3,663 Views)

Thank you,

I am thinking that if there is any IC for decoding data coming from TCP packet to raw data. 

Or by outputing data via RS232/485 socket first and  then using a  chip to process the data to RJ45 socket output.

 

Could it be more easy than calling into C library? 

0 Kudos
Message 5 of 6
(3,629 Views)

I personally wouldn't consider it more easy, but YMMW. If you never have done anything in C, then I suppose just about anything else would seem easier.

Rolf Kalbermatter
My Blog
Message 6 of 6
(3,611 Views)