Hello Guest it is April 25, 2024, 05:37:14 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Kisssys

Pages: 1 2 »
1
Brains Development / Re: Update DRO from Modbus
« on: March 26, 2009, 08:46:31 PM »
Thanks Poppabear

2
Brains Development / Small change
« on: March 26, 2009, 07:42:20 PM »
I have been using the brain and script that was discussed in this thread for quite a while with great success and would like to make a small improvement but can't seem to make it work.

To refresh everyones memory quickly, I take the output of a graphics tablet into a modbus controller.  I use the data points to create a simple plasma cut file.

Everything works great but I'd like to activate the script mentioned above by a button press on the graphics controller instead of a mouse click or keyboard entry.

I modified the brain to look at another button and then "1034- Execute Button Script"  which of course doesn't do what I want or I wouldn't be posting this.  I'm confused how Mach3 stores button scripts and how to call any one individually without pressing the button with the mouse.  When I use the button editor, no matter which button I select on any page, even though the code is obviously different the file name is always "hiddenscript.m1s".

Can Poppabear or someone lead me in the right direction as how to do this.

I really appreciate the help I've gotten in the past and hope to save some time figuring this out.

Thanks
Kisssys

3
Brains Development / Re: Update DRO from Modbus
« on: October 28, 2008, 06:50:50 PM »
   

While getUserLed(1200)
Wend             'wait here for the "tablet.brn" to see I've pressed the button on the tablet
 
 
Do While Not GetUserLed(1200)   'wait a while here so we don't log more than one point

 count = count + 1      'increment delay counter
 
If count > 20000 Then
  Exit Do
End If
Loop

Replace that with
//////////////////////////////////////////////////////////////////////////////
While getUserLed(1200)
Sleep 1
Wend             'wait here for the "tablet.brn" to see I've pressed the button on the tablet

Sleep 300

That gets it to work on all 3 computers and I'm functional.  Little confused at times on the Get and SetUserLed function and how it works.  I was at times unable to NOT the function and reverse the action.  I'm working now so I'll get on with my project.  I thought the hard part would be building the Modbus board.

I looked at Mach Script docs that I have and did not see a Waitforsignal() function but I always seem to have to dig to find what I want.

Thanks for the help everyone, I'm more apt to create code like this if I know someone can bail me out

When I get time I'll add a couple of analog channels,encoder input and 8 switch inputs to the board and I'll see how well that works.  I bought a couple of RS-485 chips and when time permits I might convert my pendant to modbus instead of Keygrabber and put them on RS-485.

Kisssys

4
Brains Development / Re: Update DRO from Modbus
« on: October 27, 2008, 08:43:19 PM »
Well I thought I was ready to go out to the shop and run some tests with my plasma cutter and the code locks up at a point I'm waiting for a button press
from the graphics tablet.

The code was written on my laptop and works fine and it works on my other computer in the office all of which I would suspect running Mach3 might have an issue but
it dies on the plain old generic dell 1gig in the garage.   It locks the computer up so tight I have to hold the off switch to shut it down.  When I view the brain tablet.brn
it is reading correctly, it opens the file and as soon as I go into the code

While getUserLed(1200)
Wend             'wait here for the "tablet.brn" to see I've pressed the button on the tablet

it locks up.  I'm sure your not used to seeing something like that but its common in embedded controllers to wait for something to happen this way. 
Once it locks up I can't go look at anything to see what's going on so kinda at a loss.  I'm going to start all over in the garage with just those 2 lines of code but don't have time for a while and I was wondering if anyone has seen a script or brain act up like this.  I guess I can move my cutter into the living room

Any ideas
Kisssys

5
Brains Development / Re: Update DRO from Modbus
« on: October 21, 2008, 05:24:38 PM »
I would be glad to keep you posted on the progress.  Modbus is a pretty simple once you get the CRC code working.  It's as easy to do RS-485 as RS-232 so that's not a problem and
addressing is no problem.  Don't know much about Modbus but it's not very complicated.  I needed a way to get the Graphics tablet *********xx,yyyyy,n data in and that's the simplist way I could find.  I read the tablet into the pick and store the data in the registers that Modbus calls, pretty simple.

I'd be glad to make a few boards if the demand is their.

Kisssys

6
Brains Development / Re: Update DRO from Modbus
« on: October 20, 2008, 09:29:31 PM »
Well I installed the plug in and configured CFG0 and it works. 

Probably more to come but I'm working now

Thanks
Kisssys

7
Brains Development / Update DRO from Modbus
« on: October 20, 2008, 08:49:16 PM »
I programmed a PIC chip to be a mini ModBus and it seems to be working great

I created a little VB script to step thru to see how it's doing and it does just what I want, It  inputs 64,65,66,67 and assign's the correct values to the variables.
As you can see from the script I have a DRO assigned 1010 that it displays the XaxisRegister and it does that all correctly.

TabletXaxisPos = GetInput(64)/1000
TabletYaxisPos = GetInput(65)/1000
ButtonValue    = GetInput(66)
FlagValue      = GetInput(66)
SetOemDRO(1010,TabletXaxisPos)

All of the script works fine!!!

I am trying to write a brain to automatically update the DRO instead of a macropump and I'm not having any luck.

My brain shows MOD:4-P:64     Formula = A/1000     OEMDRO:1010    I divide by 1000 to scale the 0 to 12000 input to inches

My Mod bus is Address 01  and its the first 4 registers.  I must be doing something wrong in the Mod bus definition somewhere but can't see it.

I'm trying to display my Graphics Tablet on the Screen

Kisssys



8
VB and the development of wizards / Re: Loading Code from another program
« on: October 02, 2008, 08:34:17 PM »
That worked perfectly.

I never would have fiquired that out, can't thank you enough.

Kisssys

9
VB and the development of wizards / Re: Loading Code from another program
« on: October 02, 2008, 02:19:31 PM »
I added a reference to Mach4 and used the public procedure LoadGCodeFile and it compiles but seems to go to the DLL and dies.
Not sure about the Imports  or the Dim statement

Any Ideas as to where I'm going wrong
Kisssys

' Test code   

Imports Mach4

Public Class Form1

    Dim CMach4 As New CMach4Doc()

    Private Sub Mach3Load_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Mach3Load.Click

        CMach4.LoadGCodeFile("C:\test.tap")

    End Sub
End Class

10
VB and the development of wizards / Re: Loading Code from another program
« on: October 02, 2008, 09:33:13 AM »
Thanks for the reply, I figured it was too dumb a question for a programmer to ask.

I am using VB2005 express which is the .net framework.  I've used VB6 a fair amount but new to .net.  The Mach Com API is the best way for me to go
but not sure how to start.  I'll try to add the Mach3 COM object reference to my program and see how it goes.  I just need to buckle down and spend a half day and figure it out.

I want the program to autoload the code.  I will be cutting small pieces out on my plasma cutter of varying shapes and sizes, probably never have more than
polygon of 6 sides.  I want to take the shape on my graphics tablet and hit go and it will zip it out.

Thanks again
Kisssys

Pages: 1 2 »