Jump to content

ShaunR

Members
  • Posts

    4,850
  • Joined

  • Days Won

    292

Posts posted by ShaunR

  1. When in the Navy I used to play chess with a guy who ws rated. After some time he said to me "Ben I have to stop playing chess with you, I am getting dumber."

    In the same way that we gather together (virtually) to learn from those better than us gather only with those behind us can retard us.

    I have seen developers pick-up bad habits after spending time maintaning bad code developed by others. I have also known one developer that had trouble re-certifying since it was soooo long since he worked on good code. SO the idea hit me that this situation should warrent "battle pay".

    So the question I lay before you is;

    Is it ethical to charge a premium to work on bad code?

    Note:

    I don't control such things where I work so it will never happen here but I am still interested in hearing how other react to such an idea.

    Thank you,

    Ben

    PS If I rented mules for a living and one customer always brought them back beaten, I'd would be concidering the same.

    I'm reminded of the saying...

    Software is like a fart. Yours is OK. But everyone else's stinks. wink.gif

    Charge more because it stinks so badly I can taste it? That's a contractor question but my view would be the same. I wouldn't charge more.

    If I think software is too bad, I would decline the contract because you can't sit there and whine after you've taken responsibility for it. You've been contracted to do software!

    If I really must work with it. then I'll re-code it. I'd just escalate the time-scale to account for the "learning curve" and "recoding". Then they can either accept or decline.

    • Like 2
  2. Hello folks,

    sorry if I'm a hassle, I'm a newbie here!

    Trying to control a Tek TDS3054B thats networked to the computer, running LV2009. I would like to control the time base and the input voltage of the scope for measurements, the usual signal is a 10us pulse on a 50hz frequency, 5v logic. MAX is all set up (I think!) and I've the drivers in the Instrument I/O OK. looking for best way to read data for test and measurement purposes, any hints would be much appreciated.

    Peter.

    TDS3054B

  3. Hi Lavas,

    i have a cube in 3D picture control with some points on it. I want to connect the points through lines, right now i am using "Scene Mesh" . The problem rise when i want to connect two points on two different faces. LabView connects them from inside, i don't want to transparent my cube instead i like to calculate the path by myself. I know about the mathematic of calculating the path, but i dont have any idea how i can apply it. Any idea or any similar example?

    Thanks

    I you know the maths then use a formula node. There is an example of using the formula node shipped with Labiew.

  4. Thanks a lot for your VI. I allready programmed something else:

    I'm opening the Queue in the loop, preview an element and then close it again with force destroy=false.

    Didn't have yet the possibility to test the code. What happens if I close a Queue reference with force destry=false? Doesn't it mean that at least one reference remains open somewhere? A final destruction is done with force destry=true ??

    If it is false only the reference you wire to it will be closed. If it is the last reference, the queue is also destroyed regardless if you set it to true or false.What can happen is that you get "intermittent" failures if you don't get the close exactly right. Since one part of your code may close the last ref just before another part tries to dequeue/enqueue etc.. Then a loop that obtains a reference comes around again an re-creates it but you cannot track down where the error is coming from.

    • Like 1
  5. Select is slow because you're building the array one element at at a time, you should grow it exponentially and resize it back down.

    I wrote my own SQLite wrapper a while ago, I've been debating posting it after I finish up the documentation. Its interface is more difficult than yours,since it assumes knowledge of SQLite. But is built for speed and storing any kind of LabVIEW value object. Anyway for comparison, using the 10,000 insert code you posted, on my computer with LV2010.

    Yours

    Insert 1202ms

    select 6657ms

    Mine

    Insert 451 ms

    Select 251 ms

    Funny you should say that. Downland 1.1 I've just posted above. biggrin.gif

    Using the benchmark (supplied in the update)

    Insert ~350ms

    Select ~90ms

    The initial release was really for me to get acquainted with SQLite map out the feature list. I'm thinking I maybe able to shave off a few more ms in the next release. Its a shame the"convenience" functions are unavailable to us sad.gif

    My select uses the same basic logic as yours (at least for values stored as strings). The main difference is that I prealloc 16 rows (note: it doesn't have to be 16 that just seemed like a good starting number to me), use replace subset to fill the values in and if I need more space I double the array's size (I just concat it to itself), at the end I reshape the array back down. Changing the allocation should make yours faster than mine (since you aren't dealing with type information).

    My insert is faster because I'm using prepared statements and value binding. I'm also only opening the file once, which probably accounts for some of the difference.

    Matt W

    Indeed. That's the next feature that I will be implementing and I was also thinking that would improve the insert speed.

    Good feedback. Not having other (working) implementations to compare against, I really need this kind of input.

    What are you running Win x64? LVx64? I don' t suppose you happen to have am RT Pharlap target?

  6. Yair is correct that you don't need the SetWindowPos call unless you want Topmost. Removing the SetWindowPos call does not affect focus in this use case. I've attached a VI that will cancel Topmost and another that will set Top instead of Topmost. hWndInsertAfter = -2 sets "NoTopmost" (above all non-topmost windows).

    You can also use "BringWindowToTop" which will not set it as a top level window but will bring it to the top of the Z-Order.

  7. At the moment I'm "offline" / have no possibility to access the cRIO to try your suggestions. Nevertheless I thank you very much!

    In the meantime I found exactly what I was searching for: an official NI statement about memory leakage with Queues. When I'm online again I'll try to fix that leakage like described below and the I'll let you know if it works.

    http://zone.ni.com/r...g/create_queue/

    Obtain Queue Details

    Use named queues to pass data between two sections of a block diagram or between two VIs in the same application instance. If you do not wire name, the function creates a new, unnamed queue reference. If you wire name, the function searches for an existing queue with the same name and returns a new reference to the existing queue. If a queue with the same name does not already exist and create if not found? is TRUE, the function creates a new, named queue reference.

    If you use the Obtain Queue function to return a reference to a named queue inside a loop, LabVIEW creates a new reference to the named queue each time the loop iterates. If you use Obtain Queue in a tight loop, LabVIEW slowly increases how much memory it uses because each new reference uses an additional four bytes. These bytes are released automatically when the VI stops running. However, in a long-running application it may appear as if LabVIEW is leaking memory since the memory usage keeps increasing. To prevent this unintended memory allocation, use the Release Queue function in the loop to release the queue reference for each iteration.

    This function might return error codes 1, 2, 1094, 1100, 1491, or 1548.

    I've been bitten by this before too.Now I use this vi. It ensures there is only ever 1 reference to a queue, you don't need thousands of wires all over your diagram and you can easily access queues from other VIs.

    • Like 2
  8. There will always be bugs that carry over from one version to the next.

    I hope that not the case with my cars ECU

    That does not mean that none of the bugs are being fixed.

    Indeed.

    For all bugs to be fixed all development would have to come to a halt and about six versions of BETAs would have to be run. As long as the show-stoppers get fixed and progress is made on the rest, I'm happy.

    Ben

    I don't know here to start with this statement. rolleyes.gif

    Thank you!

    The LV Champion fought long and hard to get the bugs into the public forum and tracked and I was just starting to believe that old rumour of bugs not getting fixed had been squashed.

    Take care,

    Ben

    Of the 161 known issues in LV2010, 125 are from previous versions (~78% if I've counted correctly). Rumour?

    Should I run for cover now? biggrin.gif

  9. The first error it came up with (with what you described) was here.

    Check that path exists.

    I changed if the "c:\ftpscript.txt" and no longer got the file error (obviously). However, it then complained about this one (again doesn't exist...but then it probably wouldn't on my machine)

    By adding an error out indicator Labview will no longer automatically handle the error.

    But you really need to think about your error handling because currently the software is not robust and I can see you spending the next 2 weeks creating directories that the software thinks should be there..

  10. Well. It hasn't reached 300 but it's in 3rd place. So that's awesome!

    It also surprises me that none of the idea exchange ideas ever reach really crazy number of votes. Like i've never seen 1000 votes or something. I wonder what this means?

    • There are not that many LV users out there.
    • LV users don't like voting.
    • They don't visit the idea exchange.
    • They are not aware of the idea exchange.
    • They don't like any of the ideas. (even then, why the hell wouldn't you vote?)

    No .1.

    Labview is a niche.Mainly due to its proprietary nature, targeted at test and automation and, of course, price.

  11. The error is a code 1, "SQL Error or missing database".

    Unfortunately, the Flatten To String function in LV returns a fair number of null chars when you feed it, for instance, a waveform. Escaped null chars don't seem to have the issue, so I might give that a try.

    Thanks again,

    Joe Z.

    If its a waveform you can use the "Array To Spreadsheet.vi" and store it as a comma delimited string. Or even each separate value with a time stamp in its own table.

  12. I confirm, no issues with LV9. And now that i have deleted recursive VI, no issues even with LV 8.5. Maybe i'll convert the recursive VIs as you said with call vi nodes to have all the tool working, but for the moment i only need to make some simple query and i don't need nothing more ;)

    You probably only need to take them out of the polymorphic VI. Rename column calls delete column and they are both in the table polymorphic vi.

    Fun stuff, thanks Shaun!

    It's worth noting that attempting to write a raw "\00" causes a glitch in the low level prepare (sqlite3_prepare_v2) vi. I'm guessing it's due to:

    The statement size is wired as a -1 by default. I'm tinkering with different sizes now, but would take any ideas out there.

    Thanks,

    Joe Z.

    What sort of glitch?

    -1 is much safer since if you supply a normal Labview string, you would have to add 1, however, if you supplied a null terminated string, you mustn't add the 1.The logic involved in detecting null chars outweighs any performance improvements you may get. If its better performance you are after, you'll have to wait for Version 1.1 wink.gif

    However. If you are trying to insert a null char into the database. You will have problems since c strings are null terminated, So when you pass the string (even with the length) Labview needs to convert it from a Labview string (which has a length that may have leading nulls) to a C string and this conversion will invariably truncate your string.

    Usually the way forward in the latter case is to use a "Blob" field but I haven't implemented that in this release.

  13. maybe there is a a little misunderstanding.

    i don't have LV 9.0 for linux, i have LV 8.5 for linux. That's why i have to convert VI's forst to LV 8.6 in windows and then to 8.5 for linux.

    IC.

    Well that explains the recursion issue you are seeing. Prior to LV9.0 recursion was only supported by opening a ref and using a call vi node. But its nice to know with a bit of hacking it can work on older LV versions......even Linux biggrin.gif. I presume (since you haven't mentioned any so far) that there are no issues in your windows LV 9?

  14. No I don't

    ...even if i cannot find any TARGET_BITNESS variable in the project...where is it placed?

    Oh, QUery3.vi, rename column and dlete column report the same recursion problem.

    It's an in-built definition the same as "TARGET_TYPE".

    I'm a bit stumped as to why LV9.0 on Linux cannot support recursive VI's when Windows x64 and x32 don't seem to have an issue.blink.gif You could remove them from the polymorphic table VI and add them separately to your palette since it seems it's the polymorphic instance that is causing the problem.

    Unfortunately, Linux documentation a is bit lacking. I have several VMWare Linux images, but was unable to find a downloadable trial version of LV9.0 for Linux, otherwise I would have tried it. The NI website only has windows and Mac. If you go to their Linux download section you only get a windows EXE installer although it says its for all OSs ph34r.gif.

  15. I Didn't make an example i only created a new blank vi and place a Table.vi inside.

    Could it be a converting from LV9 to LV 8.5 problem? To make this i had to convert to 8.6 first and then with LV 8.6 to 8.5...maybe something get lost inthis step.

    I created a New project but the OS variable was not "Unix" but "Linux" and the bitness variable did not exists.

    Now i'm trying reconverting Vis from LV9 to LV8.5 and using a project, i'll let you know if i find something new

    I believe TARGET_BITNESS was first introduced in LV 8.6. Do you have any difficulties in LV 9?

  16. Hi!

    i'm porting this toolkit in Ubuntu Linux with version 8.5 of Labview.

    Swwet.

    I did include aLinux x32 library but didn't advertise the fact because it was untested.

    Some polimorphic vi needs to be modifyied to work correctly such as SQLLite_Delete column.vi and SQLLite_Rename column.vi it said that "you cannot use "SQLLite_Rename column.vi" recursively, so i deleted them :)

    I'm surprised by this. What said it? Those two function are actually a trick. They just use SQL to copy the data to another table, delete then recreate the original and copy all the data back. SQLite doesn't have delete or rename columns function, but it is needed. To get this error, one of the other VIs would have to include it. Do you have an example use that shows this error?

    After that you place a conditional disabled structure for Unix but to make it work i had to change that condition from OS==Unix to TARGET_Type==Unix.

    I try changing it in OS==Linux as i see in the conditional Disable Symbols, but it didn't work the first time it said that OS was undefined. now i start labview again and it seems to work...what is better? OS or Target_Type?

    Instead, TARGET_BITNESS is an unexisting variable.

    OS and bitness are only available from within a Project. But Target Type is available all the time. Did you open them from within a project? Or just stand-alone VIs? Try adding them to a project.

    The problem is that linux, like windows, also has x32 and x64. We need the bitness to choose the appropriately compiled DLL.

    The choice of whether to use OS or Target Type was arbitrary. They both support the same things (more or less). I leaned towards OS because that is the one that NI use in their example.

  17. Hmm. I was thinking about that.

    Any thoughts on saving objects as binary text? And then opening up and acting on data and then resaving as binary?

    Does anyone have ideas about how this would perform?

    My framework is really just collecting and acting on serial data so I may have some performance time to spare.

    My original architecture was built with the thought of saving each UUT object's data somewhere. I was hoping to implement the ability to pull up any tested UUT's object data (maybe with a custom viewer) to see all the data that was collected during the test. This seemed easier than creating a custom database and spending time converting each LV piece of data to a corresponding field value.

    -Pete

    You can save the cluster as a "Blob" (Binary Large Object). Although I'm not sure what you mean by "binary text" blink.gif You wouldn't have to save the object data piecemeal style But databases are built for this kind of stuff and I think that if you went down this path you would see major benefits to saving each piece of the cluster as a separate field.

    Performance is pretty good if the DB resides on the same machine as the application. You could also look at "SQLite API". This release doesn't support "Blobs", but you could serialize the data using the flatten to string primitive.

×
×
  • Create New...

Important Information

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