LabVIEW Idea Exchange

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 
Post an idea

This is sort of two features bundled together, but they make sense to do them at the same time.

 

First, add an easy way to temporarily disable the "Allow debugging" VI property across an entire project.  This would be step 1 in making an easy "Release Mode" option.

 

Second, add some conditional disable symbols to all projects.  If the project is in debug mode, add "DEBUG_MODE" to the project, and if it's in release mode, add "RELEASE_MODE".  While it is possible to do this manually now, each user could choose a different name for their symbol.  If LabVIEW does this for everyone, then it allows better library interoperability.  The main use case for these symbols is to add debugging traces and breakpoints that are undesirable in shipping code.

I really like the idea of being able to define error codes and descriptions in an error.txt file.  It's very convenient to be able to see all the errors in a single place.  However, the location the error.txt file must be stored, to be blunt, stinks.  Instead of storing them in user.lib\errors (which creates a useless palette item) how about putting them in user.lib\_errors?  It would also be nice if the Error Cluster from Error Code VI had an optional filename input to define which error.txt file to use when looking up the error.

Trim Whitespace currently accepts strings (scalars).

 

I propose that Trim Whitespace be made polymorphic so that it also handles an array of strings (basically just wrap the scalar impelementation in a For Loop).

This has been brought up long ago, but I thing it deseves to be discussed here in the Idea exchange.

 

There are situations where it might be beneficial if we could have a string datatype that has a defined length. Arrays of such string would be stored flat in memory.

 

Application would include:

  • Typecasting a long string to a string array where the element is fixed length would slice up the string into an array of equal length strings.
  • Reading a binary file as an array of fixed strings would do the same.
  • ...

 

The default value would be a string of the defined lenght filled with \00. Shorter inputs would get padded with \00

Of course certain operations would drop the length, e.g. when concatenating such strings, the length would get dropped from the result, turning it into a plain string.

I never really understood why the default count value for Read From Binary File was 1.  95 times out of 100 I am reading the whole file (-1), the other times I am reading a fixed chunk size which is certainly not equal to 1 (and in this case I expect to wire a value).  The 'default' or natural behavior is really to read one byte/word/long at a time?  That is about as inefficient as it gets.
I would find it helpful if it were possible to define enumerated values (or some sort of pre-defined selection list) for conditional disable symbols.  The current implementation appears to be based on strings and it is easy to make a typo in either the case statement or in the conditional disable dialog box that causes unexpected execution.

LabVIEW uses 5 types of operation behavior for push buttons. However, I have come accross a rather annoying obstacle, whenever I need to execute an event for once (turning on a simple LED AND keeping lit AND keeping the button released, for instance), I need to run through Loops or structures which  consumes the space of the block diagram. Although this may sound very simple, after all I am a newbie when it comes to LabVIEW, it really helps in certain places, namely in my very simple project. Here are two of the ways that demonstrate what I am doing at the moment: 

 

 

 

 

Untitled.jpg 

 

 

And here is how the new pressonce/execute once and for all/release block diagram looks like (excuse my English, I believe the digrams must illustrate what I want to say)

 

neww.jpg

 

 As I have said, maybe it doesn't make a difference to you, but it does to others and I am one of them, well you can either go with a while loop or without, let's keep it to the big guys to decide (this is if my suggestion gets accepted). And I am choosing a random label 😄

Thank you for your time.

🙂

 

Message Edited by toniaz on 28-11-2009 12:46 AM

