586,058 active members*
3,602 visitors online*
Register for free
Login
Page 1 of 3 123
Results 1 to 20 of 44
  1. #1
    Join Date
    Oct 2005
    Posts
    1145

    UCcnc and Modbus (;-)

    Hi Guys UCcnc now has Modbus in 3 flavors TCP , RTU and ASCII . There is still more testing to do but it does read and write. Balazs created a nice simple USER interface and created new macro calls to support it.

    (;-) TP

  2. #2
    Join Date
    Sep 2005
    Posts
    287

    Re: UCcnc and Modbus (;-)

    Wonderful, UCcnc is certainly moving along. And the ASCII will be great for talking to a Hypertherm.

    Any speed specs like how fast it can read/write bytes.

    When I was writing a serial com plugin the packet receiving/sending would have been done once every 1/25 th second in the "loop" part of the plugin. Does the modbus implementation do anything like that. I think in Mach3 Modbus ran from brains which were 10 times/sec.

    Keith.

  3. #3
    Join Date
    Apr 2014
    Posts
    215

    Re: UCcnc and Modbus (;-)

    I've been starting to get into plugin writing, I won't say its easy, but once you get your head around it wow (must admit that someone kindly provided me with some of their sourcecode to look at how they did it).

    The dropdown box has got me a little though! .... trying to share the button list between various dropdowns for a contour shuttle (Pro + xpress) plugin... I'll get there, more about learning.

    Rob

  4. #4
    Join Date
    Oct 2005
    Posts
    1145

    Re: UCcnc and Modbus (;-)

    From A nonprogrammers standpoint it is all a beast to do . I am not a programmer BUT I am a fair replicator cut and paste man (;-). Once I see an example I can expand on what is there to a point. Then above that I get lost in the logic.

    For the plugins and macros I do I have a model set of code that I can work with. From there I can expand and contract what it does based on the model. THAT is about the best I can do with it.

    For USER Gcode side Macros hopefully in the future UCcnc will create a set of wrapper function codes that will make Macros simplier for users similar to how macros worked in Mach3.

    Seeing how UCcnc does NOT do conditional Gcode it is needed . IF UCcnc did conditional Gcode then it would NOT be needed.

    For example NOW it takes this to read a dro
    double Xdro = convert.ToDouble (AS3.Getfieldvalue(226) );
    OR
    double Xdro = AS3.Getfieldvaluedouble(226) ;

    and everything is case sensitive. One simple mistake with case and nothing works and you will NOT know why it does not work.

    But IF it was done this way double Xpos = GetDro(226) it would be much easier for the Users Also the GetDro() would automatically cast the Value as a double. As is teh DRO value is read as a string and you HAVE to convert it to double even to write it right the value BACK to the dro.


    (;-) TP

  5. #5
    Join Date
    Apr 2014
    Posts
    215

    Re: UCcnc and Modbus (;-)

    TP, I know exactly what you're getting at.

    For me, I write my macro, sometimes I test as I go, but other times I will write it all (or copy and past), then comment it out in chunks (using /* */ ) and add in G04 pause delays with text adjacent in order to find where my errors are.

    That I find can be very quick to isolate errors and correct them.

    Having a look at the modbus it looks very good, complete with its own comprehensive manual (11 pages), (didn't see any "TBA" or "TBD" comments .... like I see on others with development solutions)..... just need something with modbus now.... I never used modbus with Mach3 as the loop was 10hz, and didn't see it as particularly fast for my needs.

    The loop is adjustable from 20mSec (50hz) to 10000000mSec (166.66 mins) ..... yes I did check the range.... but no I've not tested it sorry.

    The guys at CNC Motion do need a pat on the back for the way its been implemented so fast complete with documentation (although still in testing).

    Rob

  6. #6
    Join Date
    Apr 2014
    Posts
    215

    Re: UCcnc and Modbus (;-)

    Sorry bit off topic.... has anyone tried installing UCCNC in another folder, and running macros from that second folder.... I think its a bug that it only likes the default c:\uccnc\ folder path, but I'd like someone else to install it (or a second copy) somewhere else just to check.

    It may be me, thanks,

    Rob

  7. #7
    Join Date
    Jun 2015
    Posts
    943

    Re: UCcnc and Modbus (;-)

    I have 2 instances installed, one in C:\UCCNC\ and one in C:\UCCNC2\
    I install development versions in /UCCNC2 folder while keeping the version which runs my machine daily in the /UCCNC folder.
    The 2 installs work together without issues for me, they do not seem to bother eachother.

  8. #8
    Join Date
    Apr 2014
    Posts
    215

    Re: UCcnc and Modbus (;-)

    OlfCNC,

    Thanks for the reply, but do the macros and custom M-codes run fine?

    I created some custom macros that ran fine in c:\uccnc\, but in my other install for the dev. version, they did not run (dispite being in the folder) other than that both versions of uccnc rn fine, it was just the customised macros that did not work in both for some reason.

    Thanks again,

    Rob

  9. #9
    Join Date
    Jun 2015
    Posts
    943

    Re: UCcnc and Modbus (;-)

    Can you post one of those macros here? So I will try to run it on my PC in the /UCCNC2/ folder to see if it works or not.

  10. #10
    Join Date
    Sep 2005
    Posts
    287

    Re: UCcnc and Modbus (;-)

    Quote Originally Posted by robertspark View Post
    The loop is adjustable from 20mSec (50hz) to 10000000mSec (166.66 mins) ..... yes I did check the range.... but no I've not tested it sorry.

    Rob
    Thanks very much Rob.

    About the plugin programming I also find it quite hard but am getting there. Everything has been hard gained and it takes time. I don't think I'm wired for programming based on how much effort I have to put into it. I'm also finding it may just be best to start learning C# from scratch because there's quite a few things can get overlooked with my current monkey see monkey do approach. I pick up bits and pieces as I go but you can spend a fair bit of time looking for one bit of info. My base is C but C# and its' OOP basis is a whole different ball game to say the least.

    I've tried several IDEs but have settled on Visual Studio Community 2015. I love its' error indication. I'll sometimes test chunks of code in a "Console Application" and single step through the code to verify I get what I'm expecting in a console window. At the moment I don't know how to single step through UCcnc plugin code because it's a "Class Application" I think and you can't single step through those. Plus you've got the all the UCcnc macro commands which would need UCcnc running IF there was a way to single step through the code. So it does seem more like a case of write the whole lot and HOPE it works.

    I just stick most of my code in the 25hz loop but for bits that need to go outside the loop I've found I can sometimes get the squiggly red line underneath. One example is getting a DRO value. It would work inside the loop but not outside of it.

    Keith.

  11. #11
    Join Date
    Oct 2005
    Posts
    1145

    Re: UCcnc and Modbus (;-)

    HIYA Keith are you talking about using UCcnc functions inside of teh plugin enviroment ? If so the you have to qualify the function as

    AS3.Getfieldvaluedouble(226) UCcnc macro
    UC.Getfieldvaluedouble(226) ; UCcnc plugin

    (;-) TP

  12. #12
    Join Date
    Apr 2014
    Posts
    215
    Keith, thanks very much for the insight,

    I am working my way through isbn 978-81-265-5969-5 at present whilst attempting a contour Shuttle Xpress plugin (which will extend to the pro too).

    Ive always struggled with programming but am self taught, I find that there is a mountain of c or CPP about, and can work my way through them, but c# has required learning the nomenclature and starting a bit from scratch.

    An example is bit masks, because I'm working with direct usb hid input or access, I'm using a usbhid library to gain access to the button presses, then am either looking to use enumeration or a switch statement to translate the button presses into uccnc button presses. It's fun but frustrating, but visual studio is now starting to click at its ease of writing and options to semicomplete, plus the use of Google for examples to work my way through I once I've figured out the nomenclature of what exactly I'm looking for as I found msdn c# standard classes confusing at first, but they are starting to click.

    Would be nice if there was a standard way to access usb hid, as I can see some m3 converts wanting to use Pokeys u57 usb consoles being linked to uccnc. Plus more of the current mpg plugin examples provided by cnc motion (I asked for their whb04 mpg but it wasn't forthcoming). I guess the standard options for interface to consoles and mpgs will be usb or Ethernet given modbus has now been sorted via the likes to Pokeys, arduino and other similar development type devices.

    All fun stuff.

    Im using vs com 2013, mainly because can't seem to get 2015 to install right on a w7 laptop for some error or a missing file or compatibility.


    Rob

  13. #13
    Join Date
    Sep 2005
    Posts
    287

    Re: UCcnc and Modbus (;-)

    Quote Originally Posted by vmax549 View Post
    HIYA Keith are you talking about using UCcnc functions inside of teh plugin enviroment ? If so the you have to qualify the function as

    AS3.Getfieldvaluedouble(226) UCcnc macro
    UC.Getfieldvaluedouble(226) ; UCcnc plugin

    (;-) TP
    Doing exactly that Terry, although some time ago I did get caught out prefixing with "AS3." in a plugin.

    What I mean is I could use UC.Getfieldvaluedouble(226) ; in the plugin loop and all is fine. However if I used it outside the loop and in the main body of the class the dreaded red squiggly line would appear underneath. Forget what error message came with that.

    The C# syntax is very similar to C but that's where it seems to end LOL.

    Rob,

    I know what you mean about installing Visual Studio. Doesn't seem to take much for things to go wonky. It takes forever to install too.

    Keith.

  14. #14
    Join Date
    Oct 2005
    Posts
    1145

    Re: UCcnc and Modbus (;-)

    I use Sharp Develop for C# (;-)

    I also have Visual Studio 2010 Express which is a very small install and works about teh same as SharpDevelope.

    (;-) TP

  15. #15
    Join Date
    Jun 2015
    Posts
    943

    Re: UCcnc and Modbus (;-)

    What modbus devices are you guys using?
    Are there any good modbus boards available out there with general purpose I/Os which does not costs an arm and a leg?

  16. #16
    Join Date
    Apr 2014
    Posts
    215
    Quote Originally Posted by OlfCNC View Post
    What modbus devices are you guys using?
    Are there any good modbus boards available out there with general purpose I/Os which does not costs an arm and a leg?
    You could run an arduino (or one of the many variants) very cheap

    These are a well known solution :
    http://www.homanndesigns.com/index.php?main_page=index&cPath=54_2

    And there is the option of direct comms with spindle vfds and setup of hyperthem 65, 85 and 105's too

    Rob

  17. #17
    Join Date
    Sep 2005
    Posts
    287

    Re: UCcnc and Modbus (;-)

    Quote Originally Posted by robertspark View Post
    These are a well known solution :
    http://www.homanndesigns.com/index.p...dex&cPath=54_2
    Rob
    I'm wondering if Pete has stopped selling that one. Seems for the last couple of years, "sold out" has been the status of that board.

    Keith.

  18. #18
    Join Date
    Apr 2014
    Posts
    215
    Quote Originally Posted by Beefy View Post
    I'm wondering if Pete has stopped selling that one. Seems for the last couple of years, "sold out" has been the status of that board.

    Keith.
    Oops, didn't know.

    This one is interesting... https://www.machsupport.com/forum/index.php?topic=21105.0

    Rob

  19. #19
    Join Date
    Sep 2005
    Posts
    287

    Re: UCcnc and Modbus (;-)

    Maybe Pete can get them made up on and "as ordered" basis, no idea.

    A couple of years ago I managed to get Mach3 / Brains modbus talking to an Arduino, but can't remember if that was the library I used. I know there's several libraries out there. But then Terry was the one got me to notice UCcnc and away from Mach3 I went.

    Keith.

  20. #20
    Join Date
    Oct 2005
    Posts
    1145

    Re: UCcnc and Modbus (;-)

    HIYA KEITH , I am HAPPY(;-) to say you can NOW get back to work with MODBUS and UCcnc. They have added a couple of more functions for modbus. 1 is a function to be able to write a string to an LCD display . That process takes speciall formating of the string to do easy. UCcnc created a function that can convert a string "X: 12.3456 " x 20 charectors into teh format needed to send to a modbus LCD display 1,2,3,4 lines or multiple units such as 2 20x4 displays or more.

    A new Hand pendant is already in planing MY WAY (;-) Currently I have a couple of MODIOs left over from teh Mach3 days (;-) 1 has the 20x4 display on it. I have been sending messages to it in testing over that last couple of days. AND have pushbuttons turning on UCcnc functions and turning ON relays from teh ModIO outputs.

    Teh next thing is to tackle ASCII in modbus and talk to a Hypertherm PM plasma unit. ASCII modbus is a whole different critter from RTU. It talks with a strange accent (;-).

    (;-) TP

    (;-) TP

Page 1 of 3 123

Similar Threads

  1. UCCNC and Mach3 Modbus MPG?
    By Signal9 in forum UCCNC Control Software
    Replies: 5
    Last Post: 09-19-2015, 07:42 PM
  2. Need help with ModBus
    By jharvey407 in forum Mach Software (ArtSoft software)
    Replies: 8
    Last Post: 03-22-2015, 06:51 PM
  3. Trying to find Modbus commands for Modbus access in VB scripts
    By JoeKumanchik in forum Screen Layouts, Post Processors & Misc
    Replies: 3
    Last Post: 10-30-2014, 05:54 PM
  4. modbus tcp
    By fishin_fl in forum Spindles / VFD
    Replies: 0
    Last Post: 08-24-2013, 03:37 AM
  5. MODBUS
    By cncbpt in forum Screen Layouts, Post Processors & Misc
    Replies: 1
    Last Post: 02-07-2013, 06:24 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •