package cn.stylefeng.guns.plcserver.server.DOP020.callback;
|
|
import cn.stylefeng.guns.plcserver.opc.GlobalVariable;
|
import org.jinterop.dcom.common.JIException;
|
import org.jinterop.dcom.core.JIVariant;
|
import org.openscada.opc.lib.da.DataCallback;
|
import org.openscada.opc.lib.da.Item;
|
import org.openscada.opc.lib.da.ItemState;
|
|
public class DataCallBack_DOP020_J_PLC_START implements DataCallback {
|
@Override
|
public void changed(Item item, ItemState itemState) {
|
|
// 读取变量的值
|
try {
|
if (itemState.getValue().getType() == JIVariant.VT_BOOL) {
|
boolean value = itemState.getValue().getObjectAsBoolean();
|
GlobalVariable.DOP020_J_PLC_START = value;
|
}
|
} catch (JIException e) {
|
e.printStackTrace();
|
}
|
}
|
}
|