Programming Examples & Sample Code
G-4. Sample Code for control PCI Industrial Card
Date : 2003, Feb. 12
Program idea:
Hardware I/O card used
The PCI Industrial Card with
a. Port0 -- 16 Photo Board
b. Port1 -- 16 Relay Board
c. Port2 -- 8Photo 8Relay Board
d. Port3 -- 8SSR Board

If PCI Industrial Card port 0 Channel 0 Isolator Input On
    Then Port 1 Channel 0 Relay Output ON
    and
    If PCI Industrial Card port 2 Channel 8 Isolator Input On
        Then Port 3 Channel 0 Relay Output ON
    Else PCI Industrial Card port 0 Channel 0 Isolator Input OFF
        Then Port 3 Channel 0 Relay Output OFF
Else PCI Industrial Card port 0 Channel 0 Isolator Input OFF
    Then Port 1 Channel 0 Relay Output OFF
    and
    If PCI Industrial Card port 2 Channel 9 Isolator Input On
        Then Port 3 Channel 1 Relay Output ON
    Else PCI Industrial Card port 2 Channel 9 Isolator Input OFF
        Then Port 3 Channel 1 Relay Output OFF


****** Sample Code for control PCI Industrial Card *****

import java.io.*;

import com.decision.rp.user.Adaptlet;

public class IndAdaptlet extends Adaptlet implements Runnable

{

public IndAdaptlet(){}

int state;

public void valueChanged(int card, int port, int line, int state)

{

if ((card == INDUSTRIAL_CARD) && (port == 0) && (line == 0) && (state == 1))

{

this.set(INDUSTRIAL_CARD,1,0,1);

state = this.get(INDUSTRIAL_CARD,2,8);

if (state == 1)

{

this.set(INDUSTRIAL_CARD,3,0,1);

}

else

{

this.set(INDUSTRIAL_CARD,3,0,0);

}

}

else

{

this.set(INDUSTRIAL_CARD,1,0,0);

state = this.get(INDUSTRIAL_CARD,2,9);

if (state == 1)

{

this.set(INDUSTRIAL_CARD,3,1,1);

}

else

{

this.set(INDUSTRIAL_CARD,3,1,0);

}

}

}

public void run(){}

public void stop(){}

public void start(){}

}

****** End Of Program *****

Back to main manual
Prepare JAVA Development Environment
Write your program
Digital I/O Command and Function
RS232/422/485 Serial Communication Command and Function
12 bit Data Acquisition Card Command and Function
Video Image Input Command and Function
Sample Code
Compile your JAVA Class application program
Upload your application program
Start and Stop run your application program
Tranzview System