Hello Guest it is March 29, 2024, 08:53:15 AM

Author Topic: How to- USB powered LCD display of DRO`s  (Read 73208 times)

0 Members and 1 Guest are viewing this topic.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: How to- USB powered LCD display of DRO`s
« Reply #10 on: July 07, 2011, 07:11:51 AM »
Don't have one of these (yet) but I'd be interested if one of you could try this: Open the vb editor in Mach and enter:

SendSerial "?c0"

and run it. No need to save the file as this needs only be run once and should set the cursor off and as Dave said, it'll store it in EEPROM.

Then enter this in the VB editor and run it and save it as M???.m1s (choose a free number). This macro should then be named in Mach's initialization string on the general config page so that it's run at the start of each Mach session.      

SendSerial "?G420?f?x00?y0X:?x00?y1Y:?x00?y2Z:?x00?y3A:"

This will set the display to 4x20, clear the screen and display the labels for X:Y:Z: and A:

Then put the following in the macropump.

SendSerial _
"?x03?y0" & Format (Getdro(0) , "+000.0000;-000.0000")" &_
"?x03?y1" & Format (Getdro(1) , "+000.0000;-000.0000")" &_
"?x03?y2" & Format (Getdro(2) , "+000.0000;-000.0000")" &_
"?x03?y3" & Format (Getdro(3) , "+000.0000;-000.0000")"

This should send the DRO values positioned at the right places without the need to continually send the labels and all those padding spaces at the end.

This should reduce the load on the macropump a tad by not sending unneccessary info every time.

Like I say - I don't have one of these to try it out so the above may or may not work.

Cheers

Ian
« Last Edit: July 07, 2011, 07:16:30 AM by stirling »

Offline budman68

*
  • *
  •  2,352 2,352
    • View Profile
Re: How to- USB powered LCD display of DRO`s
« Reply #11 on: July 07, 2011, 10:47:56 AM »
Hi, Ian,

Just (for me) to understand a little better, are you saying that while Mach is open, I can program to the LCD device directly through the VB Script Editor? I do not need to use Hyperterminal at all then?

Thanks so much for your input on this  :)
Dave
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: How to- USB powered LCD display of DRO`s
« Reply #12 on: July 07, 2011, 11:00:25 AM »
Hi Dave - Should be able to yes. I do it all the time with another piece of serial hardware.

Ian

Offline budman68

*
  • *
  •  2,352 2,352
    • View Profile
Re: How to- USB powered LCD display of DRO`s
« Reply #13 on: July 07, 2011, 11:13:03 AM »
Hi, Ian,

Tried it on my "design" PC and the script editor had no affect with SendSerial "?c0", possibly this is due to using a serial to USB converter?

Thanks,
Dave

EDIT, Ian, in the init string, do I put the M in for macro, or just the number I save it as? I'm getting a compiling/syntax error when starting up mach and it says there's an error in the Macro. Also, do I seperate with a comma in the init string?

Ok, something weird is happening here. I have my design system as a dual boot system with XP and Win 7. In Win 7, the original macro that Fred has worked fine, but now I just tested it in XP, and it does not work (just like my machine PC!). So something is going on between the 2 operating systems and for some reaso, it's not working in XP.

Fred, are you running XP or Win 7?

Nevermind, I think I see what's up, I'm running V3.039 on XP and 3.042 on Win 7.  ::)


 
« Last Edit: July 07, 2011, 11:40:49 AM by budman68 »
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: How to- USB powered LCD display of DRO`s
« Reply #14 on: July 07, 2011, 11:40:03 AM »
Tried it on my "design" PC and the script editor had no affect with SendSerial "?c0", possibly this is due to using a serial to USB converter?
Hmmmmm - shouldn't be.... try just sending "hello" or similar - what happens then? (You are pressing the VB editor run arrow yes? sorry - just checking.

EDIT, Ian, in the init string, do I put the M in for macro, or just the number I save it as? I'm getting a compiling/syntax error when starting up mach and it says there's an error in the Macro. Also, do I seperate with a comma in the init string?
say you saved it as M666.m1s then you'd just put M666 in the init string separated from whatever else is there by a space - no comma. Sounds like Mach is complaining about the syntax of the content of the macro though. Run it in the editor first to check for syntax errors - single step if needs be.

Ian

Offline budman68

*
  • *
  •  2,352 2,352
    • View Profile
Re: How to- USB powered LCD display of DRO`s
« Reply #15 on: July 07, 2011, 11:47:52 AM »
Hi Ian,

Ok, now running it in 3.042 version and yes, your direct VB Script editing works correctly for the most part, BUT (always a but, right?). All I show on the LCD screen is:

X:
Y:
Z:
A:

If I jog, nothing happens (the DRO's do not count up or down as there are no number (DRO) characters at all.
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: How to- USB powered LCD display of DRO`s
« Reply #16 on: July 07, 2011, 12:08:27 PM »
my mistake in the macropump code - try this:

Code: [Select]
SendSerial _
"?x03?y0" & Format (Getdro(0) , "+000.0000;-000.0000") & _
"?x03?y1" & Format (Getdro(1) , "+000.0000;-000.0000") & _
"?x03?y2" & Format (Getdro(2) , "+000.0000;-000.0000") & _
"?x03?y3" & Format (Getdro(3) , "+000.0000;-000.0000")
Ian

Offline budman68

*
  • *
  •  2,352 2,352
    • View Profile
Re: How to- USB powered LCD display of DRO`s
« Reply #17 on: July 07, 2011, 12:17:09 PM »
....and there it is!! You guys with your VB/CB Script knowledge, kill me. Thanks so much, Ian, I appreciate your time, my friend.  ;)

Now I just have to try up-versioning my machine PC to 3.042, and see if there are any issues with running that version.

Thanks again,
Dave
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: How to- USB powered LCD display of DRO`s
« Reply #18 on: July 07, 2011, 04:00:52 PM »
Thanks for trying it Dave. Terry et al did a good job but I just wondered if it could be optimized for your macropump issues.

Ian
Re: How to- USB powered LCD display of DRO`s
« Reply #19 on: July 07, 2011, 04:34:07 PM »
Using Version R3.043.038
I get a message "Contact Brian BUFFER ERROR"
about every few minutes after running it.
Wish it was a real time display, while jogging it waits till I stop before updating LCD.