Machsupport Forum

General CNC Chat => Show"N"Tell ( Your Machines) => Topic started by: Astroguy on June 18, 2011, 02:33:32 PM

Title: How to- USB powered LCD display of DRO`s
Post by: Astroguy on June 18, 2011, 02:33:32 PM
If anyone is interested here is how to have a remote DRO display using a USB powered LCD.
First buy a USB LCD driver kit from http://www.gravitech.us/sechlcddrbok1.html (http://www.gravitech.us/sechlcddrbok1.html)
And an LCD display http://www.gravitech.us/20chyelcdwib.html (http://www.gravitech.us/20chyelcdwib.html)
After making and testing  the kit go into windows divice manager and find out what port it is on, it will be listed under ports  and say USB serial port with the number.
Than go into Mach3 General config. setting and set the com port on the lower left corner and check Run Macropump box. See picture below.
Copy and paste the Macropump file attached here to the macro folder in Profile folder you are using.
All done, now you have a USB display of your DRO`s
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Hood on June 19, 2011, 03:51:38 AM
Looks great, thanks for sharing, I am sure a lot of people will like this.
Hood
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Tweakie.CNC on June 19, 2011, 05:47:33 AM
Nice work Astroguy.

This will make a very useful addition, thank you for posting the details.

Tweakie.
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Astroguy on June 19, 2011, 11:09:39 AM
I had a lot of help from member BR549, I could not have done it without his help.
It it very convenient to have the display at the machine when using a pendant and
now for less than $35 anyone can have one or build it into there pendant.
This is the original thread: http://www.machsupport.com/forum/index.php/topic,18702.0.html
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 01, 2011, 03:30:44 PM
Fred, thanks so much for posting this, I actually gave it a try and it works, but one question for you. The cursor is blinking on the "X" in the top left corner, is there a way to stop it from blinking?

Thanks for sharing your work and also to TP for helping sort it out with you.  ;)

Thanks,
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Astroguy on July 01, 2011, 10:13:26 PM
Fred, thanks so much for posting this, I actually gave it a try and it works, but one question for you. The cursor is blinking on the "X" in the top left corner, is there a way to stop it from blinking?

Thanks for sharing your work and also to TP for helping sort it out with you.  ;)

Thanks,
Dave


If you look in the manual for the for the LCD it lists the comands. I believe there is a way to do it but I am out of town right now, I will give it a try next week when I get back and let you know.

Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 03, 2011, 08:53:48 AM
Thanks, Fred, are you saying I have to add something to the macropump you uploaded, or is this something that is programmed into an application like "LCD Smartie" and that "shuts off the blinking cursor, and the LCD driver remembers that state?

