Vicks EDG-4516+, EDG-4508+ user manual Edgevtio.dsp, Edgevtio.dsw

Page 103

memset(&HostAddr, 0, sizeof(SOCKADDR_IN)); HostAddr.sin_family = AF_INET; HostAddr.sin_addr.s_addr = INADDR_ANY; HostAddr.sin_port = htons(5000);

//

//+-->The TCP Port in the server application

It remarks the function of htons(n), the parameter n means the TCP Port in server application and It helps the programmer to make his own program easier by referencing the note we provided.

HostSock = socket(AF_INET, SOCK_STREAM, 0);

//

//+-->Create the socket of TCP on the Host

It remarks the function of socket(AF_INET, SOCK_STREAM, 0), the function of socket(var1,var2,n) means to create the socket of TCP on Host. Programmer can also create the socket of TCP on the Host by himself.

edgevtio.dsp

Programmers can choose the develop tools for themselves. For example, in edgevtio.dsp file, the extension file name .dsp means Microsoft Developer Studio Project File. Programmer can open the file as a tem- plate to create their own programs.

edgevtio.dsw

File name of edgevtio means EDG Event I/O, extension name of dsw means it is a Microsoft Developer Studio Workspace file. This file is necessary when you open a Developer Studio Project and we make a warning note in file to reminder you not to modify or delete this related workspace file.

91

Chapter8

Image 103
Contents Port Ethernet to RS-232/422/485 Data Gateway EDG-4516+Copyright Acknowledgments CE Notification Product Warranty 2 years Packing List FCC Class a Technical Support and AssistanceContents Chapter Console Configuration Chapter Event and DI/O Monitoring Chapter Troubleshooting Appendix a Overview Introduction FeaturesPacking Checklist SpecificationsPage Getting Started Installation Flow Chart Understanding EDG-4508+ and EDG-4516+ EDG-4508+/4516+ Front Panel Connecting HardwareEDG-4508+/4516+ LED Indicators and Connectors EDG-4508+/4516+ LED & Connector Definitions EDG-4508+/4516+ Rear Panel Rack Mounting Rack MountingNetwork Connection Ethernet Connector of EDG-4508+/4516+Serial Port Connection Power Supply ConnectionOrdering Information Install/Uninstall Driver & Utility InstallationPage Page Page Page Configuration Auto Search When you run the EDG configuration utility for Locating EDG-4508+/4516+ Device Description Device System ConfigurationEthernet Data Gateway Device NameEthernet Option MAC Address Network ConfigurationDuplex Mode TCP/IP Option IP address, Subnet Mask, Default GatewayDescription Port ConfigurationPort Setting NameType Port ConfigurationFlow Control ParityStop Bits Data BitsSet All Port Baud RateAuto Reconnection Host Idle TimeoutSpecified IP can access EDG device Security ConfigurationOnly configure the allowed IP Allow any IP to accessPage Port Mapping Utility Overview Virtual COM Port SettingsProperties Auto Reconnect Function Module of Installed DeviceIP Address of Installed Device Port of Installed DeviceAdd MemoAdd All Inquiring Virtual COM Port Setting Updating Firmware Updating EDG FirmwareTest Self Test FunctionCommunication Parameters Test Signal TestApply DeleteExit If you want to quit the utility, please click on 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 Hyper Terminal Connection Connecting the cableCreating a new connection Selecting a COM Port COM Port SettingConnecting Successfully Command ListVersion Usage version Time displays or sets the time Usage time Date displays or sets the date Usage dateYou should use the net save command to Port Event Web RebootPing ExitPage Universal Serial Device Gateway File Name Description EDG-4508+/4516+ Firmware updated procedurePress Start button to start the firmware download procedure Page TCP Port number Only configure the authorized IPPort Mode Specified IP which can accessHow do you restore the firmware to EDG-4508+/4516+? File Name Description Page Network Architecture and Example Code 12 Network Architecture-Polling Polling Network ArchitectureExample EDG-4508+U 14 Network architecture Event-handling Event-handling Network ArchitectureExample EDG-4508+U 16 Network architecture Peer-to-peer Peer-to-Peer Network Architecture18 #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 Access web 3Web-BasedConfigurationforEDG-4508+U/4516+UNetwork Configuration Port Configuration Command List Cnsole Configuration for EDG-4508+U/4516+U4 DI/O Event Configuration Reset ConfigurationTime displays or sets the time VersionLog Date displays or sets the dateNet You should use the net save command to Event Ping Event and DI/O Monitoring Polling Monitoring Event and DI/O MonitoringEvent Monitoring DI Value Inverse Option Page Programming I/O How to use the sample files?Edgevtio.dsw Edgevtio.dspModbustcpmsghdrlength Mbtcp.hTroubleshooting Cannot change the IP address or other server properties Configuration Utility can not find EDG SeriesPage Page Appendix RS-232 Pin Assignment RJ-48 Cable PIN Assignment Appendix aRS-485 RS-422100