All Activity
- Past hour
-
Discussion forums like LAVA and ni.com are challenged these days by LLMs that can answer in a well structured manner very quickly and handle follow-up questions on the spot. Forums have their stenghts, but when it comes to basic questions that LLMs can find a lot about, spread across multiple forums, the LLMs win. It is a bit of a catch 22 though, as the LLMs need the forums alive to stay up to date 😮 ------------------------------ Here is Grok answering you question of what a DVR is: DVRs as References: In LabVIEW, DVRs (Data Value References) are a mechanism to access data by reference rather than by value. This means that instead of creating copies of the data (as is typical in LabVIEW's dataflow paradigm), a DVR provides a pointer-like reference to a single memory location where the data resides. This avoids unnecessary data duplication, which can be critical for large datasets or performance-sensitive applications. Avoiding Copies: By using DVRs, you can manipulate the same data in memory without creating copies, which is especially useful for large arrays, clusters, or other complex data structures. This reduces memory usage and improves performance. Parallel Operations and Race Conditions: When multiple parallel operations (e.g., parallel loops or VIs) access the same DVR, there is a potential for race conditions if the access is not properly synchronized. LabVIEW provides the In-Place Element Structure to safely access and modify DVR data. This structure ensures that only one operation can read or write to the DVR at a time, preventing race conditions. Without this, simultaneous read/write operations could lead to unpredictable results or data corruption. Key Points to Add: Thread Safety: DVRs are not inherently thread-safe. You must use the In-Place Element Structure (or other synchronization mechanisms like semaphores) to avoid race conditions when multiple parallel tasks access the same DVR. Use Cases: DVRs are commonly used in scenarios where you need to share data between parallel loops, modules, or processes without copying, such as in real-time systems or when managing shared resources. Limitations: DVRs are only valid within the application instance where they are created, and the data they reference is freed when the reference is deleted or the application stops. --------------------- Before DVRs we typically had to resort to cloning of functional globals (VIs), but DVRs make this a little more dynamic and slick. You can have a single malleable VI operate on multiple types of DVRs too e.g., that opens up a lot of nice reuse. If you have an object that requires multiple circular buffers e.g. you can include circular buffer objects in the private data of that object, with the circular buffer objects containing a DVR to an array acting as that buffer... -------------------- Here is ChatGPT comparing functional globals with DVRs: Functional Globals (FGs) and Data Value References (DVRs) are both techniques used in programming (particularly in LabVIEW) to manage shared data, but they offer different approaches and have different strengths and weaknesses. FGs encapsulate data within a VI that provides access methods, while DVRs provide a reference to a shared memory location. Functional Globals (FGs): Encapsulation: FGs encapsulate data within a VI, often a subVI, that acts as an interface for accessing and modifying the data. This encapsulation can help prevent unintended modifications and promote better code organization. Control over Access: The FG's VI provides explicit methods (e.g., "Get" and "Set" operations) for interacting with the data, allowing for controlled access and potential validation or error handling. Potential for Race Conditions: While FGs can help avoid some race conditions associated with traditional global variables, they can still be susceptible if not implemented carefully, particularly if the access methods themselves are not synchronized. Performance: FGs can introduce some overhead due to the VI calls, but this can be mitigated by using techniques like inlining and careful design. Example: An FG could be used to manage a configuration setting, with a "Get Configuration" and "Set Configuration" VI providing access to the settings. Data Value References (DVRs): Shared Memory Reference: DVRs are references to a memory location, allowing multiple VIs to access and modify the same data. This is a more direct way of sharing data than FGs. Flexibility: DVRs can be used with various data types, including complex data structures, and can be passed as parameters to subVIs. Potential for Race Conditions: DVRs, like traditional globals, can be prone to race conditions if not handled carefully. Proper synchronization mechanisms (e.g., queues, semaphores, or action engines) are often needed to prevent data corruption. Performance: DVRs can be very efficient, especially when used with optimized data access patterns. Example: A DVR could be used to share a large array between different parts of an application, with one VI writing to the array and another reading from it. Key Differences and Considerations: Control vs. Flexibility: FGs offer more control over data access through their defined interface, while DVRs offer more flexibility in terms of the data types and structures that can be shared. Race Condition Mitigation: While both can be susceptible, FGs can be designed with built-in synchronization mechanisms (like action engines), while DVRs require explicit synchronization mechanisms to prevent race conditions. Performance Trade-offs: DVRs can offer better performance in many cases, especially when dealing with large data sets, but this can be offset by the complexity of managing synchronization. Code Readability and Maintainability: FGs can make code more readable and maintainable by encapsulating data access logic, but poorly designed FGs can also lead to confusion. In summary: Use Functional Globals when: You need controlled access to data, want to encapsulate data management logic, or need to ensure some level of synchronization. Use Data Value References when: You need to share data efficiently between multiple parts of your application, need flexibility in the data types you are sharing, or when performance is critical and synchronization can be handled externally. It's worth noting that in many cases, a combination of both techniques might be used to leverage the strengths of each approach. For example, a DVR might be used to share data, while a functional global (or an action engine) is used to manage access to that data in a controlled and synchronized manner.
- 4 replies
-
- dvr
- ni software
-
(and 2 more)
Tagged with:
- Yesterday
-
Ramon Taboada changed their profile photo
-
- 4 replies
-
- dvr
- ni software
-
(and 2 more)
Tagged with:
-
Ramon Taboada joined the community
-
Pawen308 joined the community
- Last week
-
JSON is always in UTF-8, and JSONtext will try and convert to your computer's character set automatically, so I don't think you need any of that stuff that has "UTF8". Try simply using the single function to convert to a 2D array of strings. However, by sure you are actually passing true JSON, with UTF8 encoding, not whatever your computer is using.
-
Converting data file from TDMS to TXT - time format and headers.
cordm replied to sts123's topic in LabVIEW General
right-click the node, select "help" and read the manual, please why use a while loop? use an auto-indexing for loop! -
Nison419 joined the community
-
Converting data file from TDMS to TXT - time format and headers.
sts123 replied to sts123's topic in LabVIEW General
It does not throw the names as expected. to_Asci_3_range_2.vi -
jeremyleung joined the community
-
Converting data file from TDMS to TXT - time format and headers.
cordm replied to sts123's topic in LabVIEW General
Use Get Waveform Attribute (Waveform>>Get Attribute) to read the NI_ChannelName string attribute from each waveform. Add another loop before the first one where you get it from each waveform and then write it to the file. DAQmx creates that attribute automatically. This is what Waveform Graphs use for plot names. -
Hi, I am using jsontext library in a project which I have been asked to localize to Chinese but get "??" out when using from jsontext. Is there a way to do this that I am missing, or am I doing something fundamentally wrong. The dev PC in windows has all the localization / regions set to Chinese. Thank you
-
At the moment, when the tdms i split, every individual fiel has time stamp reset to 0 at the start. Is is possible to do it the way that each file has time stamps that are continuing without disruption right from the beginning?
-
Dakir480 joined the community
-
cece joined the community
-
Converting data file from TDMS to TXT - time format and headers.
sts123 replied to sts123's topic in LabVIEW General
Any thoughts how can I add header to the file, that are the same name as channels names in the Task? -
I've done it like this. Not sure if this is efficient and can avoid missing samples during split. I am using high sampling rates. RR_Spliting_2.vi
-
Converting data file from TDMS to TXT - time format and headers.
sts123 replied to sts123's topic in LabVIEW General
This worked as intended. Many thanks. -
hunkyuan joined the community
-
16635asdsadxsacxc joined the community
-
bessire joined the community
-
Well, it seems to be sufficient to set the dialog to modal *and* set its front panel to frontmost. As long as it is both the VI stays modal and blocks access to all other windows.
-
In various part of my application I want to allow users to open a setup dialog and when that setup dialog is open they should not be able to shift to another window, so the dialog should be modal... However, I also want the callers to continue to update as the user might then discover something critical in those displays while in the setup and exit the setup. The easy (/correct) solution to this is to have a separate loop in the callers that calls these setup dialogs, because then the setup dialog can be called statically/syncronously and have its window set to modal....I then get both updates in the caller's display and block access to GUI operations in the caller window. Now the downside to that is that you have to have such a dedicated loop and for various reasons some of the updates happen in the same loop here, so instead I thought I could call the dialog dynamically. This invalidates the modal behaviour though as it will not be modal in relation to the caller anymore. Setting the dialog "Always on top" is one option, but then it will stay on top even of file dialogs it calls(!) so unless you turn off the always on top setting every time you call a file dialog you have another problem. Setting the dialog to floating on the other hand does not block access to the caller's window. I can alternatively live with that by adding code to close the dialog if the parent gets closed etc, but a true modal behaviour would remove the need for such additional code and would be preferable. So, the question is, is there a way to call a VI asyncronously, but still force it to behave modal in relation to its caller (or "globally" (for the application))? Or should I just capitulate and make sure these calls happen statically in a loop that can wait?
-
Converting data file from TDMS to TXT - time format and headers.
cordm replied to sts123's topic in LabVIEW General
First search result for "labview loop tunnel mode": Auto-Indexing Tunnels with For Loops and While Loops in LabVIEW In your case: -
Unfortunately, it fails. The original error I posted is from within the MATH.vi so it would make sense that nothing downstream of that would work.
-
Unfortunately not, as it's description mention it only goes from Volume 1 to 4... Issues included are: Volume 1, Issue 1 (Spring 1993) Volume 1, Issue 2 (Summer 1993) Volume 1, Issue 3 (Fall 1993) Volume 2, Issue 1 (Winter 1994) Volume 2, Issue 2 (Spring 1994) Volume 2, Issue 3 (Summer 1994) Volume 2, Issue 4 (Fall 1994) Volume 3, Issue 1 (Winter 1995) Volume 3, Issue 2 (Spring 1995) Volume 3, Issue 3 (Summer 1995) Volume 3, Issue 4 (Fall 1995) Volume 4, Issue 1 (Winter 1996) Volume 4, Issue 2 (Spring 1996) Volume 4, Issue 3 (Third Quarter 1996) Volume 4, Issue 4 (Fourth Quarter 1996)
- Earlier
-
-
Serial Communication Question, Please
jmltinc replied to jmltinc's topic in Remote Control, Monitoring and the Internet
Sorry for the delay - we had to go out of state for a bit. ShaunR; I connected two ports together using the same USB to RS-232 adapters as used in the Write/Read example I posted above. When I click Set Break, the receiving port connector flashes but the Detect Serial Break Event VI does nothing. I am not sure what a "Break" is in serial communication. I have ARSL End Out and ASRL End In both set to "Last Bit". I tried other combinations as well. The Read vi I made is displaying what I send (I did add decimal and hexadecimal array displays to make sure the ASCII is absolutely correct). The data returned from my Write command exactly returns what the working exe sends and returns. There must be something fundamental I am missing here and for the life of me, I don't know what it is. The radio demands 4800 Baud, No Parity, No Flow Control, 1 start bit, 8 data bits, and 5 bytes - that is it. Is there something that LV appends (or doesn't) which could cause my problem? Thanks, John -
Vandy_Gan started following Francois Normandin
-
You did mentioned the articles are included on this particular CD: https://archive.org/details/labview-technical-resource-library-of-back-issues-windows-macintosh-v1.0
-
Converting data file from TDMS to TXT - time format and headers.
sts123 replied to sts123's topic in LabVIEW General
Not sure what that is. Can you please guide me? -
Just in case the previous info was a bit vague, this is what I mean: SQLite version 3.50.1 2025-06-06 14:52:32 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENAME" to reopen on a persistent database. sqlite> sqlite> .load "C:/Program Files/National Instruments/LabVIEW 2025/vi.lib/drjdpowell/SQLite Library/SQL Connection/extension-functions_64.dll" ...> The DLL seems to work fine and can be loaded into sqlite, but the LabVIEW method seems to have a problem.
-
Vandy_Gan started following UI Tools addon: Control class
-
Vandy_Gan started following [CR] UI Tools addon: Control class
-
Yes, the DLL is there. Furthermore, when calling it directly from sqlite3 it also works.
-
Does that DLL exist at the stated path?
-
Converting data file from TDMS to TXT - time format and headers.
cordm replied to sts123's topic in LabVIEW General
If the time appears for each channel, then you didn't set the loop tunnel mode to last value.