Code Monkey home page Code Monkey logo

Comments (21)

bernhard-thiele avatar bernhard-thiele commented on August 29, 2024

If I remember correctly, that will allow to connect several sinks at the output, e.g., you could use shared memory and UDP or have UDP sending to two different locations.

However, I just noticed that I can't run some the examples any more. Seems I have broken something with my last renaming action. Need to have a look at this.

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

But still

partial block PartialSerialPackager
      parameter Integer nu(min=0,max=1) = 0 "Output connector size"
          annotation(Dialog(connectorSizing=true), HideResult=true);

looks strange. Either 0 or 1 is allowed but is it not possible to edit in diagram layer.

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

Can't we get rid of nu?

from modelica_devicedrivers.

bernhard-thiele avatar bernhard-thiele commented on August 29, 2024

I just made a fix to my previous commit. Didn't rename one variable consistently.

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

OK. But back to my questions which is independent of branch.

from modelica_devicedrivers.

bernhard-thiele avatar bernhard-thiele commented on August 29, 2024

Regarding the nu, this uses the feature of automated connector sizing which should be fine

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

But dimensions are wrong then. It only works because nu is 1 in samples.

from modelica_devicedrivers.

bernhard-thiele avatar bernhard-thiele commented on August 29, 2024

The problem is that some of the ports are unconnected at the ends (for the blocks that read). They need to be size 0.

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

OK, the get functions are fine. But problem still is apparent in add functions. Above code is taken from an add function. addRealAsFloat should take nu array of pkg and return nu array of dummy.

from modelica_devicedrivers.

bernhard-thiele avatar bernhard-thiele commented on August 29, 2024

I think I understand it again. The connector is either 1 or 0. For the reading blocks that is needed so that they can be used without a terminal block. For the writing blocks that is not really needed since they will always be connected to terminal block that writes the package to a (physical) device. However, since the writing blocks inherit the same interface like the reading blocks, they share that code that is not required for them to work (but doesn't hurt either).

from modelica_devicedrivers.

bernhard-thiele avatar bernhard-thiele commented on August 29, 2024

An alternative would be to have different base classes for reading or writing blocks (and maybe factor out the common parts in yet another base class). Whether this would be a nicer solution, I'm not so sure. But we can do that. What do you prefer?

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

So how did you build the example models? Did you set nu manually in the text layer to 1? This is strange since users are not aware of such a hidden parameter.

from modelica_devicedrivers.

bernhard-thiele avatar bernhard-thiele commented on August 29, 2024

No, Dymola does set it to 1 automatically as soon as you connect to it. Just tried to build up a new model using drag-and-drop and it worked. Or am I missing some issue?

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

I see. Thus you can easily build a model with nu > 1 and run into trouble.

from modelica_devicedrivers.

bernhard-thiele avatar bernhard-thiele commented on August 29, 2024

That's partly true. In theory there is the constraint max=1 but Dymola doesn't check it. However, in that case the translation will fail due to a wrong number of equations.

What does SimulationX do? If slight changes would make it more convenient to use that blocks form both SimulationX and Dymola, we could do that.

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

SimulationX 3.6 behaves in the same way as Dymola regarding the automatic incrementation of nu. But it not fail if nu > 1 which is strange. SimulationX 3.7 will behave differently than now.

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

Maybe we should introduce different connectors for add and get packager. What do you think?

from modelica_devicedrivers.

bernhard-thiele avatar bernhard-thiele commented on August 29, 2024

I will think about it. However, have to stop looking at it and leave know. Of course if you have some idea that we can test, we'll do it...

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

OK. Let's both think about it. Is backward compatibility an serious issue for you?

from modelica_devicedrivers.

bernhard-thiele avatar bernhard-thiele commented on August 29, 2024

Backward compatibility is important. There are sometimes good reasons to break it anyway. However, I would prefer starting an alternative packaging system at some day and mark the current one as deprecated.

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

Well, then this issue can be closed, right?

from modelica_devicedrivers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.