Ethernet to Digital I/O and Analog Input. (Model: IP-IO)

Similar documents
MCW Application Notes 24 th February 2017

GNetPlus Communication Protocol

MTR-4. C8 Command to MODBUS Bridge User Manual F-1, No. 631, Chung Der Road, Sec 1, Taichung Taiwan.

CTT MODBUS-RTU COMMUNICATION PROTOCOL TEMPERATURE MONITOR DEVICE

Keywords: CRC, CRC-7, cyclic redundancy check, industrial output, PLC, programmable logic controller, C code, CRC generation, microprocessor, switch

on a 35 mm top-hat rail (in accordance with DIN EN TH35) Ambient temperature Operation: C Storage: C

Input Channels: 4 differential or four single-ended. Address / Baud rate / range configurable by the user

variable 1. Start of Packet - is used to provide synchronization when parsing packets. Always 0xFC

BENCHTOP INSTRUMENT. Digital AC/DC Power Meter. Operation Manual V1.0

PCD1.W5200-A20. E-Line S-Serie RIO 8AO. Features. General technical data. Dimensions and installation

Modbus RTU CFW100. User s Manual. Phone: Fax: Web: -

Motors I Automation I Energy I Transmission & Distribution I Coatings. Modbus RTU CFW701. User s Manual

DULCOMETER Multi-parameter Controller dialog DACa

Motors I Automation I Energy I Transmission & Distribution I Coatings. Modbus RTU CFW500. User s Manual

Motors I Automation I Energy I Transmission & Distribution I Coatings. Modbus RTU CFW300. User s Manual

PCD1.A2000-A20. E-Line S-Serie RIO 6Rel 16A. Features. General technical data. Dimensions and installation

variable 1. Start of Packet - is used to provide synchronization when parsing packets. Always 0xFC

DMTME Multimeters. Communication protocol. Technical specification V1.2 ABB

TBS Unify Pro / SmartAudio

SIMCom_3G_CSD_Application Note_V1.00

Modbus Protocol Guide for ZP2 Series Control Panels

M2M/DMTME Instruments Communication protocol. Technical specification V.2.1 2CSG445011D0201

imetos LoRa Data payload structure

RS-232 Control of the Advantage EQ281/8, EQ282/8 and Advantage SMS200

1 SETTING UP GENERAL FUNCTION TYPE PROTOCOL MESSAGES COMMAND RETURN CODES... 6 TRANSACTION EXAMPLES...

RS232C Serial Interface for Pirani Diaphragm and Pirani Standard Gauges. Caution. binary 8 data bits 1 stop bit no parity bit no handshake

Chapter 2: Secret Key

Signed/Unsigned Integer Arithmetic in C. Vineel Kovvuri

AquaCER with TTL OUTPUT

Technical Specification. Third Party Control Protocol. AV Revolution

The Roboteq Modbus Implementation User Manual

RS232C / RS485C Serial Interface for Cold Cathode and Cold Cathode Pirani Gauges

PCD1.E1000-A10. E-Line S-Serie RIO 12DI. Features. General technical data. Dimensions and installation

Diagnostic Port Serial Interface for Capacitance Diaphragm Gauges

Heat meter PolluStat M-bus communication protocol description

RS232C / RS485C Serial Interface for Pirani Capacitance Diaphragm and Pirani Standard Gauges

Request for Comments: XXXX November Registration of a Georgian Character Set draft-giasher-geostd8-00.txt

RS-232 Control of the Advantage DRI

SPARC INTERNATIONAL. Version1 SPARC Keyboard Specification

//

Highlights. FP51 (FPGA based 1T 8051 core)

FnIO S Series: NA MODBUS/TCP(UDP) Adapter. with Two RJ-45

JDICON 400/500 JDICON 401/501. B Interface Description. Universal process controller

// and verify that there is a sine wave with frequency <FREQUENCY> and

Verve IPAC Plug-in Wireless AC Module. Software Setup 3. DolphinView Software 3. Preparations 4 Transmit LINK Signals 4.

Modbus communication protocol

MODBUS Communication Protocol

Computer Control of the Advantage DRC 4+4

App Note Application Note: State-Driven Control of a dpasp using a Microchip PIC.

APPENDIX- A REFERENCE IMPLEMENTATION OF BSF-128 ===============================================================

