代码名称-功能简述
G00------快速定位
G01------直线插补
G02------顺时针方向圆弧插补
G03------逆时针方向圆弧插补
G04------定时暂停
G05------通过中间点圆弧插补
G07------Z 样条曲线插补
G08------进给加速
G09------进给减速
G20------子程序调用
G22------半径尺寸编程方式
G220-----系统 *** 作界面上使用
G23------直径尺寸编程方式
G230-----系统 *** 作界面上使用
G24------子程序结束
G25------跳转加工
G26------循环加工
G30------倍率注销
G31------倍率定义
G32------等螺距螺纹切削,英制
G33------等螺距螺纹切削,公制
G54------设定工件坐标系一
G55------设定工件坐标系二
G56------设定工件坐标系三
G57------设定工件坐标系四
G58------设定工件坐标系五
G59------设定工件坐标系六
G60------准确路径方式
G64------连续路径方式
G70------英制尺寸 寸
G71------公制尺寸毫米
G74------回参考点(机床零点)
G75------返回编程坐标零点
G76------返回编程坐标起始点
G81------外圆固定循环
G331-----螺纹固定循环
G90------绝对尺寸
G91------相对尺寸
G92------预制坐标
plc程序转为源代码步骤如下。1、在编程软件STEP7V5.5中打开想要导出的块,可以是FB,FC,DB等。
2、在打开的FC1界面的菜单中,选择文件生成源文件,输入源文件的名称后,单击“确定”,然后在生成源文件的界面中,将想要生成源文件的块从“未选择的块”添加到“选择的块”中,然后点“确定”。
3、在“源文件”的文件夹里面找到刚才生成的源文件FC1,选择编辑导出源文件,选择合适的路径,即可导出。
'人人为我,我为人人'枕善居汉化收藏整理
'发布日期:2007/09/09
'描 述:仪表盘方式显示CPU和硬盘温度及系统信息
'网 站:http://www.Mndsoft.com/ (VB6源码博客)
'网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
'ADOINFO - a Programm to Monitor the Ressource Usage (C) by TETKOduma
'
'with Car-like Gauges as Displays for:
' CPU MHZ
' CPU Usage as %
'CPU Temperature in Celsius
'HDD Temperature and S.M.A.R.T infos
'Ram USage
'and Battery load state
'This is quite usefull for Notebook users like me
'It's Tipcal for me that i dont like the
'the normal Forms and Designs, so it's Skinned again
'I Use the Smart Information for the Harddisk Temperature
Function GetDriveTemp()
Dim drv_info As DRIVE_INFO
drv_info = GetDriveInfo(0)
With drv_info
If .bDriveType = 0 Then Label2.Caption = "[无可用信息]"
If .bDriveType = 2 Then Label2.Caption = "[ATAPI 驱动器 - 无可用信息]"
If .bDriveType = 1 Then
For i = 0 To UBound(.Attributes)
If Trim$(.Attributes(i).AttrID) = "194" Then GetDriveTemp = (.Attributes(i).Raw(0)): Exit Function
Next i
End If
End With
End Function
'The Information Scrollab at the Bottom, used to Display now the SMART Information
Sub LAufschrift()
Dim drv_info As DRIVE_INFO
drv_info = GetDriveInfo(0)
With drv_info
If .bDriveType = 0 Then Label2.Caption = "[无可用信息]"
If .bDriveType = 2 Then Label2.Caption = "[ATAPI 驱动器 - 无可用信息]"
If .bDriveType = 1 Then
MsgScroller1.AddItem "模式:" &vbTab &vbTab + Trim$(.Model) + " "
MsgScroller1.AddItem "序号:" &vbTab &vbTab + Trim$(.SerialNumber) + " "
MsgScroller1.AddItem "固件: " &vbTab + Trim$(.FirmWare) + " "
MsgScroller1.AddItem "属性: " + "NAME [Value] [Treshold] [WorstValue] [RAW] "
For i = 0 To UBound(.Attributes)
MsgScroller1.AddItem "[" + Trim$(.Attributes(i).AttrID) + "] " + Trim$(.Attributes(i).AttrName) + " " + CStr(.Attributes(i).AttrValue) + " " + Trim$(.Attributes(i).ThresholdValue) + " " + Trim$(.Attributes(i).WorstValue) + " " + Trim$(.Attributes(i).Raw(0)) + " "
Next i
End If
End With
End Sub
Private Sub Form_Load()
Dim Ret As Long
'Dim Ret As Long
'Set the window style to 'Layered'
Ret = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
Ret = Ret Or WS_EX_LAYERED
SetWindowLong Me.hwnd, GWL_EXSTYLE, Ret
'Set the opacity of the layered window to 200
SetLayeredWindowAttributes Me.hwnd, 0, 240, LWA_ALPHA
'X = Form1.Width / 2: Y = Form1.Height / 2
'Query anlegen und Handle darauf ermitteln
RetVal = PdhOpenQuery(0, 1, hQuery)
If RetVal <>0 Then
MsgBox "获取信息失败!", vbExclamation, "提示!"
End
End If
'Performance-Counter definieren
RetVal = PdhVbAddCounter(hQuery, "\Prozessor(0)\Prozessorzeit (%)", hCounter) 'German OS
If RetVal <>0 Then
RetVal = PdhVbAddCounter(hQuery, "\Processor(0)\% Processor Time", hCounter) ' English OS
If RetVal <>0 Then
MsgBox "获取信息失败!", vbExclamation, "提示!"
PdhCloseQuery hQuery 'Query im Fehlerfall wieder schlie遝n
End
End If
End If
'CPU Infos ermitteln via WMI !Slow!
CPU ' We do this Once at Start
HDAnz = ListDrives 'Die Anzahl der Laufwerke holen
xP = 0
iDir = 4
Unload splash2
Call LAufschrift 'Fill the Bottom Status Bar with Information
End Sub
Private Sub Form_Unload(Cancel As Integer)
PdhCloseQuery hQuery 'Query wieder schlie遝n
End Sub
'CarComputer like Display With Wordwrap Function
'Input: PictureBox, LeftTop Position with X,Y, Wide, height, BackgroundColor, ForegroundColor, Text
Sub CarComp(Pic As PictureBox, x, y, G, G1, fa, fa2, Text)
X1 = 0
y1 = 0
'Drawing the BAckground with Line and BF Option (B for Box, F for FILLED)
If fa <>fa2 Then
Pic.Line (x, y)-(x + G, y + G1), fa, BF
End If
'Now Setting the Color for the Text and right Textsize
Pic.ForeColor = fa2
Pic.FontSize = 10
' Draw the Text on our little Display
For i = 1 To Len(Text)
s = Mid$(Text, i, 1)
A = Pic.TextWidth(s)
B = Pic.TextHeight(s)
Pic.CurrentX = x + X1
Pic.CurrentY = y + y1
If s = Chr$(12) Then
X1 = 0
y1 = y1 + B
If y1 >G1 Then Exit Sub
Else
Pic.Print s
X1 = X1 + A
If X1 >= G Then X1 = 0: y1 = y1 + B: If y1 >G1 Then Exit Sub
End If
Next i
End Sub
' Super Gauge Car like Speed Display with Leds
Sub SGauge(Pic As PictureBox, x, y, G, fa, Wert, Text)
Dim X1, X2, x3, y1, y2, y3 As Double
PI = 3.1415926543 'Pi
Z = 10
XT = 0 '
G1 = Int(G / 100) 'Our Mesarement ist %, so we build the unit
Gr = G1 * 70 'Z3 is the Radius of the Text, The lines starts from
Z1 = G1 * 110
Z2 = G1 * 130
Z3 = G1 * 90 'Radius Z2 to to radius of Z3
F1 = G1 - 2
If F1 <10 Then F1 = 10 'We care about Font Size, should not be smaller then 10
Pic.FontSize = F1 'Setting the Font
Pic.DrawWidth = 1 'Starting with line a normal thick line
Pic.Circle (x, y), Gr, fa, 5.8, 4# 'Drawing in the inner Circle
A1 = (1.78 * PI) - ((((1.78 * PI) - 1) / 100) * Wert) 'Changing the Value in Wert to an angle
r = 0 'Starting Color is Black
For i = 1.78 * PI To 1 Step -0.0455
X1 = x + Int(sIn(i) * Z1)
y1 = y + Int(Cos(i) * Z1) 'Line From Point
X2 = x + Int(sIn(i) * Z2)
y2 = y + Int(Cos(i) * Z2) 'Line to Point
x3 = x + Int(sIn(i) * Z3)
y3 = y + Int(Cos(i) * Z3) 'Postion of Text
If A1 <= i Then 'if our Value Angel is smaler or Equal then bright LEDs
If Wert <70 Then fru = &H6600 + Wert * 2 Else fru = &H33 + Wert * 2
Pic.DrawWidth = 2 'a biger Line is like a LED -)
Else
Pic.DrawWidth = 2 'the Small dark line means the LED is off
fru = 0
End If
If Z = 10 Then 'Every Ten line we draw a longer White Line in the Gauge
Pic.DrawWidth = 2
Pic.CurrentX = x3 - 40 - Pic.TextWidth(XT) / 2
Pic.CurrentY = y3 - Pic.TextHeight(XT) / 2 'Calculate the Text Position
Pic.ForeColor = fa
Pic.Print XT
XT = XT + 10 'Dawing Gauge Measerment in steps of 10
Pic.Line (X1, y1)-(X2, y2), fa
'AALine pic.hdc, X1, VarPtr(y1), VarPtr(X2), VarPtr(y2), VarPtr(Fa), 2, 100
Else
Pic.Line (X1, y1)-(X2, y2), (r + fru) '
'AALine pic.hdc, VarPtr(X1), VarPtr(y1), VarPtr(X2), VarPtr(y2), VarPtr(r + fru), 2, 100
End If
Z = Z + 1
If Z >10 Then Z = 1
r = &H6000
Next i
Pic.FontSize = 8
Pic.CurrentX = x - (Pic.TextWidth(Text) / 2)
Pic.CurrentY = y + G1 * 80
Pic.Print Text
End Sub
'Draws a horizontal Bar, like a Progressbar
Sub Balken(Pic As PictureBox, x, y, G, D, fa, Wert, Text)
Pic.DrawWidth = 1
xf = Pic.TextWidth(Text) + 40
'Wert = 90
Pic.CurrentX = x
Pic.CurrentY = y - 30
Pic.ForeColor = fa
Pic.Print Text
Pic.Line (x + xf, y)-(x + xf + G, y + D), fa, B
G2 = G - 40
D2 = D - 40
L = Int((G2 / 100) * Wert)
If Wert <85 Then fa2 = &H10000 Else fa2 = &H1
X2 = x + 20 + xf
x3 = x + xf + L
For i = 1 To D2 / 2 Step 3
y2 = y + i + 20
'F3 = ((90 + I) * fa2 + &H444444)
F3 = RGB(50, 160 + i, 50)
Pic.Line (X2, y2)-(x3, y2), F3
Next i
For i = 1 To D2 / 2 Step 3
y2 = y + (D2 / 2 + i) + 20
'F3 = ((90 + (D2 / 2 - I)) * fa2 + &H444444)
F3 = RGB(50, 160 - i, 50)
Pic.Line (X2, y2)-(x3, y2), F3
Next i
End Sub
Sub Balken2(Pic As PictureBox, x, y, G, D, fa, Wert, Text)
Pic.FontSize = 8
Pic.DrawWidth = 1
L = Int((G / 100) * Wert)
xf = Pic.TextHeight(Text) + 40
XB = Pic.TextWidth(Text) / 2
Pic.CurrentX = x - XB
Pic.CurrentY = y - xf - 20
Pic.ForeColor = fa
Pic.Print Str$(Wert) + Text
'pic.Line (x, y)-(x + D, y + g + 14), 0, BF
Pic.Line (x, y)-(x + D, y + G + 14), fa, B
G2 = G - 40
D2 = D - 40
L = Int((G2 / 100) * Wert)
L = Int((G2 / 100) * Wert)
If Wert <85 Then fa2 = &H10000 Else fa2 = &H1
X2 = x + D
y3 = y + G
For i = L To 1 Step -1
F3 = &H882222 + (i / 6)
y3 = y + G - i
Pic.Line (x + 10, y3)-(x + D - 10, y3), F3
Next i
For i = L To 100
y3 = y + G - i
Pic.Line (x + 10, y3)-(x + D - 10, y3), o
Next i
End Sub
'Gauge Type 1
Sub DrawGauge1(Pic As PictureBox, x, y, G, fa, Text)
PI = 3.1415926543
Z = 5
XT = 0
G1 = Int(G / 100)
Gr = G1 * 70
Z1 = G1 * 110
Z2 = G1 * 130
Z3 = G1 * 90
F1 = G1 - 2
If F1 <10 Then F1 = 10
Pic.FontSize = F1
'Pic.Caption = Str$(g1) + " " + Str$(R)
Pic.Circle (x, y), Gr, fa, 5.8, 4#
For i = 1.78 * PI To 1 Step -0.091
X1 = x + Int(sIn(i) * Z1)
y1 = y + Int(Cos(i) * Z1)
X2 = x + Int(sIn(i) * Z2)
y2 = y + Int(Cos(i) * Z2)
x3 = x + Int(sIn(i) * Z3)
y3 = y + Int(Cos(i) * Z3)
If Z = 5 Then
Pic.DrawWidth = 2
Pic.CurrentX = x3 - 40 - Pic.TextWidth(XT) / 2
Pic.CurrentY = y3 - Pic.TextHeight(XT) / 2
Pic.ForeColor = fa
Pic.Print XT
XT = XT + 10
Else
Pic.DrawWidth = 1
End If
Z = Z + 1
If Z >5 Then Z = 1
Pic.Line (X1, y1)-(X2, y2), fa
Next i
Pic.FontSize = 8
Pic.CurrentX = x - (Pic.TextWidth(Text) / 2)
Pic.CurrentY = y + G1 * 80
Pic.Print Text
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)