{"id":304060,"date":"2020-05-22T09:00:45","date_gmt":"2020-05-22T09:00:45","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=304060"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=304060","title":{"rendered":"\u041f\u0440\u043e\u0441\u0442\u043e\u0439 Web-\u0434\u043e\u0441\u0442\u0443\u043f \u043a VI \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c LabVIEW \u0432 PHP \u0447\u0435\u0440\u0435\u0437 ActiveX Server"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/502496\/\">\u0412 LabVIEW \u0443\u0436\u0435 \u043c\u043d\u043e\u0433\u043e \u043b\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u00ab\u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c\u00bb Web \u043a VI \u043f\u0440\u0438\u0431\u043e\u0440\u0430\u043c \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b LabVIEW, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 ActiveX. \u041d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0438 LabVIEW 2020 Community edition.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0414\u043b\u044f LabVIEW \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u0431\u043e\u0440\u043e\u0432 \u0432 Web, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0445 \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0437\u043d\u0430\u043d\u0438\u0439 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u0438\u0445 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c, \u043d\u043e \u0445\u043e\u0447\u0443 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c \u0432\u0430\u0441 \u0441 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0432 LabVIEW \u0441\u0435\u0440\u0432\u0435\u0440\u0430 ActiveX\/COM \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 Web \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a VI, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0439 \u0441\u0440\u0435\u0434\u043e\u0439 LabVIEW. \u0425\u043e\u0442\u044f ActiveX\/COM \u0443\u0436\u0435 \u0441\u0442\u0430\u0440\u0430\u044f, \u043d\u043e \u0435\u0449\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0449\u0430\u044f \u0436\u0438\u0442\u044c \u0432 Windows \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f, \u043d\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 ActiveX \u0441\u0435\u0440\u0432\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 LabVIEW \u0438 VI \u043f\u0440\u0438\u0431\u043e\u0440\u0430\u043c\u0438, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0447\u0435\u0440\u0435\u0437 Web.<\/p>\n<p>  \u041f\u0435\u0440\u0432\u043e\u0435 \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044d\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 LabVIEW \u044d\u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 ActiveX \u0441\u0435\u0440\u0432\u0435\u0440, \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0441\u0440\u0435\u0434\u044b: Tools-&gt;Options-&gt;VI Server, \u0444\u043b\u0430\u0436\u043e\u043a ActiveX.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ko\/k5\/ez\/kok5ezsezk5gumns7dp1n1mkwhs.jpeg\"><\/div>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0438 \u043a \u043d\u0435\u043c\u0443 \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u043d\u0430 VBScript. \u041d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u0441\u0442\u043e\u043b\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u0444\u0430\u0439\u043b labview_test.vbs \u0438 \u043d\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<pre><code class=\"vbscript\">Dim obj Set obj = CreateObject(&quot;LabVIEW.Application&quot;) 'Dim vi 'Set vi = obj.GetVIReference(&quot;C:\\Users\\Dell\\Desktop\\LabVIEW Web ActiveX\\ActiveX Server Executable _LV2012_NI Verified\\Executable as ActiveX Server\\ActiveX Server.vi&quot;) WScript.Echo(obj.AppName &amp; &quot; ver: &quot; &amp; obj.Version) 'WScript.Echo(vi.GetControlValue(&quot;Count&quot;)) 'Set vi = Nothing Set obj = Nothing<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u0440\u0435\u0434\u0443 LabVIEW. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0431\u0435\u0437 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0440\u0435\u0434\u044b. \u041d\u0430 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 LabVIEW \u043a\u0430\u043a ActiveX\/COM \u0441\u0435\u0440\u0432\u0435\u0440, \u0430 \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043a\u0440\u044b\u0442, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043e\u0436\u0434\u0430\u0442\u044c, \u043f\u043e\u043a\u0430 \u0432\u0441\u0435 \u044d\u0442\u043e \u00ab\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f\u00bb. \u0412 \u0432\u044b\u0432\u043e\u0434\u0435 labview_test.vbs \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u044f \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0435\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u044f.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6n\/a7\/om\/6na7omewgx5sqxfvvbz-7ekq1eg.jpeg\"><\/div>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u043e\u0439 VI \u043f\u0440\u0438\u0431\u043e\u0440 \u00abActiveX Server.vi\u00bb. \u0412 \u043d\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043e\u0432 \u0438 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u042d\u0442\u043e\u0442 VI \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043c.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hy\/ih\/77\/hyih77q0rwk2kiap_hbbfulwlha.png\"><\/div>\n<p>  \u041e\u0442 LabVIEW \u043d\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0441\u043b\u043e\u044f\u043c Web.<\/p>\n<h3>\u0422\u0435\u0440\u043d\u0438\u0441\u0442\u044b\u0439 \u043f\u0443\u0442\u044c<\/h3>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0441 \u0448\u0442\u0430\u0442\u043d\u044b\u043c Windows Web-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c Microsoft IIS. \u041f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b ASP \u043d\u0430 VBScript \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"vbscript\">&lt;% @language = &quot;vbscript&quot; %&gt; &lt;html&gt;&lt;body&gt; &lt;p&gt;ASP can output HTML tags as well as plain text&lt;\/p&gt; &lt;% \tDim obj \tSet obj = CreateObject(&quot;LabVIEW.Application&quot;) \tresponse.write(obj.AppName &amp; &quot; ver: &quot; &amp; obj.Version &amp; &quot;&lt;br&gt;&quot; &amp; vbCr) \tDim vi \tSet vi = obj.GetVIReference(&quot;C:\\Users\\Dell\\Desktop\\LabVIEW Web ActiveX\\ActiveX Server Executable _LV2012_NI Verified\\Executable as ActiveX Server\\ActiveX Server.vi&quot;) \tresponse.write(vi.GetControlValue(&quot;Count&quot;) &amp; vbCr) \tset vi = Nothing \tset obj = Nothing %&gt; &lt;\/body&gt;&lt;\/html&gt; <\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434 GetVIReference() \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 VI \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0441 \u043d\u0438\u043c \u0441\u0432\u044f\u0437\u044c. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440: \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c\u0443 VI.<\/p>\n<p>  \u0412\u044b\u0432\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440:  <\/p>\n<pre><code class=\"plaintext\">LabVIEW.exe ver: 20.0 123  <\/code><\/pre>\n<p>  \u041f\u0440\u0430\u0432\u0434\u0430, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u043e\u0437\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u043f\u0443\u043b\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 IIS \u0438 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f Windows.<br \/>  \u042f \u0440\u0435\u0448\u0438\u043b \u043d\u0435 \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u0441\u044f \u0432 ASP \u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043b\u0441\u044f \u043d\u0430 PHP. \u0414\u043b\u044f IIS \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b PHP FastCGI \u0434\u0435\u043c\u043e\u043d. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0436\u0443, \u043e\u043d\u0438 \u043d\u0435 \u0432\u0430\u0436\u043d\u044b \u0434\u043b\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u0412 PHP \u0442\u0430\u043a\u0436\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a COM \u043e\u0431\u044a\u0435\u043a\u0442\u0443 LabVIEW, \u043f\u043e \u0442\u0438\u043f\u0443:<\/p>\n<pre><code class=\"php\">$obj = new COM('LabVIEW.Application');<\/code><\/pre>\n<p>  \u0412 \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 LabVIEW \u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432 \u043d\u0435\u0439 VI (ActiveX Server.vi). \u041f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 PHP (ASP) \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f (\u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f) \u043d\u043e\u0432\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 LabVIEW.exe, \u0434\u0430\u043b\u0435\u0435 \u0432 \u043d\u0435\u043c c \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 GetVIReference() \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u043b\u0441\u044f \u0441\u0432\u043e\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u00abActiveX Server.vi\u00bb. \u041f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b PHP \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 LabVIEW \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u043b\u0441\u044f. \u0422.\u0435. \u0442\u0443\u0442 \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f \u0441 \u0443\u0436\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u043c \u0441\u0440\u0435\u0434\u044b LabVIEW. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b Process Explorer \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u0442\u0441\u044f. \u00ab\u0418\u0433\u0440\u0430\u00bb \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u043f\u0443\u043b\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 IIS \u0442\u043e\u0436\u0435 \u043d\u0435 \u0434\u0430\u043b\u0430 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0414\u043b\u044f \u0441\u0435\u0431\u044f \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e IIS \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0434\u0435\u043c\u043e\u043d \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 system, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 LabVIEW.exe, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u043a \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443 system, \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0436\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f Windows \u043c\u043d\u0435 \u043d\u0435 \u0443\u0434\u0430\u0441\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c.<br \/>  \u0422\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043c\u044b\u0441\u043b\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 web-\u0441\u0435\u0440\u0432\u0435\u0440, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u0432 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0412\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 NGINX, \u043f\u0440\u0438\u0442\u043e\u043c \u044f \u0435\u0433\u043e \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e proxy \u0434\u043b\u044f LabVIEW WebServices.<\/p>\n<h3>NGINX<\/h3>\n<p>  \u0411\u0435\u0440\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e nginx \u043f\u043e\u0434 Windows. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 nginx-1.17.10.<br \/>  \u0414\u043b\u044f \u0441\u0432\u044f\u0437\u0438 PHP \u0441 NGINX \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:<br \/>  <a href=\"https:\/\/www.nginx.com\/resources\/wiki\/start\/topics\/examples\/phpfastcgionwindows\/\" rel=\"nofollow\">www.nginx.com\/resources\/wiki\/start\/topics\/examples\/phpfastcgionwindows<\/a><\/p>\n<p>  \u041d\u0435\u0441\u043b\u043e\u0436\u043d\u0430\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 NGINX. \u0423 \u043c\u0435\u043d\u044f \u0444\u0430\u0439\u043b: c:\\nginx-1.17.10\\conf\\nginx.conf<br \/>  \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0430 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440:<\/p>\n<p>  nginx.conf:  <\/p>\n<pre><code class=\"nginx\">location \/ { \troot   html; \tindex  index.html index.htm; \tautoindex on; }<\/code><\/pre>\n<p>  \u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 PHP \u0447\u0435\u0440\u0435\u0437 FastCGI \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<\/p>\n<pre><code class=\"nginx\"># pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \\.php$ { \troot           html; \tfastcgi_pass   127.0.0.1:9000; \tfastcgi_index  index.php; \tfastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name; \tinclude        fastcgi_params; }<\/code><\/pre>\n<p>  <\/p>\n<h3>PHP<\/h3>\n<p>  \u0411\u0435\u0440\u0435\u043c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e PHP \u0434\u043b\u044f <a href=\"https:\/\/windows.php.net\/download\" rel=\"nofollow\">Windows<\/a>. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b php-7.4.5-nts-Win32-vc15-x64.zip, \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043e\u043d\u0430 \u0443 \u043c\u0435\u043d\u044f \u0431\u0443\u0434\u0435\u0442 \u0432 c:\\php-7.4.5-nts-Win32-vc15-x64<br \/>  \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c php.ini (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 php.ini-development \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430). \u0412\u043d\u043e\u0441\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<\/p>\n<p>  php.ini:  <\/p>\n<pre><code class=\"plaintext\">short_open_tag = On html_errors = On error_reporting = E_ALL &amp; ~E_NOTICE extension_dir = &quot;ext&quot; extension=gd2 extension=php_com_dotnet.dll<\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 GD \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438 (\u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u0437 LabVIEW) \u0438 \u043c\u043e\u0434\u0443\u043b\u044c php_com_dotnet.dll \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 ActiveX\/COM \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0432 PHP.<\/p>\n<p>  \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 COM \u0432 PHP \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0441\u044f \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u0431\u0430\u0433 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 (VT_BSTR), \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u043c\u0438 \u0432 \u0442\u0435\u043b\u0435 0x0 \u0441\u0438\u043c\u0432\u043e\u043b\u044b. \u0420\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043e\u043d \u0437\u0430\u043c\u0435\u043d\u043e\u0439 php_com_dotnet.dll \u043d\u0430 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c. \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0431\u0430\u0433\u0430 \u0438 \u043f\u0430\u0442\u0447 \u0441 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/bugs.php.net\/bug.php?id=63208\" rel=\"nofollow\">\u0442\u0443\u0442<\/a>. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043e\u043d \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u0432 PHP. \u042f \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u043b php_com_dotnet.dll (\u0434\u043b\u044f php-7.4.5-nts-Win32-vc15-x64), \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 php_com_dotnet.dll \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u043e <a href=\"http:\/\/www.embest.ru\/labview\/fix_php-7.4.5-nts-Win32-vc15-x64_php_com_dotnet_dll.rar\" rel=\"nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 PHP \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/wiki.php.net\/internals\/windows\/stepbystepbuild_sdk_2\" rel=\"nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e NGINX \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043d\u0430 80 TCP \u043f\u043e\u0440\u0442\u0443, PHP FastCGI \u0434\u0435\u043c\u043e\u043d \u043d\u0430 \u043f\u043e\u0440\u0442\u0443 9000, \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0447\u0442\u043e \u043d\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 \u044d\u0442\u0438 \u043f\u043e\u0440\u0442\u044b. <\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 NGINX \u0438 PHP FastCGI \u0434\u0435\u043c\u043e\u043d\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u0423 \u043c\u0435\u043d\u044f \u0434\u043b\u044f \u043d\u0443\u0436\u0434 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043e\u0444\u043e\u0440\u043c\u0438\u043b\u0438\u0441\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 cmd \u0441\u043a\u0440\u0438\u043f\u0442\u044b: \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0438\u0439\/\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0438\u0439 \u0432 \u0444\u043e\u043d\u0435 (\u0431\u0435\u0437 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u043e\u043a\u043e\u043d \u0434\u0435\u043c\u043e\u043d\u043e\u0432) start-restart-all.cmd \u0438 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0449\u0438\u0439 kill-all.cmd, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043f\u043e\u043b\u043e\u0436\u0438\u043b \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 NGINX. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Run Hidden Console \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u0432\u0437\u044f\u0442\u0430\u044f \u0438\u0437 <a href=\"https:\/\/www.nginx.com\/resources\/wiki\/start\/topics\/examples\/phpfastcgionwindows\/\" rel=\"nofollow\">\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f<\/a>.<\/p>\n<p>  start-restart-all.cmd:  <\/p>\n<pre><code class=\"powershell\">rem @echo off set PHP_FCGI_MAX_REQUESTS=0 @echo Shutting down servers... taskkill \/f \/IM nginx.exe taskkill \/f \/IM php-cgi.exe @timeout 1 @echo Starting servers... @rem start \/b \/D &quot;C:\\php-7.4.5-nts-Win32-vc15-x64&quot; php-cgi.exe -b 127.0.0.1:9000 RunHiddenConsole.exe &quot;C:\\php-7.4.5-nts-Win32-vc15-x64\\php-cgi.exe&quot; -b 127.0.0.1:9000 start \/b \/D &quot;c:\\nginx-1.17.10\\&quot; nginx.exe @timeout 3<\/code><\/pre>\n<p>  kill-all.cmd:  <\/p>\n<pre><code class=\"powershell\">taskkill \/f \/IM nginx.exe taskkill \/f \/IM php-cgi.exe pause<\/code><\/pre>\n<p>  \u0425\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f PHP_FCGI_MAX_REQUESTS. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d\u0430 \u0440\u0430\u0432\u043d\u0430 500. \u0418 \u0447\u0435\u0440\u0435\u0437 500 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0434\u0435\u043c\u043e\u043d PHP FastCGI \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443 \u0441\u0435\u0431\u044f \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b \u044d\u0442\u043e\u0442 \u0441\u0447\u0435\u0442\u0447\u0438\u043a. \u0412\u043e\u0442 \u0446\u0438\u0442\u0430\u0442\u0430 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u044b\u0448\u043b\u0435\u043d\u0438\u044f:<br \/>  <i>This PHP behavior can be disabled by setting PHP_FCGI_MAX_REQUESTS to 0, but that can be a problem if the PHP application leaks resources. Alternatively, PHP_FCGI_MAX_REQUESTS can be set to a much higher value than the default to reduce the frequency of this problem.<\/i><\/p>\n<p>  \u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b 2 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 PHP labview.php, labview_png.php, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u043d\u0435 web-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 C:\\nginx-1.17.10\\html<br \/>  labview.php \u2014 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u0430<br \/>  labview_png.php \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 PNG \u0438\u0437 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0439 \u0438\u0437 LabVIEW ActiveX \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0438\u043f\u0430 VT_BSTR.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">labview.php<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php if(strpos(exec('tasklist \/FI &quot;IMAGENAME eq LabVIEW.exe&quot; \/NH'), 'LabVIEW.exe') === false) \texit(&quot;\u041d\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d LabVIEW.exe&quot;);?&gt; &lt;!DOCTYPE HTML PUBLIC &quot;-\/\/W3C\/\/DTD HTML 4.01\/\/EN&quot; &quot;http:\/\/www.w3.org\/TR\/html4\/strict.dtd&quot;&gt; &lt;html&gt; &lt;head&gt; \t&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text\/html; charset=utf-8&quot;&gt; \t&lt;title&gt;LabVIEW PHP COM example&lt;\/title&gt; \t&lt;script src=&quot;https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/3.5.1\/jquery.min.js&quot;&gt;&lt;\/script&gt; \t&lt;script&gt; \t\t\/\/ setTimeout(function(){ \t\t\/\/\twindow.location.reload(1); \t\t\/\/ }, 3000); \t\t\/\/ setInterval(function() { \t\t\/\/\tvar myImageElement = document.getElementById('myImage'); \t\t\/\/ \tmyImageElement.src = 'labview_png.php?rand=' + Math.random(); \t\t\/\/}, 200); \t  \t\t$(document).ready(function(){ \t\t\tsetInterval(function(){ \t\t\t\t$(&quot;#png&quot;).attr('src', 'labview_png.php?rand=' + Math.random()); \t\t\t\t$(&quot;#auto&quot;).load(location.href + &quot; #auto&quot;); \t\t\t}, 1000); \t\t}); &lt;\/script&gt; \t &lt;\/head&gt;  &lt;body&gt; &lt;?php \/\/phpinfo(); echo '_GET val: '; foreach ($_GET as $key =&gt; $value) \techo &quot;$key=$value, &quot;; echo '&lt;br&gt;', PHP_EOL;  echo '_POST val: '; foreach ($_POST as $key =&gt; $value) \techo &quot;$key=$value, &quot;; echo '&lt;br&gt;', PHP_EOL;  define('FPStateInfo', ['Invalid', 'Standard', 'Closed', 'Hidden', 'Minimized', 'Maximized']); define('ExecStateInfo', ['eBad 0 VI has errors; it cannot run', 'eIdle 1 VI is not running, but the VI is in memory.', 'eRunTopLevel 2 VI is running as a top-level VI', 'eRunning 3 VI is running as a subV']);  $obj = new COM('LabVIEW.Application'); \/\/com_print_typeinfo($obj);  $vi = $obj-&gt;GetVIReference('C:\\Users\\Dell\\Desktop\\LabVIEW Web ActiveX\\ActiveX Server Executable _LV2012_NI Verified\\Executable as ActiveX Server\\ActiveX Server.vi');  \/\/$vi-&gt;OpenFrontPanel();  echo '&lt;form action=&quot;&quot; method=&quot;post&quot;&gt;'; echo '&lt;input type=&quot;button&quot; value=&quot;Refresh page&quot; onClick=\\'window.location.href=window.location.href\\'&gt;', PHP_EOL;  $fpstate = $vi-&gt;FPState(); $vistate = $vi-&gt;ExecState();  if ($_POST['action']==='run_vi' &amp;&amp; $vistate &lt;= 1) { \t$vi-&gt;Run(true); \/\/ async Boolean If TRUE, you do not need to wait for the VI to finish running. The default is FALSE. } elseif ($_POST['action']==='stop_vi' &amp;&amp; $vistate &gt; 1) { \t\/\/$vi-&gt;SetControlValue('stop', true); \t\/\/sleep(1); \t$vi-&gt;Abort(); } elseif ($_POST['action']==='open_fp' &amp;&amp; $fpstate==2) { \t$vi-&gt;OpenFrontPanel(); } elseif ($_POST['action']==='close_fp' &amp;&amp; $fpstate!=2) { \t$vi-&gt;CloseFrontPanel(); }  if ($_POST['Count2']) { \t$vi-&gt;SetControlValue('Count2', $_POST['Count2']); }  echo '&lt;h3&gt;SetControlValue(\\'Count2\\'):&lt;\/h3&gt;', PHP_EOL; echo '&lt;input onchange=&quot;this.form.submit()&quot; type=&quot;number&quot; name=&quot;Count2&quot; value=&quot;', $vi-&gt;GetControlValue('Count2'), '&quot;&gt;', PHP_EOL;  echo '&lt;div id=&quot;auto&quot;&gt;';  echo '&lt;h3&gt;AppName \/ Version:&lt;\/h3&gt;', PHP_EOL; echo $obj-&gt;AppName(), ' \/ ', $obj-&gt;Version(), '&lt;br&gt;', PHP_EOL;  echo '&lt;h3&gt;ExportedVIs:&lt;\/h3&gt;', PHP_EOL; foreach ($obj-&gt;ExportedVIs() as $value) \techo $value, '&lt;br&gt;', PHP_EOL;  echo '&lt;h3&gt;FPState:&lt;\/h3&gt;', PHP_EOL; $fpstate = $vi-&gt;FPState(); echo $fpstate, ', ', FPStateInfo[$fpstate], PHP_EOL;  echo '&lt;button name=&quot;action&quot; type=&quot;submit&quot; value=&quot;open_fp&quot;&gt;OpenFrontPanel&lt;\/button&gt;', PHP_EOL; echo '&lt;button name=&quot;action&quot; type=&quot;submit&quot; value=&quot;close_fp&quot;&gt;CloseFrontPanel&lt;\/button&gt;', PHP_EOL;  echo '&lt;h3&gt;ExecState:&lt;\/h3&gt;', PHP_EOL; $vistate = $vi-&gt;ExecState();  if ($vistate &gt; 1) { \techo '&lt;font color=&quot;blue&quot;&gt;', $vistate, ', ', ExecStateInfo[$vistate], '&lt;\/font&gt;', PHP_EOL; } else { \techo $vistate, ', ', ExecStateInfo[$vistate], PHP_EOL; }  echo '&lt;button name=&quot;action&quot; type=&quot;submit&quot; value=&quot;run_vi&quot;&gt;Run VI&lt;\/button&gt;', PHP_EOL; echo '&lt;button name=&quot;action&quot; type=&quot;submit&quot; value=&quot;stop_vi&quot;&gt;Abort VI&lt;\/button&gt;', PHP_EOL; echo '&lt;\/form&gt;', PHP_EOL;  echo '&lt;h3&gt;GetControlValue(\\'Count\\') \/ GetControlValue(\\'Count2\\'):&lt;\/h3&gt;', PHP_EOL; echo $vi-&gt;GetControlValue('Count'), ' \/ ', $vi-&gt;GetControlValue('Count2'), PHP_EOL; \/\/echo $vi-&gt;SetControlValue('Count2', $vi-&gt;GetControlValue('Count')+1), PHP_EOL;  echo '&lt;h3&gt;Array1:&lt;\/h3&gt;', PHP_EOL; foreach ($vi-&gt;GetControlValue('Array1') as $value) \techo $value, '&lt;br&gt;', PHP_EOL;  \/\/$png_data = new variant(null, VT_UI1); \/\/$png_data = variant_set_type($vi-&gt;GetControlValue('png data'), VT_UI1); \/\/echo variant_cast($vi-&gt;GetControlValue('png1'), VT_BSTR), PHP_EOL; \/\/echo mb_strlen($vi-&gt;GetControlValue('String1')), PHP_EOL; \/\/echo variant_get_type($vi-&gt;GetControlValue('png1')), PHP_EOL;  echo '&lt;h3&gt;PNG data:&lt;\/h3&gt;', PHP_EOL; $png_data = $vi-&gt;GetControlValue('PNG data'); echo 'PNG size:' , strlen($png_data), '&lt;br&gt;', PHP_EOL;   echo '&lt;\/div&gt;';  if ($vistate &gt; 1 &amp;&amp; $fpstate!=2) { \techo '&lt;img src=&quot;labview_png.php&quot; id=&quot;png&quot;&gt;'; }  \/\/ variant_set_type($variant, VT_BSTR) \/\/$png_data = variant_cast($vi-&gt;GetControlValue('png data'), VT_U1);   \/\/echo  variant_get_type($png_data), PHP_EOL; echo $vi-&gt;SetControlValue('String1', &quot;123\\x00555321&quot;); \/\/com_print_typeinfo($vi); $obj = null; ?&gt; &lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">labview_png.php<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php if(strpos(exec('tasklist \/FI &quot;IMAGENAME eq LabVIEW.exe&quot; \/NH'), 'LabVIEW.exe') === false) \texit(&quot;\u041d\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d LabVIEW.exe&quot;); $obj = new COM('LabVIEW.Application'); $vi = $obj-&gt;GetVIReference('C:\\Users\\Dell\\Desktop\\LabVIEW Web ActiveX\\ActiveX Server Executable _LV2012_NI Verified\\Executable as ActiveX Server\\ActiveX Server.vi');  $data = $vi-&gt;GetControlValue('PNG data');  $im = imagecreatefromstring($data); if ($im !== false) {     header('Content-Type: image\/png');     imagepng($im);     imagedestroy($im); } else {     echo '\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430.'; } $obj = null; ?&gt;<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 LabVIEW, \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 LabVIEW. \u0410 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c COM \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u0412 \u043c\u043e\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e AJAX \u0438 \u00ab\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u00bb, \u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 LabVIEW \u0432\u044b\u043b\u044c\u0435\u0442\u0441\u044f \u0432 \u00ab\u0447\u0435\u0440\u0435\u043f\u0430\u0448\u0438\u0439 \u043c\u0430\u0440\u0430\u0444\u043e\u043d\u00bb \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u0432 \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0439 labview.exe.<br \/>  \u0412\u0438\u0434\u0435\u043e\u043e\u0431\u0437\u043e\u0440:<\/p>\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0; width: 100%; height: 0; position: relative; padding-bottom: 56.25%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/dU2pEUCK9ko?rel=0&amp;showinfo=1&amp;hl=en-US\" style=\"border: 0; top: 0; left: 0; width: 100%; height: 100%; position: absolute;\" allowfullscreen scrolling=\"no\" allow=\"encrypted-media; accelerometer; gyroscope; picture-in-picture\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h3>Appendix. \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f NGINX \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e proxy \u0441 HTTP Basic access authentication \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 WebServices LabVIEW<\/h3>\n<p>  \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0441 WebServices LabVIEW (\u043f\u043e \u043f\u0440\u0430\u0432\u0434\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0442\u0430\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 LabVIEW). \u0422\u043e\u0433\u0434\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e \u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 (\u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 WebServices) \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0440\u0430\u0437\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 Application Server \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u00ab\u043c\u0435\u0440\u0442\u0432\u044b\u0439\u00bb Microsoft Silverlight. \u0410 \u043c\u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0431\u044b\u043b \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0442\u0438\u043f\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0430\u0440\u043e\u043b\u044f HTTP Basic access authentication.<br \/>  \u042f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f NGINX \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u0435\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e web proxy c \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 auth_basic. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441 http:\/\/server_name:5500 \u043f\u043e\u0441\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 \u043f\u0430\u0440\u043e\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a WebService \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u043c\u0443 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 http:\/\/127.0.0.1:8001\/webservice1\/. \u0417\u0430\u0449\u0438\u0449\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f webservice1.<\/p>\n<p>  nginx.conf:  <\/p>\n<pre><code class=\"nginx\">server {     listen       5500;     server_name  localhost;     location \/ {         auth_basic &quot;Unauthorized&quot;;         auth_basic_user_file htpasswd;         root html;         #autoindex on;         #index index.html index.htm;         proxy_pass http:\/\/127.0.0.1:8001\/webservice1\/;     }     error_page   500 502 503 504  \/50x.html;     location = \/50x.html {         root   html;     } }<\/code><\/pre>\n<p>  \u0438 \u0444\u0430\u0439\u043b htpasswd \u0441 \u043f\u0430\u0440\u043e\u043b\u044f\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:  <\/p>\n<pre><code class=\"plaintext\">admin:{PLAIN}1<\/code><\/pre>\n<p>  \u0420\u0430\u0437\u0432\u0438\u0432\u0430\u044f \u044d\u0442\u0443 \u043c\u044b\u0441\u043b\u044c \u0434\u0430\u043b\u044c\u0448\u0435, \u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a proxy NGINX \u043f\u043e HTTPS, \u0430 \u043e\u0442 NGINX \u043a LabVIEW \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c HTTP.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/502496\/\"> https:\/\/habr.com\/ru\/post\/502496\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/502496\/\">\u0412 LabVIEW \u0443\u0436\u0435 \u043c\u043d\u043e\u0433\u043e \u043b\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u00ab\u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c\u00bb Web \u043a VI \u043f\u0440\u0438\u0431\u043e\u0440\u0430\u043c \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b LabVIEW, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 ActiveX. \u041d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0438 LabVIEW 2020 Community edition.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-304060","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304060","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=304060"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304060\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=304060"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=304060"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=304060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}