Welcome, Guest. Please login or register.
Did you miss your activation email?
September 22, 2018, 08:55:20 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  LCD and Macropump help needed
Pages: 1   Go Down
Print
Author Topic: LCD and Macropump help needed  (Read 1213 times)
0 Members and 1 Guest are viewing this topic.
perplexed
Active Member

Offline Offline

Posts: 3


View Profile
« on: November 16, 2017, 11:46:52 PM »

Hi all, I am new to the forums and hoping to gain some help in relation to displaying data on a 20x4 LCD using macropump.

I agreed to help a friend add additional information to the LCD to make working safer...Mach 3 is running on one PC and the LCD is on the front panel of a slave machine above the mill at the other end of the workstation.

At present we can get the X, Y, Z, and A position data to show on the LCD, as well as measurement units (mm or inches), and whether EStop is triggered or the machine is in Run mode (see attached pic).

We have placeholders (SwR1 and SwR2) which we would like to populate with the following information:

SwR1 - which axis is currently selected in jog mode e.g. X, Y, Z, A
SwR2 - the jog increment e.g. 10mm, 1mm, 0.1mm etc

I have attached the macropump code.

I note from searching the forums that others have been directed to Peter Homann's code for the DIY pendant...I have looked through this and tried to get it working by using relevant parts to no avail.  The attached code is also based on the DIY pendant code.

If someone could please either write some code to get the information to display as needed, or give a thorough explanation that will help I would be grateful...I have been pulling my hair out for nearly 2 weeks now trying various options and believe it is something simple I'm missing but just cannot crack it.  I have a project I am working on that until we sort this I cannot proceed with as it is both a safety issue and will definitely speed working up.

Thanks in advance!
Hopefully perplexed not much longer!!

* Macropump_perplexed.m1s (4.29 KB - downloaded 90 times.)

* LCD current_perplexed.jpg (734.77 KB, 3264x2448 - viewed 160 times.)
Logged
Peter Homann
ModIO Adviser
Active Member

Offline Offline

Posts: 500




View Profile WWW
« Reply #1 on: November 17, 2017, 05:38:35 PM »

Hi,

A couple of things that might help.

1. Run the Macropump and single step through it, checking what is going on.
2. Remove the iCount For Loop for creating the string for the end of the Macropump. Just create the 4 lines as separate statements.

Doing the above should find the problem.

Cheers,

Peter

Logged

----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com
Peter Homann
ModIO Adviser
Active Member

Offline Offline

Posts: 500




View Profile WWW
« Reply #2 on: November 17, 2017, 05:46:05 PM »

My guess is that the error is with these 2 lines.

Code:
If getOEMLED (16) Then strMode (1) ="  Program " Else strMode (1)  =" SwR1 " 'coord sys Extra Space
If GetOEMLED (83) Then strMode (2) ="     " Else strMode (2) = " SwR2  "

You need to remove the quotes from SwR1 and SwR2

Try

My guess is that the error is with these 2 lines.

Code:
If getOEMLED (16) Then strMode (1) ="  Program " Else strMode (1)    = SwR1  'coord sys Extra Space
If GetOEMLED (83) Then strMode (2) ="     " Else strMode (2) = SwR2

Cheers,

Peter
Logged

----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com
Peter Homann
ModIO Adviser
Active Member

Offline Offline

Posts: 500




View Profile WWW
« Reply #3 on: November 17, 2017, 05:47:41 PM »


My guess is that the error is with these 2 lines.

Code:
If getOEMLED (16) Then strMode (1) ="  Program " Else strMode (1)  =" SwR1 " 'coord sys Extra Space
If GetOEMLED (83) Then strMode (2) ="     " Else strMode (2) = " SwR2  "

You need to remove the quotes from SwR1 and SwR2

Try


Code:
If getOEMLED (16) Then strMode (1) ="  Program " Else strMode (1)    = SwR1  'coord sys Extra Space
If GetOEMLED (83) Then strMode (2) ="     " Else strMode (2) = SwR2

Cheers,

Peter
Logged

----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com
perplexed
Active Member

Offline Offline

Posts: 3


View Profile
« Reply #4 on: November 17, 2017, 06:11:22 PM »

Hi Peter,

Thanks for your input. I'll give your suggestions a go and see what happens. Just a note regarding removing " " around SwR1 and SwR2...I have done this previously but that didn't seem to solve the problem. Hopefully as you suggest stepping through line by line will indicate where I've gone wrong and removing the icount loop in favour of separate statements will also help.

Will post my findings soon.

Cheers
Denyse
Logged
perplexed
Active Member

Offline Offline

Posts: 3


View Profile
« Reply #5 on: November 17, 2017, 08:23:01 PM »

Hi again Peter,

I tried all your suggestions.

1. Stepping through line by line didn't highlight the issue;
2. Removing " " from around SwR1 and SwR2 DID show a value as defined in the macro. These were previously integers so overlooked in the display output string. I have now redefined as strings & can get them both to display as needed.
3. The above was highlighted more by removing the icount loop and running as separate statements as suggested. To test I ran either SwR1 or SwR2 without any other info being displayed then have combined to display all required info once I knew each was working separately.  Now I just have to hard code the formatting.

Thanks so much for your help. I knew I wasn't far off but just needed a little pointer. My resulting code is currently in no way elegant but it works!

Thanks again  Smiley

Cheers
Denyse
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!