![](/images/new-backgrounds/1300968/300968103x1.webp)
6 F 3 B 0 3 6 2
5.2 Sample Computer Link Protocol Program
This section presents a sample program that runs on the host computer (a personal computer or workstation) and that uses computer link protocol transmission.
This program issues a read/write request for 32 words from the start of the T2N D registers.
Operating environment
∙Hardware: Toshiba
3Com Etherlink ΙΙΙ (3C509/B)
∙ Software:
Transfer parameters |
|
|
| |
∙ | Local IP address: | 133. 113. | 98. | 200 |
∙ Local UDP port number: | 3001 |
|
| |
∙ | Remote IP address: | 133. 113. | 98. | 10 |
∙Remote UDP port number: 3001
/**********************************************************************/
/* |
|
| */ |
/* | SAMPLE.H |
| */ |
/* |
|
| */ |
/* |
|
| */ |
/* | Write and read requests can be issued to other T2N units | */ | |
/* | by modifying this definition file. | */ | |
/* |
|
| */ |
/* |
|
| */ |
/* |
|
| */ |
/* | (C) Copyright TOSHIBA Corporation 1995 | */ | |
/* | All Rights Reserved |
| */ |
/* |
|
| */ |
/**********************************************************************/ | |||
| |||
/* Definition declarations | */ |
| |
|
#define | MY_PORT | 3001 | /* Local port number | */ |
#define | DST_PORT | 3001 | /* Remote port number | */ |
#define | DST_IP | "133.113.98.10" | /* Remote IP address | */ |
#define | LOOP | 10 | /* Data transmission execution count */ | |
#define | DATASIZ | 32 | /* Data length | */ |
|
|
| /* Computer link function = word units */ | |
#define | RECVTOUT | 30 | /* RECVFROM timeout time | */ |
#define | REG_TYPE | "D" | /* Register type | */ |
#define | REG_ADR | "0000" | /* Register start address */ |
⎯ 51 ⎯