How is an OPC-UA server managing EURange of a value? - opc-ua

The EURange is described here.
EURange defines the value range likely to be obtained in normal
operation. It is intended for such use as automatically scaling a bar
graph display.
Sensor or instrument failure or deactivation can result in a returned
item value which is actually outside of this range. Client software
must be prepared to deal with this possibility. Similarly a Client may
attempt to write a value that is outside of this range back to the
server. The exact behaviour (accept, reject, clamp, etc.) in this case
is Server-dependent. However, in general Servers shall be prepared to
handle this.
My question: If a variable in an OPC-UA server has a defined the EURange to "clamp" (upper and lower limits has been set), what will happen if a client writes a value that is out of the range, to the defined server variable?
Let's say EU low: 0 and EU high: 100
A clients tries to set the variable to 101. Is the OPC-UA server then supposed to automatically correct the value to the closest limit (i.e. EU high: 100)?

I believe it's appropriate for the server to either:
reject the write and return StatusCode Bad_OutOfRange
accept the write, clamp the value, and return StatusCode Good_Clamped

The boundaries of an EURange are advisory in nature. It is okay for the server to clamp, but it is also fine to set the value to the contents of the Write Request argument (or another custom clamp, if that got exceeded, too) and optionally emit an Alarm on range violation.
Example: if you monitor the water level of a basin based on inflow calculus, you don't want the level to clamp on overflow. You want a flooding alarm.

Related

How to define a good value for wal_keep_size parameter

wal_keep_size (new in v.13) parameter specifies the minimum size of past log file segments kept in the pg_wal directory. How to set an appropriate value for this parameter?
It is not really new. Before v13, it was called wal_keep_segments. It was counted in different units, but did the same thing. But generally you should be using slots instead. If you do need to use wal_keep_size rather than slots for some reason, then that reason (unknown to us) should determine what to set it to.

Anylogic forklift collision logging

