Previous in Forum: software   Next in Forum: Computer Problems
Close
Close
Close
6 comments
Rate Comments: Nested
Member

Join Date: Jun 2007
Posts: 5

Design of a multi-variable control software program

06/09/2007 11:32 AM

system software now allows computer programmers to design program that enable computers to control multiple output devices.

Let assume the program to be Visual Basic 6.0 Enterprise Edition and this program should control:

1. length of time a light is switch-on and off

2. control the speed of a direct current motor

3. controlling a traffic light switching sequence

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Anonymous Poster
#1

Re: Design of a multi-variable control software program

06/10/2007 12:36 AM

So are you going to ask a question or do we have to guess?

Register to Reply
Member

Join Date: Jun 2007
Posts: 5
#4
In reply to #1

Re: Design of a multi-variable control software program

06/10/2007 6:11 PM

now please i am an engineer trying to share ideas. my purpose i was trained for is not to guest. i know was to do and how to create and produce results. my mind reason of submitting this topic is to have different view of this topic from mine

Register to Reply
Guru
Popular Science - Biology - New Member Hobbies - Musician - New Member APIX Pilot Plant Design Project - Member - New Member Hobbies - CNC - New Member Fans of Old Computers - ZX-81 - New Member

Join Date: Jan 2007
Location: Centurion, South Africa
Posts: 3921
Good Answers: 97
#2

Re: Design of a multi-variable control software program

06/10/2007 3:31 AM

1 and 3 is easy in any language. You Will need an relay type of output device for each switch.

Serial (RS232) can handle at least 2 x 12volt relays.

Parallel can at least do 8 x 5volt relays. It can be increased to 64 with simple electronics.

2 depends on the motor , if it has an internal speed control it may be more difficult.

Variable speed controls are available (and tested) and can be controlled from a computer.

__________________
Never do today what you can put of until tomorrow - Student motto
Register to Reply
Member

Join Date: Jun 2007
Posts: 5
#3
In reply to #2

Re: Design of a multi-variable control software program

06/10/2007 6:06 PM

thanks for your response, anyway i have done 1 and 3 before and i was thinking of making both 1 and 2 as one unit but what is my problem is how can i put these three in on form. now when i was doing 1 and 2 i use parallel cable and i connect LED to it and i inpout32 as my execution file, it was wonderful. similarly i have done the motor separately with the same execution file and also it works. now my problem is how can i put all of them together in one form to execute their various functions.

Register to Reply
Member

Join Date: Jun 2007
Posts: 5
#6
In reply to #2

Re: Design of a multi-variable control software program

06/21/2007 6:06 AM

hi i have done the codes for the light but when they start operating if i stop and want to start again it will not run again i don't what is wrong. the coding is shown below:

Private Declare Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal PortAddress As Integer) _
As Integer
Private Declare Sub Out Lib "inpout32.dll" Alias "Out32" _
(ByVal PortAddress As Integer, ByVal Value1 As Integer)

Dim PortAddress As Integer
Dim X As Integer
Dim redtime As Long
Dim yellowtime As Long
Dim greentime As Long
Private Sub Command4_Click()
tmrFlash.Enabled = True
redtime = Val(Text1.Text)
yellowtime = Val(Text2.Text)
greentime = Val(Text3.Text)
Text1.Text = Invisible
Text2.Text = Invisible
Text3.Text = Invisible
If Command4.Caption = "NORMAL" Then
Command4.Caption = "STOP"
Else
Command4.Caption = "NORMAL"
ShpRed.FillColor = vbWhite
ShpYellow.FillColor = vbWhite
ShpGreen.FillColor = vbWhite
tmrFlash.Enabled = False
End If
End Sub


Private Sub Form_Load()
ShpRed.FillColor = vbWhite
ShpYellow.FillColor = vbWhite
ShpGreen.FillColor = vbWhite
tmrFlash.Enabled = False
Out 888, 0
End Sub
Private Sub tmrFlash_Timer()
If ShpRed.FillColor = vbRed Then
'change the color to yellow
tmrFlash.Interval = yellowtime
ShpRed.FillColor = vbWhite
ShpYellow.FillColor = vbYellow
ShpGreen.FillColor = vbWhite
Out 888, 1
X = 5
ElseIf ShpYellow.FillColor = vbYellow And X = 5 Then
'change the color to green
tmrFlash.Interval = greentime
ShpRed.FillColor = vbWhite
ShpYellow.FillColor = vbWhite
ShpGreen.FillColor = vbGreen
Out 888, 4
X = 1
ElseIf X = 1 And ShpGreen.FillColor = vbGreen Then
'change the color in ShpYellow to vbYellow
tmrFlash.Interval = yellowtime
ShpRed.FillColor = vbWhite
ShpYellow.FillColor = vbYellow
ShpGreen.FillColor = vbWhite
Out 888, 1
X = 0
Else
tmrFlash.Interval = redtime
ShpRed.FillColor = vbRed
ShpYellow.FillColor = vbWhite
ShpGreen.FillColor = vbWhite
Out 888, 2

'change the color to yellow

End If
End Sub

and this is visual basic 6.0 working edition and the execution file is inpout32.dll.

thanks in advance for your help.

regards

gerald

Register to Reply
Anonymous Poster
#5

Re: Design of a multi-variable control software program

06/11/2007 3:33 PM

Put each function on IRQ. Use timer to drive each subroutine's IRQ sequentially.

Or you can interleave all 3 subroutines so they're executed together. Like: sub 1 line 1, sub 2 line 1, sub 3 line 1, sub 1 line 2, sub 2 line 2 etc.

Or multi-thread the 3 subs and let OS execute them. OS will allocate time for each one.


Pineapple

Register to Reply
Register to Reply 6 comments
Copy to Clipboard

Users who posted comments:

Anonymous Poster (2); bonnie18252 (3); Hendrik (1)

Previous in Forum: software   Next in Forum: Computer Problems

Advertisement