Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 28, 2012, 02:21:08 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
Brains Development
Update DRO from Modbus
Pages:
1
2
»
Go Down
« previous
next »
Author
Topic: Update DRO from Modbus (Read 4211 times)
0 Members and 1 Guest are viewing this topic.
Kisssys
Active Member
Offline
Posts: 11
Update DRO from Modbus
«
on:
October 20, 2008, 07: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
Logged
Kisssys
Active Member
Offline
Posts: 11
Re: Update DRO from Modbus
«
Reply #1 on:
October 20, 2008, 08: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
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Update DRO from Modbus
«
Reply #2 on:
October 21, 2008, 08:47:48 AM »
I would LOVE to hear about your progress in this area!!! By all means, PLEASE keep up posted!! Also, is you Pic design for sale? Can you assign different device numbers to your Pic so that you could have multiple of these devices on a 485 or 422 drop net work??
How much I/O do you have? (Discrete and Analog?)
Scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Kisssys
Active Member
Offline
Posts: 11
Re: Update DRO from Modbus
«
Reply #3 on:
October 21, 2008, 04: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
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Update DRO from Modbus
«
Reply #4 on:
October 21, 2008, 06:45:20 PM »
Please list total specs, and can each be addresssed differently so they can be Chained to gether with a drp network for expandability??
est. Price, etc.
Also: ETHERNET Options!!!!!!!!!!!!!
Scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Kisssys
Active Member
Offline
Posts: 11
Re: Update DRO from Modbus
«
Reply #5 on:
October 27, 2008, 07: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
HiddenScript.m1s
(2.07 KB - downloaded 207 times.)
Tablet.brn
(2.51 KB - downloaded 176 times.)
tablet.jpg
(31.2 KB, 948x537 - viewed 395 times.)
Logged
fer_mayrl
Global Moderator
Offline
Posts: 452
Re: Update DRO from Modbus
«
Reply #6 on:
October 28, 2008, 06:52:53 AM »
Hello
Try adding a:
SLEEP 100
between the
While getUserLed(1200)
Wend 'wait here for the "tablet.brn" to see I've pressed the button on the tablet
To get
While getUserLed(1200)
SLEEP 100
Wend 'wait here for the "tablet.brn" to see I've pressed the button on the tablet
When you have a loop like that, mach makes MANY cycles and uses a lot of resources, adding the sleep command, slows down this cycle as to not lock up your computer.
What version of mach are you using, If you are using the latest version, then just adding that line would do, Art added the declaration of the sleep command internally, if you are using older versions of mach, then you would have to declare it with this at the beginning of your code:
Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
Hope that gets you going
Fernando
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Update DRO from Modbus
«
Reply #7 on:
October 28, 2008, 04:24:05 PM »
If you can,
I would get away from the while loop all together, there is a friendlier version of it. I think it is called "WaitForSignal()" (or something like that, I am in Venezuala so I dont bring my Mach R & D stuff with my work computer......... Some else here can look it up, OR you can look on the Wiki under "Mach Specific Functions" Its exact syntax and use is in there. It only works on a REAL input signal, NOT a simulated on.......
Scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Kisssys
Active Member
Offline
Posts: 11
Re: Update DRO from Modbus
«
Reply #8 on:
October 28, 2008, 05: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
Logged
Kisssys
Active Member
Offline
Posts: 11
Small change
«
Reply #9 on:
March 26, 2009, 06: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
Logged
Pages:
1
2
»
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...