I need to measure the time forklift spends in collision, however movement_log
for agent type that is a forklift managed by transporter, fleet is not available. I also can not use statecharts because it uses much performance.
Situation: I am simulating a warehouse with one-way aisles and the capacity of these one-way aisles is 2 vehicles. There are situations
where a forklift (the yellow one) needs to wait behind another one in one-way aisle, I currently have that modeled properly I just don't know how to detect this situation and log it.
Thank you
I would do it as following:
Create a new 2-dimensional variable called collisionLog.
Check the speed [getSpeed() function] and state [TransporterState getState() function] every 1 second.
Write these into the collisionLog.
Once the simulation is completed, remove the rows with idle status.
Then do the calculations based on the fact that when speed is zero and transporter is busy, then you have the waiting vehicle.
There is no accessible trigger point (typically an action of a block) to trap when transporters have collisions. Yes, that situation obviously has to be captured internally to enable the transporters to avoid collisions, but in this situation that is not exposed as a block action, or action anywhere else. (AnyLogic space markup elements never have actions, except for some of the newer Material Handling library ones like Station, because these effectively represent a process step.)
The Transporter Control block has all the settings for collision detection and avoidance, but no related actions.
So your alternatives are really
'Scan' for this situation occurring: Yashar's answer, inferring that zero speed when non-idle means 'waiting due to collision' (which may or may not be 100% robust) being one way.
Explicitly break down the movement (from the process perspective) to define the potential 'conflicts' and decision-making within the process flow (e.g., if you're trying to move to an aisle, move to an entrance node, reserve a space in the aisle using resource pools or similar, and only enter when free). Clearly that doesn't cover every possible case, but may be useful in some situations.
The actions that do exist in the Transporter Control block could help a bit here (for both alternatives) since at least you have action points on entering paths and nodes. (You could also raise an enhancement request with AnyLogic to add collision-related actions here....)
I have a huge model with large number of forklifts, checking any attribute every second would result in huge performance loss
I also can not use statecharts because it uses much performance
Have you actually tried it though? Some things do not result in as much of a performance hit as you might think, and performance should not be an a priori 'that will be too slow' thing; ideally you have requirements for acceptable performance and you work round that. (There are always trade-offs between performance, functionality and maintainability.)
[You also don't say how you think using statecharts could have helped. Did you mean doing the 'scanning' approach via a statechart, say with cyclic entry/exit from a Scan state?]

How can I understand "value" in bacis paxos

I am reading Lamport's Paxos Mode Simple, and I get confused with the meaning "value" here.
For example, Lamport says:
If a proposal with value v is chosen, then every higher-numbered proposal that is chosen has value v
I don't know what value v means here:
Does it mean different value of a certain variable, such as variable x's value can be 1 or 42?
Or is it something like one log entry in Raft, such as x=1 or y=42?
I think the first interpretion is right, and basic Paxos can't determine multiple values, it just Propose-Accept-Chosen, and the whole basic Paxos instance finishes its mission.
However, I am not for sure.
Your second interpretation is correct ("It's like one log entry in Raft").
You are also correct that Basic Paxos can't choose multiple values, it just chooses one, like a single log entry in Raft. To choose a series of values you need to chain multiple Basic Paxos instances together, like in Multi-Paxos or Raft.

Map commands to value objects in CQRS

On one hand, the invariants should be protected (To make invalid states impossible early and preferably at compile time rather than run time), and on the other hand, passing domain knowledge out of the domain is wrong.
On one hand, the value objects protect our domain invariants at first place, on the other hand using them as commands or as it's properties equals passing domain knowledge around.
The only solution for both protecting the invariants, and avoiding the domain knowledge from leaking the domain boundary (encapsulating the domain model), seems to wrap the aggregates in a command-to-value-object-mapper.
I'm using CQRS along with ES.
Is it ok to have a wrapper as a command-to-value-object-mapper around my aggregate roots? Is there any other solution?
The value objects can have constraints such as for instance valid range on a integer or a regex on a string. If these constraints are validated and the values are passed around in the same compiled code boundary it should be ok. If you validate the values in another boundary and then just accept it as valid after deserialization, that would be leaky.
The commands just express intent. Its values are validated when handling the command with respect to the current domain state. Domain values are created and can both validate themselves internally or be validated by other domain logic.

Is it correct to use TargetSubID as a flag for test data in FIX protocol?

We are currently working on a FIX connection, whereby data that should only be validated can be marked. It has been decided to mark this data with a specific TargetSubID. But that implies a new session.
Let's say we send the messages to the session FIX.4.4:S->T. If we then get a message that should only be validated with TargetSubID V, this implies the session FIX.4.4:S->T/V. If this Session is not configured, we get the error
Unknown session: FIX.4.4:S->T/V
and if we explicitly configure this session next to the other, there is the error
quickfix.Session – [FIX/Session] Disconnecting: Encountered END_OF_STREAM
what, as bhageera says, is that you log in with the same credentials.
(...) the counterparty I was connecting to allows only 1 connection
per user/password (i.e. session with those credentials) at a time.
I'm not a FIX expert, but I'm wondering if the TargetSubID is not just being misused here. If not, I would like to know how to do that. We develop the FIX client with camel-quickfix.
It depends a lot on what you system is like and what you want to achieve in the end.
Usually the dimensions to assess are:
maximising the flexibility
minimising the amount of additional logic required to support the testing
minimising the risk of bad things happening on accidental connection from a test to a prod environment (may happen, despite what you might think).
Speaking for myself, I would not use tags potentially involved in the sesson/routing behavior for testing unless all I need is routing features and my system reliably behaves the way I expect (probably not your case).
Instead I would consider one of these:
pick something from a user defined range (5000-9999)
use one of symbology tags (say Symbol(55)) corrupted in some reversible way (say "TEST_VOD.L" in the tag 55 instead of "VOD.L")
A tag from a custom range would give a lot of flexibility, a corrupted symbology tag would make sure a test order would bounce if sent to prod by accident.
For either solution you may potentially need a tag-based routing and transformation layer. Both are done in couple of hours in generic form if you are using something Java-based (I'd look towards javax.scripting / Nashorn).
It's up to the counterparties - sometimes Sender/TargetSubID are considered part of the unique connection, sometimes they distinguish messages on one connection.
Does your library have a configuration option to exclude the sub IDs from the connection lookups? e.g. in QuickFix you can set the SessionQualifier.