Vicks EDG-4508+, EDG-4516+ user manual Programming I/O, How to use the sample files?

Page 102

8.3 Programming I/O

According the feature list, it mentioned EDG-4508+/4516+ provide the D/I AND D/O handling function. In order to help customer to create the I/ O event handling environment. We provide a programmable I/O sample program for customer use. After installing the EDG COM Port Utility, the sample programs will be on the location as follow:

C:\Program Files\Advantech\EDG COMPort Utility\samples\vc\ edgevtio.

How to use the sample files?

(1) The sample programs include following file and the develop envi- ronment is based on Microsoft Visual C++.

edgevtio.cpp

edgevtio.dsp

edgevtio.dsw

edgevtio.ncb

edgevtio.opt

edgevtio.plg

mbtcp.h

(2)Compiler the sample program

(3)Run the sample program

After compiler the program and run the program, the system will change to Server mode to trigger any D/I event and sent back to sys- tem to active the D/O event.

(4)You can modify the program and create your own event handling process.

(5)Sample files list and description as follow:

edgevtio.cpp : Defines the entry point for the console applica- tion.edgevtio.dsp

edgevtio.dsp : Microsoft Developer Studio Project File

edgevtio.dsw : Microsoft Developer Studio Workspace File

edgevtio.ncb : Microsoft C/C++ program database edgevtio.opt

edgevtio.plg

mbtcp.h

In this sample files, we provide the note for the parameter for program- mer use.

For example:

In edgevtio.cpp file content, line 32 to line 41

EDG-4508+/4516+ User Manual

90

Image 102
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 Name Device System ConfigurationEthernet Data Gateway Device DescriptionTCP/IP Option IP address, Subnet Mask, Default Gateway Network ConfigurationDuplex Mode Ethernet Option MAC AddressName Port ConfigurationPort Setting DescriptionPort Configuration TypeParity Flow ControlData Bits Stop BitsBaud Rate Set All PortHost Idle Timeout Auto ReconnectionAllow any IP to access Security ConfigurationOnly configure the allowed IP Specified IP can access EDG devicePage Port Mapping Utility Virtual COM Port Settings OverviewPort of Installed Device Module of Installed DeviceIP Address of Installed Device Properties Auto Reconnect FunctionMemo AddAdd All Inquiring Virtual COM Port Setting Updating EDG Firmware Updating FirmwareSelf Test Function TestSignal Test Communication Parameters TestDelete ApplyExit 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 Connecting the cable Hyper Terminal ConnectionCreating a new connection COM Port Setting Selecting a COM PortCommand List Connecting SuccessfullyVersion Usage version 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 Exit RebootPing 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 Reset Configuration Cnsole Configuration for EDG-4508+U/4516+U4 DI/O Event Configuration Command ListDate displays or sets the date VersionLog 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