Latest Posts

Thursday, October 19, 2017

Build the Tiny SecsGem base on the secsdriver.


With the SecsDriver, we can build the SECSGEM (E30) application base on it, called TinySecsGem.

OS and Hardware

- Raspberry Pi (ARM APU) with raspbian OS
- Window or Linux OS. 

The middle layer of TinySecsGem include

- Database: Mysql
- Script control language: Lua script
- Communication: TCP/IP or RS-232
- Setting Equipment Control: Web application, bootstrap, mysql, php, apache.
- Communication with equipment sensor, device.. via TCP/IP.
- and SecsDriver.

SEMI Std supported:

- E4 SECS-I, E5 SECS-II, E37 HSMS
- E30 GEM
     + Establish Communications: Eqp send establish communication and Eqp attempts to establish communication.
     + Data Collection: Grant multiblock, Dynamic Event Report Configuration.
     + Variable Data Collection
     + Trace Data Collection
     + Limits Monitoring(S2F45, S2F47)
     + Status Data Collection
     + On-line Identification
     + Alarm Management
     + Remote Control Command
     + Equipment Constants
     + Process Program Mng
     + Material Movement (Not support yet)
     + Equipment Terminal service (stream 10)
     + Error Message
     + Clock



Saturday, September 30, 2017

Secsdriver: Access the SECS-II message which not been defined in XSML file.


When we build the Tiny SECS/GEM, we got the issues like this.
The S2,F15 New equipment const send, it send from host to equipment to define the equipment const.

secsdriver provided the method to process. In lua script file, we have the new function named "EQPReceivedMsg"

Code
So, with the S2F15 message, all of data item will be accessed by the index look like Jquery Selected. Example code:
After receive the ECID and ECID value, we can process to save this ECID to database, and do reply the secondary message S2F16 with the ACK OK to host. The secsdriver support the API to send message on the fly.


Email me if you have the issue !

We are building the Tiny SECS/GEM on the raspbery Pi. Keep connect with us to see more...
Thank you.

Monday, August 21, 2017

SecsDriver on Raspberry Pi3

The raspberry Pi, is the tiny computer which is built on the ARM CPU architecture. So we have to rebuild the c++ source code for ARM  architecture.

We try a lot with the cross compiler for ARM, but it still get stuck with the LUA library. Finally, we bring the source code into the Raspberry Pi...and we solved it.

You can try it now.

Step by step to install the SecsDriver system on Raspberry Pi

