<< 点击显示目录 >> 主页 轴控开发使用手册 > ACP10/ARNC0帮助信息 > ACP10_MC运动库 > 分类的功能块 > 管理ACOPOS ParIDs > MC_BR_InitReceiveNetworkData > Possible procedure for determining "NodeNumber", "BitOffset" and "DataType" > Receiving input data via a bus controller |
•Use the plAction(), actionID = plACTION_GET_DP_INFO function and both "DeviceName" and "ChannelName" to determine the node number of the bus controller and the offsets of the data from the input channels that should be read by the drive.
•Determine the offset that is a multiple of 32 and makes it possible for the drive to access the data from the input channels (→ Integer arithmetic → Offset_ACOPOS = Offset / 32 * 32). It may be necessary to configure multiple receive channels on the drive depending on which channels of the input modules are being used. → Step 4 must be repeated accordingly.
•"DataType": For positions or signed values use ncPAR_TYPE_DINT; for status information, etc. always use ncPAR_TYPE_UDINT.
•Specify the offset from step 2 for the function block and then execute the function block.
•Map the "ReceiveParID" to a BIT SPT function block instance and extract the data.
The positive hardware limit switch, negative hardware limit switch and reference switch of an ACOPOSmulti axis are connected to an X20 input card. The X20 input card (IF1.ST2) is connected to a POWERLINK bus controller (ST12) operated on the same POWERLINK network as the ACOPOSmulti drive. The inputs should automatically be transmitted to the ACOPOSmulti drive and mapped to the axis.
I/O mapping of the DI card:
Determining the bit offset:
PlActionGetDPInfo.DeviceName := ADR('SS1.IF2.ST12.IF1.ST2');
PlActionGetDPInfo.ChannelName := ADR('DigitalInput01');
plActionStatus := plAction(0,plACTION_GET_DP_INFO,ADR(PlActionGetDPInfo),SIZEOF(PlActionGetDPInfo));
Function block call:
MC_BR_InitReceiveNetworkData_0.Axis:=axis1Ref;
MC_BR_InitReceiveNetworkData_0.NodeNumber:=PlActionGetDPInfo.SrcNode;
MC_BR_InitReceiveNetworkData_0.BitOffset:=
(PlActionGetDPInfo.OffsetAbs / 32) *32; (* determine bit offset in multiples of 32 bits *)
MC_BR_InitReceiveNetworkData_0.DataType:=ncPAR_TYP_UDINT;
MC_BR_InitReceiveNetworkData_0.InterpolationMode:=mcIPL_OFF;
MC_BR_InitReceiveNetworkData_0.ReceiveChannel:=1;
MC_BR_InitReceiveNetworkData_0.Execute:=TRUE;
MC_BR_InitReceiveNetworkData_0();
Mapping the ACOPOS DI ParIDs to the received data:
A BIT SPT function block is configured so that the individual bits of the received data (transmitted digital inputs) are available as ParIDs. These ParIDs are mapped to the "ParID pointers" for the ACOPOS digital inputs.
ParID |
Value |
ACP10PAR_FUNCTION_BLOCK_CREATE |
ACP10PAR_BIT_MODE+0 |
ACP10PAR_BIT_A1+0 |
1 |
ACP10PAR_BIT_A2+0 |
1 |
ACP10PAR_BIT_A3+0 |
1 |
ACP10PAR_BIT_B1+0 |
(PlActionGetDPInfo.OffsetAbs MOD 32) |
ACP10PAR_BIT_B2+0 |
(PlActionGetDPInfo.OffsetAbs MOD 32)+1 |
ACP10PAR_BIT_B3+0 |
(PlActionGetDPInfo.OffsetAbs MOD 32)+2 |
ACP10PAR_BIT_IN1_PARID+0 |
MC_BR_InitReceiveNetworkData_0.ReceiveParID |
ACP10PAR_BIT_IN2_PARID+0 |
MC_BR_InitReceiveNetworkData_0.ReceiveParID |
ACP10PAR_BIT_IN3_PARID+0 |
MC_BR_InitReceiveNetworkData_0.ReceiveParID |
ACP10PAR_BIT_MODE+0 |
10 (extract from right) |
ACP10PAR_POS_LIMIT_SWITCH_PARID |
ACP10PAR_BIT_VALUE1+0 |
ACP10PAR_NEG_LIMIT_SWITCH_PARID |
ACP10PAR_BIT_VALUE2+0 |
ACP10PAR_REFERENCE_SWITCH_PARID |
ACP10PAR_BIT_VALUE3+0 |
Table: Parameter list