All About Circuits Forum  

Go Back   All About Circuits Forum > Software, Microcomputing, and Communications Forums > Programmer's Corner

Notices

Programmer's Corner Discussion forum for all aspects of programming and software engineering. Any software programming language welcome: C, C++, C#, Fortran, Java, Matlab, etc.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 02-20-2008, 04:21 AM
Spogpean Spogpean is offline
New Member
 
Join Date: Feb 2008
Posts: 8
Default Pulse Width Modulation using visual basic

hi all,

im trying to impliment PWM control of a heating element using visual basic, but have come unstuck. i cannot find ANYTHING on the net about it. would anyone have any kind of source code that i could use?

regards
Reply With Quote
  #2  
Old 02-20-2008, 04:13 PM
beenthere's Avatar
beenthere beenthere is offline
Super Moderator
 
Join Date: Apr 2004
Location: Missouri, USA (GMT -6)
Posts: 12,954
Blog Entries: 10
Default

You may have a hard time with VB. It does not have those nice old PEEK and POKE functions that allow low-level hardware access. It will take a different language like Power Basic or X Basic, or else in-line assembler to let you do PWM.

What port or interface were you going to use?
Reply With Quote
  #3  
Old 02-20-2008, 05:01 PM
SgtWookie's Avatar
SgtWookie SgtWookie is offline
Senior Member
 
Join Date: Jul 2007
Location: Orlando, FL USA
Posts: 13,802
Default

I wouldn't try to do PWM straight from Visual Basic. Timing would vary widely depending upon events outside of program control.

But you could use it to communicate with a microcontroller that's actually performing the PWM.
__________________
General info:
If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input.
Reply With Quote
  #4  
Old 02-26-2008, 12:41 PM
Spogpean Spogpean is offline
New Member
 
Join Date: Feb 2008
Posts: 8
Default

Thanks for the replys sos far lads. So could I build a PWM Circuit, and then use the VB to see the signals generated on a graph or something?

I need to see the PWM signal on the screen, how would I go about doin that?

Thanks!
Reply With Quote
  #5  
Old 03-05-2008, 12:42 PM
Spogpean Spogpean is offline
New Member
 
Join Date: Feb 2008
Posts: 8
Default

anyone got any info??
Reply With Quote
  #6  
Old 03-05-2008, 01:37 PM
thingmaker3's Avatar
thingmaker3 thingmaker3 is offline
Super Moderator
 
Join Date: May 2005
Location: Rural, Oregon GMT -8
Posts: 5,051
Blog Entries: 6
Default

If your frequency is low enough, you can buy or build one of the PC oscilloscopes. If your frequency is to high for that, you might have to get creative with your serial port and software other than VB.
__________________
"I want to establish in your mind very clearly that you must not think I deny all that I do not admit. On the contrary, I think there are many things which may be true, and which I shall receive as such hereafter, though I do not as yet receive them; but that is not because there is any proof to the contrary, but that the proof in the affirmative is not yet sufficient for me"
- Michael Faraday
Reply With Quote
  #7  
Old 03-09-2008, 08:22 PM
Ian_McCrum Ian_McCrum is offline
New Member
 
Join Date: Mar 2008
Posts: 1
Default

You could get VB to generate PWM - since you are driving a heating element then the TIMER activeX control could output a waveform that is high and low, say over 1/10th of a second. You set the interval of the timer to the number of milliseconds you want - it is probably only accurate to a millisecond (I think there is a way of getting more accuracy).

Certainly when I use the timer in animation I do not notice any "Jerkiness"

Presumably for your project you need to sense temperature and output an on-off signal. The input and output will be harder than getting PWM. Sounds like you could use the parallel port for that... any more details?

Ian McCrum
IJ.McCrum@ulster.ac.uk

__
Reply With Quote
Reply   Post New Thread

Bookmarks

Tags
, , , ,

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
pulse width modulation 016chris The Projects Forum 4 04-16-2009 03:01 PM
pulse width modulation 016chris The Projects Forum 6 11-21-2007 04:31 AM
pulse width modulation with ne555 Steve555 The Projects Forum 8 10-17-2006 12:08 PM
pulse width modulation bbarker General Electronics Chat 2 04-21-2006 09:43 AM
pulse width modulation bbarker General Electronics Chat 1 04-21-2006 01:14 AM


All times are GMT. The time now is 10:29 PM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License. Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.