GSD文件中定义了这个几个模块:
Module="DI8 (PORT1) " 0x42,0x00,0x00,0x01
1
EndModule
Module="DI8 (PORT2) " 0x42,0x00,0x00,0x02
2
EndModule
Module="DO8 (PORT1 LED)" 0x82,0x00,0x00,0x03
3
EndModule
Module="DO8 (PORT2 LED)" 0x82,0x00,0x00,0x04
4
EndModule
Module="DIO32 " 0xC1,0x03,0x03,0x05
5
EndModule
Module="Counter 16bit " 0xC1,0x01,0x01,0x06
6
程序中定义了这样的默认配置数据:
//default configuration data for startup
static const UBYTE DefCfg[36] = { 0x42,0x00,0x00,0x01,//DI8 (red dip switch)
0x42,0x00,0x00,0x02,//DI8 (blue dip switch)
0x82,0x00,0x00,0x03,//DO8 (led)
0xC1,0x03,0x03,0x04,//DIO32
0xC1,0x01,0x01,0x05, //Counter 16bit
0x03,0x00,0x00,0xFF,//Empty-Module
0x03,0x00,0x00,0xFF,//Empty-Module
0x03,0x00,0x00,0xFF,//Empty-Module
0x03,0x00,0x00,0xFF //Empty-Module
};
具体内容是什么含义我是知道的,但是一次通讯中只能用一个模块还是可以用多个模块?数据长度的计算函数中(vpc3_calculate_inp_outp_len)是所有的都算上了,模块到底应该怎么用呢?