Specifiche generali protocollo MODBUS-RTU Rev. 10 (inglese) REVISIONS

Flexi Soft T E L E G R A M M L I S T I N G

MICROPROCESSOR CONTROLLER RE15

HDLC BCC 15.1 Data Link Protocol Description

Using the USB and Serial Interfaces

StarPRNT ios SDK User s Manual

Description. thanos ModBus. thanos SR ModBus

IEC /104 Communications Protocol

#include <stdio.h> // // Global CONSTANTS

Ethernet to Serial Port Module RS-232/422/485 to Internet Gateway

CSEE bit AES decryption. Shrivathsa Bhargav Larry Chen Abhinandan Majumdar Shiva Ramudit. Spring 2008 Project Design Document

GSA GAT PROTOCOL V Game Authentication Terminal

Ethernet to RS-232/485 Gateway

MODEL TDAI-2170 INTEGRATED AMPLIFIER EXTERNAL CONTROL MANUAL

ADV7610 SOFTWARE MANUAL SOFTWARE MANUAL. Documentation of the Register Maps. Rev. 0

Modbus Map: Conext XW/XW+ Device

SXH Protocol by Spinel Version 3.0 Date:

PLC Lite Host Message Protocol Specification

CS 4400 Fall 2018 Midterm Exam 2 Practice (Version 2)

RITA. LDA110E Power Meter INSTRUCTION MANUAL TEL (02) FAX (02)

UNPACKING THE PACKED UNPACKER: REVERSING AN ANDROID ANTI-ANALYSIS NATIVE LIBRARY Maddie Stone Google, USA

Security Analysis of Lightweight Authentication Protocol from WISTP ,2) P, Xiao FuP P, Chen Dan-weiP P, Wang Ru-chuanP

DATA SHEET. article numbers P125-1b & P125-1g

CLOCKAUDIO. MR88 Automatic Microphone Mixer RS232 Programming Version 4.2

JMY504M User's Manual

ADV7612 SOFTWARE MANUAL SOFTWARE MANUAL. Documentation of the Register Maps. Rev. A

ID: Sample Name: Q3dY56x3hp Cookbook: defaultlinuxfilecookbook.jbs Time: 04:08:56 Date: 21/08/2018 Version:

Intro (with some history) Issues ow, ow, ow, ow, ow, ow, ow, ow, Disclosure/Timeline CHIASMUS cipher

Planar Simplicity Series

ANM071. Keypad decoding technique using TSC80251G1. 1. Description 2. TSC80251G Keyboard interrupt Power down mode

8x8 HDMI over CAT5 Matrix with IR Pass-through

ECE251: Intro to Microprocessors Name: Solutions Mid Term Exam October 4, 2018

TCG Algorithm Registry

Protocol Description. thanos ModBus. thanos SR ModBus

Technical Information. Command overview of Vision Systems

JMY607H User's Manual

User s Guide TLNETCARD

Software Manual. Applicable Models TSP100ECO TSP100GT TSP100LAN TSP100U/PUSB. Rev. 5.5

RTX64. Supported Network Interface Cards

RTX64. Supported Network Interface Cards IntervalZero, Inc. IZ-DOC-X R32 March 2017

BC3G-US-SMA API. Rev 2.0

8x8 HDMI over CAT5 Matrix with IR Pass-through

DMA Profinet Manual. Revision History

Application Note BDLxxxx RS232 SERIAL INTERFACE COMMUNICATION PROTOCOL (SICP V1.82)

Interface Card, Interface Box, Datalogger & Interface. Bedienungsanleitung. Kommunikationsprotokoll. Operating Instructions. Communications protocol

TPMC816. Two Independent Channels Extended CAN Bus PMC Module. Version 2.2. User Manual. Issue August 2014

TECHNICAL SHEET. Hydrovar HVL Modbus HVL Modbus Protocol & Parameters. HVL Software Version: 2.00

Modbus Map: MPPT60 Device

Interface Control Document

SIRKOM'Digital'Signage'Div.''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''MedeaWiz 'Sprite' High'Definition'Video'Player' User'Manual'

Transcription:

