admin管理员组

文章数量:1531374

2024年6月29日发(作者:)

三菱PLC编程口通信C语言源代码 - 三菱

plc

fxnew.h

#define DELAY_TIMES 30000L

#define TRUE 1

#define FALSE 0

#define TRUE 1

#define FALSE 0

#define FORCE_ON 0x37

#define FORCE_OFF 0x38

void init_plc(void);

int check_plc(void);

int _read_data_register(unsigned int uAddress,unsigned int

number);

int _read_mdata_register(unsigned int uAddress,unsigned int

number);

int _write_data_register(unsigned int uAddress,unsigned int

number);

int _force_m_contact(unsigned int uAddress,unsigned char

ucOn_off);

int read_data_register(unsigned int uAddress,unsigned int

1

number);

int read_mdata_register(unsigned int uAddress,unsigned int

number);

int write_data_register(unsigned int uAddress,unsigned int

number);

int force_m_contact(unsigned int uAddress,unsigned char

ucOn_off);

int _read_m_register(unsigned int uAddress,unsigned int

number);

int read_m_register(unsigned int uAddress,unsigned int

number);

int TESTING=0;

unsigned int uRead_value[25];

unsigned int uWrite_value[25];

unsigned int COMM_PORT=1;

unsigned int STATS_PORT=0x2fd;

unsigned int DATA_PORT=0x2f8;

void init_plc(void)

{ _AX=0xfa;

_DX=COMM_PORT;

geninterrupt(0x14);

while((inportb(STATS_PORT)1)!=0)inportb(DATA_PORT);

2

本文标签: 编程源代码C语言