IOCTL_FARC_NETMAP_SETTINGS

Description:
Set settings for netmap build on COM2002x controller. The netmap itself must be requested by IOCTL_FARC_GET_NETMAP

Parameters:

Parameter Type Description
Input
return condition
(optional)
struct ARCNET_NETMAP Defines the settings for netmap build
  • ba_netmap[32] - defines the node that will included in netmap build and can checked later with IOCTL_FARC_GET_NETMAP
  • w_timeout - define “not present”-timeout for single node in 10ms units. Setting this value to 0 causes the driver to use worst case conditions (255 nodes, full network load, current busspeed/extended timeout settings).
Note: You should set the timeout value depending on your network size, data traffic and so on. Please refer to the COM2002x data sheet for further information.
Output
- - -

Remarks:
Netmap build is done using the TENTID bit and the NEXTID register of the COM2002x controller. The driver goes through the expected net map defined by ba_netmap[32] and tries to detect the node with specified node id by setting TENTID ID register. If node was not detected (TENTID Bit is not set) after “not present”-time then node is declared as non-existing.

Have in mind, that the time for building a netmap increases with every node, you set in ba_netmap[32]. For example, if you want to build a netmap with all 255 nodes and you have a timeout of 50ms set, netmap build is complete after 255*50ms or approx. 12,7 sec!

Notes:

1) This function does not supported by SH ARC-66 as Chip SMSC 90C66 does not provide TENTID ID register
2) This function does not supported by SH ARC-USB as SH IP-CORE-ARCCTRL does generate the netmap itself
3) If you need a safe and reliable node/netmap detection, use SH ARCALYZER.

Possible errors (see also Error codes):
E_FARC_NOT_INITED,
E_FARC_EXCESSIVE_RECON,
E_FARC_BUFFER_TOO_SMALL,
E_FARC_NETMAP_ERROR

Example:
Note, that the following example is only a fragment. It is recommended, that the driver is opened in asynchronous mode and a handle to the driver is available.

OVERLAPPED overlapped; DWORD read, err; BOOL ret; ARCNET_NETMAP sNetmap; overlapped.Offset = 0; overlapped.OffsetHigh = 0; overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); ... memset(&sNetmap,0,sizeof(sNetmap)); sNetmap.ba_netmap[0] = 0x8E; // scan only nodes 1..3 and 7 sNetmap.w_timeout = 2; // 20ms "not present timeout" ret = DeviceIoControl(drvhandle, IOCTL_FARC_NETMAP_SETTINGS, &sNetmap, sizeof(sNetmap), NULL, 0, &read, &overlapped); if (!ret) { err = GetLastError(); if (err == E_FARC_PENDING) { ret = GetOverlappedResult(drvhandle, &overlapped, &read, TRUE); if (!ret) { err = GetLastError(); // do errorhandling here } } else { // other error occured, perhaps wrong handle } } ...

See also:
DeviceIoControl()
IOCTL_FARC_GET_NETMAP

Back to Programming Guide