This file contains hidden or 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
| require "lipa" | |
| store = Lipa::Tree.new :store do | |
| kind :category, :for => :node do | |
| unit_count Proc.new { | |
| count = 0 | |
| children.values.each do |u| | |
| count += u.count if u.kind == "unit" | |
| end |
This file contains hidden or 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
| dir_2["dir_1/dir_2/searched_obj"] | |
| dir_2["searched_obj"] | |
| dir_2["./searched_obj"] | |
| dir_2["../dir_2/searched_obj"] |
This file contains hidden or 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
| require "rmodbus" | |
| s = ModBus::TCPServer.new(9999, 1) | |
| s.holding_registers = [1] * 10 | |
| s.start | |
| ModBus::TCPClient.connect('127.0.0.1',9999) do |cl| | |
| cl.with_slave(1) do |slave| | |
| slave.raise_exception_on_mismatch = true | |
| slave.debug =true |
This file contains hidden or 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
| require "rmodbus" | |
| ModBus::TCPClient.connect('127.0.0.1',9999) do |cl| | |
| cl.debig = true | |
| cl.with_slave(1) do |sl_1| | |
| sl_1.debug #=> true | |
| end | |
| cl.with_slave(2) do |sl_2| | |
| sl_2.debug = false |
This file contains hidden or 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
| require "lipa/web" | |
| #Configuration | |
| srv = root :server do | |
| node :message do | |
| html text("Hello World!") | |
| end | |
| end | |
| srv.run! |
This file contains hidden or 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
| Rehearsal ------------------------------------------------------------ | |
| Read coils 0.480000 0.080000 0.560000 ( 0.495899) | |
| Read discrete inputs 0.420000 0.140000 0.560000 ( 0.503507) | |
| Read holding registers 1.360000 0.150000 1.510000 ( 1.436041) | |
| Read input registers 1.330000 0.150000 1.480000 ( 1.424927) | |
| Write single coil 0.290000 0.120000 0.410000 ( 0.335850) | |
| Write single register 0.300000 0.090000 0.390000 ( 0.329078) | |
| Write multiple coils 0.510000 0.120000 0.630000 ( 0.564480) | |
| Write multiple registers 1.540000 0.110000 1.650000 ( 1.582799) | |
| --------------------------------------------------- total: 7.190000sec |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'pp' | |
| require 'test/unit/assertions.rb' | |
| class NMatrix | |
| attr_reader :shape, :elements, :count, :strides | |
| def initialize(shape, elements = nil) | |
| @shape = shape |
This file contains hidden or 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
| diff --git a/src/OpcUaStackServer/ServiceSet/Session.cpp b/src/OpcUaStackServer/ServiceSet/Session.cpp | |
| index e6ec6a85..54ba71e4 100644 | |
| --- a/src/OpcUaStackServer/ServiceSet/Session.cpp | |
| +++ b/src/OpcUaStackServer/ServiceSet/Session.cpp | |
| @@ -255,10 +255,10 @@ namespace OpcUaStackServer | |
| Log(Debug, "user name invalid"); | |
| return BadIdentityTokenInvalid; | |
| } | |
| - if (token->passwordLen() == 0) { | |
| - Log(Debug, "password name invalid"); |
This file contains hidden or 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
| #include "vendor/ra/powerFlex525/DPIFaultManager.h" | |
| using namespace eipScanner; | |
| using namespace eipScanner::vendor::ra::powerFlex525; | |
| struct DPIFaultManagerResponse { | |
| bool isTripped; | |
| bool isErrored; // flag to say that we failed to make the request | |
| std::vector<DPIFaultObject> faultObjects; | |
| }; |
This file contains hidden or 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
| // | |
| // Created by Aleksey Timin on 11/16/19. | |
| // | |
| #include <cstdlib> | |
| #include <sstream> | |
| #include <cip/connectionManager/NetworkConnectionParams.h> | |
| #include "SessionInfo.h" | |
| #include "MessageRouter.h" | |
| #include "ConnectionManager.h" |