03-15-2014 02:13 PM
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!!
Solved! Go to Solution.
03-15-2014 02:35 PM - edited 03-15-2014 02:37 PM
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.
03-15-2014 03:15 PM
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......
03-15-2014 06:00 PM - edited 03-15-2014 06:05 PM
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.
03-16-2014 05:20 AM
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?
03-16-2014 11:07 AM
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.