Modbus Help - MB2HAL

More
11 years 1 month ago #62086 by racedirector
Replied by racedirector on topic Modbus Help - MB2HAL
Had to make a few adjustments but all is good so far. Just incase anyone else is watching this with an X200 here are the changes

==== CODE BELOW - for formatting ====
loadusr -Wn x200 mb2hal config=x200vfd.ini

setp x200.direction.00 1 This doesn't seem to work, got to figure this one out

loadrt scale count=1
addf scale.0 servo-thread

scale.0.gain = 0.16666667

net spindle-speed scale.0.in <= motion.spindle-speed-out
net x200-freq x200.frequency.00 <= scale.0.out

net x200-run x200.run.00 <= motion.spindle-on
net x200-dir x200.direction.00 <= motion.spindle-reverse <- This is weird, the spindle actually goes CLOCKWISE when M3 is called. Another one to work out

net x200-at-speed x200.at-speed.00 <= motion.spindle-at-speed

========

It turns out the X200 frequency range under ModBus is 0 to 4000 as it accepts values in increments of 0.1Hz so above at 12000 / 0.16666667 = 2000.00004 which the VFD reads as 200.000004Hz.

As for the direction issue I am workin on it :)

Cheers

Please Log in to join the conversation.

More
11 years 1 month ago #62087 by LearningLinuxCNC
That is what I get for trying to write HAL of the top of my rusty brain. Glad you were able to interpret what I meant. Not what I typed. :silly:

Please Log in to join the conversation.

More
11 years 1 month ago #62089 by racedirector
Replied by racedirector on topic Modbus Help - MB2HAL

NitroCH3NO2 wrote: That is what I get for trying to write HAL of the top of my rusty brain. Glad you were able to interpret what I meant. Not what I typed. :silly:

Hahaha, whats in your rusty brain far exceeds what I know about HAL. Thanks for the leg up!

Please Log in to join the conversation.

More
11 years 1 month ago #62093 by racedirector
Replied by racedirector on topic Modbus Help - MB2HAL
net x200-dir x200.direction.00 <= motion.spindle-reverse

I think I understand why this is so.....

motion.spindle-forward is an OUT BIT and when M3 is called, it goes TRUE or 1. When that was getting sent to my X200 VFD direction coil it was telling the VFD to run CCW as CCW = 1 and CW = 0. Using motion.spindle-reverse in the way I am using it, when M3 is called it goes to FALSE or 0 and the is correct for my VFD.

Truth be known no one else knows anyway as it is buried in my HAL file :)

Please Log in to join the conversation.

More
2 years 1 week ago #313144 by besriworld
Replied by besriworld on topic Modbus Help - MB2HAL
Hello, I am trying to read the spindle load using Modbus. It works fine with the Windows program, but with Linux and mb2hal, it does not. The problem occurs when I attempt to read address 420—it does not return any value, only increments the error counter. Some addresses can be read, but others cannot. What am I doing wrong?Here is the configuration, along with a screenshot of the working Windows setup.  

 

Attachment not found



 

Attachment not found



 

Attachment not found




ps now working!  i just changed this parameter MAX_UPDATE_RATE

Please Log in to join the conversation.

Time to create page: 0.049 seconds
Powered by Kunena Forum