用IPA函数
Private Declare Function SetLocalTime Lib "kernel32" (lpSystemTime As SYSTEMTIME) As Long
Public Sub SetTimer(Mstis As MstCtrlInstruction) '系统对时
Dim A As Long
Dim TimerS As SYSTEMTIME
TimerS.wDay = Day(Mstis.CompareTime)
TimerS.wYear = Year(Mstis.CompareTime)
TimerS.wMonth = Month(Mstis.CompareTime)
TimerS.wHour = Hour(Mstis.CompareTime)
TimerS.wMinute = Minute(Mstis.CompareTime)
TimerS.wSecond = Second(Mstis.CompareTime)
A = SetLocalTime(TimerS)
Dim Del_zdrw As PPCInfoBlock
Set Del_zdrw = New PPCInfoBlock
Del_zdrw.TaskCode = Mstis.TaskCode
Del_zdrw.InfoBlockType = cPkDtComplete
PwrPpcComm1.SendInfoBlock Del_zdrw
End Sub
Private Declare Function SetLocalTime Lib "kernel32" (lpSystemTime As SYSTEMTIME) As Long
Public Sub SetTimer(Mstis As MstCtrlInstruction) '系统对时
Dim A As Long
Dim TimerS As SYSTEMTIME
TimerS.wDay = Day(Mstis.CompareTime)
TimerS.wYear = Year(Mstis.CompareTime)
TimerS.wMonth = Month(Mstis.CompareTime)
TimerS.wHour = Hour(Mstis.CompareTime)
TimerS.wMinute = Minute(Mstis.CompareTime)
TimerS.wSecond = Second(Mstis.CompareTime)
A = SetLocalTime(TimerS)
Dim Del_zdrw As PPCInfoBlock
Set Del_zdrw = New PPCInfoBlock
Del_zdrw.TaskCode = Mstis.TaskCode
Del_zdrw.InfoBlockType = cPkDtComplete
PwrPpcComm1.SendInfoBlock Del_zdrw
End Sub
Private Const LOCALE_SDATE = &H1D '日期分隔符 如/、-
Private Const LOCALE_SLONGDATE = &H20 '长日期格式 如yyyy年MM月dd日
Private Const LOCALE_SSHORTDATE = &H1F '短日期格式 如MM/dd/yy
Private Const LOCALE_STIMEFORMAT = &H1003 '时间格式 如H:mm:ss
Private Const LOCALE_STIME = &H1E '时间分隔符 如:
SetLocaleInfo 0, LOCALE_STIMEFORMAT, "HH:mm:ss"