流年堪佳 发表于 2016-5-31 14:56:33

SPS模拟顺序输送中intran文件的编写

在模拟中,intran文件为:
DEFINE BATCH_CTRL = 0
DEFINE.SEQUENCE L_GAS (_SIZE_)
{ OPEN B_GASOLINE
POKE B_GASOLINE:CF = 0
WAIT.UNTIL (B_GASOLINE:CF >= _SIZE_) /*累计流量
SET BATCH_CTRL = 1
CLOSE B_GASOLINE }
DEFINE.SEQUENCE L_DIESEL (_SIZE_)
{ OPEN B_DIESEL
POKE B_DIESEL:CF = 0
WAIT.UNTIL (B_DIESEL:CF >= _SIZE_) /*累计流量
SET BATCH_CTRL = 0
CLOSE B_DIESEL }
DEFINE.SEQUENCE L_WATER (_SIZE_)
{ OPEN B_WATER
POKE B_WATER:CF = 0
WAIT.UNTIL (B_WATER:CF >= _SIZE_) /*累计流量
SET BATCH_CTRL = 2
CLOSE B_WATER }
DEF.SEQ LBA (_SIZE_)
{ WAIT.UNTIL(BATCH_CTRL = 0 )
SUB.SEQ L_GAS (_SIZE_ )
WAIT.UNTIL(BATCH_CTRL = 1 )
SUB.SEQ L_WATER (_SIZE_ )
WAIT.UNTIL(BATCH_CTRL = 2 )
SUB.SEQ L_DIESEL (_SIZE_ ) }
WHENEVER ((N3:NFLU = WATER & B1_WATER:ST = CLOSED ))
{OPEN B1_WATER
CLOSE B1_GASOLINE
CLOSE B1_DIESEL }
WHENEVER ((N3:NFLU = GASOLINE & B1_GASOLINE:ST = CLOSED ))
{OPEN B1_GASOLINE
CLOSE B1_WATER
CLOSE B1_DIESEL }
WHENEVER ((N3:NFLU = DIESEL & B1_DIESEL:ST = CLOSED ))
{OPEN B1_DIESEL
CLOSE B1_WATER
CLOSE B1_GASOLINE }
DEFINE BATCH_CTRL = 0
DEFINE.SEQUENCE L_GAS (_SIZE_)
{ OPEN B_GASOLINE
POKE B_GASOLINE:CF = 0
WAIT.UNTIL (B_GASOLINE:CF >= _SIZE_) /*累计流量
SET BATCH_CTRL = 1
CLOSE B_GASOLINE }
DEFINE.SEQUENCE L_DIESEL (_SIZE_)
{ OPEN B_DIESEL
POKE B_DIESEL:CF = 0
WAIT.UNTIL (B_DIESEL:CF >= _SIZE_) /*累计流量
SET BATCH_CTRL = 0
CLOSE B_DIESEL }
DEFINE.SEQUENCE L_WATER (_SIZE_)
{ OPEN B_WATER
POKE B_WATER:CF = 0
WAIT.UNTIL (B_WATER:CF >= _SIZE_) /*累计流量
SET BATCH_CTRL = 2
CLOSE B_WATER }
DEF.SEQ LBA (_SIZE_)
{ WAIT.UNTIL(BATCH_CTRL = 0 )
SUB.SEQ L_GAS (_SIZE_ )
WAIT.UNTIL(BATCH_CTRL = 1 )
SUB.SEQ L_WATER (_SIZE_ )
WAIT.UNTIL(BATCH_CTRL = 2 )
SUB.SEQ L_DIESEL (_SIZE_ ) }
WHENEVER ((N3:NFLU = WATER & B1_WATER:ST = CLOSED ))
{OPEN B1_WATER
CLOSE B1_GASOLINE
CLOSE B1_DIESEL }
WHENEVER ((N3:NFLU = GASOLINE & B1_GASOLINE:ST = CLOSED ))
{OPEN B1_GASOLINE
CLOSE B1_WATER
CLOSE B1_DIESEL }
WHENEVER ((N3:NFLU = DIESEL & B1_DIESEL:ST = CLOSED ))
{OPEN B1_DIESEL
CLOSE B1_WATER
CLOSE B1_GASOLINE }
运行出来的结果为

但教程给出的运行结果为

自己不知道是那块设置有问题,希望给予指导
页: [1]
查看完整版本: SPS模拟顺序输送中intran文件的编写