Currently the synchronous and asynchronous modes of writing data have little to no effect when communication over TCP. The write will return immediately after buffering the data to be written. However, the data it self may take considerable time to actually be written to the network. Absent some type of hand shaking at the application level there is no way for an application to wait until all the data has actually been written. The native LabVIEW TCP Write behaves in the same manner as the VISA write. Given this behavior it is impossible to implement a well behaved write queue for queuing up and transmitting data to a device. For example a normal print queue will open a connection and send the data to the printer. It will not attempt to open a second connection for the next print job until the first one has consumed all of the data. If a large amount of data is being written it can take time for all of it to be transmitted. The way the VISA or TCP write VIs behave the print queue would open a connection and write the data. However the call to the write would return immediately because the lower level network stack has accepted the data and buffered it. The print queue then believes the first job is complete and begins processing the second job. This will mean that a second connection will be opened. Some devices will allow multiple connections and some do not. However without the ability to actually wait for the data to be completely written the queue would have to continually try to open connections. This would be unnecessary network traffic and and unnecessary communication with the printer.

 

I would like to see an open on the write VIs to allow for a true blocking write. The write will not return until the data has truly been transmitted. The current behavior is also valid and can be retained.

 

Note: I have not tested the behavior on other types of interfaces so I am not sure if this is a TCP only issue.

I think that is usefull to convert a string-array as/into a enum.

After that you can use the enum easier in cases, and s.o.

As we look at the Comparison Palette, there are three functions that offer negative logic, but fail to offer the positive logic alternative:

 

NotLogic.png

 

I commonly find myself placing a Boolean "not" right after these functions (e.g., if I want to know if there are elements in an array I must test if it is "not not empty", or if I want to know if a ref is valid I must test if it is "not not valid". Take a look at my other idea which illustrates not not logic.).

 

I have two proposed solutions: 1. offer a single function that has an "Invert?" option on the output, or 2. offer both the positive and negative logic primitives on the palette.

Message Edited by Laura F. on 11-16-2009 08:51 AM

I propose that Case Selectors should accept any type of reference, and the two cases generated are "Valid Ref" and "Invalid Ref". (This would be very similar to the current behavior of the Case Selector accepting errors with the two cases of "Error" and "No Error".)

 

The current behavior using "Not a Number/Path/Refnum" is very unintuitive. It requires the programmer to use Not Logic (i.e., do something if the reference is "not not valid").

 

ReferencesIntoCaseSelectors.png

 

 

Problem: 

When handling larger data blocks I get "not enough memory" error messages with only option to kill the executable (from time to time, but usually unwanted Smiley Wink ).

Most of the time this involves array functions (initialize array, build array, etc). As this problem is also related to the used PC it cannot be tested (easily) on a developer machine before deploying the executable to a wide range of computers...

 

I propose the idea to enable some error handling in such cases. This could be done in two ways:

1) Add error output to array functions. This could be available optionally by right-click menu so you don't break older code. Output would be an error stating "Not enough memory for operation ..."

 

2) Add a new application event "Application.MemoryAllocationError". This way the program the program can atleast catch the problem. (Inspired by "OnError" constructs of text-based programming languages...)

Whenever I turn on Hightight Execution, there may be a lot of display area that is not in my active window.  How about limiting the Highlight Execution to only the part of the Block Diagram that is visible?  This will greatly speed up the process if there is a lot of the block diagram that I'm not interested in.

