![background image](http://html1.mh-extra.com/html/omron/cs1w-etn01/cs1w-etn01_operation-manuals_742528093.webp)
5-4
Section
Sending Commands From a Host Computer
81
DA1 (Destination Node Address)
Specifies the number of the node where the command is being sent. This
node number is the address used for FINS, and is different from the IP ad-
dress used for Ethernet.
00 (Hex):
Local PC Unit
01 to 7E (Hex): Destination node number (1 to 126)
FF (Hex):
Broadcasting
When multiple Communications Units are mounted, DA1 specifies the node
number of the Unit connected to the network specified by DNA.
DA2 (Destination Unit Address)
Specifies the number of the Unit at the destination node.
00 (Hex):
PC (CPU Unit)
10 to 1F (Hex): CPU Bus Unit #0 to #15 (16 to 31)
E1 (Hex):
Inner Board
FE (Hex):
Unit connected to network.
SNA (Source Network Address)
Specifies the number of the network where the source node is located.
00 (Hex):
Local network
01 to 7F (Hex): Source network number (1 to 127)
SA1 (Source Node Address)
Specifies the local node number. The ranges of numbers that can be speci-
fied are the same as for DA1.
SA2 (Source Node Address)
Specifies the number of the Unit at the source node. The ranges of numbers that
can be specified are the same as for DA2.
SID (Service ID)
The SID is used to identify the process that data is sent from. Set any desired
number from 00 to FF for the SID. The same number will be returned in the re-
sponse, allowing you to match commands and responses in your application.
5-4-3 Sample Program
Operation Overview
This program reads 150 words of the PC memory beginning at D00100 by send-
ing an FINS command (MEMORY AREA READ, command code 0101) from a
UNIX workstation to the PC on the Ethernet network. If no response is received
within two seconds of sending the FINS command, the command will be resent.
Settings
The Ethernet Unit IP address is 196.36.32.100, and the FINS node number is
100. IP address conversion is set to automatic generation.
The workstation’s IP address is 196.36.32.50 and its FINS node number is 50.
The FINS UDP port number is 9600 (default).
Sample Program
1
#include <errno.h>
2
#include <stdio.h>
3
#include <sys/types.h>
4
#include <sys/socket.h>
5
#include <netinet/in.h>
6
#include <signal.h>
7
8
#define FINS_UDP_PORT 9600
9
#define SERV_IP_ADDR ”196.36.32.100” /
*
Ethernet Unit IP ADDRESS
*
/
10
#define MAX_MSG 2010
11
#define RESP_TIMEOUT 2
12
13
14
/*
15
*
FINS COMMUNICATIONS SAMPLE PROGRAM