macro_command main()
short result, offset1, alarm // 1 word º¯¼ö
GetData(result, "Local HMI", LW, 11, 1) // HMI µ¥ÀÌÅÍ Àбâ
GetData(offset1, "Local HMI", LW, 12, 1) // HMI µ¥ÀÌÅÍ Àбâ
if result >= offset1 then // Æ®¸®°Å Á¶°Ç ON½Ã
alarm = 1
SetData(alarm, "Local HMI", LW, 14, 1) // PLC¿¡ µ¥ÀÌÅÍ ¾²±â
else if result <= offset1 then //Æ®¸®°Å Á¶°Ç OFF½Ã
alarm = 0
SetData(alarm, "Local HMI", LW, 14, 1) // PLC¿¡ µ¥ÀÌÅÍ ¾²±â
end if
end macro_command
ÇöÀç ¸ÅÅ©·Î ¼³Á¤ ÇØµÐ °ªÀε¥
ÇöÀç ¿ÀÇÁ¶óÀÎ Å×½ºÆ® ½Ã ¾ç¼ö ÀÏ ¶§´Â Á¤»ó µ¿ÀÛÀ» È®ÀÎÇÏ¿´À¸³ª
result °ª°ú offset °ªÀÌ À½¼ö ÀÏ ¶§ ¼³Á¤ÇØ¾ß ÇÏ´Â ¹æ¹ýÀÌ ±Ã±ÝÇÕ´Ï´Ù.
°¨»çÇÕ´Ï´Ù.