Introduction
From RTE 34.9.5, it is possible to communicate with Robox controls in ProfiNET device mode.
The Robox control can be configured, via ETH FB-S ports 4 and 5, as an I/O device within the ProfiNET network and appears as a SLAVE type peripheral.
Compared with Profibus, the control allows the exchange of up to 352 Bytes in the two directions divided into 11 blocks in TX and 11 in RX, instead of 6, of 16 words each.
The control is implemented as Profibus DPSlave emulation if ProfiNET channel enabled and PFB.CFG present in the folder alias SYS_DIR or FB_DIR.
For more details, see Profibus documentation.
Since RTE34.15.4, the ability to handle SYNCHRONOUS (IRT) information has been added.
In the block definition, the IRT attribute BLOCK_TO_RBX n [IRT] has been added where:
•n is the block number
•IRT specifies that the incoming block contains IRT data
and the new keyword IRT_TO n [IRT] where:
•n is the RR index where to enter the reference time TO
NOTE: In case warm_rst.8 is active, all ProfiNET communications are disabled.
Example
in PFB.cfg IRT_TO 211 ; Definition of RR index where to store the Time Output ... BLOCK_TO_ROBOX 1 IRT O-0 R_32 1001 ; position of master reference in [unit] O-4 R_32 1002 ; master speed in [unit/1000/sec] ... in RULE LIT rr_Irt_TO_PN RR(211) LIT r_PosMaster_PN R(1001) LIT r_SpeedMaster_PN R(1002) ... REAL irt_to ; data application time irt [uSec] REAL irt_to_prec ; previous value of irt_to [uSec] REAL dtMaster ; delta master variation time [sec] REAL velMaster ; speed of the master [unit/sec] REAL deltaPosMaster ; master position variation [unit] INT posMaster ; position of master arrived from profinet [unit] INT posMasterPrec ; previous position of the master arrived from profinet [unit] INT adjMaster ; position of the master adjusted to the rule execution time INT adjMasterPrec ; previous position of master adjusted to rule [unit] REAL deltaAdjMaster ; change in position of master [unit] REAL totMaster ; totalizer of the master [unit] INT mstFlag ; flag to specify how to handle master information ; 0 --> 0x01 Speed reference present ; 1 --> 0x02 master position size 1 indicates 32 bits, 0 indicates 16 bits REAL KconvSpeedPN2US = 0.001 ; constant to convert master speed received via profinet to speed in units/sec ... FUNCTION AdjMasterPosition () ; update incoming data from profinet irt_to = rr_Irt_TO_PN ; output time configured in pfb.cfg [microseconds]. posMaster = r_PosMaster_PN ; master space configured in pfb.cfg [master unit] ... IF (mstFlag.(0)) ; posMaster and master speed are fronted directly from PN velMaster = r_SpeedMaster_PN * KconvSpeedPN2US ; speed conversion in [master units/sec] ELSE ; handling if only the position of the master is provided.. IF ((irt_to <> irt_to_prec) AND (irt_to_prec<>0)) dtMaster = (irt_to - irt_to_prec)/1e6 ; time between last two reads (from rule) of Time Output PN in seconds irt_to_prec = irt_to ; calculation of master space between last two reads (from rule) IF (mstFlag.(1)) deltaPosMaster = DELTA_ENC32(posMaster, posMasterPrec) ; with positions 32 bits ELSE deltaPosMaster = DELTA_ENC16(posMaster, posMasterPrec) ; with positions 16 bits ENDIF ; calculation of velcity in [master units/sec] velMaster = (deltaPosMaster) / dtMaster ENDIF ; updates previous data posMasterPrec = posMaster irt_to_prec = irt_to ENDIF ; calculates the posMaster position adjusted to the rule sampling adjMaster = posMaster + velMaster *(SYNCH_HW_TIME - irt_to)/1e6 IF (mstFlag.(1)) deltaAdjMaster = DELTA_ENC32 (adjMaster , adjMasterPrec) ; with positions 32 bits ELSE deltaAdjMaster = DELTA_ENC16 (adjMaster , adjMasterPrec) ; with positions 16 bits ENDIF ; updates previous data adjMasterPrec = adjMaster ; calculation of master evolving to infinity and beyond totMaster = totMaster + deltaAdjMaster END_FUN |