පරිඝණකයෙන් විදුලි උපකරණ හසුරවමු 02
පරිඝණකයෙන් විදුලි උපකරණ හසුරවමු 01. නොබලපු අයට මෙන්න ලින්ක් එක
http://www.elakiri.com/forum/showthread.php?p=13579024#post13579024
අපි පහුගිය Thread එකේදී කතා කලේ කොහොමද Data Port එක පාවිචචි කරල බාහිර විදුළි උපකරණ පාලනය කරන්නේ කියල , එහිදී මම ඉදිරිපත් කලා Relay Interface පරිපථයක්.අද මන් කියල දෙන්නම් මෙම Relay Interface පරිපථයට ගැලපෙන වැඩසටහන් 2ක්. මුල් එක ඉතාම ප්රාථමික වැඩසටහනකි.එහිදී වරකට ක්රියාත්මක කල හැක්කේ එක Relay එකක් පමණී. මෙන්න එහෙනම් ඒ වීඩියෝ එක.
අනෙක් වැඩසටහනේදී එකවර Relay කීපයක්ම ක්රියාත්මක කල හැක.එම වැඩසටහනේ සම්පූර්ණ වීඩියෝ එකම දාන්නනම් ටිකක් අමාරැයි.මම කොටසක් පමනක් දැම්මා ( මූලික කොටස).ඉතිරි ටික ටයිප් කරන්නම්.එහෙනම් බලන්නකෝ වීඩියෝ එක.
මේකේ Timer එකේ Full Code එක පහතින් තිබේ.
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If (Relay_01.Checked = True) Then
Out(Val("&h378"), 1)
ElseIf (Relay_02.Checked = True) Then
Out(Val("&h378"), 2)
ElseIf (Relay_01.Checked = True And Relay_02.Checked = True) Then
Out(Val("&h378"), 3)
ElseIf (Relay_03.Checked = True) Then
Out(Val("&h378"), 4)
ElseIf (Relay_01.Checked = True And Relay_03.Checked = True) Then
Out(Val("&h378"), 5)
ElseIf (Relay_02.Checked = True And Relay_03.Checked = True) Then
Out(Val("&h378"), 6)
ElseIf (Relay_01.Checked = True And Relay_02.Checked = True And Relay_03.Checked = True) Then
Out(Val("&h378"), 7)
ElseIf (Relay_04.Checked = True) Then
Out(Val("&h378"), 8)
ElseIf (Relay_01.Checked = True And Relay_04.Checked = True) Then
Out(Val("&h378"), 9)
ElseIf (Relay_02.Checked = True And Relay_04.Checked = True) Then
Out(Val("&h378"), 10)
ElseIf (Relay_01.Checked = True And Relay_02.Checked = True And Relay_04.Checked = True) Then
Out(Val("&h378"), 11)
ElseIf (Relay_03.Checked = True And Relay_04.Checked = True) Then
Out(Val("&h378"), 12)
ElseIf (Relay_01.Checked = True And Relay_03.Checked = True And Relay_04.Checked = True) Then
Out(Val("&h378"), 13)
ElseIf (Relay_02.Checked = True And Relay_03.Checked = True And Relay_04.Checked = True) Then
Out(Val("&h378"), 14)
ElseIf (Relay_01.Checked = True And Relay_02.Checked = True And Relay_03.Checked = True And Relay_04.Checked = True) Then
Out(Val("&h378"), 15)
End If
End Sub
මේ කොළ පාටින් තියෙන Code එක වැඩසටහනේ Timer_Tick Event එක තුලට Paste කරගැනීම පමනයි කරන්න තියෙන්නේ.
ඒ කොටසට පස්සේ අපිට තියෙන්නේ බාහිර විදුළි උපකරණයකින් පැමිනෙන සංඥා කියවන එකයි.මන් අද ඒ කොටස ඉදිරිපත් කරන්නම්.
අදට මන් මෙතනින් නවතින්නම්.ඉදිරියේදී මන් ඹ්ගොල්ලන්ට දෙන්නම් විවිධ Port Program වැඩසටහන් හා ඒවා කරන ආකාරයන්.

