mb2hal: trying to control a Siemens Sinamics V20 VFD

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
Code:
halcmd -f sinamics_mb2hal.hal
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):
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.

More
5 years 1 month ago #219887 by flawapawacrew
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

Please Log in or Create an account to join the conversation.

More
5 years 1 month ago #220306 by andypugh
It is possible that the error you see is caised by the earlier error:
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.

More
5 years 1 month ago #220458 by flawapawacrew
Hi andypugh,

thank you for your answer!

Using
Code:
show pin
, I was able to understand that there is a
Code:
mb2hal.00.00.int
and
Code:
mb2hal.00.00.float
pin. Using either of them did get rid of the aforementionned error. So that's a step forward!

Unfortunaltely, the
Code:
Illegal data address
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

Please Log in or Create an account to join the conversation.

More
5 years 1 month ago - 5 years 1 month ago #220463 by Aciera
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.

More
5 years 1 month ago #220713 by Todd Zuercher
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.

Please Log in or Create an account to join the conversation.

Time to create page: 0.326 seconds
Powered by Kunena Forum