Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Get Fast RT/XP Ethernet Comm.s?

I have an application where I need to do the following between an XP
computer and a PXI-8187 RT computer:

1. Send a small set of values (<100 bytes) from XP to RT.
2. Send a small set of values (<100 bytes) from RT to XP.
3. Send a large I16 array (20,000 size or 40kbytes) from RT to XP.

My RT loop rate needs to be 20 Hz. The XP loop rate can very but I cannot
miss any of the 20k I16 array.

I started out by using DataSocket but it was much too slow. My next step
was to do number 1 & 2 above using UDP. This was simple and works fine.
Unfortunately, RT cannot presently send UDP packets that are greater than
4096 bytes at one time so I could not use UDP to send the I16 array.

I then setup TCP/IP and RT FIFO parallel loops to send the I16 array but it
isn't working very well. I setup my FIFO to be 80x 20kI16 arrays which
should be four seconds of data. When I run my program my TCP transmit loop
loses some of the packets from the RT buffer. I will get good data for a
second or two and then loose around 20 packets and this will then repeat
every few seconds but the time it works is not consistent. I'm not sure if
my problem has to do with the RT FIFO or the Ethernet communications. I did
setup a test VI that did not have the RT FIFO in it and did not lose any
data but this only works if I can guarantee that the XP computer can keep a
consistent 20Hz TCP/IP loop and this would be too risky. Note that I did
not use the RT Communication Wizard to setup my program but I did use it to
create a similar example to look at. My XP monitor shows LAN utilization of
only 0.4% max and my XP CPU usage is only around 10%.

Does anyone have any ideas of why I can't get consistent data at the speed I
am trying for?

Does anyone have a better network communications approach to do what I am
trying to do?


0 Kudos
Message 1 of 10
(6,556 Views)
Consider the dev zone document:
http://zone.ni.com/devzone/conceptd.nsf/webmain/0986799C984500F886256F170079411E

I use this concept fo stream 8 channels of 5 kSA/sec 32bit integers continiuosly from an RT target to my PXI machine.

Let us know what you think.

Preston Johnson
National Instruments
Preston Johnson
Solutions Manager, Industrial IoT: Condition Monitoring and Predictive Analytics
cbt
512 431 2371
preston.johnson@cbtechinc
0 Kudos
Message 2 of 10
(6,549 Views)
Preston,

Thanks but this article has no speed benefits over what I have already
tried. It is aimed more towards making the data formatting easier to deal
with but my format is simply an I16 array so that part is easy. The article
also does not get into using RT FIFOs which I think are necessary to prevent
slow down of the RT main loop rate.

"preston johnson" <x@no.email> wrote in message
news:220133@exchange.ni.com...
> Consider the dev zone
> document:<br>http://zone.ni.com/devzone/conceptd.nsf/webmain/0986799C984500F886256F170079411E<br><br>I
> use this concept fo stream 8 channels of 5 kSA/sec 32bit integers
> continiuosly from an RT target to my PXI machine. <br><br>Let us know
> what you think. <br><br>Preston Johnson<br>National Instruments


0 Kudos
Message 3 of 10
(6,547 Views)
Thanks for the feedback,

yes RT FIFOS are used to get data from the time critical loop, to the communications loop. Then in the communications loop you can use the TCP/IP tools to transmit the data to the recepient.

The benefit of Simple TCP, is that you have more control of what is sent and when.

Preston
Preston Johnson
Solutions Manager, Industrial IoT: Condition Monitoring and Predictive Analytics
cbt
512 431 2371
preston.johnson@cbtechinc
0 Kudos
Message 4 of 10
(6,543 Views)

This article (linked at the bottom of the Simple TCP article) includes RTFIFO and may or may not help you with your speed but gives a good example of using RTFIFO and TCP Meta together.

https://www.ni.com/en/support/documentation/supplemental/21/command-based-communication-design-patte...

 
0 Kudos
Message 5 of 10
(6,434 Views)
I have the same problem with sending many small packets from RT->XP (DSC) using Data Socket. Every 4-5 seconds transmission stops for a second and then resumes. Setting 10 ms delay in the sending loop resolves the problem. The only problem is I don't want to wait this time. " Does anyone have any ideas of why I can't get consistent data at the speed I am trying for?"
0 Kudos
Message 6 of 10
(6,278 Views)

Greetings!
     Data socket communication with RT is non-deterministic. It should not be used inside a time critical VI. Using it inside the time critical VI adds jitter. Hence
1) With data socket communication is not deterministic
2) Also the network issues like network traffic, not communicating using cross over cables, using static IP address are ideas you can take in to account. Please refer to the links

http://digital.ni.com/public.nsf/websearch/FD24D98FF428F21686256B64007FB6C1?OpenDocument

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3DED156A4E034080020E74861&p_node=174821&p_source=External

Hope this helps
Thanks much
Avi Harjani




0 Kudos
Message 7 of 10
(6,258 Views)
LabVIEW Real Time version 8.0 + PC as a Target
 
Does any one knows which kind of the two described below connections results in faster and safer data transmissión between a PC and the PC-Target ?
 
1) Direct connection between the PC and PC Target using a crossed cable .
2) Through a hub switch 100 Mbps using a normnal ethernet cable
 
I suppose the difference in behaviour, if any, it would also apply to PC and PXI.  
 
Regards
Simbani
 
0 Kudos
Message 8 of 10
(5,978 Views)
Simbani,

Obviously the less components in the system, the more reliable the system.  However, realistically, there will be no observable difference between these two configurations (unless there are additional devices on the switch configuration with lots of extra traffic).

--Paul Mandeltort
Automotive and Industrial Communications Product Marketing
0 Kudos
Message 9 of 10
(5,938 Views)
 

Would something like this work?  It is 8 channels at 33kSa per second per channel from a 200Mhz RT controller

http://sine.ni.com/nips/cds/view/p/lang/en/nid/202103 

The source code for this is at:

http://zone.ni.com/devzone/conceptd.nsf/webmain/3F941A040879E64086256FA20067041A 

It uses the command server architecture

 

Preston Johnson
Solutions Manager, Industrial IoT: Condition Monitoring and Predictive Analytics
cbt
512 431 2371
preston.johnson@cbtechinc
0 Kudos
Message 10 of 10
(5,934 Views)