⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 control.htm

📁 BLDC_SENSORLESS controller using freeescale mcu aw60
💻 HTM
字号:
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<LINK REL=stylesheet href=main.css>
</HEAD>
<BODY >

<script language="VBScript">

Function Periodically()

	dim v, tv, Item
	succ = false

	succ = pcm.ReadVariable("Applied Voltage",v,tv)

	If succ then
		txtVoltage.InnerText = tv
	End If
	
	succ = pcm.ReadVariable("Actual Speed",v,tv)

	If succ then
		txtSpeed.InnerText = tv
	End If
	
	succ = pcm.ReadVariable("Application Mode",v,tv)

	If succ then
		txtStatus.InnerText = tv
	End If
	
	succ = pcm.ReadVariable("Required Speed",Item)

	If succ then
		Item = Round(Item/10)
		gPlot(Item)
	End If
	
End Function


Function btnUP_onClick()

	dim v, tv
	succ = false

	succ = pcm.ReadVariable("Required Speed",v,tv,retMsg)

	If succ then
		If v = 0 then
			v = 400
		else
			v = v+100
			If v > 1000 then
				v = 1000
			End If
		End If

		succ = pcm.WriteVariable("Required Speed",Round(v),retMsg)

		If not succ then
			txtErrMsg.InnerText = retMsg		
		End If
	Else
		txtErrMsg.InnerText = retMsg		
	End If	

End Function


Function btnDOWN_onClick()

	dim v, tv
	succ = false

	succ = pcm.ReadVariable("Required Speed",v,tv,retMsg)

	If succ then
		If v = 0 then
			v = -400
		else
			v = v-100
			If v < -1000 then
				v = -1000
			End If
		End If

		succ = pcm.WriteVariable("Required Speed",Round(v),retMsg)

		If not succ then
			txtErrMsg.InnerText = retMsg
		End If
	Else
		txtErrMsg.InnerText = retMsg		
	End If	

End Function


Function gPlot(ByVal Item)

	If Item = -100 then
		g_100.src = "g-100_1.gif"
	else
		g_100.src = "g-100_2.gif"
	End If

	If Item < -90 then
		g_90.src = "g50_2.gif"
	else
		If Item = -90 then
			g_90.src = "g-50_1.gif"
		else
			g_90.src = "g50_0.gif"
		End If
	End If

	If Item < -80 then
		g_80.src = "g50_2.gif"
	else
		If Item = -80 then
			g_80.src = "g-50_1.gif"
		else
			g_80.src = "g50_0.gif"
		End If
	End If

	If Item < -70 then
		g_70.src = "g50_2.gif"
	else
		If Item = -70 then
			g_70.src = "g-50_1.gif"
		else
			g_70.src = "g50_0.gif"
		End If
	End If

	If Item < -60 then
		g_60.src = "g50_2.gif"
	else
		If Item = -60 then
			g_60.src = "g-50_1.gif"
		else
			g_60.src = "g50_0.gif"
		End If
	End If

	If Item < -50 then
		g_50.src = "g50_2.gif"
	else
		If Item = -50 then
			g_50.src = "g-50_1.gif"
		else
			g_50.src = "g50_0.gif"
		End If
	End If

	If Item < -40 then
		g_40.src = "g50_2.gif"
	else
		If Item = -40 then
			g_40.src = "g-50_1.gif"
		else
			g_40.src = "g50_0.gif"
		End If
	End If

	If Item < -30 then
		g_30.src = "g50_2.gif"
	else
		If Item = -30 then
			g_30.src = "g-50_1.gif"
		else
			g_30.src = "g50_0.gif"
		End If
	End If

	If Item < -20 then
		g_20.src = "g50_2.gif"
	else
		If Item = -20 then
			g_20.src = "g-50_1.gif"
		else
			g_20.src = "g50_0.gif"
		End If
	End If

	If Item < -10 then
		g_10.src = "g50_2.gif"
	else
		If Item = -10 then
			g_10.src = "g-50_1.gif"
		else
			g_10.src = "g50_0.gif"
		End If
	End If

	If Item < 0 then
		g00.src = "g00_0.gif"
	else
		If Item = 0 then
			g00.src = "g00_1.gif"
		else
			g00.src = "g00_2.gif"
		End If
	End If

	If Item < 10 then
		g10.src = "g50_0.gif"
	else
		If Item = 10 then
			g10.src = "g50_1.gif"
		else
			g10.src = "g50_2.gif"
		End If
	End If

	If Item < 20 then
		g20.src = "g50_0.gif"
	else
		If Item = 20 then
			g20.src = "g50_1.gif"
		else
			g20.src = "g50_2.gif"
		End If
	End If

	If Item < 30 then
		g30.src = "g50_0.gif"
	else
		If Item = 30 then
			g30.src = "g50_1.gif"
		else
			g30.src = "g50_2.gif"
		End If
	End If

	If Item < 40 then
		g40.src = "g50_0.gif"
	else
		If Item = 40 then
			g40.src = "g50_1.gif"
		else
			g40.src = "g50_2.gif"
		End If
	End If

	If Item < 50 then
		g50.src = "g50_0.gif"
	else
		If Item = 50 then
			g50.src = "g50_1.gif"
		else
			g50.src = "g50_2.gif"
		End If
	End If

	If Item < 60 then
		g60.src = "g50_0.gif"
	else
		If Item = 60 then
			g60.src = "g50_1.gif"
		else
			g60.src = "g50_2.gif"
		End If
	End If

	If Item < 70 then
		g70.src = "g50_0.gif"
	else
		If Item = 70 then
			g70.src = "g50_1.gif"
		else
			g70.src = "g50_2.gif"
		End If
	End If

	If Item < 80 then
		g80.src = "g50_0.gif"
	else
		If Item = 80 then
			g80.src = "g50_1.gif"
		else
			g80.src = "g50_2.gif"
		End If
	End If

	If Item < 90 then
		g90.src = "g50_0.gif"
	else
		If Item = 90 then
			g90.src = "g50_1.gif"
		else
			g90.src = "g50_2.gif"
		End If
	End If

	If Item < 100 then
		g100.src = "g100_0.gif"
	else
		g100.src = "g100_1.gif"
	End If

