Jump to content

crossrulz

Members
  • Posts

    533
  • Joined

  • Last visited

  • Days Won

    21

Posts posted by crossrulz

  1. You might want to look into the Producer/Consumer design pattern and the use of Queues. There are certainly many ways to communicate between parallel VIs (global variables, Queues, Notifiers, Action Engines). Based on what little I understand about your situation, I would say the Queue if probably your best bet.

    As far as reducing block diagram size (for a main VI), subVIs are your friend, especially if you are performing the same action in different places.

  2. To make that work, I would have to 1) iterate through the frequency data column to identify between which two entries the target frequency lies (similar to Shaun's vi), then 2) look up what the associated two frequencies are, then 3) create a fractional index by dividing the difference between these frequencies by the target frequency, then 4) add the resulting fractional index to the lower index of those two looked-up frequencies, and finally ...

    Or just use the Threshold 1D Array primitive (should be right next to the Interpolate 1D Array) on your array of frequencies.

    post-11268-099178200 1288715197_thumb.pn

    Edit: I might have the signals backwards, but the concept is still the same.

    • Like 1
  3. It looks like Default Value is a scripting property (at least as of 8.6). So in the development environment, the answer would be yes. No so in an application.

    A work around may be to save your current value, invoke the Reinitialize to Default (use an invoke node), grab the new value (the default), and then set the value back to your original saved value. Hopefully somebody smarter than I has a better idea than that.

  4. Your problem is in where you are trying to figure out when button was pressed. The state tunnel out of the for loop will only output the result from the last button check (Button 3). If you want to keep what you have, change the tunnel to a shift register and feed the previous value through in the false cases.

    However, polling controls are BAD. You will be much better off with an Event Structure. NI's example is from right when the event structure was coming out and I have a feeling it was simply upgraded from a previous version long ago. Polling uses up lots of CPU unless you have waits in your loops. An event structure will sleep until one of its registered events have occurred.

  5. In case you haven't heard, LV 2011 is going to be largely a stability release. The entire LV team, acting on requests from customers, is going to pull back on features, focusing on bugs, performance and integration between existing features. There will be very little that is new in LV 2011, but we think customers will want it nonetheless.

    I'll take stability over fancy new toys any day!

  6. The most simple way would probably make another consumer loop for showing your non-modal dialog boxes. Have another queue (or notifier) running around to tell the loop to run a certain window. You would be limited to one dialog box opening in the new consumer, but it is a quick and easy way to handle your issue.

    • Like 1
  7. Shaun hit the big one. You need to properly shut down your system: turn power supplies, function generators, DIO, etc. off, reset other equipment, close out references and handles. The abort button will not do that. I have troubleshot a program where someone hit the abort button and ran again and wondered why the DIO port was not available (because it wasn't released from the previous run!).

    My experience, however, is mostly with non-LabVIEW people as my user and 99.9% of the time they do not see my giant Stop button (even though it is in the top right corner) and go straight for the Windows "X". If you don't handle this properly, the VI is still actually running even though you don't have a front panel. This will lead to a similar problem as just aborting. So I don't use Stop buttons anymore and just use an event structure and the "<This VI> Panel Close?" filter event. I discard the event, close up everything properly, and then shut down (if needed).

  8. Add another vote for VIPM Pro from me too.

    I've was playing around with VIPM 2010 yesterday and found that I can now build all the packages I want with the free community version. There used to be limitations, but it looks like JKI decided to open it.

    Here are my major reasons to use VIPM: 1. It manages your user library for each version of LabVIEW you have installed, 2. You can define your palettes a lot more easily than using LabVIEW's palette editor, 3. You can install only which packets you need, 4. It handles packet dependencies (ex. my GPIB packet need my Wait packet in order to work). These are things a normal SCC just cannot do, or at least not cleanly.

  9. What exactly do you mean by "merge"? Are you looking for a 3D array or a concatenation? It really depends on what the data is and what you are doing with it (post processing algorithms, save to disk, etc.).

  10. I feel your pain. What I ended up doing was copying the distribution DVDs onto my hard drive and then install from my hard drive. The installer builder looks at the location of the installer at the place the function was installed from. So since I installed from my hard drive, the installer builder found the location and didn't give me a pop up. Only do this if you have plenty of hard drive space (for obvious reasons). Another option might be to copy the DVDs onto a server and install from there. Haven't really tried that yet.

  11. How can I concatenate these 2 parts of 8 bits and plot them in a chart?

    Is there a function that do this for me?

    Look in Numeric>>Data Manipulation to find Join Numbers and Split Number. Join Numbers will take two U8s and turn them into a U16. Split Number will do the opposite. If you are dealing with arrays of your 16bit data, you may want to also look at the Decimate 1D Array and Interleave 1D Arrays.

    post-11268-008772500 1277147493_thumb.pn

  12. As can be seen from the image, I've put in the Property Node and set both the Termination Character Enable and the Suppres End Enable to TRUE. It works!

    I would have thought that you wanted Termination Character Enable to be set to FALSE. But I don't have the stuff in front of me. As long as the thing works.

    One more question: is it neccessary to have VISA Clear function?

    I honestly have not used the VISA Clear function. According to the help it just clears out the transfer buffers. It might be a good practice to use it after opening your VISA session, but definitely not necessary.

  13. There is equipment out there that uses termination characters. I think by default VISA has termination characters on. The o-scope may be using what VISA thinks is a termination character as a separator for some reason. You can use a property node to change the VISA settings. You should check with Hameg, but it is likely you either need to disable termination characters or change the termination character.

    post-11268-127444125489_thumb.png

×
×
  • Create New...

Important Information

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