Jump to content

hooovahh

Moderators
  • Posts

    3,432
  • Joined

  • Last visited

  • Days Won

    289

Everything posted by hooovahh

  1. In newer versions of LabVIEW (2009 or around there) NI changed how local variables looked to make them look more like Global Variables. Maybe you aren't familiar with the older way of seeing them.
  2. Thousand, Million, Billion, Trillion, Quadrillion, Quintillion. Each comma is a new unit which is every 10^3. Always seemed logical to me but I've always lived in the US. More info on Wikipedia.
  3. I've already admitted defeat, and hope I am clear that I never asked for it to be one way or another. But because it is Monday I made the 3 ways to do what we are talking about. The native way (the actual function), the right way (start with is the value less then Max?) and the wrong way (start with is the value greater then Max?). Both the right and wrong way have the same amount of logic having two checks each. I don't see how doing it the wrong way adds extra checks. After running the test on an array with 100000000 doubles I got a resulting time of 233ms for native, 239ms for right, and 238ms for wrong. I think we can call that a wash. Coerce Tests.vi
  4. Forgive my ignorance, but are you telling me that 1,000,000,000 American doesn't equal 1,000,000,000 European? EDIT: Wikipedia
  5. But if I say is the value less then Max then I also get a false, meaning I am outside the valid range and should coerced... (you must have known I would have came to this logic)
  6. I guess I expected it to coerce a number to be within the range I provided. This is the first time I found that providing an input to that function didn't force my value to be within the range specified. I'm not saying it should coerce, and I agree that it behaves the way standards say it should (and the documentation says as well). I was just taken back because I've never seen it behave that way is all. It's like if I used the one button dialog box and if I make the message one specific constant it behaved differently.
  7. Your image doesn't look like it represents the function you are asking for. I implemented the function the way you described it. You provide a folder of JPGs and run. It loads the first picture in the folder. If there isn't any it prompts you. Once it has been loaded you use the Next and Previous buttons to go between images. Cycle Through Images.vi
  8. Go ahead and type in that path on your windows machine into Run or the Explorer path. I'm guessing that it won't work because your path contains spaces between each character, some non printable characters, and characters before the drive letter. Looks like something went wrong with your read and conversion to a path.
  9. I just tested in 2011 on many different comparisons and you are right that it always returns false, and the Coerce In Range. My coworker must have been confused but claims it was in version 2010. I did discover one other potential issue with this NaN and comparison business. Lets say I take an average of some values, and then want to command a device over serial with that average value. I have a valid range so I use the Coerce In Range to be between 0 and 10 which in this hypothetical is my devices limit. If my average returns NaN by trying to divide by 0, then the coerce in range returns NaN not 0 or 10. This functionality isn't what I expected, but it is what is documented in the help.
  10. I heard recently that when you look at your code from 3 years ago that you should feel disgusted. If you look at your code and think you did a pretty good job, then you aren't improving, or using the new techniques and features in newer versions. Isn't it quite interesting how LabVIEW code looks dated? I mean I can look at a block diagram and and based on coding styles make a pretty good guess at what version it was developed in. Oh using white labels instead of transparent on block diagram controls? Labels on the left or the top of controls? Comments not part of the wires but intended to be? Bookmarks? Subdiagrams on structures? Lots of polling controls? Default subVI icons? When I look at C++ code from 5 years ago it more or less looks the same. But 5 year old LabVIEW code is very different. Either we're changing too much, or they aren't changing enough.
  11. According to this post http://forums.ni.com/t5/LabVIEW/nan-change/td-p/1826573 It happened some time in version 2010 or 2011 (since it worked one way in 2009 then another in 2011). Now the other question. Well while I can understand while some would say a NaN should be something and some would say it should be something else when converted, I agree that changing it between versions is asking for trouble. I know I had a coworker have a similar issue when he was doing limit checking. He had code to say is the measured value less then X and I think NaN would always return true (or maybe greater then X). But once the conversion was understood (for that version of LabVIEW) there were no other issues.
  12. hooovahh

    Cross post?

    Are you a wizard?
  13. Here are some of the free tutorials I suggest: 3 Hour Introduction http://www.ni.com/white-paper/5243/en/ 6 Hour Introduction http://www.ni.com/white-paper/5241/en/ LabVEW Basics http://www.ni.com/gettingstarted/labviewbasics/ Self Paced training for students http://www.ni.com/academic/students/learn/ Self Paced training beginner to advanced, SSP Required http://sine.ni.com/myni/self-paced-training/app/main.xhtml LabVIEW Wiki on Training http://labviewwiki.org/LabVIEW_tutorial#External_Links Of course the best training is to work along side those who are experts on all things LabVIEW. It is also very motivating to know there are others who struggled just like you but became experts over time, and constantly researching newer and better ways of doing things.
  14. So I've played around with Arduinos in the past mostly just the Uno and 328 set of microcontrollers. But I was looking for something a little faster for doing some stuff that I didn't have a use for yet and stumbled on the Teensy 3.1. It's a microcontroller that is ARM based running at 96MHZ (Uno is 16MHZ). It also has a bunch of DIO, AIO (yes real analog output), SPI, I2C, a bunch of serial ports, real integrated USB with DMA not the RS-232 to USB FTDI, and it even has a built in CAN bus. And for $20 bucks. One of the things I wanted to see if I could do with this is make a CAN gateway, where it used the one built in CAN bus, and then filter the messages or translated them, and then send it out on another CAN bus talking with SPI. I also thought it would be cool if I could send all that CAN from both buses over USB to the PC, or even log to a micro SD that's onboard. I didn't finish my project because of other tasks, but I can confirm that the thing is capable of doing all of these things. I can elaborate more details if there is interest but really the purpose of this post is to talk about the Teensy itself which is a very powerful microcontroller that has alot of Arduino compatible modules and even uses the Arduino IDE. It isn't as cheap as a blank microcontroller but the form factor, compatibility, and capability is great for the price.
  15. If you don't mind I took it a step further. http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Conditional-Disable-LabVIEW-Run-Time-Versions/idi-p/2795540 But going with the tools we have now, I think that defaulting to the NI method is probably best. There are multiple functions that are both done by NI and OpenG and when possible I choose the NI because I expect with each version LabVIEW gets better NI's methods maybe improved. Besides I think NI has better support then OpenG.
  16. You are right to be worried about lighting. It is more of an art form and having something as open as this type of setup you will need to experiment alot to see what can be done. In the past I have seen a line scan camera where a light bar was directed right at the lens of the camera. This caused a saturation of all other light in the environment. I'm not saying to use this product but the light bar looked similar to this. This setup was for detecting objects falling and worked well because it was the only place where light was obstructed. In your setup a line scan camera coupled with a light bar might work as well, if you can mount some kind of light behind the steel strip. Then you'll see light where there is no steel, and you'll see darkness where there is steel. You'll then need to perform a binary threshold using some kind of tolerances or other image filtering, and then perform edge detection with a few degrees of rotation, and then some measurement for horizontal distance. Sounds fun, and doable just some time experimenting with setups to get it right.
  17. Sorry I'm not answering the question you ask (because I don't use your messenger but do like it). But I wanted to mention that I love this type of feature. The majority of the time I have a state machine of some kind with a BFC (big cluster) with data I pull out and put into stuff and having it get the name from the data and making the name optional is a great feature. I wonder if it would be worth reading the Application.VersionYear and perform one set of code for 2011, and another for other versions? I realize this would add to the overhead so it might not be worth it, but if someone is concerned I'm guessing all of that overhead would be skipped if a Label name was provided.
  18. I this case I would call that a feature, which clears the error, which is the intent. EDIT: I also like the idea of putting an X on VIs that run regardless of the error. I do this on driver level code I write for the close tasks but think it would be best to make it clearer.
  19. I don't believe it will. There are several functions (like Close VI Ref) that will function even if an error is passed in because it knows it is a cleanup operation and should try to run no matter what.
  20. Yeah stupid me forgot to test the type cast. In either case I can suggest an improvement. Turn on For Loop Parallelism for the for loop, and for the number of instances wire the array size. This way they will all be closed in parallel like your first post. To do this you'll need to remove the shift register, but again as stated we don't care about the error so just pass out the last one from the for loop and clear it.
  21. After a few tests I didn't come up with anything. I thought I'd be smart and use the Coerce to Type but it also only works with user events of the same data type. Another method was OpenG Variant to Array of VData, then Variant to Data, or Coerce to Type of a user event that is a variant type. That didn't work either. So my official solution is to change your architecture to either have all user events user the variant data type. Or only have one user event with the variant data type. And in both situations convert back to the usable data type where the data is used. Sorry I couldn't come up with something better.
  22. I can't seem to find it at the moment, but I remember seeing a post someone made at NI's forums where they used VLC to perform an operation similar to what you are asking using ActiveX. It didn't fully work but I saw what they were going for and maybe that is an option. VLC by the way plays just about everything under the sun and I'd be surprised if it didn't play mov files. Since I can't provide a link to that idea here is another topic very close recommending a command line call to FFMPEG which might be useful too. Oh here is another similar topic.
  23. I'm not apart of the beta, but if I was I think I wouldn't be allowed to answer that. I can say 2013 SPI doesn't have the type of functionality built in that you are looking for.
  24. I've done some work on tables to make them more user friendly. Things like Tab, Enter, Shift+Tab, or Enter, formatting of cells to accept strings, or numbers or drop downs. All of these things are a manual process. LabVIEW gives you the controls to be able to do what ever you want, if you don't mind spending the time getting it right. I think some of the slowness you are seeing is because of custom cell formatting on each cell that you have. LabVIEW had a few functions for coloring an entire column, or row a specific color and that helps with performance, but having each cell individually colored is more difficult for LabVIEW. It even struggles with cells that aren't being shown. So if you have 10000 rows with custom formatting it doesn't matter that you only see 5 rows at a time. There are a few techniques to help with this, things like a virtual table that only shows 5 rows at a time, and it loads the data and formatting from some other location. Also in 2013 there were many improvements to tables and multicolumn listboxes to be able to handle this data a little smoother. It looks like you are on the right track, but unfortunately there aren't many native controls for what you want. I'm not sure your application but you could try to do some ActiveX and actually insert an Excel table in a LabVIEW front panel. I've experimented with this and had decent results, even with the free Excel for web pages can be inserted, but with limited functionality.
  25. I probably spent more time on this then I should have but I got carried away. Basically you could do it with multiple loops but there really is no need, you are only going to be doing one thing at a time. This makes state machines a good design. I created a state machine that is string based using an event structure to handle the UI being interacted with by the user. You said you wanted to find the peaks but didn't really specify how long the test should run for so I added a control that at the moment defaults to 5 seconds. So after clicking start it will run for 5 seconds displaying new data on a chart, and keeping track of the first value, and the maximum value. At the end of the 5 seconds you click Exit and Log or close the window to save the data the same way you were before. I also added a splitter and resized the graph with the window. I don't think this does all you need but it is a good place to start and to build on without shooting your self in the foot. Efficiency Checker Hooovahh Edit.vi
×
×
  • Create New...

Important Information

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