Home
DCON Utility (DOS)
Contents
1. sr test 485 int i j k znum ComPort checksum iRet long BaudRate char str1 80 str2 80 str3 80 float ok err ok err 0 0 for stream fopen test dat r fscanf stream d amp num for k 0 k lt num k ok 1 0 fscanf stream d ld d s s amp ComPort amp BaudRate amp checksum str1 str2 iRet OPEN COM ComPort BaudRate if IRet 0 err 1 0 SEND CMD ComPort TIMEOUT checksum RS 232 settling time delay RECEIVE CMD ComPort str3 TIMEOUT checksum SEND CMD ComPort strl TIMEOUT checksum RECEIVE CMD ComPort str3 TIMEOUT checksum printf Instr1 s receive s strl str3 if mememp str2 str3 strlen str2 0 err 1 0 fclose stream printf nOK 1f err 1f Press any key to stop ok err printf n DE if kbhit 0 getch return DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 2 2 5 1 Function 0 INIT This function is designed to initiate the COM port The program steps are given as below step 1 input the COM port number step 2 input the baud rate number step 3 input the checksum status step 4 call OPEN COM to initiate the COM port step 5 show the result of operation This function set the parameters for the COM port and the function to function 4 will also operate based on these parameters Refer to S
2. DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 59 6 MMICON Applications 6 1 Introduction PWR 24 ORS 485 Function Keys 8 Z OMMICON 1 Tm MMICON n Can Connecting 256 MMICON without repeater 7510 Refer to MMIDOS Software User Manual for demo program DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 60 MMICON command sets change display page AA MMICON address DD page num change to page 0 default pin 0 gt AA 0 change to page 1 default pin 0 gt AA 0 show string AA MMICON address V 0 7 HH 0 14 hex Str string to be shown on LCD show Hello in row 0 column 2 00T310Test show Test in row 3 column 0x10 read 4 4 keyboard if key buffer overflow then V 1 else V 0 Keys keys pressed code refer to MMICON user manual for keycode details 101019010314 no keys pressed 101002 19 01 03 14 total 4 keys are pressed 02 total 1 key is pressed VoAANNTTBBO0O AA change configuration AA current addr INN new addr TT mode number refer to Sec 7 1 for operating mode 00 gt mode 0 digital I O interface mode 01 gt mode I PC RS232 RS485 interface mode 02 gt mode 2 PC RS232 interface mode 03 gt mode 3 PLC RS232 mode BB baudrate RS232 RS485 baudrate 03 gt 1200 04 gt 2400 05 gt 4800 06 gt 9600 07 gt 19200 change to PC RS232 RS485 interface mode change to PLC RS232 interface mode change to PC RS232 i
3. 7520R 7520R This is the cheapest way and can maintain the 3000V high isolation The user should not replace these 7520R 6 OQ to 7520 Refer to 7000 Bus Converter User Manual for more information The operation steps are given as following host PC send out RS 232 command to 07520 07520 convert this command to RS 485 signal 97520R 7520R and O7520R convert this signal to RS 232 command PLC1 PLCn and OPLCm receive this RS 232 command and start to execute the destination PLC send result to 7520R the 07520 convert this result signal to RS 232 signal the host PC receive this result and take next action DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 55 5 2 Example The communication data format of OMRON COMI amp C200 is the same The data format 1s given as following OMRON CQMI1 I start 7 data 1 even parity 2 stop 11 bit byte OMRON C200 1 start 7 data 1 even parity 2 stop 11 bit byte This demo will connect three OMRON PLC into one RS 485 network as following 1 PCL1 address 00 COMI baud rate 9600 2 PLC2 address 01 CQM1 baud rate 9600 3 PLC3 address 02 C200 baud rate 9600 97520R Q7520R 7520R OPLC 3 address 2 5 2 1 Program Source The files in NAP7000S PLC_NET TC are given as below UART H gt header file UART C library file TEST C application file TEST PRJ 7 project file send command char cmd
4. function 3 demo char cCmd 50 int iRet DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 33 printf gt 3 demo command 012 01M 01F strepy cCmd 012 printf nSend 012 iComPort SEND_CMD iComPort cCmd TIMEOUT 0 iRet RECEIVE CMD iComPort cCmd TIMEOUT 0 if iRet 0 printf Receive s cCmd else if iRet 1 printf Receive com value error must 1 2 3 4 else if iRet 2 printf Receive Timeout else if iRet 3 printf Receive chksum error strepy cCmd 01M printf nSend 01M iComPort SEND_CMD iComPort cCmd TIMEOUT 0 iRet RECEIVE CMD iComPort cCmd TIMEOUT 0 if iRet 0 printf Receive s cCmd else if iRet 1 printf Receive com value error must 1 2 3 4 else if iRet 2 printf Receive Timeout else if iRet 3 printf Receive chksum error strepy cCmd 01F printf nSend 01F iComPort SEND_CMD iComPort cCmd TIMEOUT 0 iRet RECEIVE CMD iComPort cCmd TIMEOUT 0 if iRet 0 printf Receive s cCmd else if iRet 1 printf Receive com value error must 1 2 3 4 else if iRet 2 printf Receive Timeout else if iRet 3 printf Receive chksum error function 4 ui host watchdog char cCmd 50 int iRet printf gt 4 host watchdog test for 70
5. totally 1024 different address The user can design his special command format as desired For example amp AAA string chksum cr amp 1s a delimiter character AAA 3 byte HEX address from 000 to FFF string command string chk 2 character checksum if checksum disable no chk cr 0x0D The files in DCON_ Utility DOS PC_NET TC TEST EXE are designed to link thousands of remote PC with one HOST PC The address of host is 0 The address of remote PC are from 1 to FFF totally 1023 max The TEST EXE will read the content of ADDR DAT These is only one address data in ADDR DAT If this data 1s 0 the TEST EXE will demo as a host PC If this data is any value other than 0 the TEST EXE will demo as a remote PC The demo steps are given as following DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 49 step 1 the user can key in command in the host PC step 2 the host PC send out command to remote PC step 3 all remote PC receive this host command step 4 the remote PC with the same address as the destination address will send result to the RS 485 network step 5 the host PC receive this result The steps for host PC to run TEST EXE are given as following step 1 edit ADDR DAT key in 0 step 2 run TEST EXE step 3 key in command string step 4 repeat step3 until stop step 5 key in Q command can stop TEST EXE The steps for remote PC to run TEST EXE are given as following step 1 edit ADDR DAT key
6. 01400600 Send 01M PReceive 017060 Send 01F Receive 0141 6 SW WoW row Diagnostic Program SRR oro ror COM 1 Baud Rate 9600 Checksum DISAGLE for all modules DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 13 2 1 5 Test Host WatchDog Function The operation steps to test programmable host watchdog are shown as following 1 step I press 4 2 step 2 press any key to simulate host failure 3 step 3 press any key to clear module status 3 deno 002 500060 for all module Host Watchdog test for TEL D R 485 network testing for all module qut i rik Presa Kevnord d wtttdduuuuntdddduuutT 4 gt dihost watchdog test for 7021 ddress 02 Stepl D 5 0 Volt jtepa enable programmable host watchdog E Stepd simulate host reflesh programmable host watchdog timer press any key to simulate host failure Stepd now HOST is in failure state simulation press any key to disable Steps disable programmable host watchdog OK rv Diagnostic Progran ro STATUS COM 1 Baud Rate S600 Checksun DIDABIE This function gives a short demo about the programmable host watchdog The operation steps are given as following step 1 send command to control D A of 7021 to 5V address 03 step 2 enable the host watchdog host watchdog timer 1 second step 3 send 0x0D command to refresh the host watchdog timer step 4 user press any key to stop the re
7. 7060 4 D I 4 relay Analog learning kit 7520 7012D gt 16 bit A D 5 digit LED display RS 485 network learning kit 7520 3 for PC networking or PLC networking High speed high number digital control kit 7520 7053 7043 16 D I 16 D O O C High speed high number data acquisition kit 7520 7017 7018 gt 8 A I 8 thermocouple Professional kit 7520 7060 7012D 7021 gt 4 D I 4 Relay 16 bit A D with LED 12 bit D A with V I output DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 41 The module status of learning kits are given as following rate jm 7012D 02 108 19600 disable A D 10V range 7021 ElBg pe disable D A 0 10V voltage 7017 106 108 S 9600 disable A D 10V range 7018 aad disable A D J thermocouple 3 4 Driver Source WIDCON Utility DOSWearning TEST C main program file IDCON Utility DOS learning UART C USART library file DCON_ Utility DOS UART H gt header file DCON_Utility DOS learning TEST PRJ gt TC project file DCON_Utility DOS learning TEST EXE gt learning kits execution file DCON_Utility DOS learning learning dat gt data file for TEST EXE Type TEST EXE to execute learning kits utility software DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 42 3 2 Function Descriptions 3 2 1 Function 0 INIT Refer to Sec 2 1 1 3 2 2 Function 1 Search Refer to Sec 2 1 2 3 2 3 Function 2
8. break case 4 iBase Com4 break default printf iPort d iPort getch return 1 port must 1 2 3 4 DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 20 switch IBaudRate case 1200L break case 2400L break case 4800L break case 9600L break case 19200L break case 38400L break case 57600L break case 115200L break default return 2 baud rate error j bb 115200L cc bb IBaudRate ratehi cc amp 0xf 00 gt gt 8 ratelo cc amp Oxff outportb iBase Lcr 0x80 set DLAB outportb iBase DIL ratelo outportb iBase Dlh ratehi outportb iBase Lcr 0x03 data format 0000 0011 gt 8 bit 1 stop no parity outportb iBase Ier 0 disable interrupt outportb iBase Fcr 0x07 clear input output FIFO for 1 0 1 lt 8 i inportb iBase 1 clear R outportb iBase Fcr 0x01 enable FIFO return 0 j Tag ten erre pe Aa r tee TIL iy SRE re return 0 gt OK I gt error T int CLOSE COM int iPort use polling so do nothing here return 0 j DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 21 return 0 gt OK gt port value error 2 gt timeout 5 int SEND CMD int iPort char cCmd long int ITimeout int iChksum m Int 1 ret long t switch iPort case I iBase Coml break case 2 iBase Com2 break case 3 iBase Com3 break case 4 iBase Com4 b
9. char result int chksum i function I chksum 0 gt no add FCS gt add FCS M int iRet iLen if chksum 1 add FCS cmd SEND CMD iComPort cmd TIMEOUT 0 iRet RECEIVE CMD iComPort result TIMEOUT 0 iLen strlen cmd cmd iLen 1 0 printf Send s cmd if chksum 1 if IRet 0 printf gt Receive s result else if 1Ret 1 printf gt Receive com value error must 1 2 3 4 else if 1Ret 2 printf gt Receive Timeout else if 1Ret 3 printf gt Receive chksum error j printf n j DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 57 add FCS char td int len 1 char aa 3 unsigned int a len strlen td a td 0 for 171 i lt len i a td i itoa a aa 16 if strlen aa 1 strcat td 0 strcat td aa strupr td strcat td x0d j function 2 T to plcl strepy cCmd1 00SC02 change to MONITOR mode t send command cCmdl cCm4d2 1 strepy cCmd1 00WD00040001 write DM 0004 send command cCmdl cCmd2 1 strepy cCmd1 00WD00050002 write DM 0005 send command cCmdl cCm4d2 1 strepy cCmd1 00SC03 change to RUN mode send command cCmdl cCm4d2 1 printf n strepy cCmd1 00RD00040001 read DM 0004 send comman
10. 1 Baud Rate 9600 Check sum PISABLE for all module search 1200 to 115200 for all module The operation steps of this function are given as following Step 1 This function will automatically add the 0x0D to the input string Step 2 If the checksum status is ENABLE the extra two checksum bytes will be added into the input string also Step 3 This function will send out the command string first then wait for the result string Step 4 If the result string is received before the time out interval this function will automatically check the format of the result string The result string will be shown on the screen Step 5 If no module response to this command the time out message will be shown on the screen DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 12 2 1 4 Demo Function 012 0x0D read module configuration code 01M 0x0D read module name 01F 0xOD read firmware version number This function will send out these three commands in sequence to identify the module s basic information This function is very useful during the diagnostic interval The operation step of demo function is given as following step I press 3 3 demo 012 501NM S01LF for all module 4 Host Watchdog test for 70211 5 m La La R5 485 network testing for all module quit SW WoW ro roo Press Eeyuword TAKT WoW rrr ro ccc 3 gt 3 demo command s012 501M 501F Send 012 BReceive
11. 5860 s device address Therefore the user can send command to 5860 very similar to 7000 series modules The partial command sets are given as following e amp AAOB information request of board B e amp AAIB data read from D I of board B e amp AA2B data gt write to D O of board B e amp AA3BNNCC gt set A D configure CC of channel NN board B e amp AAABNN data gt read from A D channel NN data of board B e amp AASBNN data write to D A chanel NN of board B e amp AAA data gt write to user program e amp AABNN gt read from user program The TSR will put all I O states in the PC memory or file The user can write his application using QB or C under DOS The user does not have to write I O driver he can access these I O states through PC memory or PC file If there is no user program the 5860 will function very similar to 7000 The 5860 command sets are also very similar to 7000 DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 64
12. Comand n j else 1 i convert addr result 1 j convert addr result 2 k convert addr result 3 addr i 25643 16 k If ADDRESS addr printf gt this is my command n sprintf cmd Echo from remote PC d ADDRESS SEND CMD iComPort cmd TIMEOUT iChksum j j j if kbhit 0 getch exit 0 j DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 52 convert addr char c switch c 1 case 0 return 0 case 1 return 1 case 2 return 2 case 3 return 3 case 4 return 4 case 5 return 5 case 6 return 6 case 7 return 7 case 8 return 8 case 9 return 9 case A return 10 case B return 11 case C return 12 case D return 13 case E return 14 case F return 15 j DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 5 PLC Networking Applications 5 1 Introduction Q7520R 97520R 7520R Fig 24 The PLC1 PLCn and OPLCm can be used in different baud rate amp different configuration For example PLC 1 I start 7 data stop 9 bit byte baud rate 1200 PLC n 1 start 8 data 1 parity 1 stop 11 bit byte baud rate 9600 PLC m 1 start 8 data 1 parity 2 stop 12 bit byte baud rate 115200 DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 54 In this configuration the PLC1 PLCn PLCm provide DC power to 687520R
13. Manual Mar 2003 Ver 1 0 1 45 3 3 Demo of the Digital Control learning Kit run TEST EXE press 3 gt to find all modules name press H gt to show help information press 4 3 to test 7060 press any key to stop function 4 3 4 Demo of the Analog learning Kit run TEST EXE press 3 gt to find all modules name press H gt to show help information apply a DC voltage source to analog input of 7012D press 5 gt to test 7012D press any key to stop function 5 3 5 Demo of the RS 485 Network learning Kit Refer to Chapter 4 for PC networking Refer to Chapter 5 for PLC networking DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 46 3 6 Demo of the high speed high number Digital Control Kit run TEST EXE press 3 gt to find all modules name press H gt to show help information press 8 gt to test 7053 amp 7043 press any key to stop function 8 3 7 Demo of the high speed high number data acquisition Kit run TEST EXE press 3 gt to find all modules name press H gt to show help information press 6 gt to test 7017 press any key to stop function 6 press 7 gt to test 7018 press any key to stop function 7 3 8 Demo of the the professional kit run TEST EXE press 3 gt to find all modules name press H gt to show help information press 4 gt to test 7060 press any key to stop function 4 press 9 gt to test 7012D amp 7021 press any key to stop function 9 DCON
14. Send Command Refer to Sec 2 1 3 3 2 4 Function 3 Find Learning Kits Send out 01M 02M 03M 04M 05M 06M and 07M commands to show all modules of learning kits 3 2 5 Function_4 7060 Test The default setting of 7060 are given as following address 01 baud rate 9600 checksum disable 4 channels of D I are connected to 4 channels of D O The operation steps of demo program step 1 turn relay 1 ON read all D A step 2 turn rely 2 ON read all DA step 3 turn relay 3 ON read all D A step 4 turn relay 4 ON read all D I repeat step1 to step4 until user press any key DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 43 3 2 6 Function 5 7012D Test The default setting of 7012D are given as following e address 02 baud rate 9600 checksum disable type 08 10V range The operation steps of demo program e step 1 read analog input e step 2 show analog input value in screen e repeat stepl to step2 until user press any key 3 2 7 Function 6 7017 Test The default setting of 7017 are given as following e address 06 baud rate 9600 checksum disable type 08 10V range The operation steps of demo program e step 1 read 8 channels of analog input e step 2 show 8 channels of analog input values in screen e repeat stepl to step2 until user press any key 3 2 8 Function 7 7018 Test The default setting of 7018 are given as following e address 07 baud rate 9600 checksum disabl
15. Value 0 OK 1 port value error validate value 1 2 4 8 others invalidate 2 time out e Demo Program Refer to Sec 2 2 4 DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 28 2 2 5 TEST C include uart h FILE stream define TIMEOUT 60000L int iComPort iChksum long int IBaudRate float ok count 256 err count 256 main 4 main 1 char cChar iComPort 1 iChksum 0 IBaudRate 9600L OPEN COM iComPort IBaudRate default for 1 printf gy aak aak akok k ak Diagnostic Program a i a tt ye show status printf n O init for all module printf n I search 1200 to 115200 for all module printf n 2 send command for all module printf n 3 demo 012 01M 01F for all module printf n 4 Host Watchdog test for 7021 printf n 5 RS 485 network testing for all module printf n Q quit im printf nF tester eet eee Press Keyword FRE printf n cChar getche switch cChar case 0 init break case 1 search break case 2 send_command break case 3 demo break DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 29 case 4 host watchdog break case 5 test 4850 break case q case Q goto ret label default printf gt Error Keyword break j j ret la
16. checksum bytes if needed The program steps are given as below step 1 Input the original command string step 2 CALL the SEND CMD to send out command string step 3 CALL the RECEIVE CMD to receive the result string step 4 Show the operation status and the result string if operation success Refer to Sec 2 1 3 for demonstration 2 2 5 4 Function 3 Demo This function is designed to read and show the module status module name and module firmware version These three parameters are the basic information for each 7000 module The module address of the factory setting is 01 so this function is designed for the new module The address is fixed to 01 and the checksum status is DISABLE The program steps are given as below step I Call SEND CMD to send out the command string 012 step 2 Call RECEIVE CMD to show the module status step 3 Call SEND CMD to send out the command string 01M step 4 Call RECEIVE CMD to show the module name step 5 Call SEND CMD to send out the command string 01F step 6 Call RECEIVE CMD to show the module firmware version Refer to Sec 2 1 4 for demonstration DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 38 2 2 5 5 Function 4 Test Host Watchdog This function give a demonstration for the usage of host watchdog The operation steps are given as below Step 1 send out the 40305 000 0x0D command Step 2 read back and show the operation result step 3 enab
17. include lt math h gt include lt conio h gt include lt io h gt include lt dos h gt include lt stdarg h gt include lt string h gt define Com1 0x3f0 Hdefine Com2 0x2f0 define Com3 0x3e0 Hdefine Com4 Ox2e0 define Txbuf 0x08 tx buffer define Rxbuf 0x08 rx buffer define DII 0x08 baud sb define DIh 0x09 baud msb define Ier 0x09 int enable reg define Fer Ox0a FIFO control register define Ler OxOb line control reg define Dfr OxOb Data format reg define Mcr 0x0c modem control reg define Lsr OxOd line status reg int OPEN COM int iPort long int IBaudRate int CLOSE COM int iPort int SEND CMDant iPort char cCmd long int ITimeout int iChksum int RECEIVE CMD int iPort char cCmd long int ITimeout int iChksum DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 19 2 2 4 UART C Hinclude uart h int iBase com port base address char cHI cLO void compute chksum char cBuf char hex to ascii int 1Hex input port 1 2 3 4 baud 1200 2400 4800 9600 19 2K 38 4K 57 6K 115 2K chksum 0 is DISABLE others is ENABLE return 0 gt OK I port value error 2 gt baud rate error int OPEN COM int iPort long int IBaudRate E int uart 1 char ratehi ratelo long int bb int cc switch iPort case 1 iBase Coml break case 2 iBase Com2 break case 3 iBase Com3
18. j lt 10 j search from BaudRate 1200 to BaudRate 115200 switch j case 3 BaudRate 1200L break case 4 BaudRate 2400L break case 5 BaudRate 4800L break case 6 BaudRate 9600L break case 7 BaudRate 19200L break case 8 BaudRate 38400L break case 9 BaudRate 57600L break case 10 BaudRate 115200L break OPEN COM iComPort BaudRate iRet OPEN COM iComPort BaudRate if iRet 0 printf Open Error iComPort d BaudRate ld iRet d iComPort BaudRate iRet SEND_CMD iComPort cCmd3 TIMEOUT 0 RS 232 settling time delay RECEIVE CMD iComPort cCmd2 TIMEOUT 0 chksum disable DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 31 iD1 i 16 iD2 1 16 cCmdl l get ascii iD1 cCmd1 2 get_ascii iD2 cCmd1 3 2 cCmd1 4 0 AA2 gt read status cFlag 0 ere checksum DISABLE SEND_CMD iComPort cCmd1 TIMEOUT 0 chksum disable iRet RECEIVE CMD iComPort cCmd2 TIMEOUT 0 chksum disable if iRet 0 cFlag 1 find module in chksum DISABLE cCmd1 3 M cCmd1 4 0 AAM gt read module name SEND CMD iComPort cCmdl TIMEOUT 0 chksum disable iRet RECEIVE CMD iComPort cCmd2 TIMEOUT 0 chksum disable if iRet 0 printf nFind c c c ec gt Address d Chksum DISABLE speed ld cCmd2 3 cCmd2 4 cCmd2 5 cCmd2 6 i BaudRate cCmd1 3 2 c
19. 1 7 2 Diagnostic Program 2 1 Functions Description The diagnostic program DCON_ Utility DOS DIAG TC TEST EXE can be executed in the environment of DOS Windows 3 1 Windows 95 Windows NT Run TEST EXE the screen will be shown as following ohh e e ETE Diagnostic Program rokokko kokk STATUS COM 1 Baud Rate 9600 Checksum DISABLE all module search 1200 to 115200 for all module send command for all module demo 012 01M 01F for all module Host Watchdog test for 70211 R5 485 network testing for all module quit TENKTE ATERKTET Press Eeyuord rir rnc There are six functions supported in TEST EXE given as following 0 init gt to initialize the COM port 1 search to search the 7000 8000 87000 modules in the RS 485 network 2 send command to send command string and receive the result string 3 demo gt to demo command 012 01M 01F 4 Host Watchdog Test gt test programmable host watchdog 5 RS 485 network testing gt test the stability of RS 485 network Q quit gt to quit the TEST EXE DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 8 2 1 1 Init Function The operation steps to initialize the COM port are given as following 1 step I press 0 2 step 2 press I Enter 3 step 3 press 9600 Enter 4 step 4 press 0 Enter init for all module search 1200 to 115200 for all modul
20. 21 Address 03 strepy cCmd 0305 000 SEND_CMD iComPort cCmd TIMEOUT 0 iRet RECEIVE CMD iComPort cCmd TIMEOUT 0 DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 34 if iRet 0 amp cCmd 0 gt printf nStep1 DA 5 0 Volt else printf ntest error return strepy cCmd 03310A SEND CMD iComPort cCmd TIMEOUT 0 iRet RECEIVE CMD iComPort cCmd TIMEOUT 0 if GRet 0 amp cCmd 0 printf nStep2 enable host watchdog OK else printf ntest error return printf InStep3 HOST continuously reflesh watchdog timer normal condition printf n press any key to simulate host failure for strepy cCmd SEND_CMD iComPort cCmd TIMEOUT 0 iRet RECEIVE CMD iComPort cCmd TIMEOUT 0 if kbhit 0 getch break j printf nStep4 HOST is failure now simulation printf n gt host watchdog will active printf n gt D A will go to safe state printf n gt module LED will flash printf n press any key to continue getch strepy cCmd 031 SEND_CMD iComPort cCmd TIMEOUT 0 iRet RECEIVE CMD iComPort cCmd TIMEOUT 0 if iRet 0 1 printf InStep5 clear module status printf n gt module LED will not flash else printf ntest error return DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 35 function 5
21. Cmd1 4 0 AA2 gt read status SEND_CMD iComPort cCmd1 TIMEOUT 1 chksum enable iRet RECEIVE CMD iComPort cCmd2 TIMEOUT 1 chksum enable if iRet 0 cFlag 1 find module in chksum ENABLE cCmd1 3 M cCmd1 4 0 AAM gt read module name SEND_CMD iComPort cCmd1 TIMEOUT 1 chksum enable iRet RECEIVE CMD iComPort cCmd2 TIMEOUT 1 chksum enable if iRet 0 printf nFind c c c ec gt Address d Chksum ENSABLE speed ld cCmd2 3 cCmd2 4 cCmd2 5 cCmd2 6 i BaudRate DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 32 if cFlag 0 printf ld x BaudRate i if kbhit 0 getch goto ret label ret_label OPEN COM iComPort IBaudRate default j get ascii int iHex if Hex lt 10 return iHex 0 else return A 1iHex 10 j function 2 3i send command char cCmd1 50 cCmd2 50 int iRet printf gt 2 send_command n printf cmd scanf s cCmd_1 SEND_CMD iComPort cCmd1 TIMEOUT iChksum iRet RECEIVE CMD iComPort cCmd2 TIMEOUT iChksum printf Port d chksum d Send s n iComPort iChksum cCmd1 if iRet 0 printf Receive s cCmd2 else if iRet 1 printf Receive com value error must 1 2 3 4 else if iRet 2 printf Receive Timeout else if iRet 3 printf Receive chksum error
22. DCON Utility DOS User Manual 7000 New Features Your Powerful Tools Self Tuner Inside Multiple Baud Rate i 1 2 3 Multiple Data Format 4 Dual WatchDog Inside 5 6 True Distributed Control High Speed amp High Density l I O Create New Applications Warranty All products manufactured by ICP DAS are warranted against defective materials for a period of one year from the date of delivery to the original purchaser Warning ICP DAS assume no liability for damages consequent to the use of this product ICP DAS reserves the right to change this manual at any time without notice The information furnished by ICP DAS is believed to be accurate and reliable However no responsibility is assumed by ICP DAS for its use nor for any infringements of patents or other rights of third parties resulting from its use Copyright Copyright 1997 by ICP DAS All rights are reserved Trademark The names used for identification only maybe registered trademarks of their respective companies License The user can use modify and backup this software on a single machine The user may not reproduce transfer or distribute this software or any copy in whole or in part DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 1 Table of Contents T NADER CEN ON a so esae gees Ur DEN PEADER TG 3 lA Floppy Contents e secerni onee ea e i Ea iE 3 1 2 Compiler amp Link Using TC Luse Sakene 3 M E dg c M 4 2 Diagnosti
23. DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 10 step 1 baud rate 1200 send 002 Enter gt gt wait for response step 2 baud rate 1200 send 002B6 Enter gt wait for response step 3 baud rate 2400 send 002 Enter gt wait for response for ddress step 4 baud rate 2400 send 002B6 Enter gt wait for response 00 step 15 baud rate 115200 send 002 Enter gt wait for response step 16 baud rate 115200 send 002B6 Enter gt gt wait for response step 17 baud rate 1200 send 012 Enter gt wait for response step 18 baud rate 1200 send 012B7 Enter gt wait for response for address 01 12 step 31 baud rate 115200 send 012 Enter gt wait for response 13 step 32 baud rate 115200 send 012B7 Enter wait for response 16 step 4095 baud rate 115200 send FF2 Enter 17 step 4096 baud rate 115200 send SFF2E2 Enter FF for address DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 11 2 1 3 Send Command Function The operation steps of send command function are given as following 1 step I press 2 2 step 2 press Enter module i search 1200 to L1LS200 for modules send command for module demo 012 01M 01F1 Lor module Host Watchdog test for 7021 BS 465 network testing for modules quit 2 gt Z send command cmd 01 Port 1 chksum 0 Send grnl z Peceive 01400600 STATUS COM
24. Utility DOS User s Manual Mar 2003 Ver 1 0 1 47 4 PC Networking Applications 4 1 Introduction zd PWR 24 ma ORS 485 na 07520 3 remote PC RS 232 URN 256 remote PC max without repeater 7510 RS 232 remote PC Fig 25 Every remote PC must has its own address This address is similar to module address of 7000 8000 87000 series We call it remote PC address The module address of 7000 8000 87000 is limited to 256 but the remote PC address is unlimited The user can connect thousands of PCs in one RS 485 network by using repeater 7510 DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 48 The host PC can send out command to remote PC just like send out command to 7000 8000 87000 modules The remote PC will receive command and execute command if the destination address is matched with his local address This remote PC and 7000 8000 87000 series modules can share the same RS 485 network The host PC can send out 7000 8000 87000 command and send out PC networking command at different time These modules and remote PC will receive their command respectively This make the network very low cost flexible and reliable This is a unique feature in the world 4 2 Example Assume the Host PC has to link 1000 sets of remote PC with the same communication speed and the same RS 485 network the address field must be 3 byte The 3 byte address can be from 000 to FFF
25. ary is designed to send the command string to the RS 485 network The function will automatically add the two checksum bytes to the original string if the checksum status is ENABLE Also this function will add the Ox0D command terminator to the end of the command string e Syntax int SEND CMD int iPort char cCmd long int ITimeout int iChecksum e Input Parameter iPort 1 COM1 2 COM2 3 COM3 4 COM4 others invalidate cCmd the starting address of the original command string terminated with 0 ITimeout constant for time out control iChecksum 0 DISABLE others ENABLE e Return Value I port value error validate value 1 2 4 8 others invalidate 2 time out e Demo Program Refer to Sec 2 2 4 DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 27 2 2 4 3 RECEIVE CMD e Description This library is designed to receive the result string from the RS 485 network The function will automatically check the two checksum bytes of the result string when the checksum status is ENABLE Also this function will check the Ox0D command terminator in the end of the result string e Syntax int RECEIVE CMD int iPort char cCmd long int ITimeout int iChecksum e Input Parameter iPort 1 COM1 2 COM2 3 COM3 4 COM4 others invalidate cCmd the starting address of the result string terminated with 0 ITimeout constant for time out control iChecksum 0 DISABLE others ENABLE e Return
26. bel na Diagnostic Program pa show status show status 1 printf n STATUS COM d iComPort printf Baud Rate 51d 1BaudRate if iChksum 0 printf Checksum DISABLE else printf Checksum ENABLE printf n x J function 0 od init 1 int iRet iPort printf gt 0 init n printf port 1 2 3 4 scanf 96d amp iPort printf baud rate 1200 2400 4800 9600 19200 38400 57600 115200 scanf 1d amp 1BaudRate printf chksum O DISABLE others ENABLE scanf d amp iChksum iRet OPEN COM iPort IBaudRate if iRet 0 printf gt OK iComPort iPort else if iRet 1 printf gt port error else if iRet 2 printf gt baudrate error j DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 30 function char cCmd1 100 cCmd2 100 cCmd3 100 search int 1 D1 iD2 iRet j long BaudRate char cFlag printf Search address 00 to FF baudrate 1200 to 115200 press any key to stop n cCmd1 0 strepy cCmd3 Test Command for for i 0 1 lt 256 i search from adress 00 to adress FF printf n n for j 3
27. c PAO STAM usc ute buceo etti ctetu a aeduan sea Ride cds tadpitn dudo 1a 8 2 1 Functions DESCRIP ON ay ads serverer 8 2 2 DIAG TC Source Program sssnnrvsernsnnnnrnnessnnnnnnversnnnnenvessnnnnessene 18 2 3 DIAG QB Source Produserer apene 40 3 Learning Kits Software Assen 41 3A Driver SOU Ci uei ERI PONE a a A EEE a 42 3 2 Function DeSCEIDLODSS d e o tutes va pi a etae 43 3 3 Demo of the Digital Control learning Kit sss 46 3 4 Demo of the Analog learning Kit sss 46 3 5 Demo of the RS 485 Network learning Kit 46 3 6 Demo of the high speed high number Digital Control Kit 47 3 7 Demo of the high speed high number data acquisition Kit 47 3 8 Demo of the the professional kit 47 4 PC Networking Applications ssroroonnnvnronnrnrrnnrrrrrrrnnvsrerrrnrrsrrnrsernnseenn 48 5 PLC Networking Applications ete scorta tec bti orta Haee ci ve 54 T MMES 54 222 Example ou NTE ER I ET EK NR teats 56 6 MMICON Applications s o ee ertet ett ettet rti een 60 OI Introd ON tu oerte nouae dede PR Dessau Ris 60 Te 990 0 APP ON E OR NRI UR In d d NA ede sao dpud 63 7 1 5860 5 7 12 Specifications e sacar Porta o oe Socata eo Ete PUE 63 yerbum 64 7 3 5860 Software Environment seii edere pestes gite paie th ten 64 DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 2 1 Introduction The DCON Utility DOS provides utility demo p
28. d cCmd1 cCmd2 1 strepy cCmd1 00RD00050001 read DM 0005 send _command cCmd1 cCmd2 1 strepy cCmd1 00RD00070001 read DM 0007 send command cCmdl cCm4d2 1 j DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 58 5 2 2 PLC Command cr power on initialization command AATS test string FCS cr test command AARDSSSSNNNN FCS cr read DM command AAWDSSSSNNNN FCS cr write DM command AASC02 FCS cr change to MONITOR mode AASC03 FCS cr change to RUN mode 5 2 3 PC Test Function function 0 PC COM port initialization Refer to Sec 2 1 1 function 1 send out TEST command Refer to Sec 2 1 3 function 2 send command to PLC 1 change DM 0004 amp DM 005 read back DM 0004 DM 0005 DM 0007 function 3 send command to PLC 2 same as function 2 function 4 send command to PLC 3 same as function 2 The screen dump of function 2 is given as following z tn picl test 3 to plcz test 4 to ples test Oo quit TTT TTT a Press Keyword ccce ZSend N00SC0252 Receive iin scungso Send N00WDOO04000156 Receive H nWpun5sai Send N00WDOOQ05S000254 Receiwve HB nNpuansai Send B nscus53 gt Receiwve BH nzcnnsn Send GO00RDO0004000153 gt Receive BS00RD00000157 Send B00RDO005000152 gt Receive hfORDOOOOOZ254 Send B uRDb UO7000150 Receive 00RD00000355 ew hoch AN RN 8 SN PLE Metworking cce ow ro a COM 1 Baud Rate 9600
29. ddress 00 to FF baudrate 1200 to 115200 press any key to 3 1200 1 2400 1 Find 7052 Address 1 Chksum DISABLE speed 4800 Find 7060 gt Address 1 Chksum DISABLE speed 9600 Find 7012 gt Address 1 Chksum DISABLE speed 19200 Find 7050 gt Address 1 Chksum DISABLE speed 38400 Find 7017 gt Address 1 Chksum DISABLE speed 57600 7013 Address l1 Chksum DISABLE speed 115200 1200 3 2400 3 4800 3 9600 3 19200 3 38400 3 57600 3 115z00 3 This function will search from baud rate 1200 to 115200 for address 00 Then search from baud rate 1200 to 115200 for address OT oce At last search form baud rate 1200 to 115200 for address OxFF If the user press any key during the search interval this function will stop immediately If any 7000 8000 87000 module is found the module name address checksum status and baud rate will be shown in the screen In this example the search function find six 7000 8000 87000 module in the RS 485 network Their module addresses are all equal to 01 but their baud rate are all different The 7000 8000 87000 series modules can share the same RS 485 network with different baud rate Therefor there can be installed 256 8 2048 modules with repeater in one RS 485 network This function will search all possible modules including checksum enable disable in the RS 485 network therefore this function will search 2048 2 4096 times max in one completely search interval as following
30. e send command for all module demo 012 s01M so01F for all module Host Watchdog test for 70211 5 RS 465 network testing for all module QO quit Ce UN NUN SN TAA Press Eewyword hc E UU O gt init port l z 3 4 l baud rate l200 2400 4800 9600 19200 36400 57600 115200 9600 chksum 0 DISABLE others EMABLE 0 gt DE cc oro Diagnostic Program SRW oa COM 1 Baud Rate 9600 Checksum DISABLE step I select functoion 0 of TEST EXE step 2 key in COM port code I gt COMI 2 gt COM 2 32 COM3 43 COM4 step 3 key in baud rate 1200 or 2400 or 4800 or 9600 or 19200 or 38400 or 57600 or 115200 step 4 key in checksum ENABLE DISABLE 0 is DISABLE otherssENABLE This function will initialize the COM port of PC The function 2 3 4 will also use this setting later The default setting is COMI 9600 and checksum DISABLE This configuration is suitable for 7000 8000 87000 default setting If the 7000 8000 87000 modules are used in another configuration the user has to use this function to re initialize the PC COM port DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 9 2 1 2 Search Function The operation steps of search function all the 7000 8000 87000 modules connected in the RS 485 network are given as following step 1 press I step2 wait until no need to search press any key Td d dd s 4d tt Press Keyyord fd eee ee eee ae d dd s l Search a
31. e type 0E J type thermocouple The operation steps of demo program e step 1 read 8 channels of thermocouple input e step 2 show 8 channels of temperature values in screen e repeat stepl to step2 until user press any key DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 44 3 2 9 Function 8 7053 7043 Test The default setting of 7053 are given as following e address 04 baud rate 9600 checksum disable 16 channels of D I The default setting of 7043 are given as following e address 05 baud rate 9600 checksum disable 16 channels of D O e 16 channels of D I are connected to 16 channels of D O The operation steps of demo program e step 1 turn D O channel 1 ON read all D I e oe e stepl6 turn D O channel 16 ON read all DA e repeat stepl to stepl6 until user press any key 3 2 10 Function 9 7012D 7021 Test The default setting of 7012D are given as following e address 02 baud rate 9600 checksum disable type 08 10V range The default setting of 7021 are given as following e address 03 baud rate 9600 checksum disable type 32 0 10V voltage e voltage output is connected to analog input of 7012D The operation steps of demo program e step 1 send out D A 1 0V read A D value e oe e step 9 send out D A 9 0V read A D value e repeat stepl to step9 until user press any key 3 2 11 Function_H Help Information Show help information of 7000 learning kits DCON Utility DOS User s
32. ec 2 1 1 for demonstration 2 2 5 2 Funcrtion 1 Search This function is designed to search the 7000 modules in the RS 485 network The program steps are given as below step 1 calculate next address AA if AA gt FF 3 Stop step 2 for each baud rate from 1200 to 115200 repeat step3 to step step 3 send out command string AA2 0x0D in checksum DISABLE step 4 if any response in step3 gt find a new 7000 module gt send out command string AAM 0x0D to get the module name and show it in the screen step 5 send out command string AA2 chk 0x0D in checksum ENABLE step 6 if any response in step5 gt find a new 7000 module gt send out command string AAM chk 0x0D to get the module name and show it in the screen step 7 if user press any key gt stop this function Otherwise go to step 1 to search next address The modules found by this function will be shown in the screen with their address and checksum status Refer to Sec 2 1 2 for demonstration DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 37 2 2 5 3 Function 2 Send Command This function is designed to send out the command string to the RS 485 network This function will call SEND CMD to send out command string and call the RECEIVE CMD to receive the result string The SEND CMD will automatically add the two checksum bytes and the 0x0D command terminator to the original command string The RECEIVE CMD will check the 0x0D and the two
33. fresh operation gt simulate host failure step 5 after I second the host watchdog timer will be active gt the DA output will go to the safe value gt the module LED will flash gt the module status will be setting to 04 gt disable the host watchdog timer automatically gt will ignore any D A output command from host step 6 user press any key to clear the module status gt the module status is clear to 0 gt the module led will no more flash gt the DA output unchanged gt will accept and execute host D A output command DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 15 2 1 6 Test RS 485 Network Function The operation steps to test RS 485 network are shown as following 1 step 1 install all modules into RS 485 network 2 step 2 edit TEST DAT 3 step 3 press 5 to select RS 485 network testing function This function will read the command and expected response from TEST DAT first then send out the command and check the module response If the module response and expected response is the same gt OK OK 1 If they are different gt ERR ERR 1 This function will repeat testing until the user press any key to stop receive 01400502 receive 01400600 receivez l s0 700 receive 01400800 receive 01080900 recelye 01230400 receive 01400502 receive 01400600 receivez l sn 700 receive 01400800 receive 01060900 receive 01230A00 The format of TEST DAT is given as followi
34. in address not 0 step 2 run TEST EXE step 3 press any key will stop TEST EXE DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 50 4 2 1 Program Source The files in NAP7000 PC_NET TC are given as below UART H gt header file UART C gt library file TEST C application file TEST PRJ 7 project file These files are very similar to those introduced in Sec 2 2 Refer to companion floppy disk for program source Refer to Sec 2 2 for more information is master i int iRet for printf nCommand scanf s cmd SEND _CMD iComPort cmd TIMEOUT iChksum if cmd 0 q cmd 0 Q return iRet RECEIVE CMD iComPort result TIMEOUT iChksum if iIRet 0 printf Receive s result else if iIRet 1 printf Receive com value error must 1 2 3 4 else if iRet 2 printf Receive Timeout else if 1Ret 3 printf Receive chksum error j DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 51 is remote int iRet addr 1 j k for 1 iRet IS DATA iComPort if iRet 0 iRet RECEIVE CMD iComPort result TIMEOUT iChksum i strlen result result i 1 0 if qRet 0 printf Receive 9os result else if iRet 1 printf Receive com value error must 1 2 3 4 else if 1Ret 2 printf Receive Timeout else if iRet 3 printf Receive chksum error if result 0 amp printf gt Receive a Error
35. le the host watchdog timer and set the watchdog timer I sec step 4 send out the 0x0D command to refresh the host watchdog timer until user press any key to simulate a host failure condition step 5 wait for user s key to continue User can use a voltage meter to measure the D A output safe value step 6 clear the module status Refer to Sec 2 1 5 for demonstration 2 2 5 6 Function 5 RS 485 Network Test This function is designed to test the reliability of RS 485 network The operation steps are given as below step 1 read next command and test pattern from TEST DAT repeat step2 to step6 step 2 initiate COM port step 3 send out command and receive result string step 4 compare the result string amp the test pattern read from TEST DAT step 5 if result string test pattern OK OK 1 else Error Error 1 step 6 Go to step I Refer to Sec 2 1 6 for demonstration DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 39 2 3 DIAG QB Source Program The QB BAS in NAP7000S DIAG QB is a QBASIC program its source listing is given as following 10 OPEN COM1 9600 N 8 1 RS CS CD DS AS 1 20 CMDS 012 30 PRINT 1 CMD 40 RESULTS INPUTS 9 41 50 PRINT Send 012 gt Receive RESULTS 60 CLOSE END DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 40 3 Learning Kits Software There are six learning kits given as following Digital control learning kit 1 7520
36. network in send mode to allow the 7000 8000 87000 modules to send the result to the host computer Everything is automatically done the user need not to care about the direction of data flow The user only has to care that he should send the command string first then waiting for the result string next The RTS control signal of RS 232 is ignored The 7000 8000 87000 don t use the RTS signal Q10 Can I use the 7000 8000 87000 in the conventional 4 wire RS 485 network A10 No The 7000 8000 87000 is designed for 2 wire RS 485 network Q11 How can the 7000 8000 87000 modules identify the correct command All Every 7000 8000 87000 module has it s own module address The command string always include the desired module s address When the host computer send the command string all the 7000 modules in the RS 485 network will receive this command string at the same time Then All the 7000 8000 87000 modules will interpret this command string simultaneously They will fetch the address field and identify the destination address Only the module with the same address as the destination address will response to the host computer All the other module in the network will bypass this command string and waiting for the next command For example 012 0x0D is a validate command string and the destination address is 01 The 7000 8000 87000 module with address 01 will response to this command DCON Utility DOS User s Manual Mar 2003 Ver 1 0
37. ng line 1 N gt number of commands to test line 2 command 1 line 3 command 2 line N 1 command N The format of command is given as following com iud GR MEE rate puru ARE expected response ia ves dil 0 inel 100 expected 19200 38400 57600 l enable commandl response from 115200 TXXX The default TEST DAT is given as following 4800 0 012 01400502 9600 0 012 01400600 19200 0 012 01080700 38400 0 012 01400800 57600 0 012 01080900 DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 17 2 2 DIAG TC Source Program The usage of TEST EXE are given in Sec 2 1 The complete source codes are given in the companion floppy disk These programs are written in TURBO C The files in DCON Utility DOS DIAG TC are given as below UART H gt header file UART C gt library file TEST C gt application file TEST PRJ 7 project file The compiler and link for TC are given as below 1 Set DOS PATH to TC 2 Using TC integrated environment to set PROJECT to TEST PRJ 3 Press F9 to MAKE the project file TEST PRJ 4 Execution file TEST EXE 2 2 1 TEST PRJ 4800 0 012 01400502 9600 0 012 01400600 38400 0 012 101400800 57600 0 012 101080900 6 1 l I 19200 0 012 01080700 l l 1 115200 0 012 01230A00 DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 18 2 2 3 UART H include lt stdio h gt include lt stdlib h gt
38. nterface mode AATTBBFF read current configuration 101030600 mode 3 PLC RS232 interface mode 101010600 mode 1 PC RS232 RS485 interface mode AAMMICON read module name 101MMICON IAAA read firmware version number 101A2 3 software version 2 3 DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 7 5860 Applications 7 1 5860 5 7 12 Specifications 1 CPU CARD SSC 5x86HVGA 2 RACK PRI105 for 5860 5 PAC 70H for 5860 7 RACK 300H for 5860 12 3 RAM 4M 4 PROMDISK 2M with DOS amp 5860 utility 5 CPU AMD 5x86 133 6 FLOPPY DRIVER 1 44M 1 7 ISA 7520R 8 EMPTY SLOT 3 for 5860 5 5 for 5860 7 10 for 5860 12 9 SOFTWARE NAPDOS9 10 OPTIONS I O boards ISO AD32L H ISO DA8 16 ISO P32C32 ISO P64 ISO C64 PSR8DIO PI6R16DIO ISO 813 More OOAND NA BWN DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 63 7 2 5860 features 1 PC based embedded controller 2M solid state electronic disk on board 2 High density high speed I O isolated A D D A D I D O boards 3 Accept command from RS 485 network command sets are similar to 7000 series 4 User can write his application program by any programming language 7 3 5860 Software Environment The 5860 software is a TSR program which will automatically run after power on This TSR program will accept command from RS 485 network and execute this command if the command destination address is match with
39. ow to calculate the checksum A5 The steps to calculate the checksum are given as following 1 step 1 checksum 0 2 step 2 for all command byte checksum checksum command byte 3 step 3 checksum checksum amp Oxff 4 step 4 convert checksum to ASCII high byte and ASCII low byte for example command 012 Enter checksum 0 1 2 0x24 0x30 0x3 1 0x32 0xB7 checksum amp Oxff OxB7 checksum ASCII high byte ASCII B 0x42 checksum ASCII low byte ASCII 7 0x37 command with checksum 012B7 Enter DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 5 Q6 What s the syntax of the command string A6 The syntax of command string is shown as following leading char address data checksum 0x0D leading char or or or or address 00 to FF gt 256 different module address max data command code and the related data 1f needed checksum two chars if checksum enable no char if checksum disable 0xX0D ASCII code 0x0d the command string terminator Command string Result string 1 or Ji floxop T J fe lo Jfs lo 116 Tio Tio oxo Q7 Can I use the 7000 8000 87000 module in the RS 232C network A7 No the 7000 8000 87000 use the RS 485 network So the users need a 7520 RS 232 to RS 485 converter to convert the RS 232C signal to the RS 485 signal That is to say that the users need at least two modules to form a minimum 7000 8000 87000 system One is
40. r The user shouldn t change this format to the following invalidate format I start 8 data no parity 2 stop gt invalidate format I start 8 data even parity l stop gt invalidate format I start 8 datatodd parity l stop gt invalidate format I start 7 datatno parity 2 stop gt invalidate format I start 7 data even parity l stop gt invalidate format I start 7 datatodd parity l stop gt invalidate format Q2 What programming language can be used A2 Any programming language can be used to program the 7000 8000 87000 modules if this language can send out the RS 232C command string It is recommended to use the C C VB and Delphi DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 4 Q3 Can the baud rate be changed A3 Yes the validate baud rate are 1200 2400 4800 9600 19200 38400 57600 and 115200 BPS PC can send out the command string under all these baud rate Refer to Sec 2 1 1 for baud rate change Q4 Can the checksum of the command string be enabled A4 Yes but the default condition of checksum is DISABLE Refer to Sec 2 1 1 for enable disable checksum To ENABLE the checksum two more checksum char must be added to the original command string So the command string in checksum enable mode is two more bytes longer than the default checksum disable command string 012 0x0D gt command string under checksum DISABLE 012B1 0xO0D gt command string under checksum ENABLE Q5 H
41. r s Manual Mar 2003 Ver 1 0 1 23 1 0 t 0 for while inportb iBase Lsr amp 0x01 0x01 check line ready wi t if t gt ITimeout return 2 time out j c inportb iBase Rxbuf amp Oxff receive next char if c 0x0d break receive 0x0d gt end of command else cCmd i c store the command E next char if 1235 cCmd 1 0 string must terminate with 0 printf os 7 7 7 cCmd break j t 0 reset timer cCmd i 0 string must terminate with 0 if iChksum 0 return chk chksum cCmd else return 0 j VL ee eee tee tee ae NE RT Ace eee cere void compute chksum char cBuf unsigned int 1 j len sum len strlen cBuf j len sum 0 for 1 0 i lt len i sum cBuf 1 amp 0xff 0x0D not included sum sum amp 0xff cHI hex to ascii sum 16 CHKSUM high byte cLO hex to ascii sum 16 CHKSUM low byte j DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 24 char hex to ascii int 1Hex if 1Hex 10 return iHex 0 else return A iHex 10 j fe 9 x return 3 gt chksum error 0 gt OK int chk chksum char cBuf unsigned int 1 len sum char h l len strlen cBuf sum 0 for 1 0 i lt len 2 i sum cBuf 1 amp Oxff sum sum amp Oxff h hex to ascii sum 16 I hex to ascii sum 16 if cBuf len 2 h
42. reak default return 1 port must 1 2 3 4 compute chksum cCmd add chksum and Ox0d to input 170 t 0 while cCmd 1 NULL while inportb iBase Lsr amp 0x20 0 check line ready t if t gt ITimeout return 2 time out outportb iBase Txbuf cCmd i i next char t 0 reset timer j if iChksum 0 while inportb iBase Lsr amp 0x20 0 check line ready t if t gt ITimeout return 2 time out outportb iBase Txbuf cHI send out checksum HIGH byte DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 22 t 0 reset timer while inportb iBase Lsr amp 0x20 0 check line ready t if t gt ITimeout return 2 time out outportb iBase Txbuf cLO send out checksum LOW byte t 0 reset timer j while inportb iBase Lsr amp 0x20 0 check line ready t if t gt ITimeout return 2 time out outportb iBase Txbuf 0x0D send out 0x0D return 0 send cmd OK j FE REE EE SEN Pei MER Ker PP return 0 gt OK gt port value error 2 gt timeout 3 gt chksum error i int RECEIVE CMD int iPort char cCmd long int ITimeout int iChksum oF Int 1 char c long t switch iPort case I iBase Com1 break case 2 iBase Com2 break case 3 iBase Com3 break case 4 iBase Com4 break default return 1 port must 1 2 3 4 j DCON Utility DOS Use
43. return 3 compare CHECKSUM high byte if cBuf len 1 1 return 3 compare CHECKSUM low byte return 0 j The UART C includes three basic subroutines OPEN COM SEND CMD and RECEIVE CMD for 7000 modules This file can be viewed as the library file The detail descriptions of these three libraries are given from Sec 2 2 3 1 to Sec 2 2 3 3 The application user can call these basic libraries to simply their programming design DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 25 2 2 4 1 OPEN COM e Description This library is designed to initialize the COM port The program code will directly control the PC AT compatible UART I O port instead of calling system BIOS utility This code is compatible with 8250 16450 16550 UART controller If the 16550 is used the on chip 16 bytes FIFO will increase the system performance e Syntax int OPEN COM int iPort long IBaudRate e Input Parameter iPort I COM1 2 COM2 3 COM3 4 COMA others invalidate IBaudRate the validate baud rate are 1200 2400 4800 9600 19200 38400 57600 115200 e Return Value 0 OK 1 port value error validate value 1 2 4 8 others invalidate 2 baud rate error validate value 1200 2400 4800 9600 19200 38400 57600 115200 others invalidate e Demo Program Refer to Sec 2 2 4 DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 26 2 2 4 2 SEND CMD e Description This libr
44. rograms and data acquisition subroutines for the user to handle 7000 8000 87000 series modules The 7000 8000 87000 are a family of remote controllable data acquisition modules They provide A D D A DI O Timer Counter MMI and other functions The 7000 modules operate with a simple command response protocol to control all module functions 1 1 Directory Contents The contents of the directory is given as following IREADME txt gt read me file DCON_ Utility DOS DIAG gt diagnostic utility DCON_ Utility DOS learning gt learning kits utility DCON_ Utility DOS PC_NET gt PC networking application utility IWIDCON Utility DOS PLC_NET gt 7000 PLC networking application utility 1 2 Compiler amp Link Using TC The including file gt UART H There are 2 source files gt UART C amp TEST C The project file gt TEST PRJ Use TC integrated environment to select large model amp project file press F9 to compiler amp link DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 3 1 3 Q amp A Q1 How to program the 7000 8000 87000 modules Al The user can use any RS 232C device to send the command string to the 7000 8000 87000 modules and the 7000 8000 87000 modules will echo the result string to the RS 232C device The data format of command character is given as following Data format 1 start 8 data no parity 1 stop total 1 8 1 10 bits per characte
45. the 7520 and another is 7000 8000 87000 module A D or D A or DI O or Timer Counter modules Q8 Can the 7000 8000 87000 be used as a full duplex RS 485 system A8 NO the 7000 8000 87000 is worked in a half duplex RS 485 system The 7000 8000 87000 use a two wire D and D differential RS 485 network The D and D signal logically form a single bi direction data line so this single data line can send or receive data in the different time Therefore the 7000 8000 87000 can t send the command string and receive the result string at the same time The host computer must send the command string first then wait for the result string returned by the 7000 8000 87000 DCON Utility DOS User s Manual Mar 2003 Ver 1 0 1 6 Q9 Who handle the direction of two wire RS 485 network A9 The two wire RS 485 network is a pairs of differential signal So logically these two line equals to one data line This data line can be used to transfer command and receive result both This needs a direction controller to handle the two wire RS 485 network The 7520 RS 232 to RS 485 converter is a intelligent controller It will automatically detect and control the direction of data flow When the host computer send RS 232C command string the 7520 set the direction of the RS 485 network in received mode and the 7000 8000 87000 modules can receive the host s command string After the command string is finished the 7520 will set the RS 485
Download Pdf Manuals
Related Search
Related Contents
Operating Manual Refrigerated Display Cabinet Samsung APH450PG User Manual KOHLER K-1418-HE-96 Installation Guide MS-BB300 User Manual English PM On Board 1155 User Manual Plantronics Savi office WO350 大変なエコバッグ 7 - ups-info.ru Philips D Ultra Alkaline Battery Hisense Group KFR 2601GW/BPE Air Conditioner User Manual Copyright © All rights reserved.
Failed to retrieve file