Vicks EDG-4516+ user manual Example EDG-4508+U

Page 80

Example (EDG-4508+U):

SOCKADDR_IN Dst4508UAddr; SOCKET Dst4508USock;

char RxData[10];

memset(&Dst4508UAddr, 0, sizeof(SOCKADDR_IN)); Dst4508UAddr..sin_family = AF_INET; Dst4508UAddr..sin_addr.s_addr = inet_addr("10.0.0.1"); //Indicate the IP Address of EDG-4508+U that you want to connect.// Dst4508UAddr..sin_port = htons(5201);

//Indicate which port of EDG-4508+U you want to access//

//TCP port no. of Port1 = TCP port +1//

//TCP port no. of Port2 = TCP port +2//

Dst4508USock = socket(AF_INET, SOCK_STREAM, 0));

//EDG-4508+U creates the TCP socket// connect(Dst4508USock, (sockaddr *)&Dst4508UAddr, sizeof(Dst4508UAddr));

//Connect to the EDG-4508+U// send(Dst4508USock, "0123456789", 10, 0);

//Send data "0123456789" to the port of EDG-4508+U// recv(Dst4508USock, RxData, 10, 0);

//Receive the data from the port of EDG-4508+U// closesocket(Dst4508USock);

//Disconnect from the EDG-4508+U//

EDG-4508+/4516+ User Manual

68

Image 80
Contents EDG-4516+ Port Ethernet to RS-232/422/485 Data GatewayCopyright Acknowledgments CE Notification Product Warranty 2 years FCC Class a Technical Support and Assistance Packing ListContents Chapter Console Configuration Chapter Event and DI/O Monitoring Chapter Troubleshooting Appendix a Overview Features IntroductionSpecifications Packing ChecklistPage Getting Started Installation Flow Chart Understanding EDG-4508+ and EDG-4516+ Connecting Hardware EDG-4508+/4516+ Front PanelEDG-4508+/4516+ LED Indicators and Connectors EDG-4508+/4516+ LED & Connector Definitions EDG-4508+/4516+ Rear Panel Rack Mounting Rack MountingEthernet Connector of EDG-4508+/4516+ Network ConnectionPower Supply Connection Serial Port ConnectionOrdering Information Installation Install/Uninstall Driver & UtilityPage Page Page Page Configuration Auto Search When you run the EDG configuration utility for Locating EDG-4508+/4516+ Device System Configuration Ethernet Data GatewayDevice Name Device DescriptionNetwork Configuration Duplex ModeTCP/IP Option IP address, Subnet Mask, Default Gateway Ethernet Option MAC AddressPort Configuration Port SettingName DescriptionPort Configuration TypeParity Flow ControlData Bits Stop BitsBaud Rate Set All PortHost Idle Timeout Auto ReconnectionSecurity Configuration Only configure the allowed IPAllow any IP to access Specified IP can access EDG devicePage Port Mapping Utility Virtual COM Port Settings OverviewModule of Installed Device IP Address of Installed DevicePort of Installed Device Properties Auto Reconnect FunctionAdd All MemoAdd Inquiring Virtual COM Port Setting Updating EDG Firmware Updating FirmwareSelf Test Function TestSignal Test Communication Parameters TestExit If you want to quit the utility, please click on DeleteApply Save the Configuration Web-Based Configuration Access Web All new configurations will take effect after EDG-4508+ and EDG-4516+ provide RS-232 DI/O Event Configuration Reset Configuration Console Configuration Creating a new connection Connecting the cableHyper Terminal Connection COM Port Setting Selecting a COM PortVersion Usage version Command ListConnecting Successfully Date displays or sets the date Usage date Time displays or sets the time Usage timeYou should use the net save command to Port Event Reboot PingExit WebPage Universal Serial Device Gateway EDG-4508+/4516+ Firmware updated procedure File Name DescriptionPress Start button to start the firmware download procedure Page Only configure the authorized IP TCP Port numberSpecified IP which can access Port ModeHow do you restore the firmware to EDG-4508+/4516+? File Name Description Page Network Architecture and Example Code Polling Network Architecture 12 Network Architecture-PollingExample EDG-4508+U Event-handling Network Architecture 14 Network architecture Event-handlingExample EDG-4508+U Peer-to-Peer Network Architecture 16 Network architecture Peer-to-peer18 #1 EDG-4508+U Configuration Utility 19 #2 EDG-4508+U Configuration Utility 20 Key-in information of #2 EDG-4508+U 22 Communication parameters of #1 EDG-4508+U 3Web-BasedConfigurationforEDG-4508+U/4516+U Access webNetwork Configuration Port Configuration Cnsole Configuration for EDG-4508+U/4516+U 4 DI/O Event ConfigurationReset Configuration Command ListVersion LogDate displays or sets the date Time displays or sets the timeNet You should use the net save command to Event Ping Event and DI/O Monitoring Event and DI/O Monitoring Polling MonitoringEvent Monitoring DI Value Inverse Option Page How to use the sample files? Programming I/OEdgevtio.dsp Edgevtio.dswMbtcp.h ModbustcpmsghdrlengthTroubleshooting Configuration Utility can not find EDG Series Cannot change the IP address or other server propertiesPage Page Appendix Appendix a RS-232 Pin Assignment RJ-48 Cable PIN AssignmentRS-422 RS-485100