Leaderboard
Popular Content
Showing content with the highest reputation since 12/03/2024 in all areas
-
A customer asked me to create a powerpoint explaining the advantages of LabVIEW. While putting together the practical rationales, just for grins I asked Chatgpt to create a presentation explaining the philosophy of LabVIEW in a Zen sort of way. Here is what it came up with. Zen_of_LabVIEW.pdf6 points
-
In a previous life, I used to teach a CLD level class using this book, and enjoyed it a lot -- Some of it is certainly outdated at this point, but I think it still has a lot of solid info / strategies in it. I've attached the files as a .zip file to this post. Good luck! Effective LabVIEW Programming Files.zip3 points
-
I have put some effort into improving the VI icons in Messenger Library, in hopes of making things clearer. I have particularly been trying to get rid of the magnifying glass icon, which was standing in for too many concepts. I have also tried to improve the Palettes by putting the standard VIs (that one would most commonly use) in the root-level palette: The 2.0 version also introduces Malleable API methods (the orange-coloured ones), which make code cleaner. If anyone could spare some time, it would help me to have feedback. Especially from people who have not used Messenger Library before, so I can get an idea if the key concepts come across. New 2.1.3 version is available here: https://forums.ni.com/t5/JDP-Science-Tools/New-icons-for-Messenger-Library/m-p/4412550#M1923 points
-
The examples you provide are invalid JSON, which makes it difficult to understand what you are actually trying to do. In your VI, the input data is a 2D array of string but the JSON output is completely different. Your first step should be to define the types you need to produce the expected JSON output. Afterwards you can map your input data to the output data and simply convert it to JSON. The structure of the inner-most object in your JSON appears to be the following: { "Type":"ABC", "IP":"192.168.0.0", "Port":111, "Still":1, "Register":"Register", "Address":12345, "SizeLength":1, "FET":2, "Size":"big", "Conversion":"small" } In LabVIEW, this can be represented by a cluster: When you convert this cluster to JSON, you'll get the output above. Now, the next level of your structure is a bit strange but can be solved in a similar manner. I assume that "1", "2", and "3" are instances of the object above: { "1": {}, "2": {}, "3": {} } So essentially, this is a cluster containing clusters: The approach for the next level is practically the same: { "TCP": {} } And finally, there can be multiple instances of that, which, again, works the same: { "EQ1": {}, "EQ2": {} } This is the final form as far as I can tell. Now you can use either JSONtext or LabVIEW's built-in Flatten To JSON function to convert it to JSON {"EQ1":{"TCP":{"1":{"Type":"ABC","IP":"192.168.0.0","Port":111,"Still":1,"Register":"Register","Address":12345,"SizeLength":1,"FET":2,"Size":"big","Conversion":"small"},"2":{"Type":"ABC","IP":"192.168.0.0","Port":111,"Still":1,"Register":"Register","Address":12345,"SizeLength":1,"FET":2,"Size":"big","Conversion":"small"},"3":{"Type":"ABC","IP":"192.168.0.0","Port":111,"Still":1,"Register":"Register","Address":12345,"SizeLength":1,"FET":2,"Size":"big","Conversion":"small"}}},"EQ2":{"TCP":{"1":{"Type":"ABC","IP":"192.168.0.0","Port":111,"Still":1,"Register":"Register","Address":12345,"SizeLength":1,"FET":2,"Size":"big","Conversion":"small"},"2":{"Type":"ABC","IP":"192.168.0.0","Port":111,"Still":1,"Register":"Register","Address":12345,"SizeLength":1,"FET":2,"Size":"big","Conversion":"small"},"3":{"Type":"ABC","IP":"192.168.0.0","Port":111,"Still":1,"Register":"Register","Address":12345,"SizeLength":1,"FET":2,"Size":"big","Conversion":"small"}}}} The mapping of your input data should be straight forward.2 points
-
I did a quick test in a private MediaWiki instance and got it to work using the fix available on GitHub: Switch jquery.cookie to mediawiki.cookie by paladox · Pull Request #1 · debtcompliance/TreeAndMenu · GitHub1 point
-
I fixed it. I had to disable an extension that was breaking that page for some reason. Several others have reported it broken on the support page.1 point
-
The LabVIEW Wiki has received an update. Hopefully, it responds with fewer errors.1 point
-
1 point
-
Glad to hear you got it working! The reason it doesn't update is explained in the documentation: https://www.ni.com/docs/en-US/bundle/labview/page/loading-net-assemblies.html#d62572e601 point
-
Welcome to the LAVA! Wire your struct to a Property Node to access public properties and fields. You can set it to either read or write a value. Please be careful when changing signatures. LabVIEW does not automatically detect when the type of an argument changes. You'll have to manually update all calling sites to match the new signature which can lead to bad behavior. That said, calling by ref or by value both work. Here is a complete example for both of them: namespace DemoLib { public struct MyStruct { public string Message { get; set; } public int Number { get; set; } } public class MyClass { public string GetMessage(MyStruct data) { return data.Message; } public int GetNumber(MyStruct data) { return data.Number; } public string CreateMessageByRef(ref MyStruct data) { data.Message = "Hello from CreateMessageByRef"; return data.Message; } public int CreateNumberByRef(ref MyStruct data) { data.Number = 42; return data.Number; } } } Example.vi1 point
-
You are probably getting a permissions error on the Open (windows doesn't ordinarily allow writing "c:") which will yield a null refnum and an err 8 on the open. Your err 5000 becomes a noop as does the write. You're then clearing that error so when you come to close the null refnum it complains it's an invalid parameter - equivalent to the following. Is it expected behaviour? Yes. Should it report a different error code? Maybe.1 point
-
No you can't. This lets you use XNet hardware (which I don't think you have) but use the older NI-CAN drivers. This was intended to help developers transition to the newer XNet hardware but use their old software. You cannot use any XNet sessions on the 8473 hardware.1 point
-
Yes- that did fix the issue. I moved "Create control.vi" out of the C:\Program Files (x86)\National Instruments\LabVIEW 2018\project\UI Tools\Control Generator directory, opened LabVIEW 2018 SP1 (which now launches without crash), moved "Create Control.vi" back into the original directory and mass compiled the directory and now everything works. I appreciate your assistance and I apologize for digging up an issue with an outdated version of LabVIEW but some of us are stuck on older versions. Again- Thanks!1 point
-
A little while ago I posted some code on how to create boolean controls with images that scale well because the images are vector based and can scale up or down better than a static image like a PNG. After making that I made a utility that allows for selecting an image, and a control template and it creates the control. I showed this off to Danielle Hamburger and she encouraged me to clean it up and post it to the community. I'm still putting this in the In Development section just because there are several external tools needed that working around would be ideal if this were to be finished but for now it works and I use it often. So it works like you'd think. There is a library of vector images you select from, pick the one you want, then pick the Control Type (which is a folder of CTLs), then click create and it creates the control setting the decal button, VI description (adding License text if needed) and sets the icon editor icon. Dependencies If you just run the Vector Boolean Control Creator you'll need OpenG Time, OpenG File, and the JKI State Machine toolkit installed in LabVIEW 2015 or newer. The included libraries will work without anything else as long as you are in Windows (more on that later). If you want to include your own controls there are a few more steps and I left a text file explaining that in the Template Controls folder, but I included several already. If you want to add your own images I also left instructions in the Libraries folder. I wrote a VI that can convert from SVGs to the needed PNG and EMF files as long as you download inkscape (again instruction text files included). But inkscape is only a dependency if you want to use that utility to add your own libraries which are in SVG. Demo For good measure I made a Jing video showing how it works. Windows Only... So the Windows only part is an interesting one. I started with my UI being just a single 2D picture control and as you type your search in the top, it would go and open each image that matched the result, shift them into rows and columns, detect the number of columns shown, then detect and show mouse selection, and all the other stuff that would be needed. To say the least it was slow. I tried several ways to improve it, but in the end it was slow and I couldn't come up with a solution I liked. I could have added a search button but I really like the live search of typing it in and seeing it update as you type just like the icon editor glyphs do. So for a first release I went with the cheap and hacky solution and that was to leverage some .Net to embed a Windows Explorer window into my front panel, which is just the search results of a folder on disk. This now means you see the PNG images on the front panel, but it will only use that to show the UI to you, but then use the vector based EMF file when creating the control. Doing the search was a bit weird too since I couldn't figure out how invoke a search with the Explorer .Net so instead I wrote to a temp location a saved search that is XML, which I tell the UI to navigate to which then shows the search results. Oh and there is some .Net GDI resize going on so the PNG image is used as icon editor icon for the control but dependency could likely be removed with some G work. Anyway hope people find this useful. Vector Boolean Creator.zip1 point
-
Because of a thread over on the darkside, I got the motivation to improve this code, and include the Google Material icons in it. I posted the package over on VIPM.IO. This uses the native 2D picture control for displaying icons like I wanted. It still requires Windows due to how icons are resized, but maybe that could be worked around if there is interest. https://www.vipm.io/package/hooovahh_boolean_vector_controls/ Install the package and its dependencies and you'll have a Tools >> Hooovahh >> Boolean Control Creation... Once ran it will start trying to display all the icons the toolkit installed. In the background it will be converting the vector images to 56x56 PNGs to be able to display them in the window. I tried being smart and having it prioritize icons that you scrolled to, but I honestly don't know how well it works. It basically takes about a minute after first launching it to have all of its icons displayed properly. You can use the tool during that minute but not all the icons will be available yet. From that point on you can scroll around and resize the window and it should work as expected, just a little bit slow at times. There is a single constant on the block diagram where you can change the icon side. At one point I had icon size be a control on the front panel but since it took about a minute to process all the images for every change I just left it. Some of the icons have multiple versions. If you left click on an icon and a window pops up you can pick from what version of that icon you'd like to use. Then create a control using that icon. You can theoretically put your own EMF files in the folder with the rest but at the moment it doesn't scan for new files since it is relatively slow to find all icons on every launch. What I'm saying is compromises had to be made. Maybe I could have a separate program that gets ran in the Post Install VI that starts processing the icons right away in parallel. That way the tool might be done processing icons by the time the user launches it for the first time. I did use the Post Install and Post Uninstall to do extra work since there are so many individual files. Normally you'd have VIPM handle the files but it took a long time. So the package just installs a Zip, and the Post Install will unzip them. This also means Post Uninstall needs to delete the extracted files. Not ideal but the install time was much longer otherwise.1 point
-
When i install some thirdpart code-packs, it seems there is a .mnu file in every sub folder such as openG's toolset and Adlink's driver pack,and the .mnu files change automatically when their installed path changed. How to make this?And in openG toolsets there are some subvis that when it is put onto the diagram,there shows no vi's icon but vi's diagram block,i found this only related to its mnu file.I think this can be very useful.How can this be achieved? Download File:post-449-1090386869.bmp0 points