Jump to content

drjdpowell

Members
  • Posts

    1,964
  • Joined

  • Last visited

  • Days Won

    171

Posts posted by drjdpowell

  1. Note: I've also been thinking about UDP Messenger functionality, and am interested in people's use cases:

    https://forums.ni.com/t5/JDP-Science-Tools/UDP-Messengers/m-p/4099792#M17

    The use case I'm interested in is discoverability on the network.  So, allowing actors on different machines to announce their existence (ip address and port) via UDP, so that a TCP Messenger connection can then be established.  This could be built in to the new Reconnecting TCP Messengers.

  2. Do you use any DVRs?  I believe quite a lot happens when the LabVIEW execution system changes a VI from "running top level" to "idle", including destroying any references created by that VI.  Not sure what happens if a DVR that it owns is currently being accessed by another VI; I assume it must wait for the DVR to be released before finishing teh transition to "idle".

  3. 1 hour ago, Jordan Kuehn said:

    Thank you for the confirmation. I have done something similar using numeric types, but it is inconvenient at best. An NXG version of this toolkit would be fantastic. 

    Unfortunately, the NXG Web module lacks both recursion and VIs for determining the data type inside a variant.  This makes porting JSONtext to it very difficult.

  4. 5 hours ago, LogMAN said:

    For example, what is the expected outcome of this?

    That's sloppy on my part.   Arrays should not be supported at all and that should throw an "Unable to Bind Arrays" error.  The code for that is in the Disabled case of "Parse Parameters (Code).vi".  I was experimenting with the idea of allowing U8 Arrays as binding as BLOBs, and I seem to have not undone my buggy experimental modification.

  5. 4 hours ago, mramsdale said:

    1) Can parameters be used for writing multiple rows to a table?  (rather than the step method)

    Hi Guys,

    Support for writing multiple rows in this manner is on the Roadmap, but not yet existing, partly because I am debating multiple options:

    1. A new function, "Execute SQL Multiple Times", that takes a parameter input of arrays of clusters or a cluster of arrays and does multiple executions of one SQL statement. 
    2. Integrating it into the existing "Execute SQL" node.  
    3. Upping the LabVIEW version to 2017 and introducing a new VIM version of either (1) or (2).

    The problems with (2), which you guys are thinking should work are:

    • "Execute SQL" is a polymorphic VI with many members, and major changes to support functionality like this is very time expensive for me.
    • That function is already quite complicated, and increasing what it can do is going to make it more confusing.

    Usually when one is executing the same SQL many times, one is INSERTing rather than getting any results, so a new function (1) would only be one VI, and it could have documentation (and a different icon) that clearly describes using it on multiple INSERTs.   An advantage of the VIM (3) is that I can make the input accept only data in the right form (array of cluster, cluster of arrays).  

     

    This is not high priority for me, as I see it as about convenience rather than new capability.  You can already do things more flexibly and faster-executing using "Prepare Statement" followed by a loop, or you can do it easy (but slow) with "Execute SQL" in a loop.

  6. I am trying to shift discussion of Messenger Library to a group at NI, as this conversation is at 12 pages and is hard to follow.

    New post about a beta feature  for TCP that I am working on: https://forums.ni.com/t5/JDP-Science-Tools/New-Beta-feature-Reconnecting-TCP-Messenger/gpm-p/4092514#M5

    Here's the image.  The idea is to have a persistent TCP Client connection that will try and reestablish itself if broken. 

    822534739_2020-10-2015_09_33-ContextHelp.png.78975dd0f0582c0ec0d28bfff9305aaf.png

    • Thanks 2
  7. 1 hour ago, bmoyer said:

    I was wondering how you make the front panel display update lossy.  Currently, when I want to do this, I check the Time of the event, and if the event is, let's say >1s old, I don't bother updating the display/indicator.  If that how you go about it, or is there another way?  Is there a way to only get the latest event and ignore the rest?  I'm asking this mainly from the perspective of using your Messenger Library toolkit.

    It's documented in the DEV Template.  I use a feedback timeout that is default 0 ms from every case but the Timeout case (which feeds back -1).  This makes the Timeout case execute exactly once after the event queue is empty.   Use a "Display needs update" boolean flag to record if the display needs updating in the timeout case.

    550518896_2020-10-1615_42_09-DEVActorTemplate.lvclass_Actor.viBlockDiagramonAllMessangingRelated_lvpr.png.bf6bacb7d4c8afe7d52bf36859789f92.png

    One can do this with Queues as well.

    With this one is able to look at all incoming data, but do expensive display operations only as often as possible (but as quickly as possible).  So you could, for example, have information coming in a 100 a second, and display using fancy techniques (like complex 2D pictures) that take 100ms+.  This is more responsive and a look more robust than the "drop old stuff" technique.

     

    • Like 1
    • Thanks 1
  8. 7 hours ago, Reds said:

    In this type of scenario, I would normally use a Notifier, not a Queue. If the GUI loop can run fast enough to display all of that data, that's great. If not, some data is skipped. A lossy Notifier is perfect for this scenario.

    A Notifier is only usable is you only have one type of message coming in, and your display doesn't include any history, like a chart.  

    Personally, I keep the data transfer lossless, but just make the actual front panel display update lossy. 

    • Like 1
  9. 7 hours ago, Bhaskar Peesapati said:

    Looks like you do not like to use DVRs. I read and write to DVR as property in a class in the following way only. Do you still think I am might run into problems.  If so what do you suspect. The write or SET happens only in open place.

    image.png.d037b33f337ba3f2e714d2b6a91f01e6.png

    They way you're using DVRs here, pulling the full data out of the in-place structure, forces a lot of copying.  You have to do the work inside the event structure if you wish to prevent copying.

    • Like 1
  10. I suffer from the handicap of being located in UTC+00:00, which makes it difficult for me to spot bugs in local to UTC conversion.  I have to remember to switch my computer to the wrong timezone to test things, and I obviously didn't do that here.  Thanks for spotting this. The format specifier should indeed have a ^ in it.

  11. Only suggestions I have are:

    1. Is the exe in that "builds" folder.  The EXE xpects teh dll at "<EXE's folder>/data".   Your screenshot shows the dll at "builds/data".
    2. Could be a missing dll that libpq.dll calls.  Try downloading a full set of Postgres dlls and place them in the data folder.
  12. 1 hour ago, brownx said:

    Ok - let's talk about my example - it's basically a IO driver:
    - I need to support a set of hardware, each with N inputs and M outputs (don't matter what kind, they will be many)
    - it has to be easily scaled to add more type and more from the same type
    - has to be multithreaded and permit multiple instances of the same HW
    - data has to be accessed from a single standalone vi call (hard to explain this unless You guys are using Teststand which is a bit different than having one monolith Labview app)

    How You guys would implement it? Don't need complete examples, just a few keywords from where I can get a new viewpoint ...

    All my applications are developed with a package I wrote several years ago called "Messenger Library": https://labviewwiki.org/wiki/Messenger_Library  There are a few YouTube videos linked from that wiki that go through an actual example application.   It's motivated by the Actor Model, and so I take inspiration from frameworks like Erlang, Akka or the C++ Actor Framework.  The core concept is "messaging" to gain the benefits you list.

    • Thanks 1
  13. Remember that you are a User, and you only look at User Interface.  When you "open a class" a cluster UI widget is loaded to represent the class data.  But that widget is not the actual cluster.  When you "open a subVI", the corresponding front panel is loaded with UI widgets to correspond to the block diagram terminals.  But for most subVIs, that front panel is never loaded if it is not opened. 

    This is unfortunately counter intuitive, as every subVI has a User Interface (Front Panel) a new programmer will think that is significant, while an experienced LabVIEW programmer will intuitively understand that the front panel of most subVIs doesn't really exist at runtime.

     

    • Like 2
  14. Didn't not read the full conversation, but thought I'd point out to the OP that it is a common mistake for programmers coming into LabVIEW to mistakenly identify LabVIEW's UI Widgets (Controls/Indicators) as being "variables", and Control References (actually references to the UI widgets) as being "data references".  They also confuse the UI Widgets with the data that the Widget is acting as a UI for (which I suspect the OP has done when they talked about having many data copies in using "Arrays" and "Clusters").

    Performant data-handling code will not utilize the User Interface at all, and if a "reference" were to be needed, it would probably be a DVR.

    • Like 1
×
×
  • Create New...

Important Information

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