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 25, 2012, 05:25:28 AM
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
Third party software and hardware support forums.
PoKeys
(Moderator:
NeoTO
)
trying to set PWM from vb script
Pages:
1
Go Down
« previous
next »
Author
Topic: trying to set PWM from vb script (Read 1461 times)
0 Members and 1 Guest are viewing this topic.
RadiantHeat
Active Member
Offline
Posts: 30
trying to set PWM from vb script
«
on:
July 24, 2009, 05:33:30 PM »
I would like to use the PWM outputs from VB. I have had some success in reading the pokeys data and setting outputs from vb script , but I can't figure out how to pass a PWM array to pokeys from VB script. I suspect its a syntax error , but EVEN after reading the manuals , I can't figure it out. I am attaching the offending lines below. I have also attached the whole vb script in case it is necessary to check the whole script.
' before these lines run, the pokeys unit is initialized , the build date is read in , the arrays are dim(ed) and
' start values are assigned. full details in attachment. script needs 8 userlabels and a button.
' here are problem lines. I tried many different syntax combos ?
' when the 2 lines below run , the vb scripts stated error is
' class does not support automation or does not support expected interface
b = device.SetPWMOutputs (channel() ,Period() ,duty() )
b = device.GetPWMOutputs (channel() ,Period() ,duty() )
thanks in advance
pokeys PWM.m1s
(1.29 KB - downloaded 94 times.)
Logged
borisz
Active Member
Offline
Posts: 209
Re: trying to set PWM from vb script
«
Reply #1 on:
July 26, 2009, 07:08:41 AM »
Hi!
You should set some values to channel, period and duty.
E.g. duty(50)
regards
Boris
Logged
www.poscope.com
home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: trying to set PWM from vb script
«
Reply #2 on:
July 26, 2009, 09:10:36 AM »
RadientHeat,
Are you trying to connect to the Mach3 Pokeys plugin?, if so then PWM is not currently supported through the plugin of Mach3.
The new Plugin (attached to my Post about the new plugin) does have a spindle output but it is analog 0-3.3v on pin 43 if you choose.
if the drive your using to run your spindle will only take a PWM signal then let me know.
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/
RadiantHeat
Active Member
Offline
Posts: 30
Re: trying to set PWM from vb script
«
Reply #3 on:
July 26, 2009, 12:21:26 PM »
Thanks again for your quick response. No, I am not trying to use your plugin. I am trying to use the VB tools and DLL that come with pokeys to read and write to the unit from mach3/cypress vb. I can open the pokeys , read , setup and write to the device , all from cypress/vb. Only problem is I can't figure out how to pass arrays (I think thats the problem). The following code creates an error when run inside a Mach3 Button. Boris wrote that perhaps I was not setting values first , but I was , full program below.
setbuttontext "pokeys PWM test"
Dim builddate As String
Dim test As Integer
Dim b As Boolean
Dim channel(6) As Boolean
Dim period(6) As Long
Dim duty(6) As Long ' tried type as long and single
Set device = CreateObject("PoKeysDevice_DLL.PoKeysDevice") ' declare
test=device.enumeratedevices()
MsgBox "Devices"+str$(test)
b=device.ConnectToDevice (0)
If b <> true Then Stop
b=device.getbuilddate(builddate)
MsgBox "Build Date " & builddate ' this shows communications working , pokeys on-line
For v = 0 To 5
channel(v)=true
period(v)= 12000000
duty(v)=6000000
Next v ' set values
MsgBox "Values declared for Channel PWM 1 " & channel(1) & " " & Period(1) & " " & Duty(1)
b = device.SetPWMOutputs (channel() ,Period() ,duty() ) ' program fails here
b = device.GetPWMOutputs (channel() ,Period() ,duty() ) ' error message is class does not support automation or does not support expected interface
MsgBox "Results for Channel PWM 1" & channel(1) & " " & Period(1) & " " & Duty(1)
b=device.DisconnectDevice()
End
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: trying to set PWM from vb script
«
Reply #4 on:
July 26, 2009, 08:32:36 PM »
down load the developers manual that shows all the functions and hwo to write to them.
other than that, cant help you, sorry.
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/
borisz
Active Member
Offline
Posts: 209
Re: trying to set PWM from vb script
«
Reply #5 on:
July 28, 2009, 03:19:00 AM »
Quote from: RadiantHeat on July 26, 2009, 12:21:26 PM
b = device.SetPWMOutputs (channel(*********) ,Period(*********) ,duty(*********) ) ' program fails here
b = device.GetPWMOutputs (channel(*********) ,Period(*********) ,duty(*********) ) ' error message is class does not support automation or does not support expected interface
Hi!
Probably it is not too hard to put same values instead of "*********" what I have suggested before.
You should also read PoKeys55 protocol specs published on
www.poscope.com
regards
Boris
Logged
www.poscope.com
home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope
Pages:
1
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...