![]() |
|
|||||||
| 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. |
|
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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? |
|
#3
|
||||
|
||||
|
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. |
|
#4
|
|||
|
|||
|
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! |
|
#5
|
|||
|
|||
|
anyone got any info??
|
|
#6
|
||||
|
||||
|
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 |
|
#7
|
|||
|
|||
|
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 __ |
|
| Bookmarks |
| Tags |
| basic, modulation, pulse, visual, width |
| Thread Tools | |
| Display Modes | |
|
|
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 |