- Posts: 20
- Thank you received: 3
mb2hal: trying to control a Siemens Sinamics V20 VFD
- flawapawacrew
- Topic Author
- Offline
- Junior Member
-
Less
More
5 years 1 month ago #219884
by flawapawacrew
Hello everyone,
I am new to the forum and to linuxcnc. I am currently trying to connect with a Sinamics VFD using mb2hal.
My setup is a RaspberryPi 4 with the "official" linuxcnc raspibian build with USB to RS485 adapter. This is connected to the VDF using a twisted pair and GND, and all terminating resistors, etc... are connected as recommended by the Operating instructions (attached). I scoped the signals, double, triple checked the parameters set in the VFD. I am 90% sure the communication setup in hardware is sane.
I wrote a very simple .ini file and .hal file to test the communication (attached). The .ini file was written based on the the Operating instructions for number of bits, partiy, etc...
I use
to start the hal component. Unfortunately, I get an error message after sending the first command (returned by the VFD if I am not mistaken):
The complete output of the shell command is attached ("shell_mb2hal_output_short.txt"). This is with all debug levels set to 3.
From what I understand, the register addresses are wrongly defined...? I followed the table at page 142 of the Operating Instructions.
Is there something I am missing here?
Also, I noted an error at the beginning:
Which makes no sense to me as transaction 00 is defined and we read two registers. Note that this error is not present for mb2hal.00.01
Again, am I missing something?
I thank you in advance for your insight!
Cheers,
Flawa
I am new to the forum and to linuxcnc. I am currently trying to connect with a Sinamics VFD using mb2hal.
My setup is a RaspberryPi 4 with the "official" linuxcnc raspibian build with USB to RS485 adapter. This is connected to the VDF using a twisted pair and GND, and all terminating resistors, etc... are connected as recommended by the Operating instructions (attached). I scoped the signals, double, triple checked the parameters set in the VFD. I am 90% sure the communication setup in hardware is sane.
I wrote a very simple .ini file and .hal file to test the communication (attached). The .ini file was written based on the the Operating instructions for number of bits, partiy, etc...
I use
Code:
halcmd -f sinamics_mb2hal.hal
Code:
ERROR Illegal data address
The complete output of the shell command is attached ("shell_mb2hal_output_short.txt"). This is with all debug levels set to 3.
From what I understand, the register addresses are wrongly defined...? I followed the table at page 142 of the Operating Instructions.
Is there something I am missing here?
Also, I noted an error at the beginning:
Code:
sinamics_mb2hal.hal:8: Pin 'mb2hal.00.00' does not exist
Which makes no sense to me as transaction 00 is defined and we read two registers. Note that this error is not present for mb2hal.00.01
Again, am I missing something?
I thank you in advance for your insight!
Cheers,
Flawa
Please Log in or Create an account to join the conversation.
- flawapawacrew
- Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 20
- Thank you received: 3
5 years 1 month ago #219887
by flawapawacrew
Replied by flawapawacrew on topic mb2hal: trying to control a Siemens Sinamics V20 VFD
Hello,
Apparently the attached pdf was not uploaded. The Operating Instructions can be consulted online at this address :
www.manualslib.com/manual/1203313/Siemen...html?page=142#manual
Cheers,
Flawa
Apparently the attached pdf was not uploaded. The Operating Instructions can be consulted online at this address :
www.manualslib.com/manual/1203313/Siemen...html?page=142#manual
Cheers,
Flawa
Please Log in or Create an account to join the conversation.
5 years 1 month ago #220306
by andypugh
Replied by andypugh on topic mb2hal: trying to control a Siemens Sinamics V20 VFD
It is possible that the error you see is caised by the earlier error:
Is it possible to fix that? If you insert a line "show pin" straight after the loadrt mb2hal line then you will get a dump of all the pins that exist at that point in the output.
Code:
sinamics_mb2hal.hal:8: Pin 'mb2hal.00.00' does not exist
Is it possible to fix that? If you insert a line "show pin" straight after the loadrt mb2hal line then you will get a dump of all the pins that exist at that point in the output.
Please Log in or Create an account to join the conversation.
- flawapawacrew
- Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 20
- Thank you received: 3
5 years 1 month ago #220458
by flawapawacrew
Replied by flawapawacrew on topic mb2hal: trying to control a Siemens Sinamics V20 VFD
Hi andypugh,
thank you for your answer!
Using
, I was able to understand that there is a
and
pin. Using either of them did get rid of the aforementionned error. So that's a step forward!
Unfortunaltely, the
error still shows up. I tried with different register addresses in the range 40000 - 40038 with no success. An example of modbus communication found on the siemens website (
support.industry.siemens.com/cs/document...h-hmi?dti=0&lc=en-US
) seems to confirm that I am using the correct range of addresses.
I will probably factory reset and re-configure, just to be sure.
I am also wondering if there is a precise order in which one needs to access the drive's registers...
Will keep you posted.
Cheers,
Thierry
thank you for your answer!
Using
Code:
show pin
Code:
mb2hal.00.00.int
Code:
mb2hal.00.00.float
Unfortunaltely, the
Code:
Illegal data address
I will probably factory reset and re-configure, just to be sure.
I am also wondering if there is a precise order in which one needs to access the drive's registers...
Will keep you posted.
Cheers,
Thierry
Please Log in or Create an account to join the conversation.
5 years 1 month ago - 5 years 1 month ago #220463
by Aciera
Replied by Aciera on topic mb2hal: trying to control a Siemens Sinamics V20 VFD
I think in mb2hal you can turn on a debug mode that shows you the actual data being sent and recieved. That might be helpful to compare with the example modbus communication. So maybe set INIT_DEBUG=3
Code:
[MB2HAL_INIT]
#OPTIONAL: Debug level of init and INI file parsing.
# 0 = silent.
# 1 = error messages (default).
# 2 = OK confirmation messages.
# 3 = debugging messages.
INIT_DEBUG=3
Last edit: 5 years 1 month ago by Aciera.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
Less
More
- Posts: 4737
- Thank you received: 1480
5 years 1 month ago #220713
by Todd Zuercher
Replied by Todd Zuercher on topic mb2hal: trying to control a Siemens Sinamics V20 VFD
You might try using 38 (or 37 or 39) instead of 40038 as the element#.
I know the drives I'm using work that way (but they are not Siemens). The documentation lists the addresses as 400XX, but in my config I subract 40,000 from the number. So for address 40008, I'd use FIRST_ELEMENT=8 for 40038, I'd use FIRST_ELEMENT=38.
I know the drives I'm using work that way (but they are not Siemens). The documentation lists the addresses as 400XX, but in my config I subract 40,000 from the number. So for address 40008, I'd use FIRST_ELEMENT=8 for 40038, I'd use FIRST_ELEMENT=38.
Please Log in or Create an account to join the conversation.
Time to create page: 0.326 seconds