GTN_OpenRingNet
指令原型:
GT_API GTN_SaveRingNetConfig(short core,char *pFile)
指令类型:
立即指令,调用后立即生效。
指令说明:
保存运动控制器。
指令参数说明:
| core |
核号,正整数,取值范围请参照核号参数范围一栏。
1个控制器只需要保存1个配置文件,建议core参数设置为2*index-1(index为控制器序号,从1开始)。
|
| pFile |
保存的配置文件的文件名。文件格式:*.cfg
|
指令返回值:
请参照通用返回值说明。
相关指令:
GTN_NetInit
注意事项:
建议使用xml修改网络配置信息。详见指令GTN_NetInit。
配置文件字段说明
[Version]:配置文件的版本信息
[Version]
id=0x8051
type=0
year=2017
mon/day=923
rev0=0
rev1=0
rev2=0
[StationX.CoreY]
StationX:网络模块的逻辑站号,可修改
CoreY:核号,可修改
id:网络模块的类型,不能修改
phyId:物理站号,不能修改
[Station1.Core1]
id=0xa410
phyId=1
....
修改配置文件例程
一张GSN-024的主卡接了5个网络模块(分别为401+601+3个GSHD驱动器),默认配置core1连接4个站(401+601+2个GSHD驱动器)core2连接1个站(1个GSHD驱动器),配置文件如下:
[Version]
id=0x8051
type=0
year=2017
mon/day=923
rev0=0
rev1=0
rev2=0
[Station1.Core1]
id=0xa410
phyId=2
[Station2.Core1]
id=0xa600
phyId=1
[Station3.Core1]
id=0x8130
phyId=3
[Station4.Core1]
id=0x8130
phyId=4
[Station1.Core2]
id=0x8130
phyId=5
将上述同样的模块资源按照配置文件重新分配,配置文件配置信息为core1连接1个站(601)core2连接4个站(401+3个GSHD驱动器)
[Version]
id=0x8051
type=0
year=2017
mon/day=923
rev0=0
rev1=0
rev2=0
[Station1.Core2]
id=0xa410
phyId=2
[Station1.Core1]
id=0xa600
phyId=1
[Station2.Core2]
id=0x8130
phyId=3
[Station3.Core2]
id=0x8130
phyId=4
[Station4.Core2]
id=0x8130
phyId=5