Jump to content

DredPirate

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

DredPirate's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I am feading a constant complex double (CDB) set to -9+0i into the square root function and displaying the result.
  2. And here is another reason not to use express VIs or LV unit labels. Had to kill LV to stop this VI.
  3. Maybe I'm missing something but I do not beleive LV does the math correctly for complex numbers. Isn't the square root of -9 = to 0+3i? If so why does LV give a result of -8.13152E-20 +3 i? It's close but not correct.
  4. There are 2 items I don't agree with in this presentation. 1. Backround Color. I find it more readable to set the Block Diagram color to a light manila. 2. Error handling. I that LV does a terrible job of Error Handling. To often have I seen LV lock up code with a popup when it recieves an error. If you're not extremely careful you could loss data or worse destroy equipment. Other then that I think thats a great guidline on how to code in LV.
  5. You could also use a local variables or functional (LV2 Style) globals to pass your data within a case structure to your loops. That way you wouldn't need to send a variable out. And would more closely resemble you line baised equvilant.
  6. First, do not use global variables. They make maintenance and debugging a nightmare. Not to mention they are terrible on resources. If you have to use globals then look up LV2 style globals. If your program is structured correctly you should not need them except for a few special cases. Which brings me to number 2. Your main issue seems to be program structure (or lack of). Look up state machines. This is the best way to program in LV. Also make sure your file structure is well defined (do not use LLBs. They strip the file structure and offer nothing in return but bugs. There is a post on this subject.). Look at the program I've provided for an example of how to structure your code and files. Notice the parallel loop for your DAQ. I did this because of the fast update times (X ms) you require. GUI's can be slow especially when you add graphs. Running them in parallel loops can sometimes help keep your critical programs from locking on slower operations. However, try to limit the number of parellel loops in a program and make sure all of your loops stop with the exit button. (BTW
  7. Fist let me say that I solved this puzzle in about an hour. Great program! Lots of fun. You didn't need to impliment a way to clear mistake LV did it for you. Just right click and re-initialize to default it will clear the element you select. Although it doesn't work on the house color.
  8. First let me make some assumtions. It sounds like your doing a simple Back EMF measurement. Your speed control is probably +/-1 RPM. Your using a Brushless Servo motor for your drive. Your diving a Brush type motor. This is for a piece of development equipment (not production or lab). And you have no budget foir this project. Now unless your servo drive provides some sort of velocity feedback you will be stuck buying something. So lets find the cheapest and easiest solution. Seeing as your a newby to LV we will want something simple to measure. Doing a dynamic signal analysis to extract the RPM from the brush commutaion will take to much time for you to program. It can be done without any additional hardware but is tricky even for those of us with experience because you need to know exatcly what to filter. So we want something you don't have to monitor to get the velocity information. First look up analog tachometers. I have not done much research on this but I know they're out there. This would give you the quickest solution. A voltage output that corresponds to a speed. Otherwise, what you need is some device that will give a pulse or pulses for every revoltion (an encoder). Then conect the pulses into a Frequency to Voltage converter (F-V). This will give you a voltage output that corresponds to a velocity. This site has both the F-V and encoder. http://www.usdigital.com/products/etach2/ FYI - This site has great and cheap indutrial grade encoders. http://www.beiied.com/ Another option - You may be able to use one of your DIOs as a counter timer to measure the frequency. This would be the best solution because you would eliminate the need for the F-V. I have never tried this on the M series cards so you would have to experiment with it. This is all the help I can offer at this point so good luck. If you need more info then do a google search first.
  9. You could throw an AB quad encoder on the motor and use a PCI-6602 counter timer to monitor the position output. Then do some math and you get RPM. Or put the encoder output into a frequency to voltage converter and monitor it on the PCI-6221. Or set up the PCI-6602 to monitor frequency off of the encoder. Or set up a curcuit to capture commutator pulses. Or measure the com pulses with the PCI-6221. Or measure the voltage and current and compare that to a performace curve. Or ................. The list goes on and on. The method you choose really depends on your aplication.
  10. First The software is set up to take 4 readings at a time from a standard NI Multifunction DAQ card. To change the number of channels you need to edit the AI Config:physical channels constant on the left side of the screen. Look up Physical Channel Naming Convention in the help menu. I was taught an LV programmer with like 10+ years expereince so I never had to go through the pains of learning on my own. There were some things that helped though. 1. Take a LV training course if you can afford it. Although I do not agree with alot of the practices they teach, it will help get you familiar with the functions and enviroment and more importantly give you the confidence you need to really experiment in LV. (BTW I hope you didn't buy the sales pitch that anyone can program LV. While anyone can do something in LV it takes training and experience to do it well. Like anything elser.) 2. Learn the array functions inside and out. This is the most important function in LV since almost all data is in an array. 3. STATE MACHINES!!! Use this style of programming in LV. The example I provided above is a style of state machine. Walk through it get know how it operates. I personally hate the LV style state machine and most other floating around the net (See KISS). 3. Use the K.I.S.S. (Keep It Simple Stupid) method. If you can do it with a simple array function then do it with a simple array function. Do not use LV qeueing or other complex functions unless they make your program simpler or greatly improve performance. Usually though they add another uneccessary layer of complexity. 4. Search for examples. NI provides some good examples. Pick them apart and figure out how they work. 5. Use the help menu in LV. They offer alot of good resources. 6. Participate in this forum and the NI forum. There is a wealth of knowledge and experience that you will not find anywhere else. (Lava is much better than NI) If you can't find an example in LV than look here. Another thing, post examples of your code and ask for opinions. This is the easiest way to see what your doing right and wrong. For instance if you provided an example of what you tried in this post it would be easier to give you the answers you need. Share what you have learned! I cannot stress this enough. I know more than many of my conterparts because I do share information. Many of them believe they need to keep what they have learned secret to secure there jobs. NOT TRUE. I keep my job by becoming better at it and I become better at it by sharing information. Lastly, check out this website. I only read a little bit but it seemed pretty well done. http://www.upscale.utoronto.ca/GeneralInterest/LabView.html Also I just found this FAQ searching around on LAVA. http://forums.lavausergroup.org/index.php?showtopic=239
  11. Not true for multicolumn listbox. You can set the selection color. See the attached VI. Download File:post-3219-1131731871.vi
  12. No. It seems to work fine. The only undefined string I get is the empty string and only after I delete everything from the combo box. BTW I am using LV7.1.1
  13. First, look up state machines. This is the method of programing used by all LV programmers with any experience. Next I don't know if this is what you're looking for but I created a quick example of what I think you're looking for. Check it out. Download File:post-3219-1130797095.zip
  14. Same here. Dell monitors seem to like 1280X1024. Although, I do use the space. Every computer in or lab is a Dell (they were bought before I arrived) so I don't see a need to reduce the space to 1024X768 for anything but posting. (Sorry for the earlier post at 1280X1024. I will reduce the size in the future). BTW best computer supplier I found for test equipment is Axiom. Industrial Single Board Computer (SBC) with up to 14 PCI slots and resonable price. Never used more than 6 PCI slots but its nice to know its there is I need it. Its really nice when you have one at your desk. You just load it up with NI cards and debug at your desk.
×
×
  • Create New...

Important Information

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