{"id":1195,"date":"2018-08-02T07:12:14","date_gmt":"2018-08-01T22:12:14","guid":{"rendered":"https:\/\/www.kdel.org\/wp\/?p=1195"},"modified":"2018-08-02T08:53:04","modified_gmt":"2018-08-01T23:53:04","slug":"dummy-mpsmemo","status":"publish","type":"post","link":"https:\/\/www.kdel.org\/wp\/?p=1195","title":{"rendered":"Dummy MPS(MEMO)"},"content":{"rendered":"<p>\u307e\u305a\u306f\uff0cRefBox \u3068 MPS \u306e\u901a\u4fe1\u306b\u3064\u3044\u3066\u898b\u3066\u307f\u307e\u3057\u3087\u3046\uff0e<\/p>\n<p>llsf-refbox\/cfg\/config.yaml \u306b\u3088\u308a\u307e\u3059\u3068\uff0c<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n  sps:\r\n    enable: false\r\n    host: !ipv4 192.168.1.77\r\n    port: !tcp-port 502\r\n    test-lights: true\r\n\r\n  mps:\r\n    enable: false\r\n    # type: 1(incoming station), 2(singel p&amp;p), 3(double p&amp;p), 4(delivery station)\r\n    stations:\r\n      C-BS:\r\n        active: false\r\n        type: BS\r\n        host: !ipv4 192.168.2.27\r\n        port: !tcp-port 502\r\n<\/pre>\n<p>\u3068\u306a\u3063\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p>\u307e\u305a\uff0csps \u3063\u3066\u306a\u3093\u3058\u3083\u3089\u30db\u30a4\u3063\u3066\u611f\u3058\u3067\u3059\u304c\uff0cllsf-refbox\/src\/libs\/llsf_sps\/sps_comm.cpp \u3092\u898b\u308b\u3068\uff0c<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n * The SPS controls the signal lights and reads and writes from and\r\n * to the RFID sensors. This class encapsulates the communication via\r\n * Modbus and provides access to LLSF-specific actions.\r\n<\/pre>\n<p>\u3068\u3042\u308a\uff0cLogistics League sponsored by FESTO (LLSF) \u306e\u9803\u306e\uff0c\u30d1\u30c3\u30af\u3092\u30b7\u30b0\u30ca\u30eb\u306b\u904b\u3093\u3067\u3044\u305f\u6642\u4ee3\u306e\u30b7\u30b0\u30ca\u30eb\u5074\u306b\u642d\u8f09\u3057\u3066\u3044\u305f\u5236\u5fa1\u5668\u3063\u307d\u3044\u3067\u3059\uff0e<br \/>\n\u305d\u306e\u5f53\u6642\u306f\uff0c\u30d1\u30c3\u30af\u306bRF-ID \u30bf\u30b0\u3092\u53d6\u308a\u4ed8\u3051\uff0c\u30bf\u30b0\u30ea\u30fc\u30c0\u30fc\uff0f\u30e9\u30a4\u30bf\u30fc\u3092\u4f7f\u3063\u3066\uff0c\u72b6\u614b\u3092\u30d1\u30c3\u30af\u306b\u66f8\u304d\u8fbc\u3093\u3067\u3044\u307e\u3057\u305f\uff0e<br \/>\n\u305d\u308c\u304c\uff0c\u4eca\u306fMPS\u306b\u5909\u308f\u308a\u307e\u3057\u305f\u304c\uff0c\u305d\u306e\u6642\u306e\u8a2d\u5b9a\u304c1\u3064\u3060\u3051\u6b8b\u3063\u3066\u3044\u308b\u3088\u3046\u3067\u3059\uff0e<br \/>\n\u3068\u3044\u3046\u308f\u3051\u3067\uff0c\u3053\u306e\u90e8\u5206\uff08IP:192.168.1.77\uff09\u306e\u88c5\u7f6e\u306f\uff0c\u7121\u8996\u3067\u304d\u305d\u3046\u3067\u3059\uff0e<br \/>\n\u305f\u3060\uff0cSPS \u3068\u3044\u3046\u5358\u8a9e\u306f\u4eca\u5f8c\u3082\u51fa\u3066\u304d\u307e\u3057\u305f\u306e\u3067\uff0c\u3053\u3061\u3089\u306f\u7121\u8996\u3067\u304d\u306a\u3055\u305d\u3046\u3067\u3059\uff0e<\/p>\n<p>RCLL \u3067\u91cd\u8981\u306a\u306e\u306f\uff0cMPS \u3067\u3059\uff0e<br \/>\n\u3053\u3061\u3089\u306f\uff0c192.168.2.0\/24 \u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u69cb\u7bc9\u3057\u3066\u3044\u308b\u3088\u3046\u3067\u3059\uff0e<br \/>\n\u30ed\u30dc\u30c3\u30c8\u306a\u3069\u306e\u8a66\u5408\u7528\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306f172.26.0.0\/16 \u3067\u3059\u306e\u3067\uff0c1\u3064\u306eLAN \u30b1\u30fc\u30d6\u30eb\u4e0a\u306b2\u3064\u306e\u30cd\u30c3\u30c8\u304c\u5b58\u5728\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\uff0e<br \/>\n192.168.2.0 \u306f\uff0cDHCP \u3092\u4f7f\u3046\u3088\u308a\u306f\uff0c\u624b\u52d5\u5272\u308a\u5f53\u3066\u306e\u65b9\u304c\u7121\u96e3\u305d\u3046\u3067\u3059\uff0e<br \/>\n\uff08DHCP \u3092\u5229\u7528\u3059\u308b\u3068\uff0c\u30c1\u30fc\u30e0\u306eAP\u306eDHCP \u30b5\u30fc\u30d0\u306b\u3064\u306a\u304c\u308b\u5371\u967a\u6027\u304c\u3042\u308b\u304b\u3089\u3067\u3059\uff09\uff0e<\/p>\n<p>port \u3068\u3057\u3066502 \u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\uff0e<br \/>\nSPS \u3060\u3051\u3067\u306a\u304f\uff0cMPS \u306b\u3082\u3042\u308b\u8a2d\u5b9a\u3067\u3059\u306e\u3067\uff0cSPS \u306e\u9803\u3068\u540c\u3058\u901a\u4fe1\u5236\u5fa1\u65b9\u5f0f\u3092\u4f7f\u3063\u3066\u3044\u308b\u3063\u307d\u3044\u3088\u3046\u3067\u3059\uff0e<br \/>\n502 \u3067\u691c\u7d22\u3057\u3066\u307f\u308b\u3068\uff0cmodbus \uff08\u30e2\u30c9\u30d0\u30b9\uff09\u304c\u51fa\u3066\u304d\u307e\u3057\u305f\uff0e<br \/>\n\u305d\u3046\u3044\u3048\u3070\uff0c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b\u305d\u3093\u306a\u540d\u524d\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5165\u308c\u305f\u3088\u3046\u306a&#8230;\uff0e<\/p>\n<p>RefBox \u5468\u308a\u306e\u901a\u4fe1\u306fProtoBuf \u3067\u3059\u304c\uff0c\u3053\u306emodbus \u306f\u4eca\u3082\u4f7f\u3063\u3066\u3044\u308b\u306e\u304b\uff0c\u305d\u308c\u3068\u3082\u904e\u53bb\u306e\u8a2d\u5b9a\u304c\u6b8b\u3063\u3066\u3044\u308b\u306e\u304b\uff1f<br \/>\nRefBox \u304b\u3089MPS \u3078\u306e\u901a\u4fe1\u3092\u8abf\u3079\u3066\u307f\u307e\u3057\u3087\u3046\uff0e<\/p>\n<p>\u307e\u305a\u306f\uff0c\u982d\u8133\u7684\u306aCLIPS \u304b\u3089\u898b\u3066\u307f\u307e\u3057\u3087\u3046\uff0e<br \/>\nllsf-refbox\/src\/games\/rcll \u306e exploration.clp \u8fba\u308a\u304b\u3089\u624b\u3092\u51fa\u3057\u3066\u307f\u307e\u3059\uff0e<\/p>\n<p>\u63a2\u7d22\u30d5\u30a7\u30fc\u30ba\u3067MPS \u3068\u901a\u4fe1\u3092\u3059\u308b\u306e\u306f\uff0c\u5404\u30c1\u30fc\u30e0\u304b\u3089\u30de\u30b7\u30f3\u306e\u60c5\u5831\u3092RefBox \u3078\u9001\u3063\u305f\u6642\u306b\uff0c\u305d\u308c\u304c\u5408\u3063\u3066\u3044\u308b\u304b\u5426\u304b\u3092LED \u306e\u70b9\u706f\u30d1\u30bf\u30fc\u30f3\u3092\u5909\u66f4\u3059\u308b\u3068\u304d\u3067\u3059\uff0e<br \/>\ndefrule exploration-report-zone-correct \u3068\uff0cdefrule exploration-report-zone-wrong \u306e\u90e8\u5206\u3067\u3059\uff0e<\/p>\n<p>\u6b63\u3057\u3044\u5831\u544a\u306e\u6642\u306f\uff0c\u7dd1\u30e9\u30f3\u30d7\u304c\u3064\u304d\uff0c\u9593\u9055\u3063\u305f\u5831\u544a\u306e\u6642\u306f\u8d64\u30e9\u30f3\u30d7\u304c\u70b9\u6ec5\u3057\u307e\u3059\uff0e<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n(modify ?mf (desired-lights GREEN-ON))\r\n...\r\n(modify ?mf (desired-lights RED-BLINK))\r\n<\/pre>\n<p>\u4e0a\u8a18\u306e\u90e8\u5206\u3067\u3059\u306d\uff0e<br \/>\n\u305d\u3046\u3059\u308b\u3068\uff0cdesired-lights \u304c\u602a\u3057\u3044\u3067\u3059\uff0e<\/p>\n<p>grep \u3057\u3066\u307f\u308b\u3068\uff0c\u3044\u308d\u3044\u308d\u306aclp \u304b\u3089\u547c\u3073\u51fa\u3057\u3066\u3044\u307e\u3059\u304c\uff0c\u305d\u308c\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u306e\u306f\uff0cmachines.clp \u306emachine-lights \u3067\u3059\uff0e<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n(defrule machine-lights &quot;Set machines if desired lights differ from actual lights&quot;\r\n  ?mf &lt;- (machine (name ?m) (actual-lights $?al) (desired-lights $?dl&amp;:(neq ?al ?dl)))\r\n  =&gt;\r\n  ;(printout t ?m &quot; actual lights: &quot; ?al &quot;  desired: &quot; ?dl crlf)\r\n  (modify ?mf (actual-lights ?dl))\r\n        (if (member$ RED-ON ?dl) then (bind ?red-state ON)\r\n         else (if (member$ RED-BLINK ?dl) then (bind ?red-state BLINK)\r\n         else (bind ?red-state OFF)))\r\n        (if (member$ YELLOW-ON ?dl) then (bind ?yellow-state ON)\r\n         else (if (member$ YELLOW-BLINK ?dl) then (bind ?yellow-state BLINK)\r\n         else (bind ?yellow-state OFF)))\r\n        (if (member$ GREEN-ON ?dl) then (bind ?green-state ON)\r\n         else (if (member$ GREEN-BLINK ?dl) then (bind ?green-state BLINK)\r\n         else (bind ?green-state OFF)))\r\n\r\n        (mps-set-lights (str-cat ?m) (str-cat ?red-state) (str-cat ?yellow-state) (str-cat ?green-state))\r\n)\r\n<\/pre>\n<p>\u5b9f\u969b\u306e\u70b9\u706f\u30d1\u30bf\u30fc\u30f3\u3068\uff0c\u5909\u6570\u304c\u4fdd\u6301\u3057\u3066\u3044\u308b\u30d1\u30bf\u30fc\u30f3\u3068\u304c\u7570\u306a\u308b\u306e\u3092\u898b\u3064\u3051\u305f\u3089\uff0cMPS \u306b\u4fdd\u6301\u3057\u3066\u3044\u308b\u30d1\u30bf\u30fc\u30f3\u3092\u9001\u308b\u30eb\u30fc\u30eb\u3067\u3059\uff0e<\/p>\n<p>\u3068\u3059\u308b\u3068\uff0c\u5b9f\u969b\u306b\u901a\u4fe1\u3057\u3066\u3044\u308b\u306e\u306f\uff0cmps-set-lights \u306e\u90e8\u5206\u3068\u8003\u3048\u3089\u308c\u307e\u3059\uff0e<\/p>\n<p>\u3068\u3053\u308d\u304c\uff0cmps-set-lights \u3067grep \u3057\u3066\u307f\u3066\u3082\uff0csimulation.clp \u3057\u304b\u3072\u3063\u304b\u304b\u308a\u307e\u305b\u3093\uff0e<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n(deffunction mps-set-lights (?name ?state-red ?state-yellow ?state-green)\r\n  (bind ?name (sym-cat ?name))\r\n  ;(printout t &quot;Simulated light setting for &quot; ?name &quot;: red=&quot; ?state-red\r\n        ;                                       &quot; yellow=&quot; ?state-yellow &quot;  green=&quot; ?state-green crlf)\r\n)\r\n<\/pre>\n<p>simulation.clp \u3068\u3044\u3046\u540d\u524d\u304b\u3089\u5acc\u306a\u4e88\u611f\u304c\u3057\u307e\u3059\u304c\uff0c\u4f55\u3082\u52d5\u4f5c\u3055\u305b\u306a\u3044\u30eb\u30fc\u30eb\u306e\u69d8\u306b\u898b\u3048\u307e\u3059\uff0e<\/p>\n<p>\u5b9f\u306f\uff0c\u5b9f\u6a5f\u306b\u3064\u306a\u304c\u3089\u306a\u3044\u6642\uff08config.yaml \u306b\u3066\uff0cmps\/enable: false \u3068\u306a\u3063\u3066\u3044\u308b\u6642\uff09\u306e\uff0c\u30c0\u30df\u30fc\u306e\u30eb\u30fc\u30eb\u3068\u306a\u3063\u3066\u3044\u307e\u3059\uff0e<br \/>\n\u3064\u306a\u304c\u308b\u6642\uff08mps\/enable: true\uff09\u306f\uff0cllsf-refbox\/src\/refbox\/refbox.cpp \u306e LLSFRefBox::setup_clips() \u306b\u3066\uff0c<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n    clips_-&gt;add_function(&quot;mps-set-lights&quot;, sigc::slot&lt;void, std::string, std::string, std::string, std::string&gt;(sigc::mem_fun(*this, &amp;LLSFRefBox::clips_mps_set_lights)));\r\n<\/pre>\n<p>mps-set-lights \u306b\u5bfe\u3057\u3066\uff0cLLSFRefBox::clips_mps_set_lights \u95a2\u6570\u3092\u5272\u308a\u5f53\u3066\u3066\u3044\u307e\u3059\u306d\uff0e<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nvoid\r\nLLSFRefBox::clips_mps_set_lights(std::string machine, std::string red_state,\r\n                                 std::string yellow_state, std::string green_state)\r\n{\r\n...\r\n  if (! mps_)  return;\r\n  MPS *station;\r\n  station = mps_-&gt;get_station(machine, station);\r\n...\r\n    station-&gt;setAllLights(lights);\r\n...\r\n}\r\n<\/pre>\n<p>\u3068\u3044\u3046\u611f\u3058\u3067\uff0cmps_ \u304c\u5b58\u5728\u3057\u305f\u3089 get_station \u3067 machine \u540d\u306b\u4e00\u81f4\u3059\u308bMPS \u3092\u53d6\u3063\u3066\u304d\u3066\uff0csetAllLights(lights) \u3067\uff0c\u30b7\u30b0\u30ca\u30eb\u306e\u70b9\u706f\u30d1\u30bf\u30fc\u30f3\u3092\u4e0e\u3048\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p>setAllLights \u306f\uff0cllsf-refbox\/src\/libs\/llsf_sps\/mps.cpp \u306b\u3042\u308a\u307e\u3059\uff0e<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nvoid\r\nMPS::setAllLights(int lights&#x5B;3]) {\r\n  uint16_t send&#x5B;3] = {(uint16_t) lights&#x5B;0], (uint16_t) lights&#x5B;1], (uint16_t) lights&#x5B;2]};\r\n\r\n  int rc = modbus_write_registers(mb, 3, 3, send);\r\n\r\n  if(rc == -1) {\r\n    machineState = DISCONNECTED;\r\n  }\r\n}\r\n<\/pre>\n<p>\u3088\u3046\u3084\u304f\uff0c\u8fbf\u308a\u7740\u304d\u307e\u3057\u305f\uff0e<br \/>\nmodbus_write_registers(mb, 3, 3, send) \u3067\uff0cMPS \u306b\u30c7\u30fc\u30bf\u3092\u9001\u3063\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p>\u3053\u308c\u304c\uff0cRefBox \u304b\u3089MPS \u306b\u30c7\u30fc\u30bf\u3092\u9001\u3063\u3066\u3044\u308b\u3068\u3053\u308d\u3067\u3059\uff0e<br \/>\n\uff08\u6a5f\u5668\u306e\u30ec\u30b8\u30b9\u30bf\u30fc\u306b\u66f8\u304d\u8fbc\u3093\u3067\u3044\u308b\u611f\u3058\u3067\u3059\u306d\uff09\uff0e<\/p>\n<p>\u3053\u3053\u3092\u4e2d\u5fc3\u306b\uff0c\u30c0\u30df\u30fcMPS \u3092\u691c\u8a0e\u3057\u307e\u3057\u3087\u3046\uff0e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u307e\u305a\u306f\uff0cRefBox \u3068 MPS \u306e\u901a\u4fe1\u306b\u3064\u3044\u3066\u898b\u3066\u307f\u307e\u3057\u3087\u3046\uff0e llsf-re &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.kdel.org\/wp\/?p=1195\"> <span class=\"screen-reader-text\">Dummy MPS(MEMO)<\/span> \u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[10,3,2],"tags":[],"class_list":["post-1195","post","type-post","status-publish","format-standard","hentry","category-fawkes","category-logistics-league","category-robocup"],"_links":{"self":[{"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1195"}],"version-history":[{"count":2,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1195\/revisions"}],"predecessor-version":[{"id":1197,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1195\/revisions\/1197"}],"wp:attachment":[{"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdel.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}