Jump to content

larsen

Members
  • Posts

    12
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    copenhagen

LabVIEW Information

  • Version
    LabVIEW 8.6
  • Since
    1991

Contact Methods

larsen's Achievements

Newbie

Newbie (1/14)

  • First Post Rare
  • Collaborator Rare
  • Week One Done
  • One Month Later
  • One Year In Rare

Recent Badges

1

Reputation

  1. Hi hooovahh Sure I edited the front panel just to highlight where the issue is. All or none should be bold. Bracket or parenthesis: Parenthesis is for default - bracket is for unit. So different usage. I tend to be careful in specifying the unit of a numerical control or indicator as units are a constant source of confusion. cRIO: I actually do not use it on cRIO but dont se why not. Just happened to open the file in this context. Agree: Change is minor, so whenever convenient. thanks for considering.
  2. Thanks for a great tool. One comment though. In the Initialize Periodic TDMS File the timing input should be labeled New File Period [s] and not New File Frequency. Frequency is a measure of the number of events per time period, like [1/s]. Thanks for considering this - albeit tiny but never the less incoherent detail.
  3. has not set their status

  4. I use SVN sub version as archive backend but with TortoiseSVN as frontend. TortoiseSVN is a plug-in to windows explorer so you can manage revisioning from the explorer. I.e. completely independent of LV in fact. As you probably know by now, LV8.0 has a built in interface to version management systems which exposes the Microsoft Common Source Code Control interface aka. SCC. This is not supported by SVN or TortoiseSVN but you can put a layer between SVN and SCC. For instance PushOk's svnscc makes interface with LV posible although somewhat limited in functionality compared to TortoiseSVN. Unfortunately LV compare vi's does not work with svnscc as LV seems not to make a VI_compare.exe available :question: . You can "manually" compare VI's from inside LV but this is VERY tedious. The nice thing with SVN/TortoiseSVN is that it works very well and is open source! Down side is as mentioned the lack of direct LV interface. Hopefully NI/LV dev team will see an interst in also supporting this interface. Repository in SVN/TortoiseSVN can be on a local filesystem, server file system or an Apache web server. SVN's hallmark is the ability to allow multiple users to work on one source file at the same time, but in the case of LV this is useless as the concept of merging changes is imposible. So you will need to base your revision sharing on locking of files. This is indeed posible in SVN. henning
  5. In any serious application you check for errors and (try to) act sensibly on them. LV error cluster is the recommended carrier. But I am lacking a useful method to keep an order in the different error codes. LV has a built-in error database for the ones defined by NI. User error are reserved in the code range... I tried both methods but they suffer different things: General Error Handler VI is strangely complicated to apply for what little it can do, and the help for it is weird suggesting creating constants at the array input. Why does it have an array of user error codes/messages as input, when I cant use it as a kind of database for user errors? Kind of database is precisely one of the things I am lacking to have a per-project central overview of all errors. Well, I could maybe use the General Error Handler VI as such but I would then want to make a local copy and initialize the user error codes/messages arrays to my own errors (make values default) and instatiate this in my vi's. Is that what was intended for this VI/ good idea? Method 2) Using the Tools-->Advanced --> Edit error codes menu to create an xml file with all the custom error codes in. LV looks up in this database when handling error lookup. This is in principle a good idea, except it seems not posible to have one xml file per application, except if you build an application. In that case you can distribute your custom xml error file with the app. In the development situation you always refer to the file(s) in labview\user.lib\errors. And you are likely to have several ongoing project simultaneously. In addition you have to restart LV for the XML file to be re-read. What I would like would be the option to have a per-project user error table (hey, we have a project explorer now :thumbup: ). Any idea if this is posible? In summary, good ideas on error management are welcome. LV help and LV examples are not very informative in that domain. henning
  6. hello Jim, I think there is a confusion as to what a regular expression is. Search and replace String.vi has both modes. Selected by right-click on it. Take a look at the attached example comparing behaviour of Search and replace String with Search and replace pattern. Both claim to have regular expression inputs (if so selected, at least in LV8), but result differs for regular expression = [\\s\\t] (in \code display) = [\s\t] (as a normal string). Search and replace String.vi: With regular expression= [\\s\\t], string \s\t\n\r is matched in all 4 characters (all written in \ code display) Search and replace Pattern.vi: With regular expression=[\\s\\t], string \s\t\n\r is matched only in blank_space and tab characters In addition its not always clear what \s actually means: In \ code display it is ascii 0x20 whereas in normal display its acsii 0x5C 0x73. Best I can say is that its easy to misunderstand and misuse. henning Download File:post-4913-1147297019.vi
  7. Manfred, Thanks for your elegant suggestion. Speed is however not a concern in my particular case. Some other time maybe. I tried your vi, but there is a small bit of cleaning up to do though. Could not see how to fix this however, but maybe you can, having it fresh in mind: Currently it removes double characters, which was not what I had in mind: 22 33 becomes 2;3 and not 22;33 It should only slim down duplicated blanks and tabs. /henning
  8. Jim,Thanks to your precious hint I made the attached VI. Note however that I changed "[\s\t]+" into "[ \t]+" to get the newlines preserved. Note also that "[\s\t]+" is the same as "[\s]+" because "\t" is a part of whitespace "\s". But your idea works great. Every time I try to use regular expressions I learn new stuff. thanks for your help henning Download File:post-4913-1147245384.vi
  9. In a string I want to replace any sequence of blanks or tabs (\s or \t) by a single character (for instance a ; ). So a string like 123 456 78 becomes 123;456;78 irrespective if the whitespace is tabs or spaces. This should be possible to do with regular expression gymnastics, but I have not been able to figure it out. Any suggestions are wellcome. I need this to read 2D arrays of numbers from text files. Similare to the "Spreadsheet String to array" function, except that "Spreadsheet String to array" has either tabs or space as delimiter, not both. In a text file it can be hard to see the difference between tabs and spaces, and thus you may end up with both, in which case "Spreadsheet String to array" fails miserably. /henning
  10. I use a strict typedef cluster (call it StorageTypeDef) to define the structure of the data written to a binary file. The nice thing here is that if I want to change the format of the data, I just modify the cluster typedef StorageTypeDef, and all referencing vi's gets updated. Unfortunate one of the elements is a string. This has a varying length and thus the size of the cluster changes. I deal with this by limiting the string size to a maximum. This maximum value is a constant which I would like to be coded into the cluster type def. So at all times, my cluster typedef contains ALL the information necessary to encode and decode the cluster from binary image. In this way I have concentrated my information at one location, and management is simpler. Problem is however to make this constant number a value in the cluster typedef. Its simple to add a variable, call it MAX_STRING_LENGTH in the StorageTypeDef cluster and give it a default value. Problem with this soultion is that if I change the typedef's MAX_STRING_LENGTH default value at a later stage, this information does NOT get propagated to the VI's instantiating the cluster. Neither does it work to apply Right click->Data operations->Reiniz to default value at the callers. Inserting a new instance of the contol StorageTypeDef works, in the sense that it grabs the latest (correct)default value from the tyoedef, but it requires rewirering in all user-vi's. Replace of the control does unfortunately not propagate default values from the typedef. Any ideas how to pack this constant information into a strict typedef cluster? /henning
  11. Thank you AMSLCC and Guillaume, Thanks AMSLCC for your suggestions. I did not think of Teststand as an option. I will keep that method in mind, but for this particular application its likely to be overkill. The trick with property node-> value(signalling) was just what I was looking for in this situation. I have seen this property several times but did not figure out its use. Exactly as you write Guillaume, this can make reuse of code in event handlers very easy to implement, and a sequencer is also straight forward. To explore the method I also tried generating events from inside an event handler to signal another event handler and it seems to work fine. (cascading events). I am though not 100% certain this is a bullet proff method as I think to have read many years ago that Windows may drop events in case it is overloaded. For sure it drops mouse click events at regular basis. Also for my part it remains to be monitored if the seqence of generating events also defines the sequence of their execution. I.e. maybe they arrive out of order? So I will try to keep theses issues in mind in case obscure problems appears. Comments are as usual welcome. /henning
  12. I have a system with a top-level vi which is commanded via events from front panel controls. This is very convenient during development of an application. Now the application has to move to a more autonomous type application which is started and runs autonoumously without a users interaction. But now there is no user to watch the indicators and push the buttons in the right sequence to setup and start the application. I.e. what I need is some kind of scripting support. I have tried to build a sequencer into the top.vi having the event loop, and which manipulates the controls in the proper sequence, but I have not been able to trigger the event-loop. So what I am lacking is a posibilty to generate front-panel events progammatically. But maybe there are other ways of automating execution of an event driven applcation? Any idea's are welcome. regards Henning
  13. This code has a lurking disaster because you dont do any check of the x and y is within bounds. If not, crashes are certain. Printf is not posible from a dll. Where should it print to? there is no terminal. You can however use a messagebox char msg[300]; sprintf(msg, "Result of Matrix Multiplication\n"); MessageBox(NULL,msg,"info",MB_OK|MB_ICONERROR); regards henning
×
×
  • Create New...

Important Information

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