Jump to content

LogMAN

Members
  • Posts

    655
  • Joined

  • Last visited

  • Days Won

    70

Posts posted by LogMAN

  1. I agree, without any code it is difficult to explain how your particular VI works.

    That said, when using DAQmx you can just define the sample rate of your task and request the desired number of samples in order to achieve the desired loop time.

    Here is an example that reads a voltage from a channel at a rate of 1000 Hz, 500 samples at a time.

    The read function is blocking, so the loop runs at exactly 500 ms intervals.

    1073519597_TimingExample.png.7f292fd2eb757a5ee5bbc4f2852f916d.png

     

    Timing Example.vi

  2. There is no way to change the scope for elements inside a cluster. You can only hide them on the front panel.

    Your solution to unbundle the private cluster and bundle the public cluster is the best way to hide internal complexity.

    If you just want to omit certain parameters without explicitly unbundling/bundling, you could also serialize to and from JSON. Of course, this comes at a performance cost.

    Note, however, that this only works if the element names are exactly the same.

    Here is an example using JSONtext

    1624014264_ConvertClustersusingJSONtext.png.e3574a9746ccc6d8d08c9a22750f26bd.png

    image.png.6c0046d60943340026cdeea6a5a05730.png

    Convert Clusters using JSONtext.vi

    • Like 1
  3. 31 minutes ago, hooovahh said:

    I'm also not sure why this works only in the enabled structure.  I wouldn't expect the structure to be a non-reentrant type function.  And it doesn't, when I put a wait in there as a test.

    Probes on the top-level diagram of the parallel For Loop simply show no debug info unless debugging is enabled. Any subdiagram will do the trick.

    image.png.74f2471a1f15a0422afe2a37e301a2c6.png

  4. No. The image shows how to assign multiple event sources to a single event case in the Event Structure.

    You would have to create a custom user event and handle it in another event case to be able to do what you describe. It is just not a good solution for your particular usecase.

  5. 14 hours ago, epiz said:

    Is it possible to have two buttons in the same event structure(I don't think its possible but want to confirm).

    Yes. One event can be triggered by as many buttons as you want.

    image.png.48e2d287dac15fe2c5b69499698a0e3c.png

    14 hours ago, epiz said:

    Lets say one of the events is to read data from a device and it displays on the vi. Is it possible to just create another event that can simply just pull that said data and write it to a file?

    Technically yes but this is bad design because it would have to go through the UI thread, which is super slow.

    There are more robust ways to do that. Please take a look at the "Continuous Measurement and Logging" project template that ships with LabVIEW.

  6. Not sure if this is relevant but there appears to be an issue with the file paths when loading the script node. The debugging window is displayed when placing the node on the block diagram (notice the unreadable characters in the file extension):

    image.png.e2c00556a655c99739e5ef399f1f8caf.png

    It often results in a crash but when it doesn't you get another debugging window when executing the VI:

    image.png.7158e91e431b68e6499937e86b40b038.png

    It also reports the same error code as the one mentioned above:

    image.png.a423eaf452e06852c3fa09e2ef281968.png

    This is running on Windows 11 using LabVIEW 2013 (32-bit) and Python 2.7 (registered in PATH) with the latest version of LabPython from VIPM. msvcrt.dll is available in SysWOW64 and System32 (part of Windows).

    Not sure what causes the issue but at the very least it doesn't appear to be isolated to Windows Server 2019 🤷‍♂️

  7. 1 hour ago, acb said:

    We've explored the gray code idea, but it presents a few challenges; for example, what if the generated grayed out diagram is bigger than the diagram space it has? Do we push everything out to make room for the predicted code? Do we just clip it at the edge of the structure, move nodes, etc? We haven't dug into that yet. Ideas welcomed.

    Perhaps diagram zoom could be utilized or the change could be displayed in an overlay (or both combined)?

    For example, there could be an icon to indicate that Nigel has a suggestion:

    image.png.1d2057737fd86abdafef356f453f9825.png

    When hovering the icon, it could display the suggested diagram in an overlay from which I can choose to apply them:

    image.png.cb2911d04cdc535047aa1573a3571516.png

    Suggestions could also be displayed on subdiagram level, depending on the scope of the suggestion. For example, 

    image.png.6992c8e9076b8162d9c2b4508f05c534.png

    Once applied, the diagram grows to fit the new content.

  8. 55 minutes ago, acb said:

    my first post!

    Welcome to the forums 🎉

    55 minutes ago, acb said:

    What types of day-to-day tasks would you want Nigel to help you with?

    I haven't really thought about it as this was the first time I learned about Nigel (never thought anything like that is even remotely possible in LV). Still, I'm familiar with GitHub Copilot and Visual Studio's IntelliCode, which have great IDE integration.

    What I'm looking for is not so much an AI that writes my code (because I know how to do that), but one that accelerates my development process by suggesting changes in the context of my code. For example, to predict what I'm going to do and provide hints in the form of grayed-out suggestions I can simply accept by pressing a key (tab-driven-development 😉).

    Things like:

    • When I place an "open connection" function, it suggests the corresponding "close connection" function.
    • When I place several methods of a class or VISA or DAQmx, it suggests how to order them in a sensible manner (open, read, write, close).
    • When I connect the terminals of a VI, it suggests to connect error wires as well.
    • When I place error terminals it suggests adding an error case structure.

    Of course, there are more specialized tasks where a smart AI would also be really useful:

    • Creation of driver libraries, just like your example from importing a PDF to generating code.
    • Configuration of CLFNs
    • Beautify/Cleanup my block diagram
    • Suggest changes when upgrading to a newer version of LabVIEW
    • Suggest icons for my VIs 😍
    • Derive VI descriptions from code :shifty:
    • Apply changes to a set of VIs (i.e., renaming them)
    • Point out mistakes in my code (missing cases, unhandled errors, etc.)
    55 minutes ago, acb said:

    And yes, I intend Nigel to help you with your hardware and codebases that aren't the latest & greatest.

    That's awesome. I hope we can play with it soon :)

  9. 1:02:00 "... but NIgel can control your physical hardware!"

    *terminator theme intensifies*

    Jokes aside, the copilot looks interesting but it needs much better integration to be useful for any of my day-to-day tasks. It needs much faster response time and it will have to show how well it can work with legacy and non-standard code bases that aren't developed with NI's portfolio and vision in mind.

    Did they mention if and when this can be tried out?

  10. I'm not familiar with network streams but the online help provides an example for your particular scenario (scroll to the very bottom): Specifying Network Stream Endpoint URLs - NI

    Based on your code this works for me: Working Example.zip

    Edit: To provide some more explanation:

    Only one application can create endpoints in the default (empty) context "//localhost/".

    Incidentally, this is also the default context when you create a writer endpoint by name. For example, writer endpoint "my_writer" is equivalent to "//localhost/my_writer".

    In your particular example,

    •  Application B creates a writer endpoint "ApplicationA_in_writer", which is equivalent to "//localhost/ApplicationA_in_writer".
      image.png.6fe8d5891422f31a1e352ca06888687c.png
       
    • Application C creates a writer endpoint "ApplicationB_in_writer", which is equivalent to "//localhost/ApplicationB_in_writer".
      image.png.9fca77af3edd9b5c42efd05cac88eb91.png

    And since only one application can use the default context, the error happens.

    To create endpoints in separate contexts, you must specify the context in the endpoint name. For example, "//localhost:ApplicationB/ApplicationA_in_writer" and "//localhost:ApplicationC/ApplicationB_in_writer".

    image.png.c0968bf8bedb3d645ee34b7fcc909c63.png

    • Thanks 1
  11. +1 for Unbundle. It it simple, requires less code and you understand immediately that these elements belong to the current class. They are also easier to maintain in case you ever feel the need to change the name or type of an element and work well with In-Place Element Structures in Unbundle-Bundle-Scenarios.

    • Thanks 1
  12. 13 hours ago, Mahbod Morshedi said:

    I have heard that converting everything to a class is the best approach

    Not like this

    image.png.126031e50b3790892d75ffe736af3228.png

    13 hours ago, Mahbod Morshedi said:

    , but I am unable to find any suitable resources or examples for it. Most of the available information pertains to simple and uncomplicated data types.

    Because that is the goal; break down your complex and complicated data types into simple and uncomplicated ones.

    For configuration data you could maintain the path to the storage location and load the data as needed.

    • Like 1
  13. 9 hours ago, mwebster said:

    Not sure why ROLLBACK TO X didn't close the transaction, but that was the root cause.

    This is explained in the SQLITE help pages: https://www.sqlite.org/lang_savepoint.html#savepoints

    Quote

    The ROLLBACK TO command reverts the state of the database back to what it was just after the corresponding SAVEPOINT. Note that unlike that plain ROLLBACK command (without the TO keyword) the ROLLBACK TO command does not cancel the transaction. Instead of cancelling the transaction, the ROLLBACK TO command restarts the transaction again at the beginning. All intervening SAVEPOINTs are canceled, however.

     

    • Thanks 1
  14. This appears to be a known issue in LabVIEW 2021 SP1.

    Quote
    LabVIEW 2021 SP1 causes an increase in the memory usage of some applications unnecessarily over time. 
     

    Workaround:

    You can disable the performance optimization which caused the memory leak by adding "MemoryManger.UseMasterPointerPool = FALSE" to the LabVIEW INI file. LabVIEW 2021 SP1 f1 patch fixes the issue by disabling the performance optimization by default.

    https://www.ni.com/de-de/support/documentation/bugs/22/labview-2021-sp1-known-issues.html

    • Like 2
  15. 4 hours ago, bsvingen said:

    Please note that moving forward from LabVIEW 2022 Q3 you can only purchase LabVIEW Application Builder via LabVIEW Professional Development System.

    Okay, wow! This is just awful.

    4 hours ago, bsvingen said:

    Are there any other way to get around this, other third party builders, or anything?

    Community edition is equivalent to professional... just saying...

  16. This might be an issue with environment variables. Your application runs with whatever environment variables exist at the time it was launched and cuda is only added to PATH during its installation.

    Quote

    By default, where searches the current directory and the paths that are specified in the PATH environment variable.

    -- where | Microsoft Learn

    It should work if you specify the path explicitly (or somehow reload environment variables).

×
×
  • Create New...

Important Information

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