Jump to content

Neville D

Members
  • Posts

    752
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Neville D

  1. QUOTE(adriaanrijllart @ Aug 14 2007, 10:46 AM)

    One additional point I thought of is to add a criterion of filtering the signal if it contains too much noise. I thought someone would make the remark, but so far no one seems to have had this problem.

    The derivative of a signal is going to make the noise problem much worse. Discontinuities in your point data will cause spikes in the derivative. That is why its never a good idea to use it in practice. This is also the reason why increasing the derivative gain in a PID loop can cause the loop to go unstable.

    Better approach: fit a polynomial curve to the data and take its analytical derivative which should be fairly smooth and continuous.

    Neville.

  2. QUOTE(adriaanrijllart @ Aug 8 2007, 06:27 AM)

    Hi all,

    found a way to do the calculation without loop. Only array functions.

    Cheers,

    Adriaan.

    Hi Adrian,

    Though doing the calculation without a loop is possible, the code will now make two extra copies of the arrays Y and t possibly even a third copy for the dY/dt output; this may not be a big issue for "small" arrays, but with very large arrays this could affect performance due to memory manager calls.

    I would suggest using the loop approach to limit the memory issue (even if it is not a concern presently). This would prevent possible future performance issues.

    Open your VI and select:

    Tools>>Profile>>Highlight Buffer allocations

    to see what I'm talking about.

    Neville.

  3. QUOTE(george seifert @ Aug 9 2007, 10:02 AM)

    You're lucky you don't have timed loops. They're nothing but trouble. Especially if you have more than one.

    George

    Aah, but if you need the new multi-core functionality on LV-RT (or possibly LV) where you can target a specific timed loop to a specific processor core, you are stuck using them.

    Still scratching my head as to how to implement a state-machine using a timed loop.. does it even make any sense doing that?

    Neville.

  4. QUOTE(Aristos Queue @ Aug 10 2007, 02:12 PM)

    Here's one that was specifically requested by LAVA users:

    In Tools>>Options>>Front Panel, you'll now find an option for "Connector pane terminals default to Required." This makes it so that any new input connections (except the error code cluster) that you put on the conpane -- either by explicit use of the front panel wiring tool or using Create SubVI -- will default to Required instead of Recommended. The default is FALSE so as to maintain consistency with past LVs; I expect that most of you experienced users will decide to enable it.

    I think thats a fantastic addition! This will help with a free (possibly slight) performance improvement as well (as mentioned in earlier posts around LAVA).

    Great job! (And it was nice meeting you at the LAVA Barbecue).

    Neville.

  5. QUOTE(zoogies @ Jun 25 2007, 02:05 PM)

    I guess this might be a pretty standard question. One thing is I'll need IMAQ for 1394 features; is it better to go out and get a version of NI-IMAQ for 1394 compatible with Labview 7.1, or upgrade totally with IMAQdx and Labview 8.2? I don't think LV8.2 is *necessary* per se, so I'm leaning towards sticking with 7.1 (besides, don't particularly want to deal with porting issues right now). But I just wanted to gather you guys' insight; maybe there's some awe-inspiring new feature in LV8.2 that should jump out at me? (I don't think Mathscript counts)

    Although, I'm having a bit of trouble finding a NI page for "NI-IMAQ for 1394"...hm...I came up with http://sine.ni.com/nips/cds/view/p/lang/en/nid/12892' target="_blank">this but can't tell if it's right. I could've sworn I had found such a page earlier...oh well.

    Why don't you talk to your local NI rep? He can guide you through the upgrade type questions. I think you can't get the old-style IMAQ for 1394. You have to buy the latest IMAQdx. But it comes with the last frozen version of the old driver as well. It should work with LV7, as before, but there won't be any new features/functions in the old driver (depending on what version of the old driver you have).

    Also, the newer versions of IMAQ support Gig-E cameras which are becoming more popular than FireWire cameras.

    As for latest features, check out the whats new for LV 8.2.1 to get all the upgrades & features. You might even look at bundling the IMAQ/Vision with LV under the SSP, that significantly reduces your upgrade costs in future. Talk to your rep.

    LV 8.2.1 with Vision 8.2.2 and the latest IMAQ is fast and fairly stable (I haven't used any of the OOP stuff which might be a bit more delicate) apart from the slowwww startup time of LV 8.2.1.

    LV 7.1.1 was pretty stable too.

    Neville.

  6. QUOTE(george seifert @ Jul 30 2007, 01:03 PM)

    I have an executable that seems to be hanging up in a timed loop occasionally (1 sec loop time).

    The VI is kind of way too big to post and nobody's going to want to try to figure it out anyway. So any general hints would be welcome.

    George

    How about enabling debugging for executables, and trying to track it down using that ? I am assuming you are using LV >8.x

    Neville.

  7. QUOTE(wallyabcd @ Jul 27 2007, 03:30 AM)

    Hi;

    Anyone aware of any script intepreter(C/C++...) or processor that can run under labview Rt ?

    The problem with the current intepreters like Ch, Lua, Python, UnderC are the dependency problems

    with other libraries like Kernel32.dll and so forth...as such fail to work on RT.

    I got UnderC to work under labview, but failed under RT because of kernel32.dll...

    Even adding the file to the project, it still fails; in anycase, I wouldn't want to load another memory manager on the RT

    I am looking for something that comes as a DLL with header files...

    I have a control application that runs loads and runs very large text script for control...

    I also have a very simple language (intepreter) that understand the scripts.

    It was initialy kept very simple but now, we would like to extend the language, add loops,

    local variables in the scripts and inline evaluation of operations.

    for example

    m1=move_stage(position=100)

    m2=read_stage_position()

    m3=m1-m2

    if(m3>5)

    log_msg(position error)

    blah blah blah...

    else

    log_msg(position correct)

    blah2 blah2 blah2...

    end

    Ofcourse what is not obvious from the above example is that only the if statement is processed by the external

    intepreter while the rest of the lines are processed by our build in intepreter. The idea is to farmed out the loops,

    branching, and mathematical processing to the intepreter such that I can remake the application by changing the script.

    My labview functions are already scriptable...

    Needless to say this a bit more complicated that it appears because I have to cache the results from each call in a stack

    ...

    Walters

    Hi Walters,

    Take a look at http://www.kshif.com/calcexpress/' target="_blank">CalcExpress, a commercial product which seems to have very advanced capabilities for writing scripts under LabVIEW.

    Neville.

  8. QUOTE(Ben @ Jul 26 2007, 11:46 AM)

    "NaN" when presented to graph or charts will not plot any points.

    The plotting will resume once it sees a non-NaN value.

    Ben

    True, but disabling or enabling the plot will show all the data available in that particular chart view, when the switch is toggled on enable.

    With the NaN's data will only start showing up after the toggle.

    I guess you could use either depending on the requirement.

    Neville.

  9. QUOTE(sm07 @ Jul 26 2007, 09:40 AM)

    I have 2 or 3 VI's running in parallel (some may be sub-vi's of others) and i'm wondering how bad is it to use global variables in them. My needs are very simple. For example, in one program i am writing to variable X inside a while loop, and in a second program, I am using variable X to calculate variable Y. Honestly that's as simple as I need things to be. In total I might need 10 global variables. The VI's themselves are complex and they must be separated, but this is what I'd like to do with regards to global variable usage. My main concern is that my loops run for quite a while so the memory is very 'active'. On the LV website, there is a document that states that, with respect to global variables in a loop, 'labview reclaims the memory after each iteration of the loop.' so do i have much to worry about?

    You could use a Q, where you write data in one of the VI's and read it elsewhere. Q's are very easy to use, and will make sure you don't loose (overwrite) any data that you haven't used in your consumer VI.

    If you don't care about missing data, then maybe use a notifier. See LV examples for more ideas.

    If you must use globals, then use a functional global (an unitialized shift register VI with read/write access), as the native LV globals tend to make copies of the data.

    Neville.

  10. QUOTE(Dirk J. @ Jul 26 2007, 09:47 AM)

    Why would you? I guess you have a background in text-programming because you want to use a formula node that fast...

    You have two arrays of t and y(t), why not use a simple for-loop in labview?

    :) that would probably require more LV knowledge than solving the problem in G in the first place

    Going off-track for a bit, there is a very useful re-sample VI buried somewhere in LV (I found it by breaking apart an express VI: Align & Resample Express VI), which is extremely easy to use and works great.. it probably might work with the variable dt as well.

    But, I wouldn't recommend using it in this particular case.

    Neville.

  11. QUOTE(abuch06 @ Jul 26 2007, 10:18 AM)

    Sure, you can display 26 channels if you want.. question is can any human can make sense of such a display? Like I said, split them into 7 groups of upto 4 channels each. No, as far as I know, there is no way to stack groups of channels.

    Have some sort of selector (multiple selection from a list-box?) that allows the user to select the 4 channels that they want to view in a plot, and show those 4. You can use property nodes of the chart to display or hide the channels; plot all 26 in each group, but display only a maximum of any 4.

    Most technical people, when asked what data they want to see on a graph, reply "everything". That saves them the trouble of thinking through the question, and coming up with a logical answer. But if you go through the process, some channels naturally will need to be seen together, others might not. Spend some time on this process. I used to work in the fuel-cell business where hundreds of variables needed to be monitored in real-time. Still didn't need to plot them all together. Temperatures and maybe a critical pressure or two, went together, fuel-related params went together, sub-system params were lumped together etc. etc.

    QUOTE(abuch06 @ Jul 26 2007, 10:18 AM)

    Another question with the program... I need to be able to build an array that cuts out values from a previous array. The previous array is 3D, first two dimensions are channel and values, the 3rd dimension I assigned a 1 to the values I want to keep and a 0 to the ones I want to cut. I cut out the values with a case structure inside a nested for loop but when the case is false it still requires an output. I tried using the "default" output, but that just pads the areas that i want to cut out with zeros... I know there has to be a way to do this, but I'm just not seeing it.

    In future, post a picture of your block diagram (or post your code). I suspect you need a shift register to pass values previously collected, through the False case. Maybe use a Build array in the True case.

    Neville.

  12. QUOTE(abuch06 @ Jul 26 2007, 06:16 AM)

    I know that it is possible with waveform graphs... but I need to be able to add some kind of lables to the multiple channels that are displayed on a waveform chart because it's impossible to tell which one is which. Is there any way to do this? if not, any other ideas?

    How about using different line styles (dots, dashes etc) different colors, and different thicknesses? right-click on the "plot 0" (legend) for these options.

    Alternately, you could put a cursor on each plot and rename the cursors with the plot names.

    PS From GUI standpoint it is never a good idea to have more than about 4 plots per chart/graph. You might want to break it up into a few separate graphs.

    Neville.

  13. QUOTE(ntward @ Jul 20 2007, 09:13 AM)

    Neville,

    That is most helpful. One other question would be: is this actually the most elegant way of doing things then? Or is it simpler to just lump everything in one vi?

    Thank you

    Certainly, it is quite elegant. You could put different valves (or subVI's) on different tab sheets of your top-level VI.

    The only issue is that the code might be hard to understand or debug, for a new LV-er with VI's called by reference, etc.

    I would go with a toggle switch for every valve, and a status indicator (enum).

    Toggle valve--->show status Open Success, Close Success, Open Failed! Close Failed!

    This would be in a subVI in a main loop or event Structure. User hits a valve toggle, that generates an event to do the action, and the enum shows the status of that action. You can color the enum differently for a fail (use a property node and color background to red or yellow for a fail etc).

    I would also look at the different types of code architecture producer-consumer, event driven state machine etc in the examples to get some ideas.

    N.

    Neville.

  14. QUOTE(VRPaul @ Jul 20 2007, 03:00 AM)

    Hi,

    is it possible to use the same graph in multiple sequences. i'm simulating a changing pH value, each sequence i'm using a different flow(of NaOH) to neutralize it. i want to make a realtime graph of the changing pH value so it is visible on the Y-axis and the added NaOH is cumulating on the X-axis. it works fine without realtime but it would nicer if the progress of the proces was visible. it's probably a whole other of designing the program. Can anyone help me?

    Paul

    You could probably use a Chart instead of a graph, but you would have to put both the NaOH and the pH on the Y axis, and X axis would be time. You can have multiple Y-axes (one on each side of the chart) for the two variables.

    Trouble with the graph is that it is re-drawn every time even when a single point is added at the end. That said, there is an example in LV that shows how you can use a graph like a chart with updates.

    Neville.

  15. QUOTE(ntward @ Jul 20 2007, 08:41 AM)

    Hi all.

    Thanks for the advice. I made (what I think is) a nice looking control that does the trick. Now, can I use it as a sub vi? Obviously I need to be able to display its front panel on the main front panel, is this possible? I can't figure it out...

    It would be quite elegant and simplify my block diagram if I can do this, since I have dozens of valves...

    Thanks again for any pointers :)

    You can load the front panel of a subVI into the main VI using a subpanel. Check LV help on "loading a front panel in a subpanel".

    Note the subVI then has to be called by reference, and you can't plonk the subVI onto the block diagram of the top-level VI. I am sure your next question is going to be "whats call by reference"?

    I suggest you take the time to read through some basic LabVIEW tutorials or a good starter book like Jim Kring's excellent text or Gary Johnson's wonderful reference.

    Also, there is an example showing loading of subpanels in LV.

    This will go a long way in getting you up and running quickly.

    Neville.

  16. QUOTE(67nate @ Jul 19 2007, 11:45 AM)

    sorry, I attached the wrong code (it is now updated)

    I used Measurement and Automation explorer to communicate and that is working

    But labview doesn't But it should be com 1? I wasn't sure if it was that or the 34970A (the one that worked for the GPIB) I tried both and neither work.

    It seems like I'm missing something in initilizeing the serial port but I havn't a clue what.

    Run the code with the Lightbulb ON. Is the error coming frm the Init Serial? If so, play around with the parameters until it works.

    Data bits 8, Parity None, Stop bits 1, Flow Control Off seem OK values.

    Try termination character Enable or Disable and of course set the Baud rate to match, or even Stop Bits None (check your Agilent manual to see what they recommend).

    Have you tested with MAX using the Serial connection or GPIB? If serial, try to figure out what the settings for the COM port in MAX are. I seem to remember there was a way to generate code when sending some commands from MAX. Generate code if you can from there, and run that.

    Try a very simple program No loop etc to complicate anything (run in execution highlight mode->light bulb ON, so there are delays after every step):

    Init Serial Port

    Write command *IDN?

    Read response (it should be the identifying string for the instrument "Agilent...blah blah serial number..etc.")

    Sorry I have no hardware to help any further.

    You might look at the example code for the instrument included with the driver. Try running something simple from there.

    Neville.

  17. QUOTE(67nate @ Jul 19 2007, 10:00 AM)

    I can't seem to comunicate with the Agilent

    I was able to when I was using GPIB but now I need to with RS-232 and I can't get it to work.

    I'm getting error -1073807246 which is

    Property Node (arg 1) in VISA Configure Serial Port (Instr).vi->6temp.vi

    So I know somethings wrong with my configuring of the serial port but I don't know what.

    I have checked all the settings like baud rate and parity and the are all correct.

    Does any have any ideas?

    1 'Configure Serial Port' should be outside the loop so the port is configured at start, and never again.

    2 Visa Resource Name should be COM1 or COM2 i.e. the serial port in use; in your case you have it set to 34970A?

    3 Have you configured the instrument to use 19200/No Parity/Stop bits..etc same as the settings of your COM port?

    4 Try running the code without a While loop to see if it even works on a single run.

    5 There may be a way to communicate simply with your instrument using NI-MAX to see if you have all the settings right. If it works in MAX it should work with your code (i.e. you have set up the instrument correctly).

    Neville.

  18. QUOTE(HeLo @ Jul 18 2007, 02:09 PM)

    A similar problem is occuring in the use of local variables: When I want to select a different variable by right clicking the local variable, the variables are listed in the order they were created and not for example alphabetically - and annoyingly - I often really have to search for the targeted variable.

    Does anybody know a secret or nonsecret trick to this?

    By the way, one possibility I thought of is using global variables instead. I know about the rules about global variables, but if I use them very disciplined and strictly the same way as local ones, I don't see a disadvantage.

    Thank's for any suggestion

    Herbert

    You can right-click on the variable whose local you want to make and "create local" from there.. no need to scroll through the list of variables.

    That said, note that a local variable involves making a copy of the data. If you have a bunch of arrays or complicated data structures, execution speed and memory efficiency will definitely be affected.

    Race conditions are another issue (for globals or locals).

    Neville.

  19. QUOTE(wallyabcd @ Jul 18 2007, 05:41 AM)

    Hi Jean;

    You can install both the labview ETX, RTX modules.

    The ETX can be any old desktop with some few limitations on the choice of Lan card supported

    Install it on a spare PC and you're ready to go,

    and it will behave almost the same as a realtime platform.

    A few functions are not supported or different on each one...

    Additional hardware is not so obvious and depends onit's exact nature.

    See NI website for how to...

    Walters

    You would need a separate LV-RT runtime licence to do this legally (about $900 US..)

    Neville.

×
×
  • Create New...

Important Information

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