Jump to content

bjustice

Members
  • Posts

    152
  • Joined

  • Last visited

  • Days Won

    10

Posts posted by bjustice

  1. Yeah, Neil understands me here

    A shortcut cannot be a blank string.  So, I would expect a blank string, which is also the default value of the input, to yield a no-op.

    I created my own abstraction layer to sit on to of the low level menu API.  My abstraction layer is used by both by my main menu as well as by control references.  So, this behavior forced me to write a comical piece of code where I case structure 2 copies of this NI primitive, where 1 case does not wire up the shortcut input.

  2. Ok, I found something.  And it really feels like this disobeys the Laws of LabVIEW physics.

    image.png.dd4c83da587ac6dc4614fbd2484153f6.png

    image.png.68c5a8e6110739db53b47c2798f10121.png

     

    It would be my expectation as a LabVIEW developer that both the top and bottom code should execute exactly the same.  (The constant short-cut cluster wired into the "Set Menu Item Info" function is the default value of the cluster, created by right-click + create constant from the terminal of the VI.)  I would expect the default/blank value to yield a no-op.

    However, if you run the attached VI, you will find that the top screenshot produces an error.  The bottom does not.

    button right click menus are not allowed to have shortcuts.  And that's fine.  But I can't figure out how to wire a cluster to this NI primitive in a way that let's me communicate a desired no-op behavior.

    I'm scratching my head trying to determine how this even works.  Does this mean that the NI primitive is able to have code that discerns and reacts to whether or not an input terminal is wired?  It seems like that breaks LabVIEW paradigm.

    Ok, that's all.  Saw something weird and wanted to share.

    Menu example.vi

  3. BlueSerialization is currently LabVIEW 2020.

    hmm... okay.  How bulletproof do you think your VI might be?  Would LabVIEW ever be "smart" enough to not load a classes' *.ctl file into memory if it was blank or something like that?  Or perhaps drop it from a build if it were blank?

    If you think this is pretty bulletproof, I'll just use this and push a patch to the BlueSerialization library.

    I am already cacheing the results, so speed is probably not a huge issue.

  4. I ran into a situation where I need to return the class hierarchy of an object as a concrete object array.  (If you are curious, this is used in the BlueSerialization toolkit)

    The following code snippet demonstrates how I accomplished this.
    Unfortunately, I just discovered that this algorithm doesn't work if a class also inherits from an interface class.  (My algorithm here assumes that a class can only inherit from 1 other class.)

    Naturally, my immediate question is this:

    Is there a graceful NI primitive or mechanism for determining if a given object is an interface class or a concrete class?

    If yes, then I could just filter out interface classes in my code here and move on with life.

    image.png.7dc7c473f113e271b24d40e42cd4be86.png

     

    I did find the "Get LabVIEW Class Parent and Member VI information VI.  But, I can't get this VI to work recursively.  On the 2nd loop iteration, this NI primitive returns that results for a base LabVIEW object even though the wire probe shows this as not being a base LabVIEW object.

    image.png.57003127745ac439b88bd8a1437a97b0.png

     

    Get Class Hierarchy.vi

  5. 2 hours ago, drjdpowell said:

    Does a Property Node, with multiple Properties set, execute as a single action, without a parallel Property Node executing in the middle?   If so, then resetting the Active Plot in the second Property Node in the bottom loop would prevent any race condition.

    I would really like to know the answer to this question.  I would expect the answer to be "yes" since property nodes all run in the UI thread

  6. Another network question:

    Do I have to implement reconnect logic when using UDP?

    More pointedly:

    If I successfully open a UDP port, then will this UDP connection ID ever become invalid or closed somehow in a way that would force me to close it and then reopen it to reestablish communications?

    Example: TCP requires proper handling of reconnect logic.  When the client or server closes the TCP connection, then the connection is closed on both ends.

    image.png.db3bdce66bc6aa00d83ddeab67e2d9f4.png

  7. Question: is it possible to determine the local address and local port selected when using "TCP Open Connection" to connect to a TCP listener?

    It seems weird to me that the "TCP Wait on Listener" resolves and returns this information, but the TCP Client does not have a way to determine this information.  Maybe I'm missing something.

    To be clear, I'm specifically considering a situation where my computer has multiple NICs.  And I'd like to know which NIC is being used.

    I found a relevant idea exchange thread on asking to allow for LabVIEW to specify which NIC to use.  https://forums.ni.com/t5/LabVIEW-Idea-Exchange/Allow-user-to-select-the-which-NIC-to-use-for-network/idi-p/1497368#comments

    Thanks!

    image.png.77374cbe6d9edd2aad4301cec538ea7d.png

  8. Really?  You're suggesting that there's potentially a faster way to convert a u8 byte array to an array of DBLs?  I hadn't considered that.  I really thought that TypeCast would have been the fastest option.  But, I also didn't realize that type cast used the string unflatten code under the hood until AQ communicated this.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.