Ethernet to Digital I/O and Analog Input (Model: IP-IO) Feature: Operation voltage : DC 7V ~ 36V. Analog Interface: Interface : 3.3V levels compatibility. Resolution : 16-bits Σ-Δ A/D converters. Accuracy : 0.05%. Channel : 3-channles Input type : 0-20mA 4-20mA and 0-10V. Build-in digital filter function. Conversion time : 100ms. Digital Interface: Digital input/output : 7 channels 3.3V input or output by user programmable. Digital output : 1 channel optical isolation output and cut-off frequency 50KHz. Ethernet Interface: Built-in 1.5KV magnetic isolation. Ethernet Interface : 10Base-T, 100Base-TX Ethernet Speed/Duplex : Auto-negotiation 10/100Mbps, Full/Half duplex Protocols Supported : ARP, IP, ICMP,UDP, TCP, DHCP, TFTP, HTTP. Network Services : TCP Server, TCP Client, Web Control. Auto-MDIX : Yes Auto-Transmit and Auto-Connect function. Modbus over serial line v1.1 protocol and RTU transmission mode. Build-in web server setting page for parameter by user. Support all operation system, don t need any driver. 1

Cross domain parameter setting utility for windows XP/VISTA/windows 7. Support Virtual Serial Port (VSP) utility for simulate RS232 COM port. Dimension: 102 x 102 x 26 (mm) Application: Energy Meter Networks Motor Control Industrial Control Telecommunications Equipment Building Automation Networks Internet of Things 1. Pin definition: 3 LEDs Power Input Block Terminal DB9 Connector RJ-45 Auto Polling 2

1.1 DB9: 1 GND Ground 2 DIO0 None-Isolated Digital I/O, Max. 3.3V 3 DIO1 None-Isolated Digital I/O, Max. 3.3V 4 DIO2 None-Isolated Digital I/O, Max. 3.3V 5 DIO3 None-Isolated Digital I/O, Max. 3.3V 6 DIO4 None-Isolated Digital I/O, Max. 3.3V 7 DIO5 None-Isolated Digital I/O, Max. 3.3V 8 DIO6 None-Isolated Digital I/O, Max. 3.3V 93.3V DC 3.3V Power output 1.2 6P block terminal: 1 Vin DC input 7-36V 2 CH1 0-20mA 3 CH2 0-20mA 4 CH3 0-20mA 5 ISO_DO7 Optical Isolated digital output, Max. 30V 6 GND Ground 3

2. Configuration: Connect the RJ-45 cable between the PC and Gateway. Set the IP of the PC be the same as the Ethernet Gateway before use. (Ex: 192.168.0.2) 2.1 Web page: The page will set the network only. The I/O setting will be set by the DSM software, please check section 2.2. 2.2 DSM Software: The network, Digital I/O and Analog Input will be set by the DSM software. Scan Device List 4

Double click the searched item and click the right page, the AI/DIO setting display. The auto report interval will be set from 1s to 1 hour. Please switch to the Auto on the side of the box. For the polling mode, the user will set the command. 5

3. Command Protocol Baud rate : 57600.n.8.1 #define SlaveAddrss 0x55 Ddefault address Set Command #define SetDOut 0x24 set IO output value #define SetDIR 0x25 setup Input or output #define SetLevel 0x26 set IO initial value #define ACKCommand 0xEE response confirmation Example: bool SetCommand(unsigned char IPNum(IP address),unsigned char Function(command),unsigned char *Data(set data),unsigned char Length(set length of data)) { //Address Function Length Data0... DataN CRC16_High CRC16_Low fd_set fds; timeval timeout={secondtime,usecondtime; unsigned char URFIFO[30]; DWORD dwnobyte; union{ unsigned char Byte[2]; unsigned short int Word; CRC; unsigned char i; URFIFO[0]=SlaveAddrss; URFIFO[1]=Function; URFIFO[2]=Length; for(i=0;i<length;i++) URFIFO[3+i] = Data[i]; CRC.Word = CRC_CCITT(URFIFO,3+i); URFIFO[3+i]=CRC.Byte[1]; URFIFO[4+i]=CRC.Byte[0]; FD_ZERO(&fds); FD_SET(conn_socket[IPNum],&fds); switch(select(conn_socket[ipnum]+1,null,&fds,null,&timeout)){ case -1: case 0: 6