Ran into another snag as well as I connected this to my actual machine PC, and when I "run macropump" on the General config screen, Mach doesn't function correctly. It will not go in and out of Reset and I can't control the jogging. Possibly it's getting crossed up with another plugin I'm using. Oh well, I'll have to play with this another time as I'm just swamped with work at this point  >:(

Thanks,
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Astroguy on July 05, 2011, 09:50:33 AM
I messed around with the blinking and could not get it to stop. I believe it is a Mach3 problem as it reruns the macro over and over. If you notice on the driver board the red led blinks when data is sent to the LCD, it`s blinking rate is the same as the blinking on the LCD so I believe it is caused by data refreshing. As far as the problem you are having with it resetting it may be a windows thing if you have something else conflicting with the port the LCD is using. Maybe someone Else with more experience can chime in here.



Thanks, Fred, are you saying I have to add something to the macropump you uploaded, or is this something that is programmed into an application like "LCD Smartie" and that "shuts off the blinking cursor, and the LCD driver remembers that state?

Ran into another snag as well as I connected this to my actual machine PC, and when I "run macropump" on the General config screen, Mach doesn't function correctly. It will not go in and out of Reset and I can't control the jogging. Possibly it's getting crossed up with another plugin I'm using. Oh well, I'll have to play with this another time as I'm just swamped with work at this point  >:(

Thanks,
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 05, 2011, 12:35:53 PM
Fred, as per the manual, you actually do program the cursor "style" through something like hyperterminal (what I used). This is retained in the eprom chip on the board that you built. You can also make your own boot up text as well. This thing is really pretty nifty, thanks for turning me on to it  :)  Now I just have to figure out why it's not happy with my machine PC.

Set cursor style:

- ?c[style]

- [style] is range from 0-3.

- A 0 configures are no cursor, a 2 as a non blinking cursor and a 1 or 3 as a blinking cursor.

Hope this helps you.
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Astroguy on July 06, 2011, 11:54:38 AM
Thanks for the info, I really have not had much time to  mess with it yet but it sounds like it has more possiblities than I thought. I hope more people jump onboard with it and see what they can come up with.

Fred


Fred, as per the manual, you actually do program the cursor "style" through something like hyperterminal (what I used). This is retained in the eprom chip on the board that you built. You can also make your own boot up text as well. This thing is really pretty nifty, thanks for turning me on to it  :)  Now I just have to figure out why it's not happy with my machine PC.

Set cursor style:

- ?c[style]

- [style] is range from 0-3.

- A 0 configures are no cursor, a 2 as a non blinking cursor and a 1 or 3 as a blinking cursor.

Hope this helps you.
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling 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
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 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
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling 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
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 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.  ::)


 
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling 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
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 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.
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling 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
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 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
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling 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
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Ya-Nvr-No 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.
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 07, 2011, 04:37:52 PM
So there must be variables in these versions because in version 3.042, it's real time.

Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: BR549 on July 07, 2011, 11:08:09 PM
HIYA GUYS, I see you found the glitches(;-) Yes Dave there are variables in the vesions that is why I stopped working with macros you could never really depend on them from version to version, machine to machine to work the same.

Really all you need to do is  send an LCD initialation string as Ian suggested in the Mach startup initiation string to make sure the cursor is turned off.

Because you are only blasting data down the tube so to speak the raw data seemed to work the best with spacing setting up the line wraps as holders.

We did that in the early days of MODIO and the LCD display.

It SHOULD be updating at the speed of the macropump loop. But sometimes the LOOP seems to get lost for a while(;-)

COnsidering the use of send serial on the USB port I was amased it worked at all.

(;-) TP
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 08, 2011, 04:55:29 AM
Hi Terry,

Thanks for your input as well, and confirming what we've seen.

Is there any way to get this macro (or the original of yours) to work on V3.039? I really like the way that version functions on my machine PC and I'm sure you can understand that if something works perfectly, don't "fix" it  ;)

Thanks,
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling on July 08, 2011, 05:34:47 AM
According to the downloads page the latest LOCKDOWN is R3.043.022 so that's really the latest anyone should be using if they want the best available stability.

I suspect the problems are related to the SendSerial command rather than the macropump per se but let's see. (I've had problems with SendSerial before - it really is rather p*ss poor  ;D

There's really no difference between Terry's earlier version and mine except mine attempts to split things into the three parts needed for (semi)minimal use of the serial line and the macropump. i.e. that which only needs to sent once only - the cursor off command cos that's stored by the card in EEPROM. That which needs to be sent once at the beginning of each Mach session - the display size and the X,Y,Z and A labels. And finally that which needs to be sent continually - i.e the actual changing values.

Terry's get's the positioning right by padding and using line-wrap wheras mine positions the cursor appropriately and then sends the DRO values.

Anyway - let's see if we can figure out if this is a macropump issue or a SendSerial issue.

If you're using my version then just replace the macropump code I posted above in reply #16 with this:

Code: [Select]
message _
"X: " & Format (Getdro(0) , "+000.0000;-000.0000") & " " & _
"Y: " & Format (Getdro(1) , "+000.0000;-000.0000") & " " & _
"Z: " & Format (Getdro(2) , "+000.0000;-000.0000") & " " & _
"A: " & Format (Getdro(3) , "+000.0000;-000.0000")


This will display the same DRO info on Mach's status bar instead of sending it down the serial pipe.

If that works - which it does for me on the latest LOCKDOWN then we'll cast our suspicious eyes back at SendSerial.

Cheers

Ian
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 08, 2011, 10:09:14 AM
Hi Ian,

No DRO info on the status bar with that macro. As for using the version that I've stuck with, even though everyone has told me in the past (including Brian and Art), "if the version you're using is working properly, then continue to use it", I still tried to upgrade at one point (because I heard it was more stable), and it wreaked havoc on my macros that I used since I set up Mach 3. I vowed not to do that again, lol!!

I'm half afraid to change anything as I'm just not as educated in this field as most of you and the last thing I want to do is have my machine down.

I'm sure I've already taken up a lot of your time, but can you briefly explain what changes in a Mach revision/version that makes one version suitable for some macros and not suitable for others? Of, course, now thinking about that stupid question, I guess if you knew the answer, you'd be able to map out a macro that would work correctly with version 3.039, right? lol!  :P  Sorry for sounding dumb...... I guess it's all in the coding of the program, yes?

Thanks again,
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Astroguy on July 08, 2011, 10:13:57 AM
I am having no problem with the original Macro after turning off the cursor, its works just fine on my XP and windows 7 machines. There are also 4 outputs you can turn off and on on this board but not sure what they can be used for using a Macro.
Also a custom splash screen can be programed as well. I am using Version R3.043.022
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 08, 2011, 10:18:10 AM
Hi Fred,

Just a note, I didn't have a problem with your macro either, it worked just fine on the later version of Mach. It just isn't working on my earlier (prefferred version V3.039).

Thanks for the info though.
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Astroguy on July 08, 2011, 10:36:03 AM
I see, this is the first time I have used a Marco and I always use the latest version of Mach so i did not realize that there was a compatibility issue with macros and different versions of Mach, I hope you get it sorted out.


Hi Fred,

Just a note, I didn't have a problem with your macro either, it worked just fine on the later version of Mach. It just isn't working on my earlier (prefferred version V3.039).

Thanks for the info though.
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling on July 08, 2011, 02:59:08 PM
Addressing all the posts from reply #24 onwards, all I can say is that both Terry's code and mine are both simply sending control strings down the serial port to the LCD hardware. Both are correct and SHOULD work as far as the LCD display hardware manual states.

Whether the macropump and the SendSerial command are actually doing what it says on the tin REGULARLY and RELIABLY is open to question. I think Terry is probably broadly correct in saying you just can't rely on either to behave as advertised.

I know when I built my own (programable) THC and software I had to work around SendSerial's faults and also when I wrote my probing routines I had to code around G31's faults - it's horses for courses I guess.

Ian
Title: Re: How to- USB powered LCD display of DRO`s
Post by: BR549 on July 10, 2011, 09:49:45 AM
Ian is correct in that the send serial is a crap shoot. I think the problem between machines and version has a lot to do with how the MACHINE handles VB and threading along with the overall processing speed of the threads.

I have a n older 1 gig MB that will take anything that mach can throw out and it works every time. I have a 2 gig MD that chokes machVB to death without adding wait states all over the code to slow it down. It gets completly out of sync and even stores code that pops up a few lines later down the program.

I think you might want to try a simple wait state between each line to allow the LCD to process each line before Mach throws everything at it at once.

I really can't believe that mach was developed without a simple  PROPER serial port control seeing as most of the older machines had serial control for the external devices. But it was developed for the simple HOBBY market not the commercial side. I could go on but I wont (;-)

Iit is what it is, and with time you can work it out to work on YOUR machine IF you have a sense of adventure. (;-) TP
Title: Re: How to- USB powered LCD display of DRO`s
Post by: BR549 on July 10, 2011, 10:31:00 AM
OK Dave what exactly is the macro doing or not doing  on your machine.

Please be specific, (;-) TP
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 11, 2011, 07:29:11 PM
Hi Terry,

When I have everything connected, with the macropump in the macro folder, and "run macropump at startup" checked in General Config, I start Mach 3, and what SHOULD happen is my RESET button should immediatley start flashing as normal. Instead, it just sits in the red "state" and when I click on ANY buttons, they do not do anything. Nothing at all, like it's completely frozen.

The minute I uncheck the "run macropump at startup", all works fine. Somehow, something isn't happy running with it or it's as you and Ian, said, somethings just not being transferred correctly.

I have a Shuttle Pro plugin, and a Pokeys plugin as well.

Thanks,
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling on July 12, 2011, 05:45:05 AM
Dave can you post your macropump.m1s please?

Ian
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 12, 2011, 11:30:10 AM
Hi Ian,

Sure, but it'll look very familiar ;o)

Thanks,
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling on July 12, 2011, 11:49:35 AM
arf - thanks Dave - sorry - thought you may have had other things in there as well.

OK - let's try a few thangs. First we'll test sendserial.

switch off your macropump. From what you said above - Mach should now work ok - yes?
open vb editor - paste macropump code - run code in editor - does it come out on your LCD? is Mach still OK?
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 12, 2011, 12:36:50 PM
No, no, I'm the one who's sorry for thinking that is all that would be in the Macropump. I guess there are many ways to use this and was just thinking you should be able to read my mind  ;)

I wanted to add some more details about the startup that I missed. The DROs do show up on the LCD screen and read exactly what are shown in the DRO's in Mach 3.

Quote
switch off your macropump. From what you said above - Mach should now work ok - yes?

Yes, correct.

Quote
open vb editor - paste macropump code - run code in editor - does it come out on your LCD? is Mach still OK?

Yes, it worked. As soon as I hit the "run script" (green arrow icon), the LCD screen updated to reflect exactly what was on the Mach 3 DROs

Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling on July 12, 2011, 01:17:32 PM
OK, so now save an empty macropump.m1s and turn the macropump back on - what happens?
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 12, 2011, 01:39:33 PM
After following your instructions With the macropump still unchecked in General Config: The DRO's in Mach still jog, but the LCD does not update to reflect those movements.

After that happened, I checked the run macropump in Gen Config and restarted and the same thing, no movement on any buttons or flashing reset.

So there's obviously some sort of "roadblock" or bottleneck that isn't allowing the macropump to work upon startup? Possibly try a simpler macropump example?

Thanks,
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling on July 12, 2011, 02:29:52 PM
Possibly try a simpler macropump example?

Can't think of a simpler one than an empty one  ;D

You did try the empty one yes?

Ian
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 12, 2011, 02:35:19 PM
I'm sorry, Ian, I thought you meant for me to save the script in from the "empty" VB Script Editor, instead of just loading the macro file into the actual folder ......duh....  :D

Now I saved an "empty" one and it loads up fine with the normal reset flashing and jogging works as well.

Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling on July 12, 2011, 03:32:57 PM
ok - so an empty macropump.m1s with the macropump switched on allows Mach to function.
Also, with the macropump switched off the sendserial command works from the vb editor.

so try this in the editor first.

Code: [Select]
message "hello"
You should see hello on the status line of Mach.

then if that worked try

Code: [Select]
message rnd(10)
in the macropump - you should see random numbers on Mach's status line.

Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 12, 2011, 03:42:43 PM
Yes, and yes, the random numbers just kept changing very rapidly in the status line. I was able to use Mach as normal, no issues.
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling on July 12, 2011, 04:59:14 PM
ok so now change your macropump code from

Code: [Select]
message rnd(10)
to

Code: [Select]
sendserial rnd(10)
You should see your LCD fill with constantly changing random numbers - yes?
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 12, 2011, 05:27:49 PM
Yes, the LCD screen is indeed filled with rapidly changing numbers,  BUT, now Mach is crawling and painfully slow. What I mean is, in the status bar, where it normally says Press Reset, it moves VERY VERY slow, as in it takes almost 30 seconds to scroll to the left one place. I can also load a Gcode fairly quickly but again, any actions like zeroing the DRO's is super slow. They also take about 30 seconds to zero after I hit the "zero" button. Rewind, regen all act the same way as well.

Dave

EDIT: I also tried different screen sets with no difference.
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling on July 13, 2011, 03:31:23 AM
I think we have an answer then Dave. The macropump works just fine, the sendserial command works just fine. Calling "message" 10 times/sec works fine BUT calling sendserial 10 times / sec is killing your system.

Just for fun try this in the macropump

Code: [Select]
cnt=getVar(1000)
if cnt=10 then
  setVar(1000, 0)
  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")
else
  setVar(1000, cnt+1)
end if

and then jog or run a part program

If this runs OK then it will update your LCD just ONCE a second instead of 10 times / sec. Not a lot of use to you perhaps but it should at least confirm the problem.
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 13, 2011, 10:53:13 AM
Yep, a bit better but still a little sluggish for sure. Thanks for all your help Ian, I guess you've helped me figure out here that version 3.039 is not very macropump friendly.

Guess I'll be looking to update my system to a newer version when I get some open time and can be sure it'll run smoothly.

Thank you (and everyone else) as always  :)
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: BR549 on July 13, 2011, 12:20:06 PM
Out of couriousity DAVE what computer specs are you running?

(;-) TP
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 13, 2011, 12:31:21 PM
Out of couriousity DAVE what computer specs are you running?

(;-) TP

Hi Terry,

It's an Intel MOBO with a P4 (800Mhz front side bus) and 1 gig RAM. Win XP sp2 with 32MB ATI Rage video card. This is for machine use only.

Thanks,
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: BR549 on July 13, 2011, 12:34:17 PM
IAN, What about IF we try to send the data stream out throught the Serial port using the serial modbus ?

I know Mach does not have a problem with that.

Also Henrik has developed a proper serial port useage with mach through an outside DLL. It allows you OPEN the port and then send recieve, then close the port when done.

I don't have the LCD display here so I can't help develope any solutions in real time. (;-(

Just some thoughts, (;-)TP
Title: Re: How to- USB powered LCD display of DRO`s
Post by: BR549 on July 13, 2011, 12:36:54 PM
Dave is that a 800mhz CPU ?

(;-) TP
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 13, 2011, 12:40:41 PM
Sorry, no, that's the front side bus, it's a 2.8Ghz
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling on July 14, 2011, 07:44:47 AM
IAN, What about IF we try to send the data stream out throught the Serial port using the serial modbus ?

I know Mach does not have a problem with that.
You'd need a modbus slave in there between Mach's "master" and the LCD hardware. I suppose we could write a "thin" modbus slave to run on the Mach machine and connect Mach to it via a virtual null modem and then connect the slaves output to the real serial port. Seems a bit overkill though.

Also Henrik has developed a proper serial port useage with mach through an outside DLL. It allows you OPEN the port and then send recieve, then close the port when done.
This sounds more like it - where is it?


I don't have the LCD display here so I can't help develope any solutions in real time. (;-(
If you have a spare PC and a null modem cable then you could send your data to hyperterm. Or again you could use hyperterm with a virtual null modem. A good (free) one that I use is http://com0com.sourceforge.net/ (http://com0com.sourceforge.net/)

Ian
Title: Re: How to- USB powered LCD display of DRO`s
Post by: BR549 on July 14, 2011, 04:49:29 PM
HIYA IAN, Here is the link to Henrik's page.

http://henriksplace.se/cnc/cnc_mach3_vb_serial.html

(;-) TP
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling on July 17, 2011, 04:42:50 AM
Thanks for the link Terry. Don't think it's going to help us in this particular case though.

Ian
Title: Re: How to- USB powered LCD display of DRO`s
Post by: BR549 on July 17, 2011, 08:18:58 PM
I find it hard to believe that the Routine ties up Daves cpu like it does I have a MUCH slow computer here that runs it fine. I wonder if his computer is a multi core cpu that is just running on the Single core kernal. I have seen that before. all the processes runing on just 1 core section. It was a slow puppy when loaded down.

Some of the major laptops had that problem for a while the Manf mistakenly loaded the single core kernal on the multicore systems.

Just a thought(;-) TP
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 18, 2011, 06:17:41 AM
No sir, pentium 4 is only single core. It's definitely the Mach 3 version that is making the difference, as the macros run perfectly when using the latest lockdown. I really don't think it's the PC at all.

Thanks again,
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: BR549 on July 18, 2011, 09:46:28 AM
OK i see you are on one of those in between versions(;-) I know it worked on the earlier versions and the lockdown and the lastest developement version. I never tried the V.039.

(;-) TP
Title: Re: How to- USB powered LCD display of DRO`s
Post by: BR549 on July 18, 2011, 09:48:52 AM
IAN Have you evr played with the EVENT driven serial funtion?? I think it may allow one to hold the serial port open ?? Not much info on the subject.

(;-) TP
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling on July 18, 2011, 01:01:48 PM
OK i see you are on one of those in between versions(;-) I know it worked on the earlier versions and the lockdown and the lastest developement version. I never tried the V.039.

Can we just confirm - are we talking 3.042.039 (April 8 2010) OR are we talking 3.039 (March 22 2008)?

If it's the latter then the change log might give us some clues. 3.039 was released on March 22 2008 but a few months later ...
Quote
Nov 12/2008
Release 3.042.018 This is the first release of the 3.042.********* series
-- Many small bug fxes
-- Pause LED fixed
-- VB was changed to be Multi threading
-- Threading fixed for lathe
-- Tangential lookahead for preping the head for the next cut improved


IAN Have you evr played with the EVENT driven serial funtion??

In other languages - yes a lot - can you point out which particular implementation you mean Terry please?

I think it may allow one to hold the serial port open ?? Not much info on the subject.

You may be right Terry but I'd be surprised if you can do what you suggest because one way or another you have to pass some sort of handle to the open port and have that handle remain alive over invocations and that's something you just can't do with Mach's CB (AFAIK). Hence us using the kludge of passing real numbers via gcode vars, - but sadly handles are not reals etc. etc.

Ian
Title: Re: How to- USB powered LCD display of DRO`s
Post by: BR549 on July 18, 2011, 04:04:23 PM
Hi Ian, The event driven serial is a special Mach function that uses the CB commands SendFIFO() and GetFIFOEntry(). It seems that the function stays active as long as the thread is alive.

You cannot use sendserial with the function though. Just the 2 mentioned ones.

People have used it to do serial tool changer setups. But there is VERY little info on the subject. Just a splash here and there.

Do  a search here on Event Driven Serial there are about 5-6 results and a couple from Art.

(;-) TP
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on July 18, 2011, 07:45:32 PM
The version I was refering to was 3.039.

Thanks,
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: BR549 on July 18, 2011, 09:17:28 PM
Hi Ian here is about all I can find on the subject with Mach. It was something Art whipped up for himself to use. I don't think it ever got truely finished though.

(;-) TP
Title: Re: How to- USB powered LCD display of DRO`s
Post by: stirling on July 19, 2011, 12:06:00 PM
Nice find Terry - had a quick play and it seems to work just fine as (not) advertised. It would be interesting to see if it is lean enough to get around Dave's problem. That said I'm still having a side bet on it being the pre-threaded CB version that's the main prob with 3.039.

Ian
Title: Re: How to- USB powered LCD display of DRO`s
Post by: BR549 on July 19, 2011, 02:15:50 PM
Yes I agree on Daves version it was around the time that VB multi threading was added in. I think his version is single threaded by the way it acts under CB load. That would explain a LOT.

Even on other versions I think the EDS will be better than sendserial.As I understand it it waits in the background for the end of line responce to receive and is always ready to send.

IF coupled to a brain it may reduce the total CB load to do the LCD updates.

It can ALSO run  with serial Modbus running.  

It should really HELP the older machines that had a serial based tool changer and may also be very helpfull to design a NEW serial based tool changer ??????

Just a thought(;-) TP
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on August 10, 2011, 03:32:01 PM
Just wanted to update all of you that helped (or that were interested), I finally ended up upgrading to V3.042.020 and the display works perfectly.

I normally did not use macropumps until using this display. Is it normal for Mach to slow down just a tiny bit when running macropumps?

What are some of the reasons you use macropumps?

Thanks as always-
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: BR549 on August 10, 2011, 05:58:02 PM
The Macro pump can be used as a monitor to monitor things and then do other things based on events. It runs as a continous loop so it is always on duty. Min update set at 10hzs. You have access to most Mach functions . The main flaw is no threading control and slow updates.

IT can be a very powerfull tool.

The brains WERE to improve the speed of the macropump by 100 fold and create a Ladder like logic  BUT as it turned out the update speed is the same basic speed as the macropump10hz and nowhere near as flexable as the original MP. Ladder type logic does fit some functions better though.

In a nut shell, (;-) TP

Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on August 10, 2011, 06:17:00 PM
Thank you, Terry, very interesting know-  :)

As always, I appreciate your knowledge and time-
Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Astroguy on August 10, 2011, 08:01:45 PM
I am glad people are getting some use from this idea but I would like to add something that I just found out. I first started this quest to have a display at the machine for when I used my pendant and and could not see the Mach screen, as it turned out when I try to use my Shuttle Pro with the display they do not play nice together. I have not tried it with any other pendant yet but my plans to use it with the Shuttle, sort of like a ghetto version of the ShuttleRU is not working out. I did buy a ShuttleRU and like it a lot but I could not resist the urge to tinker. If I could program a plug-in I am sure it would but that is way over my head. I hope someone smarter than me with continue the effort.

 ;D
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on August 10, 2011, 08:44:00 PM
What's not working with your Shuttle with the display? I used mine today and it worked just fine, macros and all. Not that you have me worried again!  :D

Are you using Scott Sheaffers Shuttle Pro plugin with the 10 macros available?

Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Astroguy on August 11, 2011, 09:39:40 AM
After looking into it a little deeper I discovered I had the wrong shuttle checked in the plugin but that did not help. When I have them both plugged in at the same time neither one will work, one at a time and its fine. now I am doing this on my test computer which is running windows 7 and I believe there is a conflict somewhere with the ports but have not had the time to explore it. Now that I have the ShuttleRU this has been on the back burner. I am using the latest plugin but what are the 10 macros you are talking about? Also I see in the config there are two custom macro boxes but there are no instructions on how to set it up and use it. Do you know how?


What's not working with your Shuttle with the display? I used mine today and it worked just fine, macros and all. Not that you have me worried again!  :D

Are you using Scott Sheaffers Shuttle Pro plugin with the 10 macros available?

Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on August 11, 2011, 10:22:47 AM
Actually there are now 10 macros, thanks to (Scott Schafer (poppabear and www.fusioncnc.com ))

I highly recommend reading these threads about the plugin so you can see the revisions it went through. May save some problems down the road.

Look here for the updated plugin file: http://www.machsupport.com/forum/index.php/topic,12163.10.html  Reply #11 has the file.

Here's where it all started (the updated shuttle macro): http://www.machsupport.com/forum/index.php/topic,1220.80.html

As for using the macros, you just put the macro number that's in your macros folder (just the number, no "m" is used) that you'd like to assign to a specific button, then select in the dropdown menu which macro, and you're good to go.

Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Astroguy on August 11, 2011, 07:02:07 PM
Thanks I will give it a try.

Fred



Actually there are now 10 macros, thanks to (Scott Schafer (poppabear and www.fusioncnc.com ))

I highly recommend reading these threads about the plugin so you can see the revisions it went through. May save some problems down the road.

Look here for the updated plugin file: http://www.machsupport.com/forum/index.php/topic,12163.10.html  Reply #11 has the file.

Here's where it all started (the updated shuttle macro): http://www.machsupport.com/forum/index.php/topic,1220.80.html

As for using the macros, you just put the macro number that's in your macros folder (just the number, no "m" is used) that you'd like to assign to a specific button, then select in the dropdown menu which macro, and you're good to go.

Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: jsmorrison55 on August 11, 2011, 10:29:50 PM
i get the same error every time. i don't get it, i followed all the instructions. hmmm.. maybe hardware issues?
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Astroguy on August 12, 2011, 03:11:33 PM
 ???
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Ya-Nvr-No on August 27, 2011, 04:08:49 PM
I tried the following macropump, works for me but it acts like when it is updating the display and I press the arrow keys at the same time the axis takes off and wont stop till I hit esc or the opposite arrow button. Thought I'd try it on a system with a pokey55 on it, I guess it could be the issue. Other than the crash I had, it worked fine, lol


cnt=getVar(1000)
if cnt=10 then
  setVar(1000, 0)
XV = " X: " & Format (Getdro(0) , "+000.0000;-000.0000") & "       "
YV = " Y: " & Format (Getdro(1) , "+000.0000;-000.0000") & "       "
ZV = " Z: " & Format (Getdro(2) , "+000.0000;-000.0000") & "       "
AV = " A: " & Format (Getdro(3) , "+000.0000;-000.0000") & "       "
MS = "?Y0?X0?G420?a"
 
SendSerial "" &MS &XV &YV &ZV &AV
else
  setVar(1000, cnt+1)
end if
Title: Re: How to- USB powered LCD display of DRO`s
Post by: budman68 on August 27, 2011, 05:47:47 PM
Just a note that my system uses the Pokeys as well and does work correctly.

Dave
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Ya-Nvr-No on August 27, 2011, 07:18:16 PM
I'm not sure what causes the issue then, but it does keep going after I release the arrow button. This new gantry router I am building has some real leverage, creates some real bangs. Guess I'll look at again later, too much to get done to scratch my head about it now.
Title: Re: How to- USB powered LCD display of DRO`s
Post by: cd_edwards on October 09, 2011, 12:34:34 PM
I wonder if the following would work. Price is right.

http://www.ebay.com/itm/20-4LCD-Display-Board-UART-Based-USB-Edition-II-/230681598221?pt=LH_DefaultDomain_0&hash=item35b5b1d90d (http://www.ebay.com/itm/20-4LCD-Display-Board-UART-Based-USB-Edition-II-/230681598221?pt=LH_DefaultDomain_0&hash=item35b5b1d90d)

Reads like it is very similar to the gravitech board. guess I'll just have to order one and check it out.
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Astroguy on October 14, 2011, 03:35:58 PM
It looks like it should work.
Title: Re: How to- USB powered LCD display of DRO`s
Post by: cd_edwards on November 02, 2011, 11:36:55 PM
I have to report that I could not get this particular  display working at all. Oh Well back to the drawing board. I ordered the gravitech board. The display I have should work with it.
Title: Re: How to- USB powered LCD display of DRO`s
Post by: lajoolaj on November 07, 2011, 05:54:59 AM
is it possible to have two displays 4x20 thought USB???
Title: Re: How to- USB powered LCD display of DRO`s
Post by: lajoolaj on November 07, 2011, 09:17:48 AM
on first i want have X,Y,Z,A
and on second Feed, Speed...
Title: Re: How to- USB powered LCD display of DRO`s
Post by: cd_edwards on November 07, 2011, 09:00:28 PM
get a larger display. 4x20 is the size of the gravitech unit. Should be able to have all of that on there as it is. The Sure Electronics display I could not get working. It requires something that I didn't get figured out. I ordered a gravitech unit to replace it. The command sequence for the gravitech and the LCD Smartie display's are totally differant.
Title: Re: How to- USB powered LCD display of DRO`s
Post by: cd_edwards on November 20, 2011, 02:56:08 PM

Here's what I've come up with in order to get rid of some latency issues. I found that the serial protocol used was quite slow and seemed to cause a slowdown in the screen update. I don't have a mill yet so I can't test it properly that way, but I've found the following macropump helps somewhat. Putting this screen update into it's own DLL plugin would be the ideal solution though. I've been looking for what other's have done regarding this, but it seems that only commercial ventures which will not share there code are available.


If getVar(1005) = 0 Then
   XV = Format (GetDro(0) , "+000.0000;-000.0000")
   YV = Format (GetDro(1) , "+000.0000;-000.0000")
   ZV = Format (GetDro(2) , "+000.0000;-000.0000")
   AV = Format (GetDro(3) , "+000.0000;-000.0000")
   SendSerial  "?c0?f?a?g"
   SendSerial  "?y0?x00 X: " &XV
   SendSerial  "?y1?x00 Y: " &YV
   SendSerial  "?y2?x00 Z: " &ZV
   SendSerial  "?y3?x00 A: " &AV
   setVar(1005, 1)
   setVar(1004, 0)
End If


If getVar(1004) = 10 Then
    setVar(1004, 0)
   
   if getVar(1000) <> Getdro(0) Then
      XV = Format (GetVar(1000) , "+000.0000;-000.0000")
      SendSerial "?x04?y0" &XV
      setVar(1000, Getdro(0))
   End If
   
   if getVar(1001) <> Getdro(1) Then
      YV = Format (GetVar(1001) , "+000.0000;-000.0000")
      SendSerial "?x04?y1" &YV
      setVar(1001, getDro(1))
   End if
   
   if getVaR(1002) <> Getdro(2) Then
      ZV = Format (GetVar(1002) , "+000.0000;-000.0000")
      SendSerial "?x04?y2" &ZV
      setVar(1002, getDro(2))
   End If
   
   if getVar(1003) <> Getdro(3) Then
      AV = Format (GetVar(1003) , "+000.0000;-000.0000")
      SendSerial "?x04?y3" &AV
      setVar(1003, getDro(3))
   End If
else
    setVar(1004, getVar(1004) + 1)
End If   
Title: Re: How to- USB powered LCD display of DRO`s
Post by: cd_edwards on November 21, 2011, 11:33:10 PM
If anyone is interested, I've been playing around at creating a plugin that will do basically what we want are doing with the script. It's working, but I don't have a config menu created for it so it's hardcoded for a particular comport  and is not very forgiving if you suddenly remove the device. If anyone is interested, I'll hardcode a comport into the device, say #10 and upload it to this thread for people to use. Eventually I might finish it.
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Ya-Nvr-No on November 22, 2011, 05:50:44 AM
Why not post the source and someone might just finish it for ya.
Title: Re: How to- USB powered LCD display of DRO`s
Post by: cd_edwards on November 22, 2011, 07:56:42 AM
Umm mainly because it's a hack and not very pretty. If someone had the capability to finish, I would assume they would have just wrote it.
Title: Re: How to- USB powered LCD display of DRO`s
Post by: cd_edwards on November 30, 2011, 10:29:02 PM
I've uploaded a version of my LCD DRO plugin to the plugins forum if anyone is interested. You will find it to be much faster than macropump.m1s. If anyone would like to see anything added, I've put my email address into the LCDDRo.txt file included with the plugin.
Title: Re: How to- USB powered LCD display of DRO`s
Post by: cd_edwards on December 04, 2011, 05:59:06 PM
I updated the LCD DRo plugin I wrote. The comport is NOT hardcoded, but you do have to manually edit the xml file using the XML reader. I still do not have working menu's. It seems it's easy to crash Mach3 when adding menus. Anyways, it's over in the plugin's forum
Title: Re: How to- USB powered LCD display of DRO`s
Post by: danmega on January 13, 2012, 11:18:52 AM
Can I use a DB25 cable to with this lcd setup? reason being is I have a 30' run. I don't see many 50' usb cable around.

Title: Re: How to- USB powered LCD display of DRO`s
Post by: cd_edwards on January 13, 2012, 08:49:24 PM
I think there's a serial version of the gravitech board. As for the USB, it's just a USB-> serial conversion. I really need to upload a new version of the plugin next couple of days.
Title: Re: How to- USB powered LCD display of DRO`s
Post by: lajoolaj on February 17, 2012, 04:49:57 PM
hello, i have a little promblem. i am trying to configure my gravitech lcd trought macropumb. here is code that i am using.

cnt=getVar(1000)
if cnt=10 then
  setVar(1000, 0)
  SendSerial _
  "?x00?y0" & "S " + Format (Getdro(17) , "0000.00") + "    " & _
  "?x00?y1" & "F " + Format (Getdro(18) , "0000.00") & _
  "?x00?y3" & "T " + Format (Getdro(24) , "0000") & _
  "?x00?y2" & "C " + Format (Getdro(14) , "00:00:00")
else
  setVar(1000, cnt+1)
end if

spindle speed, feedrate and tool number is working fine. but i have problem with elapsed time. on lcd is always "00:00:00". i try to write code without 00:00:00 but then is on lcd only "0".

sorry for my bad english
Title: Re: How to- USB powered LCD display of DRO`s
Post by: docrawfo on March 04, 2012, 07:03:57 PM
I got the kit and display from Gravetech and it is all put together.  It works great using a hyperterminal program.  It is set up on Com 5 on my PC.  I have installed the PlugIn and have started Mach3 and enabled the PlugIn and restarted Mach3. After shutting down, I changed the ComPort from -1 to -5 in the XML file with the Artsoft XML reader.  When I run Mach3 again, nothing happens on the display.  I shut down Mach3 and go back to the XML file and it is back to -1.  Please help!

Don
Title: Re: How to- USB powered LCD display of DRO`s
Post by: Wortex_SVK on April 10, 2018, 02:41:09 AM
Hello is there anyone who try this solution for Mach3 R2.42 and Win7?