VFD Modbus Mesa 7i96S pktUART

More
2 years 7 months ago #295298 by DerChristian
Hey everybody,
as the title suggests I am trying to setup Modus between my Mesa 7i96s and my VFD (Stepperonline H100/EV50 Series 2.2kW).
I have already flashed the Mesa with the pktUART and made a cable with 330Ohm pullup and pulldown resistors.
The part I'm struggling with is the mesa modbus config file especially the addresses.
The vfd manual states the possilble function codes as 0x03, 0x00 and 0x10 and mentiones that the ram addresses are parameter number -1 +32768.
Plus there are some common address tables. But I don't get how to transfer these numbers to N x 8bit for the config file.
Maybe someone of you could point me in the right direction? 
Since the manual is to big to be directly attached, here is the link 
www.omc-stepperonline.com/index.php?rout...Full_User_Manual.pdf
The modbus communication is detailed beginning at page 117

Thanks and cheers, christian

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

More
2 years 7 months ago #295330 by DerChristian
Okay so I made some steps. The modbus driver looks like this now:
Code:
static const hm2_modbus_chan_descriptor_t channels[] = { /*  {TYPE,     FUNC, ADDR,   COUNT, pin_name} */ // Create 8 HAL bit pins coil-00 .. -07 supplying the values of coils at 0x0000     {HAL_S32,   6,   0xC122, 1,     "controlbit"},     {HAL_S32,   6,   0xC441, 1,     "speed"},     {HAL_S32,   3,   0x43F6, 1,     "status"},     };

The driver loads and a I can see them in the hal configuration. Should I be able to control them in the hal configuration via the set command? Since the controlbit does different things depending on its value I think I have to use the enum function. I'll keep on documenting my progress here. If somebody has input to jumpstart my journey it would be greatly appreciated. 

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

More
2 years 7 months ago #295340 by PCW
Replied by PCW on topic VFD Modbus Mesa 7i96S pktUART
Other somewhat obvious things are that you need to have
the modbus baudrate and channel set in your hal file

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

More
2 years 7 months ago - 2 years 7 months ago #295362 by DerChristian
Thanks for the reply. I've got the baudrate set to 19200 both in the vfd and the hal.
What do you mean with channel? If you mean the address, I dind't set it because the vfd uses per default address 1.
My problem at the moment is, that I can't get rid of the errorcode 11. The 330Ohm resitors are connected as mentioned in one of your previous posts. I already switched the polarity more than ones. Set the update-hz to 1Hz. But still no luck getting rid of the error.
Last edit: 2 years 7 months ago by DerChristian. Reason: typos

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

More
2 years 7 months ago - 2 years 7 months ago #295363 by PCW
Replied by PCW on topic VFD Modbus Mesa 7i96S pktUART
You must set the address in hal to match your devices address.
A mis-matched address guarantees a no response error (error 11)
Last edit: 2 years 7 months ago by PCW.

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

More
2 years 7 months ago #295365 by DerChristian
Just went back into the workshop to check. I assumed that "modname.address (default 0x01)" means it uses per default 1 if not set different. But no that didn't work either. Just for reference, here is my actual configuration:

HAL:
Code:
loadrt VFD_modbus ports=hm2_7i96s.0.pktuart.0 addf VFD_modbus.00 servo-thread setp VFD_modbus.00.address 1 setp VFD_modbus.00.baudrate 19200 setp VFD_modbus.00.update-hz 1

VFD_modbus.mod:
Code:
/* The format of the channel descriptors is:   {TYPE, FUNC, ADDR, COUNT, pin_name}   TYPE is one of HAL_BIT, HAL_FLOAT, HAL_S32, HAL_U32 FUNC = 1, 2, 3, 4, 5, 6, 15, 16 - Modbus commands COUNT = number of coils/registers to read */   #define MAX_MSG_LEN 16   // may be increased if necessary to max 251   static const hm2_modbus_chan_descriptor_t channels[] = { /*  {TYPE,     FUNC, ADDR,   COUNT, pin_name} */ // Create 8 HAL bit pins coil-00 .. -07 supplying the values of coils at 0x0000     {HAL_U32,   6,   0x0122, 1,     "controlbit"},     {HAL_U32,   6,   0x0121, 1,     "speed"},     {HAL_U32,   3,   0x03F6, 1,     "status"},     };

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

Time to create page: 0.101 seconds
Powered by Kunena Forum