-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13db7c8
commit 4a3c218
Showing
8 changed files
with
181 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# -*- coding: UTF-8 -*- | ||
|
||
# define constants | ||
INFO_DB_NUMBER = 6 | ||
INTEROP_DB_NUMBER = 22 | ||
|
||
|
||
# 1号线上料——原料参数 | ||
s7_server_svc.WriteString(INFO_DB_NUMBER, 2780, "1908WC16V299F6+YSTC1100139+L2/L3:1757;L1/N:1762;") | ||
s7_server_svc.WriteReal(INFO_DB_NUMBER, 3036, 3545.2) | ||
s7_server_svc.WriteReal(INFO_DB_NUMBER, 3040, 68.3) | ||
s7_server_svc.WriteReal(INFO_DB_NUMBER, 3044, 4.8) | ||
|
||
# 1号线上料——发送请求 | ||
s7_server_svc.WriteBit(INTEROP_DB_NUMBER,6,0, True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# -*- coding: UTF-8 -*- | ||
|
||
# define constants | ||
INFO_DB_NUMBER = 6 | ||
INTEROP_DB_NUMBER = 22 | ||
|
||
# 1号线上料——发送结束信号 | ||
s7_server_svc.WriteBit(INTEROP_DB_NUMBER,6,0, False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# -*- coding: UTF-8 -*- | ||
|
||
# define constants | ||
INFO_DB_NUMBER = 6 | ||
INTEROP_DB_NUMBER = 22 | ||
|
||
|
||
# 读取上料工位的缓存 | ||
# 原料码 | ||
raw_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER, 2780) | ||
# 锯切段数 | ||
cutting_num = s7_server_svc.ReadByte(INFO_DB_NUMBER, 3048) | ||
# 原料码去向 | ||
gotoline = s7_server_svc.ReadBit(INFO_DB_NUMBER,3049,0) | ||
# 尺寸判断结果 | ||
size_checking = s7_server_svc.ReadBit(INFO_DB_NUMBER,3049,1) | ||
# 理论尺寸 | ||
len_in_theory = s7_server_svc.ReadReal(INFO_DB_NUMBER,3050) | ||
width_in_thoery = s7_server_svc.ReadReal(INFO_DB_NUMBER,3054) | ||
depth_in_theory = s7_server_svc.ReadReal(INFO_DB_NUMBER,3058) | ||
cutting_code = s7_server_svc.ReadString(INFO_DB_NUMBER,3062) | ||
|
||
# 半成品码条码 | ||
banchengpin1_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,3318) | ||
banchengpin2_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,3602) | ||
banchengpin3_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,3886) | ||
banchengpin4_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,4170) | ||
banchengpin5_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,4454) | ||
|
||
|
||
# 写入一号线的贴标工位 | ||
s7_server_svc.WriteString(INFO_DB_NUMBER, 6696, raw_barcode) | ||
s7_server_svc.WriteString(INFO_DB_NUMBER, 7234, banchengpin1_barcode) | ||
s7_server_svc.WriteString(INFO_DB_NUMBER, 7518, banchengpin2_barcode) | ||
s7_server_svc.WriteString(INFO_DB_NUMBER, 7802, banchengpin3_barcode) | ||
s7_server_svc.WriteString(INFO_DB_NUMBER, 8086, banchengpin4_barcode) | ||
s7_server_svc.WriteString(INFO_DB_NUMBER, 8370, banchengpin5_barcode) | ||
# 1号线上料——发送交互请求 | ||
s7_server_svc.WriteString(INTEROP_DB_NUMBER, 8, banchengpin1_barcode) | ||
s7_server_svc.WriteBit(INTEROP_DB_NUMBER, 6, 1, True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# -*- coding: UTF-8 -*- | ||
|
||
# define constants | ||
INFO_DB_NUMBER = 6 | ||
INTEROP_DB_NUMBER = 22 | ||
|
||
# 1号线上料——发送交互请求 | ||
s7_server_svc.WriteBit(INTEROP_DB_NUMBER, 6, 1, False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# -*- coding: UTF-8 -*- | ||
|
||
# define constants | ||
INFO_DB_NUMBER = 6 | ||
INTEROP_DB_NUMBER = 22 | ||
|
||
|
||
# 读取上料工位的缓存 | ||
# 原料码 | ||
raw_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER, 2780) | ||
# 锯切段数 | ||
cutting_num = s7_server_svc.ReadByte(INFO_DB_NUMBER, 3048) | ||
# 原料码去向 | ||
gotoline = s7_server_svc.ReadBit(INFO_DB_NUMBER,3049,0) | ||
# 尺寸判断结果 | ||
size_checking = s7_server_svc.ReadBit(INFO_DB_NUMBER,3049,1) | ||
# 理论尺寸 | ||
len_in_theory = s7_server_svc.ReadReal(INFO_DB_NUMBER,3050) | ||
width_in_thoery = s7_server_svc.ReadReal(INFO_DB_NUMBER,3054) | ||
depth_in_theory = s7_server_svc.ReadReal(INFO_DB_NUMBER,3058) | ||
cutting_code = s7_server_svc.ReadString(INFO_DB_NUMBER,3062) | ||
|
||
# 半成品码条码 | ||
banchengpin1_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,3318) | ||
banchengpin2_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,3602) | ||
banchengpin3_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,3886) | ||
banchengpin4_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,4170) | ||
banchengpin5_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,4454) | ||
|
||
|
||
|
||
|
||
# 写入一号线的拍弯工位 | ||
s7_server_svc.WriteString(INFO_DB_NUMBER, 24512, raw_barcode) | ||
# 这个工位只有1个半成品码,这里假设是显示半成品码1 | ||
s7_server_svc.WriteString(INFO_DB_NUMBER, 25050, banchengpin1_barcode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# -*- coding: UTF-8 -*- | ||
|
||
# define constants | ||
INFO_DB_NUMBER = 6 | ||
INTEROP_DB_NUMBER = 22 | ||
|
||
|
||
# 读取上料工位的缓存 | ||
# 原料码 | ||
raw_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER, 2780) | ||
# 锯切段数 | ||
cutting_num = s7_server_svc.ReadByte(INFO_DB_NUMBER, 3048) | ||
# 原料码去向 | ||
gotoline = s7_server_svc.ReadBit(INFO_DB_NUMBER,3049,0) | ||
# 尺寸判断结果 | ||
size_checking = s7_server_svc.ReadBit(INFO_DB_NUMBER,3049,1) | ||
# 理论尺寸 | ||
len_in_theory = s7_server_svc.ReadReal(INFO_DB_NUMBER,3050) | ||
width_in_thoery = s7_server_svc.ReadReal(INFO_DB_NUMBER,3054) | ||
depth_in_theory = s7_server_svc.ReadReal(INFO_DB_NUMBER,3058) | ||
cutting_code = s7_server_svc.ReadString(INFO_DB_NUMBER,3062) | ||
|
||
# 半成品码条码 | ||
banchengpin1_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,3318) | ||
banchengpin2_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,3602) | ||
banchengpin3_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,3886) | ||
banchengpin4_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,4170) | ||
banchengpin5_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,4454) | ||
|
||
|
||
|
||
|
||
# 写入一号线的拍弯工位 | ||
s7_server_svc.WriteString(INFO_DB_NUMBER, 26156, raw_barcode) | ||
# 这个工位只有1个半成品码,这里假设是显示半成品码2 | ||
s7_server_svc.WriteString(INFO_DB_NUMBER, 26694, banchengpin2_barcode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# -*- coding: UTF-8 -*- | ||
|
||
# define constants | ||
INFO_DB_NUMBER = 6 | ||
INTEROP_DB_NUMBER = 22 | ||
|
||
|
||
# 读取上料工位的缓存 | ||
# 原料码 | ||
raw_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER, 2780) | ||
# 锯切段数 | ||
cutting_num = s7_server_svc.ReadByte(INFO_DB_NUMBER, 3048) | ||
# 原料码去向 | ||
gotoline = s7_server_svc.ReadBit(INFO_DB_NUMBER,3049,0) | ||
# 尺寸判断结果 | ||
size_checking = s7_server_svc.ReadBit(INFO_DB_NUMBER,3049,1) | ||
# 理论尺寸 | ||
len_in_theory = s7_server_svc.ReadReal(INFO_DB_NUMBER,3050) | ||
width_in_thoery = s7_server_svc.ReadReal(INFO_DB_NUMBER,3054) | ||
depth_in_theory = s7_server_svc.ReadReal(INFO_DB_NUMBER,3058) | ||
cutting_code = s7_server_svc.ReadString(INFO_DB_NUMBER,3062) | ||
|
||
# 半成品码条码 | ||
banchengpin1_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,3318) | ||
banchengpin2_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,3602) | ||
banchengpin3_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,3886) | ||
banchengpin4_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,4170) | ||
banchengpin5_barcode = s7_server_svc.ReadString(INFO_DB_NUMBER,4454) | ||
|
||
|
||
|
||
|
||
# 写入一号线的测长工位的原料码 | ||
s7_server_svc.WriteString(INFO_DB_NUMBER, 27800, raw_barcode) | ||
# 写入一号线的测长工位的半成品码,这里假设是显示半成品码2 | ||
s7_server_svc.WriteString(INFO_DB_NUMBER, 28338, banchengpin2_barcode) | ||
# 发请求信号, 通知上位机去1200-1 PLC那请求测长数据 | ||
s7_server_svc.WriteBit(INTEROP_DB_NUMBER, 6, 2, True) |
This file was deleted.
Oops, something went wrong.