PM851/COM3 - Modbus RTU - ACS580
In my new project I will communicate with six ACS580 drives.
I have found the Modbus library.
Are there any program examples for communicating with drives via Modbus? Function blocks for drives?
/Stefan
I have found the Modbus library.
Are there any program examples for communicating with drives via Modbus? Function blocks for drives?
/Stefan
Answers
Greetings,
There is an PDF for Modbus RTU Beginners. Please see below link:
https://forum-controlsystems.abb.com/...
You can find read, write and connect function blocks for modbus rtu. Do you need any help about drive side configuration?
Hope it helps you.
There is an PDF for Modbus RTU Beginners. Please see below link:
https://forum-controlsystems.abb.com/...
You can find read, write and connect function blocks for modbus rtu. Do you need any help about drive side configuration?
Hope it helps you.
I have programmed blocks for many drives in Simatic and Mitsubishi via Profibus and Profinet, including ACS580.
Modbus RTU and communicating with drives in AC800M is new to me.
I have 6 drives in a multidrop configuration. I want to send two words, ControlWord + Speeref. to the drives, receive two words, StatusWord + Current.
Can I MBConnect to all 6 drives in parallell, or do I need a sequence program.
In this .pdf dokument both MBRead and MBWrite Request is activated in parallell, is that possible?
Modbus RTU and communicating with drives in AC800M is new to me.
I have 6 drives in a multidrop configuration. I want to send two words, ControlWord + Speeref. to the drives, receive two words, StatusWord + Current.
Can I MBConnect to all 6 drives in parallell, or do I need a sequence program.
In this .pdf dokument both MBRead and MBWrite Request is activated in parallell, is that possible?
Hi,
Regarding to your last question - for 6 multidrop slaves, connected to one COM port of AC800M controller, you have to place 6 MBConnect blocks in your logic, one for each slave. That is why MBConnect block establish a separate connection to each slave - slave address is defined here.
Then you can connect multiple MBRead and MBWrite blocks to each MBConnect block - that depends on how many data you need to read/write to the slave.
In your case it could be only 1 MBRead block with 2 parameters (for two words to read) and 1 MBWrite block with 2 parameters to write.
You also have to take in consideration the size of words, you need to transfer trough Modbus. In case it is 16-bit size, you have to use word_to_int / int_to_word blocks, in order to connect INT variables to MBRead and MBWrite parameters.
In case of 32-bit words, you need to transfer each of them with 2 consequent INT variables, and then to unpack them in the CPU in proper way. In this case the number of parameters to each MBRead/MBWrite block will be 4
Regarding to your last question - for 6 multidrop slaves, connected to one COM port of AC800M controller, you have to place 6 MBConnect blocks in your logic, one for each slave. That is why MBConnect block establish a separate connection to each slave - slave address is defined here.
Then you can connect multiple MBRead and MBWrite blocks to each MBConnect block - that depends on how many data you need to read/write to the slave.
In your case it could be only 1 MBRead block with 2 parameters (for two words to read) and 1 MBWrite block with 2 parameters to write.
You also have to take in consideration the size of words, you need to transfer trough Modbus. In case it is 16-bit size, you have to use word_to_int / int_to_word blocks, in order to connect INT variables to MBRead and MBWrite parameters.
In case of 32-bit words, you need to transfer each of them with 2 consequent INT variables, and then to unpack them in the CPU in proper way. In this case the number of parameters to each MBRead/MBWrite block will be 4
Now I have borrowed a PM864 and connected a drive at the office for testing.
The MBConnect block signals 'Valid', but the MBRead and MBWrite blocks signals 'Error' and 'Status' = -5.
I have tried adresses '%MW00', '%MW01', ...
What is 'Status' -5?
The MBConnect block signals 'Valid', but the MBRead and MBWrite blocks signals 'Error' and 'Status' = -5.
I have tried adresses '%MW00', '%MW01', ...
What is 'Status' -5?
It seems you are closer to read/write successfully
-5 cErrTypeMismatch
The type of one or more variables does not match the requirements of the procedure.
What type of variables do you connected to Rd parameters of MB blocks?They can be simple variables of the BOOL, DINT, UINT and INT type - in your case should be INT or DINT.
Also Poll Time in Modbus settings usually should be set = 0
Could you provide a screenshot
Source: CBM help = General Status Codes
That is your mistake - to Rd parameters of Read/Write blocks you have to connect variables of type INT or DINT.
For SP41xxx variables ! No WORD format is allowed here, that is why you have -5 error code
For your case I could recommend to set in the drive 16-bit format for control and status words.
Then put INT variables in Read/Write blocks
Then use translations in AC800M :
INT_TO_WORD for read variables (SP4_SW...)
WORD_TO_INT to write variables (SP4_CW...)
In summary: Read/Write with MB blocks using only INT. Then in application, transfer that INT to WORD or vice versa, depends on read or write function
For SP41xxx variables ! No WORD format is allowed here, that is why you have -5 error code
For your case I could recommend to set in the drive 16-bit format for control and status words.
Then put INT variables in Read/Write blocks
Then use translations in AC800M :
INT_TO_WORD for read variables (SP4_SW...)
WORD_TO_INT to write variables (SP4_CW...)
In summary: Read/Write with MB blocks using only INT. Then in application, transfer that INT to WORD or vice versa, depends on read or write function
OK, now I have status = 1.
Thanks!
Thanks!
Add new comment