1. Assumption you already have the Pi (we already test with the Jessie image, can be download here https://github.com/AlbrechtL/RPi-QEMU-x86-wine)

2. Get the secsdriver4pi by download here: 

3. Upload and unzip to pi at /home/pi/secs

4. Run 
./secsdriver secsdriver.ini

Enjoy it
**************************************************
* Establish Communication Request
**************************************************
s1f13 = S1F13_S w output
    
        
    >.  
s1f14 = S1F14_R input
           = commack
        
    >.

Saturday, April 29, 2017

Tutorial: SECS-II Message definition in the XSML file.


Overview

To communication with the semiconductor equipment, you have to use the E5 SEMI standard (SECS-II). We can define the SECS-II message in the file, and the SecsDriver can process it.

With the host controler, we have to kind of messages. One called the solicited message, and the other is unsolicited messages.

Solicited message 

That means, you know exactly the sending primary message and the receiving secondary message, with the structure and data type also.
Example:
1. S1F1 ARE YOU THERE
**************************************************
** On Line Data
**************************************************
S1F1 = S1F1_AREYOUTHERE w output
    <L[2]
        <A 'Test eqp'>          = mdln
        <A 'SecsDriver-1.0'>    = softrev
    >.
S1F2 = S1F2_R input
    <L>.
S6F11
<L[3]
    <U[4] 1>
    <U[4] 22>
    <L[0]>
>.
In this example, the SecsDriver know the sending message S1F1, and expected to receiving S1F2 with the empty LIST datatype.
To send this message, in the SecsDriver supported the API, named SendRecvMessage
SendRecvMessage ("S1F1_AREYOUTHERE");
Before sending, we can set data by calling the API
SetValue( "S1F1_AREYOUTHERE", "mdln", "VARIAN_KESTREL" );
SetValue( "S1F1_AREYOUTHERE", "softrev", "Version1" );
The completed script code:
-- set value to mdln variable
SetValue( "S1F1_AREYOUTHERE", "mdln", "VARIAN_KESTREL" );
-- set value to softrev variable
SetValue( "S1F1_AREYOUTHERE", "softrev", "Version1" );
-- send S1F1 and wait for the S1F2
SendRecvMessage ("S1F1_AREYOUTHERE");
-- End
One more example with the Remote Command S2F41
**************************************************
* Host Command Send
**************************************************
s2f41 = S2F41_F42_GO_REMOTE_COMMAND w output
    <L[2]
        <A 'GO_REMOTE'>
        <L[0]>
    >.            
s2f41 = S2F41_F42_CLAMP_COMMAND w output
    <L[2]
        <A 'CLAMP'>
        <L[1]
            <L[2]
                <A 'LOC'>
                <b[1]>              = loc         
            >
        >        
    >.                
s2f41 = S2F41_F42_CANCEL_JOB_COMMAND w output
   <L[2]
        <A 'CANCEL_JOB'>
        <L[1]
            <L[2]
                <A 'MID'>
                <a[22]>             = mid1
            >
        >            
    >.        
s2f42 = S2F42_R input
    <L[2]
        <B[1]>                          = hcack
        <L[max 10 index i] 
            <L[2]
                <A[10]>                 = cpnames[i]
                <B[1]>                  = cpacks[i]
            >
        >    count n_params
    >.
In this case, the message
- S2F41_F42_GO_REMOTE_COMMAND this don't have any paparameter.
S2F41_F42_CLAMP_COMMAND have the parameter named loc.
If you want to lock the LOAD port 1, should be sent the message with value 01.
-- Set the load port 01
SetValue( "S2F41_F42_CLAMP_COMMAND", "loc", "1" );
-- Send the remote command
SendRecvMessage ("S2F41_F42_CLAMP_COMMAND");

Is this easy ? :D


Friday, April 28, 2017

Tutorial: How to build the Host Request GoOnline

Overview

Host want to send the GoOnline Request to the semiconductor equipment. The scenario likes that:

Prerequisite

1. SecsDriver had been run in the VirtualBox: See last post how to install in virtualBox

2. Download or compile the HostExample. The binary and source code which can download from:


3. The SecsDriver Controler. Can be download source code and binary from here

Deployment

1. SecsDriver and SecsDriver (tool Simultor) run on VirtualBox
2. HostExample run on Host PC
3. SecsDriverControler run on HostPC

Configuration

The default configuration:
1. SecsDriver Host
- Host port: listening on port 5555 (Waiting connection from HostExample)
- Service port: listening on port 6666 (Waiting connection from SecsDriver Controler)
- CONTROL0=Type=HSMS-SS;Log= 0log;DeviceId=0;LUA=lua2.lua;XSML=varian_host.xsml;Port=9000;IpAddress=192.168.1.1;Mode=Passive;Role=HOST;T3=10;T5=5;T6=10;T7=10;T8=10;TCA=5

2. SecsDriver Tool (simulator)
- Host port: listening on port 5557 (Waiting connection from HostExample)
- Service port: listening on port 6667 (Waiting connection from SecsDriver Controler)
- CONTROL0=Type=HSMS-SS;Log=0log_tool;DeviceId=0;LUA=lua2.lua;XSML=varian_tool.xsml;Port=9000;IpAddress=127.0.0.1;Mode=Active;Role=HOST;T3=10;T5=5;T6=6;T7=10;T8=10;TCA=5

Running

From virtualBox:

1. Run SecsDriver Host

./run.sh

2. Run SecsDriver Tool (Simulator)

./run_tool.sh

3. Run SecsDriverControler (MSC.exe)

Connect to SecsDriver Host, by IP of Virtualbox and port 6666 (port 6666 is the service port of SecsDriver Host)

4. Run HostExample
Connect to the SecsDriver Host, by IP of VirtualBox and port 5555.

Tip: How to get the IP of the VirtualBox ?
run the linux command 
ifconfig


In this example, the IP of VirtualBox is 192.168.1.8

Now we go to the main tutorial, how to build the GoOnline Request from host

Build the GoOnline Request

First, use the MSC connect to the SecsDriver Host (port 6666), then try to send the S1F1 (are you there) by click on the SEND MESSAGE from the MSC. (See the image)
You can see the S1F1 has been sent and get back the reply S1F2 from SecsDriver simulator


Update the host script control

OK, so now we get the script and change some thing. From MSC, Control_0 tree node, right click and choose GET SCRIPT




And you will get back the script of the Control_0.

The MSC.exe have the very bad of text editor :( i am sorry :) so you can copy all to your text editor.
This is the LUA script language (https://www.lua.org)

Check the script here

function MESRequest(xmlRequest, ctlId)
    print("MESRequest Begin ctlId="..ctlId.." currentControlId="..ControlID.."\n");
    print("-XML="..xmlRequest);
    xml = xmlParser( xmlRequest );
    if (xml==nil or xml[1]==nil or xml[1].xarg==nil) then
    print "NULL"
    do return end
    end
    print_r( xml );
    requestname = xml[1].xarg.name;
    requestControlId = xml[1].xarg.controlId;
    -- Check the control Id...
    if(tonumber(requestControlId)~=ControlID) then
        print("If this is not the same Control ID, do not process...\n")
        print("MESRequest END...")
        return
    end
    -- print( "SIZE="..#xml[1] );
    param={};
    for i=1,#xml[1] do
        param[xml[1][i].xarg.name]=xml[1][i][1];
    end
    print( "Request Name: ["..requestname.."]\n" );
    print( "Parameter:\n-----------------" );
    print_r( param );
    print( "-----------------\n" );

    if( requestname=="GoOnline" ) then
        GoOnline( param );
    elseif( requestname=="GoOffline" ) then
        GoOffline( param );
    else
        WriteLog( "LUA CALL WRITE STRING " );
    end

    print("MESRequest End\n");
end

All host request will be came from the function MESRequest.

String: xmlRequest: is the XML (or JSON) from the HostExample
String: ctlId : is the control Id. (integer value)

If the requestname = "GoOnline" it will call to the GoOnline

function GoOnline(param)
-- SEND S1F1 message - and wait for getting back S1F2.
SendRecvMessage( "S1F1_F2_ARE_YOU_THERE" );
-- Report to HostExample
HostReport[[<HostReport name="GoOnlineRpt"><param name="resultText">Send GoOnlineReq to Equipment Sucessful</param></HostReport>]];
end

In the MSC, find the GoOnline function, and replace by this code above
Then, click on SAVE SCRIPT. MSC will update the lua script in the SecsDriver Host. (on virtualbox)


So now, from HostExample, connect to SecsDriver Host, then BuildReq and finally send the request to SecsDriver Host.



You can see the request had been sent to SecsDriver Host.
Then SecsDriver Host, send S1F1 to tool and wait to get back S1F2
Then, SecsDriver Host send the HostReport to hostExample.

Enjoy !

Monday, April 24, 2017

The SecsDriver Controller Application (with source code)

See article:
1 SecsDriver, the demo in virtualbox image
2 SecsDriver, the cross-flatform SECS-II driver

Overview

The SecsDriver Controller, is the tool to view the SecsDriver.


Download

You can download the source code MSC.src..zip from
https://www.mediafire.com/folder/4hj5wascjg4xh/SecsDriver


Screenshot


Configuration

In the master configuration file of SecsDriver, secsdriver.ini we have the session

[HOST]
# SERVICE_TCPPORT: SecsDriverControler will connect to this port
SERVICE_TCPPORT=6666

The SecsDriver will listen on the port 6666, and the SecsDriverControler will connect to this port

How to run the demo

1. Run the SecsDriver on VirtualBox (see the last post http://www.secsdriver.com/2017/04/secsdriver-demo-in-virtualbox-image.html)

2. In virtualBox linux, run the command to start SecsDriver as the Host Role

./run.sh

It will run the SecsDriver with the master configurtion file at: /mnt/sda1/secs/secsdriver.ini

3. Get the IP of the virtualbox machine by run the command:

ifconfig

Example, the IP is 192.168.1.7

4. Run the SecsDriverControlerApp on another PC (or the virtualbox host pc, Windows OS)

5. Connect to IP 192.168.1.7, Port 6666

You will see




SecsDriver, the demo in virtualbox image

Download the demo virtualbox image

https://www.mediafire.com/folder/4hj5wascjg4xh/SecsDriver

Step by step to run the SecsDriver demo

1. Download virtualBox, and install virtualbox into your computer.

https://www.virtualbox.org/wiki/Downloads

2. Download the virtualbox image. This is the linux distro Tinycorelinux, also includes LUA, lualib, and SecsDriver.
http://www.mediafire.com/file/713uxqzjp9qc3bc/tce72.zip

After download, unzip tce72.zip into the VDI file, tce72.vdi

3. Create new VirtualBox machine from the vdi file.


Choose the tce72.vdi file

Bridge Adapter
4. Start the VirtualBox Image.


The linux distro is Tinycorelinux, download from http://tinycorelinux.net/
After start, right click mouse to open the terminal. Then do step by step (check the screen image above)

Step 1: Update the lastest secsdriver binary.

sudo ./update.sh

Step 2: When try to run the secsdriver by command:

./run.sh

You will see the message like that, MacGET = []: ec:55:f9:f4:6d:2d So you need to get the new reg.dat file from our website

Step 3: Open the Chominium browser, go to http://www.semisoftware.com/reg
Then upload the file reg.dat from /mnt/sda1/secs; and get back the download file reg.dat.
Usually, the download file reg.dat will be stored in /home/tc/Downloads/reg.dat.

Step 4: Start secsdriver. The script run.sh also have the copy command to copy the reg.dat file from Downloads folder to /mnt/sda1/secs.

./run.sh


Start secsdrive ./run.sh

About Me

Work as the developer. c++, cpp, java, c#...
vuzzan@gmail.com

Popular Posts

Search This Blog