- Posts: 43
- Thank you received: 0
Delta MS300 VFD, RS485, RPI4, QTdragon, getting it to work
I looked at M2BHAL and classic ladder, but that is just to complicated. Thats hard to say...
I don't know anything about modbus, but I do understand DMX (for lighting, that's a similar protocol)
I also tried VFDMOD, that looks very easy, but, there is no ARM64 version.
Sometimes I wonder why I started to use linuxcnc.... but I've come so far, I've learned a lot and my cnc is running but not the way I want...
To start with, which route do I have to take to get my VFD running on my Linux2.9/RPI4 arm64 machine?
In this topic there is information about adresses. forum.linuxcnc.org/24-hal-components/387...modbus-rtu?start=100
I've tried vfdb_vfd too, but the reverse and forward pins are missing.... ( linuxcnc.org/docs/html/man/man1/vfdb_vfd.1.html#PINS )
Please Log in to join the conversation.
Please Log in to join the conversation.
There should be some modbus data in your VFD terminal
Please Log in to join the conversation.
I'm now trying to figure out how I have to use the read/write/register/coil settings. It's part of how modbus in general works, but I don't understand how it's related to the VFD manual. Reading and writing is obvious, but coils and registers are getting more complicated, especialy when there are multiple settings on one address...
Please Log in to join the conversation.
This is from the manual:
This is what I have now. I'm I doing something wrong? Can I do things beter to make it more logical (for a non-IT person
Please Log in to join the conversation.
and:The names and types of pins created by Mb2hal is determined by what you put in the Mb2hal ini file. Specifically the transactions that you define there.
There are at least 5 different transaction types that can be used. And these determine if the pins created are boolean, floats, # inputs or outs.
fnct_02_read_discrete_inputs: creates boolean output HAL pins.
fnct_03_read_holding_registers: creates a floating point output HAL pins. also creates a u32 output HAL pins.
fnct_04_read_input_registers: creates a floating point output HAL pins.also creates a u32 output HAL pins.
fnct_15_write_multiple_coils: creates boolean input HAL pins.
fnct_16_write_multiple_registers: creates a floating point input HAL pins.
The number of hal pins created by each "transaction" is determined by the number of "elements" in that transaction.
The names of the hal pins created are the default name:
Example pin name for the 1st transaction 2nd element would be:
mb2hal.00.01 (transaction=00, second register=01 (00 is the first element))
or the transaction number can be replaced by name you define with
HAL_TX_NAME=name
Would give: mb2hal.name.01
Setting up modbus communication for a new device you aren't familiar with is always a pain. (even when you do know what you're doing.) The documentation for the device is almost always universally awful, worse if it is Chinglish. From the looks of it your life is going to be made difficult by the fact that according to that document the drive only supports modbus functions 3 and 6. So you won't be able to address individual bits directly or read/write to multiple addresses. The first issue will result in you having to set up hal components to translate bit io to and from S32 integer numbers. The second problem will make you have to set up individual transactions for each different register you may need to access on the drive. That can lead to slower communications, especially if you must communicate with multiple devices.
So for example you'll need to set up a transaction that writes to 1000h (That would be 4096 in dec and I think the address number you'll need to use in your modbus ini file.) But you will have to send to that transaction an integer number representing the state that you want the drive set to, fwd=1, rev=2, stop=5... One of the mux hal components might be useful for setting the value you want for the appropriate bit inputs. (It doesn't look like simple binary bit/coil translation will work for this register.)
Please Log in to join the conversation.
So, it depends on your VFD what kind of read/write types are supported. In my manual there is no paragraph about that, but there is something that looks like it. They are talking about the following functions:
So, that's where I have to deal with.fnct_03_read_holding_registers (03 = 0x03)
fnct_06_write_single_register (06 = 0x06)
fnct_16_write_multiple_registers (16 = 0x10)
I'm afraid that I need conversions in my HAL-file then....
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
- Posts: 22010
- Thank you received: 3
I did read itI'm just talking to myself, that helps too
![]()
I try to read everything, not always possible.
Please Log in to join the conversation.
Please Log in to join the conversation.
before communicating with VFD via Modbus I would buy a simple modbus input/output relay and start practicing modbus and MB2hal.
Do you know if is it possible to position spindle with MS300?
Please Log in to join the conversation.
