Showing posts with label secs-ii. Show all posts
Showing posts with label secs-ii. Show all posts

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


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

Sunday, April 9, 2017

SecsDriver, the cross-flatform SECS-II driver

1. Overview


The SecsDriver is the SEMI Standard software, implement the E4, E37 and E5 of SEMI Standard. We can use the SecsDriver to communitace with the semiconductor equipment via TCP/IP or RS-232 (COM port). With one SecsDriver, we can control many equipments. (maximum is 32).

OS support:
- Windows
- Linux x86 architecture
- Raspbian for Raspberry Pi ( ARM CPU)

2. How does it work


When the SecsDriver run, it will load:
1. The master config file, specific how many controler (equipment), and detail configuration for each equipment.
2. For each equipment, need 2 files: one for SECS-II message defined, and the other for the control logic (writen by LUA language)

3. Example of the master config

[HOST]
# HOST_TCPPORT: Will open this TCP port for listening.
# The Host will connect to this port to SEND request and RECV data collection report.
HOST_TCPPORT=5555

# HOST_FORMAT: Define format of mesage from HOST. We support XML and JSON
# XML, JSON 
HOST_FORMAT=XML

# SERVICE_TCPPORT: Will be implement later. 
SERVICE_TCPPORT=6666

[CONTROLS]
# CONTROL_COUNT: count of control.
# Each control is the Secs Entity (HSMS or SECS-I) 
# MingwSecs will load from index 0. Ignore from index count
CONTROL_COUNT=2

# Define configuration for each control.
# Type=SECS-I OR HSMS(HSMS-SS)
# DeviceId=n (unsigned short 2 byte): Device ID
# LUA= file name of LUA script file.
# XSML= file name of SML file to define SECS-II message 
# Port: for SECS-I, PORT=0-31 ( 0: COM1, 1: COM2, .... so on...)
#   for HSMS, PORT is the int value. If mode is PASSIVE, will open the listening port.
#            If mode is ACTIVE, will connect to the remote port.
# FOR SECS-I
# Role: value is: Host or Equipment
# T1: Only for SECS-I. T1 timeout
# T2: Only for SECS-I. T2 timeout
# T3: For both SECS-I and HSMS. T3 timeout (wait for secondary message)
# T4: Only for SECS-I. T4 timeout (Inter block timeout)
# RETRY: Only for SECS-I. Retry limit. Value range:(0-31)
# MS: Only for SECS-I. MASTER/SLAVE
# BAUDRATE: Only for SECS-I. BAUDRATE param for RS-232

# FOR HSMS
# Role: value is: Host or Equipment
# IpAddress: only for HSMS-SS. This is the remote IP address
# Mode: only for HSMS-SS, value is: Active or Passive
# T3: For both SECS-I and HSMS. T3 timeout (wait for secondary message)
# T5: Only for HSMS. T5 timeout
# T6: Only for HSMS. T6 timeout
# T7: Only for HSMS. T7 timeout
# T8: Only for HSMS. T8 timeout
# TCA: Only for HSMS. Linktest timeout

#CONTROL 0: HSMS
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=60;T6=10;T7=10;T8=10;TCA=5

#CONTROL 1: SECS-I
CONTROL1=Type=SECS-I;Log= 1log;DeviceId=0;LUA=lua2.lua;XSML=varian_host.xsml;Port=1;Role=HOST;baudrate=9600;T1=10;T2=5;T3=10;T4=10;T8=10;retry=3;MS=MASTER

4. Example for equipment  SECS Message Defined

**************************************************
** Stream 1 Abort
**************************************************
S1F0 = S1F0 .

**************************************************
** Are You There
**************************************************
S1F1 = S1F1 input.

**************************************************
** On Line Data
**************************************************
S1F2 = S1F2 output
    <V> .

S1F1 = S1F1 w output
 <L[2]
  <A 'Test eqp'>
  <A 'SecsDriver-1.0'>
 >.

**************************************************
** On Line Data
**************************************************
S1F2 = S1F2 input
    <L>.

5. Example of control logic file

--====================================================
-- PROCESS MESSAGE FROM EQUIPMENT
--====================================================
--====================================================
-- MESRequest
-- THIS FUNCTION WILL BE CALLED WHEN SECSDRIVER RECEIVED
-- MES REQUEST FROM MESCLIENT
-- INPUT: XML REQUEST
-- 
-- example request
-- <mesRequest name="GoOnline">
--     <param name="param1">12</param>
--     <param name="param2">123</param>
--     <param name="param3">124</param>
--     <param name="param4">125</param>
--     <param name="param5">126</param>
-- </mesRequest>
-- 
--====================================================
function MESRequest(xmlRequest)
    print("MESRequest Begin");
    -- print("-RequestName="..requestname);
    print("-XML="..xmlRequest);
    xml = xmlParser( xmlRequest );
    -- print_r( xml );
    requestname = xml[1].xarg.name;
    -- 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" );
 SendRecvMessage( "S6F11_1236_S" );
    print("MESRequest End\n");
end

--====================================================
-- EQPReceived
-- THIS FUNCTION WILL BE CALLED WHEN SECSDRIVER RECEIVED
-- SECS-II PRIMARY MESSAGE FROM EQUIPMENT.
-- 
-- INPUT: 
--    1. s: Stream
--    2. f: Function
--    3. sys: System byte. ( this used for input to
--        the API SendSecondaryMessage()
--====================================================
function EQPReceived(s,f,sys)
    print("EQPReceived Begin");
    print("-S="..s);
    print("-S="..f);
    print("-System Byte="..sys);

 if( f%2==1 ) then
  SendSecondaryMessageByID(s, f+1, sys);
  if( s==1 and f==13){
   print("EQPReceived PROCESS S1F13------------------------");

   SendMessageXML("S1F1 = S1F1_ARE_YOU_THERE_API output W .");
  }
 end
    print("EQPReceived END\n");
end


About Me

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

Popular Posts

Search This Blog