DrvModbusRtuBroadcast
(FB)
FUNCTION_BLOCK DrvModbusRtuBroadcast EXTENDS AbbLConCA
Function block DrvModbusRtuBroadcast is a communication block which sends the broadcast messages via the Modbus RTU communication to all ACS/DCS drives connected to same Modbus RTU line (physical line) and connected to same LineToken of Modbus RTU function blocks of the line . This function block does not perform modbus read operation and it does not read any values such as status word, actual value 1 and actual value 2 etc from any of the drive and thus this function block should not be used along with DrvModbusRead and DrvModbusReadWrite23 function blocks. This function block should be only used in combination with DrvModbusWrite function block for Broadcasting write operation. This block can be used with ABB Drives Classic Profile and ABB Drives Enhanced profile, but precondition is that all the drives should be configured either in ABB Drives Classic Profile or ABB Drives Enhanced profile and not mix with combination of few drives with classic profile and few drives with enhanced.
- ABB Drives Classic Profile
With input parameter EnhancedProfile = FALSE, the function block works for Drives Classic Profile.
Writing control word and reference value to drives: A rising edge FALSE -> TRUE at input SendCtrlValues starts sending broadcast message with Controlword and reference values to all the drives starting at Modbus register 400001.
- ABB Drives Enhanced profile
With input parameter EnhancedProfile = TRUE, the function block works for Drives Enhanced Profile.
The ABB Drives Profile Enhanced communication profile provides register mapped access to the Control, Status, Reference and Actual Values of the ABB Drives Profile Enhanced. The mapping of the registers has been enhanced to allow additionally writing of upto 12 control and reading of upto additionally 12 status parameters in a single Modbus job.
Writing control word and reference value to drives: A rising edge FALSE -> TRUE at input SendCtrlValues starts sending broadcast message with Controlword and reference values to all the drives starting at Modbus register 400001.
A successful broadcast message for writing controlword, reference values and additional mapped parameters (only in case of Enhanced profile) is indicated by output JobDone = TRUE and output ModMastErrorAct = FALSE. A next broadcast job for writing these values can once again only be started with a rising edge at ‘SendCtrlValues’ input.
Note
Please refer the respective drives/fieldbus module manual for parameter settings and more details on the drive configuration
The requests to process write Modbus jobs is transferred via the structure DriveData at the InOut variable DriveData which can be connected to multiple instances of write function blocks DrvModbusWrite.
For all drives, which are connected to same Modbus RTU line, one instance of broadcast block DrvModbusRtuBroadcast is enough and it should be connected to same LineToken of DrvModbusRtu function blocks which are used for communication between PLC and each drive on Modbus RTU line. All those communication function blocks of one Modbus RTU line must be linked together via one variable of type ModRtuTokenType, connected to the InOut LineToken. Via this variable the Modbus token is passed to the next drive/device, so only one drive/device at a time is communicating with the PLC.
- Error ERR_COM_DIFFERENT_LINE
In the same LineToken, if one function block has wrong Com port configured. At the program startup (rising edge of Enable input) if this block will occupy the LineToken with its Com value, the following blocks with different values at their Com input will be set to error ERR_COM_DIFFERENT_LINE, even if the following blocks might have the correct Com value. To verify who has occupied LineToken, user can check the byComSlot value in the LineToken variable. To solve this situation, a rising edge (FALSE to TRUE) must be given at Enable input of the function blocks where correct Com input is configured.
- Diagnosis
The output ErrorID, which reflects an actual error number is only valid for one cycle if output Done is FALSE and output Error is set to TRUE. To catch this error number an external function must be programmed. However there are internal diagnosis variables available, which are not shown at any output, but can be accessed from the function block instance.
The additional diagnosis variables are:
iWriteErrCnt: number of errors in write jobs since Enable = TRUE.
wLastWriteErno: holds the error number of the last executed write job.
Note
If the user changes drive profile while drive is online with PLC, function block output’s may give wrong indication
Note
When Embedded Fieldbus settings are used, we can perform only write to all the Drives using Classic Profile. Enhanced profile is not supported in Embedded Fieldbus
Note
When Fieldbus Adapter is configured, then only Enhanced profile can be used to write (input NvarWrite) upto 12 parameters to the drives.
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
Enable
BOOL
FALSE
A rising edge (Enable = TRUE) starts the operation, the output Busy goes to TRUE. All other inputs are read and considered continuously. A falling edge (Enable = FALSE) aborts the operation. During Aborting the Busy is still TRUE. Afterward all outputs are reset.
AbbLConCA
Output
Busy
BOOL
FALSE
Operation is running (while output Error is FALSE)
AbbLConCA
Error
BOOL
FALSE
Operation is stopped with error (while output Busy is FALSE). This output is TRUE for at least one cycle or until Enable is set to FALSE. The output ErrorID gives more details about the error.
AbbLConCA
Input
Com
BYTE
1
2: Modbus communication port - e.g: 1 = COM1 - changes are valid only after rising edge of Enable input (FALSE -> TRUE). Valid values are 1 to 3 depending on PLC type and configuration.
Prio
BOOL
FALSE
3: Reserved - not used
EnhancedProfile
BOOL
FALSE
- 4: To select either ABB Drives Classic profile or ABB Drives Enhanced profile. FALSE = ABB Drives Classic Profile, TRUE = ABB Drives Enhanced Profile. Profile should not be switched when PLC is online with the Drive.
Drive profile has to be properly configured in drives parameters, any mismatch with drive parameter configuration may lead to incorrect block behavior.
NvarWrite
BYTE
0
5: Enhanced Profile: Number of parameters to write to Reg 400054. Max 12. Depending of configured parameters in Group FBA DATA OUT in drive. Valid range: 0..12. This variable is applicable only to enhanced profile.
WriteValues
ARRAY [1..12] OF INT
[12(0)]
6: Enhanced Profile: Array of values to write to Reg 400054..400065 of drive configured parameters in Group FBA DATA OUT in drive. This variable is applicable only to enhanced profile.
SendCtrlValues
BOOL
FALSE
7: A rising edge (SendCtrlValues = TRUE) starts the sending of the broadcast job for WriteCtrl instance FB, which writes Control Word, Reference1 and Reference2. Also writes values from input array WriteValues to parameters configured in FBA DATA OUT of drives in case of Enhanced Profile.
Inout
LineToken
ModRtuTokenType
8: Reference variable to connect to other DrvModbusRtu / ModRtuToken function blocks of same Modbus RTU line
DriveData
9: Drive reference variable to connect to all function blocks of this drive
Output
ErrorID
3: Error codes
ModMastErrorAct
BOOL
FALSE
4: Active error in ModMast. Operation is running with error . This output is TRUE for at least one cycle or until Enable is set to FALSE. The output ModMastErrorIDLast gives more details about the last error.
ModMastErrorIDLast
WORD
0
5: Error code of last active error in ModMast. For error code description, refer to error codes in Modbus RTU library, “AC500_ModbusRtu.ERROR_ID”.
WarnAct
BOOL
FALSE
6: Operation is running with warning . This output is TRUE for at least one cycle or until Enable is set to FALSE. The output WarnIDLast gives more details about the warning.
WarnIDLast
7: Warning code of last active warning
JobDone
BOOL
FALSE
8: Modbus job done
JobBusy
BOOL
FALSE
9: Modbus job busy