Appendix 2 Communication Protocol 149
EV1000 Series General Purpose Variable Speed Drive User Manual
Note: the usage of command group 7 and 8 is the same. For those parameters that are changed
frequently, you may use command group 8 if not required to save to E
2
PROM considering its service life.
6. Example of Program
Routine (Turbo C 2.0): send RUN, STOP, SET FREQUENCY command (set F0.00=2, F0.03=2 first)
#include <dos.h>
#include <bios.h>
#include <conio.h>
#include <stdio.h>
#define COM1 0
/*serial port 1*/
#define COM2 1
/* serial port 2*/
#define SET_COMPARA 0
/*set port parameter*/
#define DEFAULT_BAUD 0xE3
/*8-N-1,9600bps*/
#define PORT_ADDR 0x3F8
/* serial port 1 address 3F8H*/
#define delaytime 100
/*100ms delay*/
char run_inverter[20]="~010200000183\r";
/*drive run command*/
char stop_inverter[20]="~01020007018A\r";
/*drive stop command*/
void send_comd(char *sendstr,char *display_type);
/*send command*/
void checksum(char *sendstr,char result_sum[]);
/* calculate checksum*/
main()
{
char sum_of_cmd[5],buf[25];
/*4-byte checksum and
character string*/
char set_frequency[25]="010200010BB8";
/*set 30.00Hz */
bioscom(SET_COMPARA,DEFAULT_BAUD,COM1);
/*set COM1,8-N-1,9600bps*/
send_comd(run_inverter,"HEX");
/*send Run command, display
HEX format*/
printf("\nPress anykey to set frequency to 30.00Hz ...");
while(!kbhit());
/*wait for keypad input */
getchar();
/*clear the character*/
checksum(set_frequency,sum_of_cmd);
/*calculate command
checksum*/
sprintf(buf,"~%s%s\r",set_frequency,sum_of_cmd);
艾默生变频器、艾默生CT高级授权代理商--广州盟雄 020-85543394 qq:2294731312