Jazz Soft 您要联络吗?   JazzSoft@live.com     简体字汉语   英语  日语  繁体字汉语  简体字汉语
提供半导体工厂自动化与生产效率改善法 
Skip Navigation Links首页 > 产品一览 > Savoy > Samples > Host (Visual Basic 2008)

Jazz Soft has been moved from Japan to New York in 2024.

Savoy ActiveX Control   




Brochures

Japanese

Savoy Sample - Mini Host (Visual Basic 2008)

This tutorial will explain programming with Savoy by making a mini host application.


Specification of Mini Host

Following is the specification of mini host which will control a general wafer inspection tool.

  • Attempt on-line, select recipe, start inspection and collect data.
  • The messages this software can send are as follows.


    Select.req
    Select.rsp
    S1F13
    S2F41
    S6F12


  • The messages this software can receive are as follows.


    Select.req
    Select.rsp
    S1F14
    S2F42
    S6F11


  • Initial setting on equipment side had already been configured and done.
  • Stream 9 and function 0 will not be processed.
  • Don't check T3 timeout.

Create New Project

  1. Launch Visual Studio 2017 and click [New] - [Project...] from File menu.




  2. Choose "Windows Forms Application" from "Visual Basic" project type, and type project name and folder name. For example, project name could be "SavoyTutorialVB2008". If setting was OK, click "OK" button.



  3. New project was created.




Add Savoy into Toolbox

Following procedure should be done only once. User doesn't have to do this again next time.
  1. Right click on empty area on Toolbox, click "Choose Items..." from the popup menu. This may take more than one minute until the next screen will appear.




  2. Select "COM Components" tab and put check mark on "Savoy ActiveX Control module". Click "OK" button.




  3. Since Savoy will be added to tool box, add new tab such as "Jazz Soft" and put them in it for ease of access in a future, if needed.




Paste Savoy into Form

  1. Place 1 SavoyHsms and 2 SavoySecsIIs on the form as follows.




  2. Make button event handler function. If user clicks "Open" button, communication setting dialog box of SavoyHsms will appear on the screen. And then establish connection, if user clicks "Open" button. Since communication setting would be saved in "Savoy.ini" file, user doesn't have to change the setting next time.

    Visual Basic

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      ' Setup
      hsms.LoadIniFile()
      If hsms.Setup("") Then
        ' If OK button was pressed, establish connection
        hsms.Connect = True
      End If
    End Sub



  3. If user clicks "Online" button, send S1F13 message.

    Visual Basic

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
      ' Send S1F13
      outmsg.SML = "s1f13w{}"
      hsms.Send(outmsg.Msg)
    End Sub



  4. If user clicks "PP Select" button, send remote command "PP-SELECT".

    Visual Basic

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
      ' Send S2F41 PP-Select
      outmsg.SML = "s2f41w{<a'PP-SELECT'>{{<a'PPID'><a'" + TextBox1.Text + "'>}}}"
      hsms.Send(outmsg.Msg)
    End Sub



  5. If user clicks "PP Start" button, send remote command "START".

    Visual Basic

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
      ' Send S2F41 Start
      outmsg.SML = "s2f41w{<a'START'>{{}}}"
      hsms.Send(outmsg.Msg)
    End Sub



Event Procedure

Capture events from SavoyHsms control.
  1. If Connected event occurs, send select request message.

    Visual Basic

    Private Sub hsms_Connected(ByVal sender As System.Object, ByVal e As AxSAVOYLib._DSavoyHsmsEvents_ConnectedEvent) Handles hsms.Connected
      ' Connected
      ' Send select request
      outmsg.SML = "Select.req"
      hsms.Send(outmsg.Msg)
    End Sub



  2. If Received event occurs, pass incoming message to SavoySecsII control to analyze message structure.

    Visual Basic

    Private Sub hsms_Received(ByVal sender As System.Object, ByVal e As AxSAVOYLib._DSavoyHsmsEvents_ReceivedEvent) Handles hsms.Received
      inmsg.Msg = e.lpszMsg



  3. If incoming message requires reply message, return appropriate message such as "<b 0>".

    Visual Basic

    Select Case inmsg.SType
    Case 0
      ' Data message
      If inmsg.Wbit And (inmsg.Function Mod 2) <> 0 Then
        ' Need to reply something...
        outmsg.SML = "<b 0>"
        outmsg.Reply(e.lpszMsg)
        hsms.Send(outmsg.Msg)
      End If



  4. If select request message arrives, reply select response message.

    Visual Basic

    Case 1
      ' Select request
      outmsg.SML = "Select.rsp"
      outmsg.Reply(e.lpszMsg)
      hsms.Send(outmsg.Msg)



Entire Source Code

That's it. This project was created from zero, however, the number of lines of entire source code is only 55 lines including empty lines and comments. Actual code we wrote was only 25 lines except comment lines. We didn't write any configuration file or data file which typically was required by competitors' products. Competitors' products are never as simple as Savoy.

Visual Basic

Public Class Form1

  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    ' Setup
    hsms.LoadIniFile()
    If hsms.Setup("") Then
      ' If OK button was pressed, establish connection
      hsms.Connect = True
    End If
  End Sub

  Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    ' Send S1F13
    outmsg.SML = "s1f13w{}"
    hsms.Send(outmsg.Msg)
  End Sub

  Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    ' Send S2F41 PP-Select
    outmsg.SML = "s2f41w{<a'PP-SELECT'>{{<a'PPID'><a'" + TextBox1.Text + "'>}}}"
    hsms.Send(outmsg.Msg)
  End Sub

  Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
    ' Send S2F41 Start
    outmsg.SML = "s2f41w{<a'START'>{{}}}"
    hsms.Send(outmsg.Msg)
  End Sub

  Private Sub hsms_Connected(ByVal sender As System.Object, ByVal e As AxSAVOYLib._DSavoyHsmsEvents_ConnectedEvent) Handles hsms.Connected
    ' Connected
    ' Send select request
    outmsg.SML = "Select.req"
    hsms.Send(outmsg.Msg)
  End Sub

  Private Sub hsms_Received(ByVal sender As System.Object, ByVal e As AxSAVOYLib._DSavoyHsmsEvents_ReceivedEvent) Handles hsms.Received
    inmsg.Msg = e.lpszMsg
    Select Case inmsg.SType
      Case 0
        ' Data message
        If inmsg.Wbit And (inmsg.Function Mod 2) <> 0 Then
          ' Need to reply something...
          outmsg.SML = "<b 0>"
          outmsg.Reply(e.lpszMsg)
          hsms.Send(outmsg.Msg)
        End If
      Case 1
        ' Select request
        outmsg.SML = "Select.rsp"
        outmsg.Reply(e.lpszMsg)
        hsms.Send(outmsg.Msg)
    End Select
  End Sub
End Class

您要联络吗?   JazzSoft@live.com
  Copyright © 1997 - 2024 Jazz Soft, Inc.