Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 02:33:38 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  General Mach Discussion
| | |-+  Display Spindle Temperature on Mach3 ??
Pages: 1   Go Down
Print
Author Topic: Display Spindle Temperature on Mach3 ??  (Read 815 times)
0 Members and 2 Guests are viewing this topic.
frogblender
Active Member

Offline Offline

Posts: 13


View Profile
« on: May 17, 2010, 11:41:05 AM »

I have a USB temperature probe, which writes the temperature to a textfile every 10 seconds.

I want Mach3 to:
1)  read the temperature from the textfile and display it in a DRO every 10 seconds.
2) estop if the temperature exceeds some setpoint.


Any ideas how to do this?    I'm fluent in vbscripts.
Logged
Hood
Active Member

Online Online

Posts: 17,344


Carnoustie, Scotland


View Profile
« Reply #1 on: May 17, 2010, 01:02:41 PM »

Afraid I am the exact opposite to you regards VB but if you can read this text file then all you would need to do is write the VB  in the macropump and if it sees the high temp do the E-Stop.


Hood
Logged
BR549
Active Member

Offline Offline

Posts: 2,551


View Profile
« Reply #2 on: May 19, 2010, 08:34:10 PM »

Just an idea but from past experiements trying to do a timed loop in VB may tie up a lot of CPU time.

An option would be set up a Brain to do a 10 sec timout loop  and set a UserLed on. Then when the simple VB script sees the Led go active THEN it reads the last line of the text file into a variable and then VB can do the compare and act on it.

What does each line of the text file look like?

Just a thought
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« Reply #3 on: May 30, 2010, 03:26:45 AM »

Put this in your macropump, modify the path to where it dumps your USB txt file. Also the script below will only
read and post the FIRST line of data in that file, so make sure each time it updates you file, it only puts the data
in the first line, overwritting any old data there. I used UserDRO 2000 but you can use what ever, just change it.
it ASSUMES that the ONLY thing on that first line is DIGITS!! any none digits will throw an error.

Open "C:\User\MyAccount\Desktop\UsbSpindleTemp.txt" For Input As #1   ' Open to read file.
Line Input #1, FileData                  ' Read the first line of data.
SetUserDRO(2000, FileData)        'Puts the temp as digits from the 1st line of your txt file.
Close #1

'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/
Zaaephod
Active Member

Offline Offline

Posts: 73


View Profile
« Reply #4 on: May 31, 2010, 07:00:45 PM »

If you don't require up to the millisecond data, It might be a good idea to use a timer in your macropump script (not a loop) so it only does that file read every few seconds. Otherwise it will be reading that file as fast as it possibly can. Just a thought.
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« Reply #5 on: June 02, 2010, 02:25:22 AM »

Zaaephod,

    has a good point, but it might be easier to do a counter in the macropump, that when it loops through and counts up to 5 (1/2 second), or 10 (one second), it does the read, then resets the counter to Zero, then you dont have the overhead of a VB timer in your macropump, as well.

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/
Zaaephod
Active Member

Offline Offline

Posts: 73


View Profile
« Reply #6 on: June 02, 2010, 09:11:36 AM »

poppabear,

I considered the same, but I wasn't sure if a macropump ran at a set interval, or if it was dependent on CPU speed for its cycle time. I presume by what you said that the macropump, by default, runs at 1/10 second intervals? Is there any way to change the interval for it? If so, I might just change some of my macropump code.
Logged
BR549
Active Member

Offline Offline

Posts: 2,551


View Profile
« Reply #7 on: June 02, 2010, 09:26:28 AM »

it would be best to set up the timer in a brain to set an led. Sometimes trying to do a timer loop in the macropump causes problems with CPU hogging.

Set the brain to set an LED /on. Then when the macropump sees the LED/ON then do" code whatever" AND set the LED to OFF.

Just a thought
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!