´äº¯ ÁֽŠ±Û Àß ÀÐ¾î º¸¾Ò½À´Ï´Ù..
Áö±Ý ¸ÅÅ©·Î¸¦ ÀÌ·¸°Ô ÁöÁ¤Çؼ ¿ÀÇÁ¶óÀÎ test½Ã
1¹øÀ» °Çµå¸®¸é ·¥ÇÁ°¡ µ¿ÀÛÀ» Çϴµ¥ ´Ù¸¥ 3,5,7, --- °Çµå¸®¸é ·¥ÇÁ µ¿ÀÛÀ» ¾ÈÇϳ׿ä
3,5,7,9 --- Ç׸ñÀ» else if ¸»°í end if ÈÄ ´Ù½Ã if¹®À» °É¾îµµ µ¿ÀÛÀÌ ¾ÈµË´Ï´Ù..
Ȥ½Ã if¹® ¸»°í ´Ù¸¥ ÇÔ¼ö¸¦ »ç¿ëÇÏ¿©¾ß Çϳª¿ä?
===============================================================================================
macro_command main()
short re1, la1, re2, la2, re3, la3, re4, la4, re5, la5, re6, la6, re7, la7, re8, la8, re9, la9, re10, la10, re11, la11, re12, la12, re13, la13, re14, la14, re15, la15, re16, la16, re17, la17, re18, la18, re19, la19, re20, la20, re21, la21, re22, la22, re23, la23, re24, la24, re25, la25, re26, la26, re27, la27, re28, la28, re29, la29, re30, la30, re31, la31, re32, la32, re33, la33, re34, la34, re35, la35, re36, la36, re37, la37, re38, la38, re39, la39, re40, la40, re41, la41, re42, la42, re43, la43, re44, la44, re45, la45, re46, la46, re47, la47, re48, la48, re49, la49, re50, la50, re51, la51, re52, la52, re53, la53, re54, la54, re55, la55, re56, la56, re57, la57, re58, la58, re59, la59, re60, la60, re61, la61, re62, la62, re63, la63, re64, la64, alarm, alarm2
GetData(re1, "Local HMI", LW, 11, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la1, "Local HMI", LW, 1000, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re3, "Local HMI", LW, 21, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la3, "Local HMI", LW, 1001, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re5, "Local HMI", LW, 31, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la5, "Local HMI", LW, 1002, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re7, "Local HMI", LW, 41, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la7, "Local HMI", LW, 1003, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re9, "Local HMI", LW, 51, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la9, "Local HMI", LW, 1004, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re11, "Local HMI", LW, 61, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la11, "Local HMI", LW, 1005, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re13, "Local HMI", LW, 71, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la13, "Local HMI", LW, 1006, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re15, "Local HMI", LW, 81, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la15, "Local HMI", LW, 1007, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re17, "Local HMI", LW, 111, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la17, "Local HMI", LW, 1008, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re19, "Local HMI", LW, 121, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la19, "Local HMI", LW, 1009, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re21, "Local HMI", LW, 131, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la21, "Local HMI", LW, 1010, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re23, "Local HMI", LW, 141, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la23, "Local HMI", LW, 1011, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re25, "Local HMI", LW, 151, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la25, "Local HMI", LW, 1012, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re27, "Local HMI", LW, 161, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la27, "Local HMI", LW, 1013, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re29, "Local HMI", LW, 171, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la29, "Local HMI", LW, 1014, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re31, "Local HMI", LW, 181, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la31, "Local HMI", LW, 1015, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re33, "Local HMI", LW, 211, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la33, "Local HMI", LW, 1016, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re35, "Local HMI", LW, 221, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la35, "Local HMI", LW, 1017, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re37, "Local HMI", LW, 231, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la37, "Local HMI", LW, 1018, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re39, "Local HMI", LW, 241, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la39, "Local HMI", LW, 1019, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re41, "Local HMI", LW, 251, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la41, "Local HMI", LW, 1020, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re43, "Local HMI", LW, 261, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la43, "Local HMI", LW, 1021, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re45, "Local HMI", LW, 271, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la45, "Local HMI", LW, 1022, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re47, "Local HMI", LW, 281, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la47, "Local HMI", LW, 1023, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re49, "Local HMI", LW, 311, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la49, "Local HMI", LW, 1024, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re51, "Local HMI", LW, 321, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la51, "Local HMI", LW, 1025, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re53, "Local HMI", LW, 331, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la53, "Local HMI", LW, 1026, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re55, "Local HMI", LW, 341, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la55, "Local HMI", LW, 1027, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re57, "Local HMI", LW, 351, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la57, "Local HMI", LW, 1028, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re59, "Local HMI", LW, 361, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la59, "Local HMI", LW, 1029, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re61, "Local HMI", LW, 371, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la61, "Local HMI", LW, 1030, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(re63, "Local HMI", LW, 381, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(la63, "Local HMI", LW, 1031, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(alarm, "Local HMI", LW, 14, 1)
if re1 < 0 and la1 < 0 then
re2 = re1 * -1
la2 = la1 * -1
else if re2 >= la2 then
alarm = 1
else if re2 < la2 then
alarm = 0
else if re3 < 0 and la3 < 0 then
re4 = re3 * -1
la4 = la3 * -1
else if re4 >= la4 then
alarm = 1
else if re4 < la4 then
alarm = 0
else if re5 < 0 and la5 < 0 then
re6 = re5 * -1
la6 = la5 * -1
else if re6 >= la6 then
alarm = 1
else if re6 < la6 then
alarm = 0
else if re7 < 0 and la7 < 0 then
re8 = re7 * -1
la8 = la7 * -1
else if re8 >= la8 then
alarm = 1
else if re8 < la8 then
alarm = 0
else if re9 < 0 and la9 < 0 then
re10 = re9 * -1
la10 = la9 * -1
else if re10 >= la10 then
alarm = 1
else if re10 < la10 then
alarm = 0
else if re11 < 0 and la11 < 0 then
re12 = re11 * -1
la12 = la11 * -1
else if re12 >= la12 then
alarm = 1
else if re12 < la12 then
alarm = 0
else if re13 < 0 and la13 < 0 then
re14 = re13 * -1
la14 = la13 * -1
else if re14 >= la14 then
alarm = 1
else if re14 < la13 then
alarm = 0
SetData(alarm, "Local HMI", LW, 14, 1)
end if
if re1 >= 0 and la1 >= 0 then
else if re1 <= la1 then
alarm = 1
else if re1 > la1 then
alarm = 0
else if re3 >= 0 and la3 >= 0 then
else if re3 <= la3 then
alarm = 1
else if re3 > la3 then
alarm = 0
else if re5 >= 0 and la5 >= 0 then
else if re5 <= la5 then
alarm = 1
else if re5 > la5 then
alarm = 0
else if re7 >= 0 and la7 >= 0 then
else if re7 <= la7 then
alarm = 1
else if re7 > la7 then
alarm = 0
else if re9 >= 0 and la9 >= 0 then
else if re9 <= la9 then
alarm = 1
else if re9 > la9 then
alarm = 0
else if re11 >= 0 and la11 >= 0 then
else if re11 <= la11 then
alarm = 1
else if re11 > la11 then
alarm = 0
else if re13 >= 0 and la13 >= 0 then
else if re13 <= la13 then
alarm = 1
else if re13 > la13 then
alarm = 0
SetData(alarm, "Local HMI", LW, 14, 1)
end if
if alarm == 1 then
alarm2 = 1
SetData(alarm2, "Local HMI", LW, 15, 1)
else if alarm == 0 then
alarm2 = 0
SetData(alarm2, "Local HMI", LW, 15, 1)
end if
end macro_command