පරිඝණකයෙන් විදුලි උපකරණ හසුරවමු 01. නොබලපු අයට මෙන්න ලින්ක් එක
http://www.elakiri.com/forum/showthread.php?p=13579024#post13579024
අපි පහුගිය Thread එකේදී කතා කලේ කොහොමද Data Port එක පාවිචචි කරල බාහිර විදුළි උපකරණ පාලනය කරන්නේ කියල , එහිදී මම ඉදිරිපත් කලා Relay Interface පරිපථයක්.අද මන් කියල දෙන්නම් මෙම Relay Interface පරිපථයට ගැලපෙන වැඩසටහන් 2ක්. මුල් එක ඉතාම ප්රාථමික වැඩසටහනකි.එහිදී වරකට ක්රියාත්මක කල හැක්කේ එක Relay එකක් පමණී. මෙන්න එහෙනම් ඒ වීඩියෝ එක.
අනෙක් වැඩසටහනේදී එකවර Relay කීපයක්ම ක්රියාත්මක කල හැක.එම වැඩසටහනේ සම්පූර්ණ වීඩියෝ එකම දාන්නනම් ටිකක් අමාරැයි.මම කොටසක් පමනක් දැම්මා ( මූලික කොටස).ඉතිරි ටික ටයිප් කරන්නම්.එහෙනම් බලන්නකෝ වීඩියෝ එක.
මේකේ Timer එකේ Full Code එක පහතින් තිබේ.
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If (Relay_01.Checked = True) Then
Out(Val("&h378"), 1)
ElseIf (Relay_02.Checked = True) Then
Out(Val("&h378"), 2)
ElseIf (Relay_01.Checked = True And Relay_02.Checked = True) Then
Out(Val("&h378"), 3)
ElseIf (Relay_03.Checked = True) Then
Out(Val("&h378"), 4)
ElseIf (Relay_01.Checked = True And Relay_03.Checked = True) Then
Out(Val("&h378"), 5)
ElseIf (Relay_02.Checked = True And Relay_03.Checked = True) Then
Out(Val("&h378"), 6)
ElseIf (Relay_01.Checked = True And Relay_02.Checked = True And Relay_03.Checked = True) Then
Out(Val("&h378"), 7)
ElseIf (Relay_04.Checked = True) Then
Out(Val("&h378"), 8)
ElseIf (Relay_01.Checked = True And Relay_04.Checked = True) Then
Out(Val("&h378"), 9)
ElseIf (Relay_02.Checked = True And Relay_04.Checked = True) Then
Out(Val("&h378"), 10)
ElseIf (Relay_01.Checked = True And Relay_02.Checked = True And Relay_04.Checked = True) Then
Out(Val("&h378"), 11)
ElseIf (Relay_03.Checked = True And Relay_04.Checked = True) Then
Out(Val("&h378"), 12)
ElseIf (Relay_01.Checked = True And Relay_03.Checked = True And Relay_04.Checked = True) Then
Out(Val("&h378"), 13)
ElseIf (Relay_02.Checked = True And Relay_03.Checked = True And Relay_04.Checked = True) Then
Out(Val("&h378"), 14)
ElseIf (Relay_01.Checked = True And Relay_02.Checked = True And Relay_03.Checked = True And Relay_04.Checked = True) Then
Out(Val("&h378"), 15)
End If
End Sub
මේ කොළ පාටින් තියෙන Code එක වැඩසටහනේ Timer_Tick Event එක තුලට Paste කරගැනීම පමනයි කරන්න තියෙන්නේ.
ඒ කොටසට පස්සේ අපිට තියෙන්නේ බාහිර විදුළි උපකරණයකින් පැමිනෙන සංඥා කියවන එකයි.මන් අද ඒ කොටස ඉදිරිපත් කරන්නම්.
අදට මන් මෙතනින් නවතින්නම්.ඉදිරියේදී මන් ඹ්ගොල්ලන්ට දෙන්නම් විවිධ Port Program වැඩසටහන් හා ඒවා කරන ආකාරයන්.


