System bus (CAN) with Ser vo PLC & Drive PLC
LenzeCanDrv.lib - Function blocks
9.1 Transmit CAN object (L_CanPdoTransmit)
9-4
L
PLC-Systembus EN 1.1
Forced transmission
In some cases, a transmission request must be saved in the transmission request memory without
consideration of a data change (event-controlled) or a cycle time (time-controlled).
To d o t h i s , t h e L_CanPdoTransmit FB supports the command SendData in transmission mode
“Forced transmission” (
byTransmitMode
=3).
Example
Function block declaration in ST:
SendWithID678: L_CanPdoTransmit; (* send data with identifier 678 *)
Calling the function block in ST:
SendWithID678 (wDrvNr:=10,
byLen:=8,
dwCobID:=678,
pIOAdress:= ADR(abySendData),
tRepeatTime:=T#5ms,
byTransmitMode:=3);
Command “Forced transmission” in ST:
SendWithID678. SendData; (* force send procedure *)
Note!
With the L_CanPdoTransmit and L_CanPdoReceive FBs you must not use an address which is
part of the memory area of the operating system!
Problem:
The system variable addresses (system block I/Os) are also part of the
memory area of the operating system, in the below figure the system
variable AIN1_nIn_a:
Remedy:
Use the address of a normal variable inst ead of the system variable
address and copy the value of the corresponding system variable to it:
ADR
2
AIN1_nIn_a
L_CanPdoTransmit
wDrvNr
byLen
dwCobId
pIOAdress
tRepeatTime
byTransmitMode
nState
wNrOfCallsToSend
10
8
750
t#10ms
nAnalogInput
AIN1_nIn_a
nAnalogInput
ADR
2
L_CanPdoTransmit
wDrvNr
byLen
dwCobId
pIOAdress
tRepeatTime
byTransmitMode
nState
wNrOfCallsToSend
10
8
750
t#10ms