Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 07:59:32 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
| | |-+  need help with simple script
Pages: 1   Go Down
Print
Author Topic: need help with simple script  (Read 360 times)
0 Members and 1 Guest are viewing this topic.
Fiero Addiction
Active Member

Offline Offline

Posts: 17


View Profile
« on: December 10, 2010, 07:10:01 PM »

I currently use this one line in a macro file to toggle the THC on/off.

 DoOEMButton(123)  ' toggle THC on/off

This works perfectly. The problem I have is that the program does not know the current state of the THC. So I am trying to make separate THC on and off macros.

' to turn THC on
Cur_THC_status = GetOemLed(24)           'get the state of the THC
  If Cur_THC_status  = 0 Then                ' if the THC is off
   DoOEMButton(123)                              'push the THC button to toggle it on
  End If                                        'end condition statement

' to turn THC off
Cur_THC_status = GetOemLed(24)           'get the state of the THC
  If Cur_THC_status  = 1 Then                ' if the THC is on
   DoOEMButton(123)                             ' push the THC button to toggle it off
  End If                                        'end condition statement

These do not work and I don't know why. I know very little about scripting. Suggestions would be appreciated.
Logged
Ya-Nvr-No
Active Member

Offline Offline

Posts: 268


Scuptris 3D


View Profile
« Reply #1 on: December 10, 2010, 09:11:15 PM »

' to turn THC on
' get the state of the THC
  If GetOemLed(24)  = false Then                ' if the THC is off
   DoOEMButton(123)                              'push the THC button to toggle it on
  End If                                        'end condition statement

' to turn THC off
' get the state of the THC
  If GetOemLed(24)  = true Then                ' if the THC is on
   DoOEMButton(123)                             ' push the THC button to toggle it off
  End If                                        'end condition statement

Logged
Fiero Addiction
Active Member

Offline Offline

Posts: 17


View Profile
« Reply #2 on: December 11, 2010, 11:28:54 AM »

Works great, thank you.
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!