Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Mads last won the day on January 10

Mads had the most liked content!


About Mads

  • Birthday 12/01/1975

Profile Information

  • Gender
  • Location
    Bergen, Norway
  • Interests
    Trail running, skiing, fly fishing, science fiction, food and travel.

LabVIEW Information

  • Version
    LabVIEW 2020
  • Since

Contact Methods

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Mads's Achievements


Explorer (4/14)

  • Conversation Starter Rare
  • Reacting Well Rare
  • First Post Rare
  • Collaborator Rare
  • Dedicated Rare

Recent Badges



  1. No complaints, you are doing a fantastic job 😀👍 I edited my examples to include two versions based on JSONtext (attached). PS. I have not tried to scale up the cluster array to see what the differences would be performance-wise yet, they all have their pros and cons usability-wise though. Distributing cluster changes, now with 4 solutions.zip
  2. Aah, thanks, that works.😃 I made a demo of the issue, but you replied just when I was about to post it. The reason I though the $.[0] notation should work was that if I tested it with https://jsonpath.com/ it (almost) seems to find what I wanted... Attached is the demo/test I made...but now with the correct notation for arrays as well. Exploring having Cluster array as JSON.vi
  3. The GUI presents a list of devices by tag in a list box or tree where the user can choose to select one or multiple devices (only of the the same type). If they choose multiple that is one way for me /the code to know whether they want to have changes replicated. If they have selected multiple serial links e.g. the GUI will only show the setup of one link, but changes will be applied to all. There is also a tick box that allows them to put the GUI into "global mode", which is just a shortcut to always apply all changes to all devices of the same type (no need then to select them manually in the listbox/tree). As you say there is one issue with this, and that is if they want to apply a value that is already set for the device chosen by the GUI as the "template". They then have to re-enter the value just to trigger the distribution of it to the other device configurations. This I find OK though - it is part of the "contract"; when you select global mode or multiple devices the user accepts that this will apply *changes* to all - and that is that. With that contract in their head the function makes sense / is intuitive enough. You could add additional GUI elements like an apply all button to sub-sections of the configuration, it depends on how many elements you have in the setup and how often the user would want to replicate them. In my case there are many inputs, but only some of them make sense to replicate; but those often need to be replicated to *many* devices, so the user saves a lot of time having this feature (makes users very happy to have it, so no complaints about such shortcomings... 🙂 ). I do not indicate to the user which values he has changed, that I expect the user to keep track of himself...(he knows what he just did, if he has forgotten already he can always cancel the changes though) but as @hooovahhmentions you could do that... One thing I have not mentioned is that the replication/apply to many/all functionality is kept from touching things that should be unique anyway... Guarding from such changes can be put at different levels, in my case they it is handled by having dedicated event cases for those controls, but in a more generic solution you might want to have a blacklist instead, or include a key in the control name that enabled/disables the replication...
  4. I have not used JSON/JSONtext much, but this sounds like a good plan. If you can bare with me, could you elaborate a bit on how this can be implemented (or point me to an example/documentation that would help)? To use the solution examples I posted as a starting point: Would I replace the array of clusters with a JSON object? In JSONtext, how do I go about replacing the value of multiple items then? If I start with this (instead of the LabVIEW cluster array from the examples): [ {"Enabled":true,"Hello":-2,"Hi":6}, {"Enabled":true,"Hello":-2,"Hi":6}, {"Enabled":true,"Hello":-2,"Hi":6}, {"Enabled":true,"Hello":-2,"Hi":6} ] and try using Set item with the path $.[*].Enabled e.g. when that value changes, it returns an error. Accessing just one of the indexes ($.[0].Enabled e.g.) fails as well. What would be the correct way? Naming each element to be able to use set multiple items with an item names input? (I did successfully rewrite the demo to work with JSON using JSONtext, but then I just treated each array element as a separate JSON string and ran Set item on each of them with the path $.<Label.text>😳) PS. I guess you would also use your SQLite library to store the configuration of each device in a table with the config clusters as JSON strings then...or?🙂
  5. Basic problem: If an element of a given cluster is changed - that value, and that value change alone, should be applied to several other clusters (which will otherwise retain their other element values). Known solutions: In the attached file (LabVIEW 2020 code) I have two ways of doing this: 1) using dynamic events and Set Cluster Elements by Name (OpenG), or 2) by using the Cluster To Array of VData.vi (also from OpenG). (Note: The use of array locals in the examples are there just to simplify the demo). Question: Are there other / better ways of doing it? A bit more background: In configuration windows I sometimes allow users various ways to choose to apply any *changes* globally or to a selection of targets. If e.g. they want to change the baud rate of 3 out of 5 different serial links they can choose the 3 links, and if they change anything in the communication setup of the first of them it will be applied to all 3 links (the rest of their setup will remain as before (they might still have different parity settings e.g.). I usually avoid clusters in the GUI so each change is handled individually, either in a dedicated value change event case (lots of coding needed...), or in a common case that uses the control reference to touch the correct element of the other target's configuration...(less code needed). However, in cases where the number of controls is very high, it can be nice to just have them in a cluster in the GUI as well - and to not have to write event cases to handle the change of each and every cluster element... Distributing cluster changes.zip
  6. Have you installed sudo and added the lvuser to the sudoders list? If you are calling a script make sure lvuser has access to the file (ownership defaults to admin if you have transferred it onto the device logged on as admin). The LabVIEW RT Linux site has some threads with pointers for this, like these: https://forums.ni.com/t5/LabVIEW/Mount-NSF-share-to-NI-Linux/td-p/3822135 https://forums.ni.com/t5/NI-Linux-Real-Time-Discussions/Is-it-possible-to-close-and-re-open-RTEXE-through-Embedded-UI/td-p/3707540
  7. We should have a native solution to this. I added it as an idea on the idea exchange...
  8. Finding problems is an integral part of coding; you code, test, code, test etc. If you are not testing continuously and spending much more time on that than actual coding you are bound to run into serious trouble late in the project. Code reviews? Ten people can look at the same code and think it is fine. Testing, and most importantly - testing while coding is more effective. When you think you have something completed - someone else tests it, sure. You have probably overlooked things. Again the ones that test it do it best alone (they should not be guided by you, that will reduce the likelihood of them finding errors and non-intuitive designs), and when they find something they review the code and discuss the issue with you etc. I am talking more of the creative side of coding (including the feedback from the aforementioned testing). Two heads or more should always be involved at some stage, but it should not replace the focus only a single mind can achieve. The holes I am talking about are holes in the plan that become visible when you start to poke at it / actually execute the plan. There are no waterfall projects , you learn while doing and adjust. As for item 8 the use of remote work *is* in line with having quiet offices. For people that do not have that at home though, remote work is not a good option and we return to item 8 😉
  9. Ok, so you need the processing to return the results faster for other reasons than the sampling itself. Just as a comparison I set up a test on my computer (I used the NI_Gmath:Interpolate 1D.vi, with spline as the chosen method) and as on your computer it took 400 ms to run through an array of 10000*100. Adjusting the parallelism of the loop running the interpolation VI it dropped to 220 ms with 2 loops. With 16 loops it got down to 74 ms (I ran it on an i7-9700 with 8 cores).
  10. No, I am asking why you need the spline to run between the measurements, instead of just handling that part off to a parallel or post-processing code. If the result of the spline is not needed for the next measurement the two things might not need to be handled sequentially. If that is the case the time spent on the interpolation would not be an issue...(it might represent a memory issue instead then, but that is less likely and easier to deal with).
  11. Is the output of the previous interpolation used in the setup of the next measurement, or could you process the incoming readings in a separate loop to avoid having to wait for the interpolation before doing the next measurement?
  12. Wow, I would *never* program in pairs. Who can stay in the zone with someone else messing with the flow (see item 8 on this list...) Working together while discussing the work and writing pseudocode is good, but while actually programming? Yuck. To work well I need to keep and manipulate 110% of the problem in my head (the extra 10 percent (or 200%) is the array of continuously variating attacks on the project my fantasy throws at it while I am working on it to find holes, weaknesses and opportunities in the plan 🧐) , and to do that I need to be "alone inside my head"....
  13. Have you tried updating the firmware via the web interface of the controller?
  14. Toronto is halfway around the globe from me so I will not pretend to know anything about the job market there, but just out of curiosity I found 28 adverts here that at least mentions LabVIEW. The number of open positions that mentions LabVIEW here in Norway actually seems slightly higher than it used to be (contrary to the feeling I also have about its decline). There are very few pure developer positions though, as has always been the case.
  15. The path to the rtexe launched by the RTE is not fixed...so perhaps you could just change the given path before killing the current application? I have not tried, but if it works it would allow you to keep multiple rtexe files instead of overwriting them: On LinuxRT the path is in: etc/natinst/share/lvrt.conf which is an ini-file formatted file it looks like with the key: RTTarget.ApplicationPath=/home/lvuser/natinst/bin/startup.rtexe
  • Create New...

Important Information

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