Manufacturing Data Systems, Inc.
 

Menu

  Articles
 Main Directory
 New Articles
 Popular Articles
 Top Articles
 Articles FAQ

Search: 

Newest Articles

 Ethernet I/O Tips
(Hits: 4205)
Best practice and how-to’s for Ethernet I/O.
 Supported Network Cards
(Hits: 4306)
This is a list of network cards supported in our l...
 OpenCNC Versions and Windows Versions
(Hits: 4493)
A list of OpenCNC Versions and what Windows versio...

Printable Version Ethernet I/O Tips


Ethernet I/O Setup Tips

Get an Exclusive IRQ for the Ethernet Chip:

1) in RTX Properties...Plug-N-Play, set the RTX ethernet port to use IRQ 6.
2) in Device Manager, disable the floppy drive (it was using IRQ 6).
3) reboot
4) the port now has exclusive use of IRQ 6-- it seems like other devices never try to grab IRQ 6. This also scrambled IRQ usage around enough that the following steps worked to get use of the floppy back.
5) find an unused IRQ in Device Manager, then in RTX Properties...Plug-N-Play, set the RTX ethernet port to use it.
6) in Device Manager, enable the floppy drive.
7) reboot

On one particular system, it was able to give the RTX ethernet port exclusive use of IRQ 5. The key is to temporarily ***ign it an IRQ that is generally ***igned to a specific device.


Getting Ethernet I/O to Work in Realtime:

Using a 10Mbs-only base controller with an ethernet card (and optionally with a 10Mbs hub), you can prevent the card from trying to operate in 100Mbs mode. Before the card is converted to an RTX device, set it to "10Mbs" instead of "Auto" via Device Manager...Network Adapters...Advanced.

If the realtime ethernet stack reports an error "max sockets must be between 1 and 255", add a “MaxSockets=30” line to the RtxTcpip.ini file as follows:

[TCP/IP]
MemoryInk=256
MaxSockets=30
TimerPriority=16
NumStartupEvents=40
...

Note that there cannot be any extra spaces in the .ini file, especially at the end of a line.

PC Will Not Shutdown:
We have developed an application based on the 10 Feb, 2006 RTX Tech Note, “An RTSS application with TCP/IP has terminated early and now RTX and /or the PC will not shutdown gracefully/properly”. Run the executable, RtTcpIpCleanup from a command window rtssrun path\RtTcpipCleanup.rtss (for realtime TCP/IP)

path\RtTcpipCleanup.exe (for soft-realtime TCP/IP)


It will display a success/failure message. OpenCNC does not need to be running. If this fixes the shutdown problem, the program can be automatically run from OpenCNC's ".men" file SHUTDOWN group.

Suggestions for Optimizing Ethernet I/O:

1) Too high of a video acceleration level can interfere with some real-time operations. Some of the problems that can arise include:
  - a failhold 400 or 800 can occur
  - a Mechatrolink drive might report an E5, E6, or F6 alarm

To set the video acceleration to an appropriate level, do the following:
  - Log in as Administrator.
  - Right-click on the screen's background area.
  - In the Display Properties pop-up window, go to the Settings tab.
  - Click the Advanced button.
  - Select the Troubleshoot tab.
  - Move the Hardware Acceleration level to the 3rd tick from None to disable
    DirectDraw and Direct 3D (DirectX), cursor, and advanced accelerations.
  - Leave "Enable write combining" checked.
  - Click "Apply"-- the screen will go black, then restore itself after a few
    seconds.
  - Click Ok on the Troubleshooting window, then Ok on the Display Properties
    window.


2)  In the RTX file
RtxTcpIp.ini, (in C:\Program Files\VenturCom\RT-TCPIP or C:\Program Files\Ardence\RT-TCPIP), there are two parameters:
  InterruptPriority=16
  ReceivePriority=17

The realtime ethernet documentations specifies that ReceivePriority must have a higher number (which is a lower priority) than InterruptPriority, although I have used it successfully the other way:

  InterruptPriority=17
  ReceivePriority=16

3)  As a test, you can temporarily increase the IO cycle time, and tweak some ethernet IO parameters.  We generally do this if we get Ethenet IO 9000 -type errors, but you can try it.  If you look at the variable
ioEnetRWTime (or ioEnetADRWTime) with winVar, you can get an idea of the typical ethernet packet reply time, then try to optimize around that.

In the 'start' (.ost) file, add '-retries' and '-timeout_ms" parameters:

  ....ioEnetAutoDirect"  -retries 3 -timeout_ms 12 -node ....

In the 'tune' (.tun) file:

  defIOCycleRate  0.050 sec
  ioEnetMxErrCyc  2


-retries sets the maximum number of times, within one OpenCNC IO cycle, that the ethernet driver will attempt to send the IO packet.  Without this parameter, the default is 2.

-timeout_ms
sets the maximum time, in milliseconds, that the ethernet driver will wait for a reply from the ethernet base module.  The default is (IO cycle rate / retries), rounded down.  The expected amount of time for a reply packet mostly depends on how much analog IO there is.  Digital IO modules typically take 1-2ms, but analog IO modules add 3-4ms per module.

ioEnetMxErrCyc sets the maximum number of OpenCNC IO cycles that can occur without a successful ethernet IO update.  The default is 1.

The driver has a built-in limit of 50 ms without a successful ethernet IO update.  The following must be met, or the driver will complain:

  retries X timeout_ms <= 50 ms
  retries X timeout_ms <= IO cycle time
  IO cycle time X ioEnetMxErrCyc <= 50 ms

For optimization, you can pick the highest IO cycle rate you can live with.  Then pick a
-timeout_ms value a bit higher than what you typically see in winVar's ioEnetRWTime.  Set the -retries parameter for the maximum number of attempts possible within 1 IO cycle.


 Hits:  4205
 Rating:   Rating:0  Votes:0 (Rating Scale: 1 = worst, 10 = best)
 Added on:  1/23/2007
 Author/Source:  n/a
 Author's contact:  n/a
 Posted by:  bruce rick
 Comments:  0 Comment(s)


Other Articles by this Author

Back

Featured Articles

 Supported Network Cards
(Hits: 4306)
This is a list of network cards supported in our latest version of OpenCNC.
Set us as your default homepage Bookmark us Privacy   2008 Manufacturing Data Systems, Inc. All Rights Reserved. Go To Top Of Page