default: if(fd_isset(conn_socket[ipnum],&fds)) send(conn_socket[ipnum],urfifo,length+5,0); FD_ZERO(&fds); FD_SET(conn_socket[IPNum],&fds); switch(select(conn_socket[ipnum]+1,&fds,null,null,&timeout)){ case -1: case 0: default: if(fd_isset(conn_socket[ipnum],&fds)){ dwnobyte = recv(conn_socket[ipnum],urfifo,5,0); if(!((dwnobyte==5)&&(urfifo[0]==slaveaddrss)&&(urfifo[1]==ackcommand))){ return false; else return true; return false; Program initial value asetup: You have to setup the IO for input or output from the beginning by (SetDIR Command), Then, setup IO initial valuefor high or low by (SetLevel Command), Setup high or low for output by (SetDOut Command). CRC16 Checksum : #define POLYNOMIAL 0xA001 #define INITIAL_VALUE 0xFFFF /* Table of CRC values for high order byte */ const unsigned char auchcrchi[] = { 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 7

0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 ; /* Table of CRC values for low order byte */ const unsigned char auchcrclo[] = { 0x00, 0xC0, 0xC1, 0x01, 0xC3, 0x03, 0x02, 0xC2, 0xC6, 0x06, 0x07, 0xC7, 0x05, 0xC5, 0xC4, 0x04, 0xCC, 0x0C, 0x0D, 0xCD, 0x0F, 0xCF, 0xCE, 0x0E, 0x0A, 0xCA, 0xCB, 0x0B, 0xC9, 0x09, 0x08, 0xC8, 0xD8, 0x18, 0x19, 0xD9, 0x1B, 0xDB, 0xDA, 0x1A, 0x1E, 0xDE, 0xDF, 0x1F, 0xDD, 0x1D, 0x1C, 0xDC, 0x14, 0xD4, 0xD5, 0x15, 0xD7, 0x17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0x8D, 0x4D, 0x4C, 0x8C, 0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86, 0x82, 0x42, 0x43, 0x83, 0x41, 0x81, 0x80, 0x40 ; unsigned short int CRC_CCITT(unsigned char *Data,unsigned char Length){ unsigned char uchcrchi,uchcrclo,uindex; uchcrclo=0xff; uchcrchi=0xff; 8

while(length--){ /* pass through message buffer */ uindex = uchcrchi^*data++; /* calculate the CRC */ uchcrchi = uchcrclo^auchcrchi[uindex]; uchcrclo = auchcrclo[uindex]; return ((uchcrchi<<8) uchcrclo); Get Command #define GetDIn #define GetDIR #define GetLevel 0x34 0x35 0x36 Example: bool GetCommand(unsigned char IPNum(IP 位址 ),unsigned char Function( 指令 ),unsigned char Length( 讀取資料長度 ) { //Address Function Length Data0... DataN CRC16_Low CRC16_High fd_set fds; timeval timeout={secondtime,usecondtime; unsigned char URFIFO[12]; DWORD dwnobyte; union{ unsigned char Byte[2]; unsigned short int Word; CRC; URFIFO[0]=SlaveAddrss; URFIFO[1]=Function; URFIFO[2]=0; CRC.Word = CRC_CCITT(URFIFO,3); URFIFO[3]=CRC.Byte[1]; URFIFO[4]=CRC.Byte[0]; FD_ZERO(&fds); FD_SET(conn_socket[IPNum],&fds); switch(select(conn_socket[ipnum]+1,null,&fds,null,&timeout)){ case -1: case 0: default: 9

if(fd_isset(conn_socket[ipnum],&fds)) send(conn_socket[ipnum],urfifo,5,0); FD_ZERO(&fds); FD_SET(conn_socket[IPNum],&fds); switch(select(conn_socket[ipnum]+1,&fds,null,null,&timeout)){ case -1: case 0: default: if(fd_isset(conn_socket[ipnum],&fds)){ dwnobyte = recv(conn_socket[ipnum],urfifo,length+5,0); if(!((dwnobyte==(length+5))&&(urfifo[0]==slaveaddrss))){ return false; switch(function){ case GetResponseTime: case GetMode: case GetAddress: case GetDIn: if(urfifo[1]==getdin) Module[IPNum].Input = URFIFO[3]; case GetDIR: if(urfifo[1]==getdir) Module[IPNum].IODIR = URFIFO[3]; case GetLevel: if(urfifo[1]==getlevel) Module[IPNum].IOLevel = URFIFO[3]; return true; return false; 10