there have been several ideas on the forums pertaining to making labview smarter about how it handles arrays, but none of them (that i've been able to find) quite get to the root cause: labview doesn't directly support a 'sorted' status of arrays.

 

sorted-arrays.png

 

 

labview should add a 'sorted' field to the array data. when the array primitives detect, either at runtime or compile time, that an array is or could be sorted, it generates optimized code. for the most part primitives will function the same but just be more efficient (e.g. array min/max will be constant time operations).

 

the special cases for this feature are the array building and modifying primitives because i believe they will need special behavior in some cases to make sorted arrays useful.

 

build array  when all input arrays are sorted, the output array will be sorted. this seemed strange to me at first, but the more i thought about it, the better this seemed as the default behavior.

 

insert into array  when the input array is sorted and the index is unwired, the output will be sorted. this will be true whether or not the insertion is one element or an array of (possible unsorted) elements. 

 

i would assume you could turn any of these behaviors off by right-clicking on the node and configuring it. i'm sure the labview team can figure out mutation issues as necessary.

Currently there is no way to delete multiple elements in an array, that are not in sequence.

This way elements 2,4,7 would be deleted in just one function.

 

Delete from Array.png

 

It is cleaner code and in big arrays can enhange performance (at least i think)

When you have several arrays of the same size and you need to sort them one can use the "Index & Bundle Cluster Array", use the "Sort 1D Array", the put down a for loop and then unbundle to get the arrays back to arrays.  It would be nice to have the reverse capability of "Index & Bundle Cluster Array" to make the array of clusters back to a group of arrays.  In my testing the  "Index & Bundle Cluster Array" was 5 times faster than a For loop and Bundle.  I would assume that the reverse could also be much faster.

 

 

Index And Bund Cluster Array.png

 

 

 

This post

Has gotten me thinking about how to handle preserving a memory location for external data updates.  @009 has much better memory management- couldn't a Preserve Memory primitive be written? For obvious reasons a counterpart Deallocate would need to be required for each "Preserve" call

 

hmm2.PNG

As we us Ctrl+Z for other program we can go quite back but in case of LabVIEW we are usually limited for 4 to 5 steps only. I think there must be some option to go back more step because some times in block diagram it happen which bother a lot specially if your not in good mood 🙂

Imagine you develop an VI that generates serious errors and you would like to force a calling VI to handle them. This ist not possible is the current and previous versions of LabVIEW.

 

Typically a library VI does not know how to recover or to handle the errors. The calling VI has the responsibility to handle such subVI errors or to propagate them to its caller.

 

The following VI snippet shows the idea of the error handler structure. I am using this work-around to imitate a try-catch mechanism, but still missing the complete list of possible errors  of subVIs.

VI-Snippet: Exception Handling (LV 9.0) 

 

The calling VI needs to know all possible errors/exception that can be thrown by a subVI. At the moment a develeoper has to check the blockdiagram, VI description or manual to get this information. From my point of view this error/exception information must be part of the VI's public interface.

 

So, I propose an additional category in the VI Properties dialog: "Exceptions" and a "try{...} catch(exception){...}" programming structure.

- The Exceptions category should contain the list of possible exception that can be filled by the developer, Error/Warning code, description etc. Additionally the developer should be able to pass data to the exception handler, e.g. similar to dynamic event dispatching to the event structure. Of course the corresponding data types need to be defined somewhere in the VIs public interface, e.g. typedefs(.ctl) or subclasses of a generic exception class.

- The "try{...} catch(exception){...}" programming structure could be designed similar to the event structure with dynamic events. The timeout case would correspond to the try-block, other cases implement the catch(exception)-blocks. Since exception are part of the VI's public interface, possible exceptions coud be selected from an context menue that contains all possible exceptions of all subVIs in the try-case. All exceptions not handled here will be propagated to the calling VI. Of course this unhandled exception become automatically inserted in the exception list of the exception-category of its VI-Properties.

- Missing exception handling when using subVIs that have defined exceptions will break the VI Run-button.

 

I think it is absolute necessary to become able to force a subVI user to deal with possible exceptions. At least all VIs contained in vi.lib should have at least an explicite error list in its VI Properties as part of their public interface.

 

What's your opinion?

 

Regards Holger

I like using User Events.

 

I find them intuitive for (certain) communication between code modules.

 

One thing bugs me though.  If I decide to keep the Event private to a certain module and only release a pre-registered User Event (registered for each listener) careless code can bring the entire communication to a halt.  The bare User Event refnum (pre-registration if you wish) is exposed within the Event Structure.  I have yet to understand wha this is but whatever the reason, it essentially means that it's a serious problem for 1 to n communication.  If one of the n listeners decides to destroy the user event, communication to ALL listeners is destroyed.

 

Registered Event exposure.png

 

I wish we could set the User Event refnum to being private so that it would NOT be exposed within the Event Structure.

 

Shane.