End Function

</script>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
	<tr>
	<td><object classid="clsid:48A185F1-FFDB-11D3-80E3-00C04F176153" height="0" id="MCB_PC_Master_Services1" name="pcm" width="0">
	</object>
	<strong><font size=2> Designed By<br>
	<marquee width="500" height="22">
	Motorola Czech System Laboratories, Roznov p.Radh., Czech Republic
	</marquee></font></strong></td>
	<td align="right"><img src="sighrz.gif"></td>
	</tr>
</table>
<center>
<p><font color="#ff7f50" face="Tahoma" size="6"><strong>BLDC Demo Control with Hall Sensors</strong></font></p>
</center>
<center>
<p>
<table align="center" border="5" bordercolordark="#142a66" bordercolorlight="#b0cbea" cellpadding="1" cellspacing="1" width="640" height="310" background="" bgcolor="#44629f">
	<tr height="20">
		<td colspan="9" height="20" bordercolor="#44629f"></td>
	</tr>
	<tr height="50">
		<td rowspan="4" width="20" bordercolor="#44629f"></td>
		<td width="280" bordercolor="#44629f" valign="top" height="50"><font color="white" size="4"><strong>Applied Voltage:</strong></font></td>
		<td width="140" bordercolor="#44629f" align="right"  valign="top"><strong>
			<font id="txtVoltage" color="yellow" size="4">0</font></strong></td>
		<td width="40" bordercolor="#44629f" valign="top" style="WIDTH: 40px" height="50">
			<font color="yellow" size="4"><strong>%</strong></font></td>
		<td rowspan="4" width="20" bordercolor="#44629f"></td>
		<td rowspan="4" width="50" bordercolor="#44629f"><font size="4"><img name="g100" src="g100_0.gif" style="LEFT: -1px; TOP: 18px"><img name="g90" src="g50_0.gif"><img name="g80" src="g50_0.gif"><img name="g70" src="g50_0.gif"><img name="g60" src="g50_0.gif"><img name="g50" src="g50_0.gif"><img name="g40" src="g50_0.gif"><img name="g30" src="g50_0.gif"><img name="g20" src="g50_0.gif"><img name="g10" src="g50_0.gif"><img name="g00" src="g00_1.gif"><img name="g_10" src="g50_0.gif"><img name="g_20" src="g50_0.gif"><img name="g_30" src="g50_0.gif"><img name="g_40" src="g50_0.gif"><img name="g_50" src="g50_0.gif"><img name="g_60" src="g50_0.gif"><img name="g_70" src="g50_0.gif"><img name="g_80" src="g50_0.gif"><img name="g_90" src="g50_0.gif"><img name="g_100" src="g-100_2.gif"></font></td>
		<td rowspan="4" width="20" bordercolor="#44629f"></td>
		<td rowspan="4" width="70" bordercolor="#44629f" valign="center">
			<font color="white"><strong>Required Speed</strong></font></td>
		<td rowspan="4" width="20" bordercolor="#44629f"></td>
	</tr>
	<tr height="70">
		<td valign="top" bordercolor="#44629f" height="70">
			<font color="white" size="4"><strong>Speed:</strong></font></td>
		<td valign="top" bordercolor="#44629f" align="right" height="70"><strong>
			<font id="txtSpeed" color="yellow" size="4">0</font></strong></td>
		<td valign="top" bordercolor="#44629f" width="40" height="70">
			<font color="yellow" size="4"><strong>rpm</strong></font></td>
	</tr>
	<tr height="70">
		<td valign="top" bordercolor="#44629f" height="70">
			<font color="white" size="4"><strong>Application mode:</strong></font></td>
		<td colspan="2" bordercolor="#44629f" valign="top"><strong>
			<font id="txtStatus" align="right" color="yellow" size="4">Stopped</font></strong></td>
	</tr>
	<tr height="50">
		<td></td>
		<td valign="bottom" bordercolor="#44629f" height="50">
			<input name="btnUP" style="FONT-WEIGHT: bold; HEIGHT: 34px; LEFT: 76px; TOP: 0px; WIDTH: 89px" type="button" value="UP"></td>
		<td valign="bottom" bordercolor="#44629f" height="50" width="40">
			<input name="btnDOWN" style="FONT-WEIGHT: bold; HEIGHT: 34px; LEFT: 76px; TOP: 0px; WIDTH: 89px" type="button" value="DOWN"></td>
		<td bordercolor="#44629f" valign="bottom" width="70" height="50"></td>
	</tr>
	<tr height="20">
		<td colspan="9" height="20" bordercolor="#44629f"></td>
	</tr>
</table>
<font id=txtErrMsg></font></P>

<script language="VBScript">

Window.SetInterval "Periodically", 500

</script>
		
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -