Jump to content

ShaunR

Members
  • Posts

    4,855
  • Joined

  • Days Won

    293

Posts posted by ShaunR

  1. Hi Shaun,

    I can find my USB camera in MAX, But if i try to stop the grab in max after caputuring the image the total MAX gets closed. the same thing is happening in LabView also( whenever i call the USB close.vi function). whether this is camera issue or i have to do some other thing. please give your ideas. (I am using Mightex USB camera).

    Regards,

    Kalanga

    MAX uses NI-IMAQdx so you should be using the IMAQdx functions instead of the USB driver.llb functions (see the link I posted earlier). These are notoriously problematic. Make sure they are uninstalled / removed from your system.

    Also, make sure you have the latest IMAQdx drivers installed.

  2. Interpolation (As the name suggests) is for creating intermediate values where none exist. I don't think this is what you are trying to do (maybe wrong rolleyes.gif ).

    From the VI implementation and description it looks like you are trying to find a motor position that is a close match to the desired frequency since the motor position cannot be fractions (discrete steps). I.e you have a look-up table.

    So based on that I have modified your VI to do this.

  3. You may wish to look at this - http://lavag.org/fil...ol-inheritance/

    I haven't used it myself, so I can't comment on it.

    Thanks Yair. Unfortunately uses OGlibs so cannot try it. It talks about inheriting "daughters'" properties which might be the reverse of what I was seeking.But should we really use a tool to do this? I did briefly look at scripting to generate the VIs for the properties and methods, but couldn't get a list of them from the original control. But still. That's a lot of VIs to do what the control already does blink.gif

  4. I have been playing with them more and more lately and getting a good feel for the style thats required to use them.

    I have a few gripes too that make me stay away from them, e.g. I can't include it's reference as a member of a Class (works in src not in build) etc...

    But some really powerful stuff there - they just need a little make-over IMHO.

    Indeed. My gripes are a bit more fundamental than that though.

    All I wanted to do was add a "Clear" method,alternating row colours and make it accept arrays of strings instead of using the "Item Strings" property to a multicolumn list box. But the amount of effort in re-implementing all the standard stuff just doesn't make it worth it. Only took me 15 minutes to create the control and make the changes I wanted, then it looked like another 2 days to re-implement the standard stuff.

  5. ShaunR - I appreciate the replies. At this point I have NI Tech Support performing a lot of the same head-scratching that I've been doing.

    I like the use of the shift register to read additional elements.

    The CPU pegged at 100% usage, which isn't surprising since there is not a wait in the loop. I opened and closed various windows and was still able to create the timeout condition in the FPGA FIFO. The timeout didn't consistently happen when I minimized or restored the Windows Task Manager as before, but it does seem to be repeatable if I switch to the block diagram of the PC Main VI and then minimize the block diagram window. I charted the elements remaining instead of the data; the backlog had jumped to ~27,800 elements.

    I dropped the "sample rate" of the FPGA side to 54 kHz from 250 kHz. I was able to run an antivirus scan as well as minimize and restore various windows without the timeout occuring. That is good, though the CPU usage is bad as there are other loops that have to occur in my final system.

    Tim

    There is not supposed to be a wait. The read function will wait until it either has the number of elements requested, or there is a time-out. In this respect you change the loop execution time by reading more samples. If you are pegging the CPU then increase the number of samples (say to 15000) and increase your PCs buffer appropriately (I usually use 2x te FPGA size). 5000 data points was an arbitrary choice to give a couple of ms between iterations but if the PC is is still struggling (i.e there is some left over in the buffer at the end of every read) then it may not be able to keep up still when other stuff is happening.

  6. Yer, it still blows my mind at how crazy it went with just a 4MB array!

    And don't worry, I still have another installment (X-Control) waiting for me tomorrow!

    At first glance there is no Build Array's etc... but there are options to transpose the buffer, then th buffer gets reformatted to an XY Graph.

    That should be fun, can't wait! tongue.gif

    Spooky :P

    I was playing with Xconrols this weekend too (not fr buffer stuff though).

    I shelved it in the end since I was really annoyed that a XControl doesn't inherit all the properties and methods of the base data type meaning you have to re-implement all the built in stuff. angry.gif

  7. Except then the PowerMeter class is dependent on the PowerSensor class. You have to drag the PowerSensor code around every time you want to use the PowerMeter class. (Maybe a power meter without a power sensor is meaningless, in which case that would be okay. Otherwise I try to break up dependencies in potential reuse code.)

    Not really. The PowerMeter class has no dependencies its just a container used to manipulate the object you pass in to give the results context and meaning. PowerSensor Could Just as easily be an RTDSensor. You put it more eloquently than I in your previous paragraphs but basically we are thinking along the same lines.

    And BTW, I thought you didn't like OOP... ;)

    LVOOP! My other language is Delphiwink.gifHorses for courses.thumbup1.gif

  8. I am gonna side step my original statement of that I cannot use the preserve run time class VIs. Any place where I would perform that downcasting I wouldn't be changing the class on the wire (I would be getting downcast errors.) As far as that replacement goes it did eliminate my errors in the development environment (no crashes, no data type losses.) But In a built application it still crashes.

    Could you build one of your own applications where you are using property nodes?

    I didn't consistently see the error until I built my application for the first time. Furthermore, it was mostly displaying bad data in fixed data types like U32s or some other scalar. It wasn't until I used a datatype like a string or array before the crash became consistent (I think its still a matter of probability, it just gets alot higher the more memory you require for a datatype.)

    The "Othello" contribution in the "Examples Competition" uses property nodes.

    Othello

  9. I too was surprised at a lot of the finalists.

    Considering the purpose was to tender "Example" code, I think many of them are way too complicated and don't really demonstrate anything that isn't already there.

    I was expecting small simple, easy to understand demos rather than complex (1-2 MB) applications (although the games one might be the exception).

    Perhaps I misunderstood the purpose blink.gif.

  10. Hi Pete

    This is a common problem and I’ve seen many people going down the road of having one Power Meter object and then calling it like PowerMeter.GetPowerFromSnesor(1..n).

    I don’t like this approach because if you only start with only needing 4 sensor (assume that the Power Meter only have support for max 4 sensors), then your top application only needs to create One PowerMeter object.

    Then you suddenly needs another PowerSensor, then you have to create another PowerMeter Object and know which sensor ID and which PowerMeter every sensor is linked to.

    Instead I would go for the PowerSensor objects.

    Remember that the objects should reflect the reality, and it’s Power Sensors you are dealing with.

    If you need to have the knowledge of the PowerMeter I suggest that every time you create a PowerSensor object, just also creates a PowerMeter Object if needed and adds a reference to it.

    When I say needed, I would use named objects of the PowerMeter and if the PowerMeter this sensor is using has not been created yet they create it, and if it is already created then refer to the same object.

    Of cause this requires object by reference.

    This is how would have done it.

    post-941-006950000 1288304684_thumb.png

    post-941-045046300 1288304698_thumb.png

    PowerSensors.zip

    (LV 8.6, using GOOP3 object from GDS)

    Now I like someone to give me the solution to do this with ByValue objects. ( wub.gif my reference objects )

    Cheers,

    Mikael

    Why go for one OR the other. Surely a "PowerMeter" contains a collection of "PowerSensors". blink.gif (amongst other things ;) )

    So my "PowerMeter.GetPowerFromSensor(1..n)" would actually be "PowerMeter.GetPowerFromSensor(PowerSensor)".

    I would also say you would need a lot of knowledge about the power meter since you probably won't be able to talk to any sensors and it will be the device that contains range, scaling, math functions and probably calibration data (unless the cal is on-board the sensor). So you will need things like PowerMeter.SetRange, PowerMeter.SetSamples, PowerMeter.Calibrate etc, etc. So from my viewpoint, the sensor is just a value. The PowerMeter makes that value meaningful. And PowerMeter, Ammeter, Voltmeter are semantics.

  11. I'm hoping someone has run into this and can point me in a good direction.

    The test machine I'm using is a 2.79 GHz Pentium 4, WinXP, 1 GB RAM system with a PCI-7831R card in it. I'm running LabVIEW 8.6.1.

    I'm trying to stream data from the FPGA to the PC over a DMA FIFO. I've picked 250 kHz as my current benchmark as that is significantly above where the actual system is going to need to run. The FPGA side uses a fixed time interval (4 usec) FIFO write. The PC side uses two loops, one to read a latched timeout flag in the FPGA and one to read out the FIFO in a 20 msec loop.

    This works most of the time until I do something like minimize Windows Task Manager. The CPU usage doesn't blip and stays at ~25%; the number of elements remaining in the FIFO jumps to 30,000+ and I start to lose data points as the FIFO write in the FPGA times out.

    I've attached my test code.

    I appreciate any light people can shed on this.

    Tim

    What's the FIFO depth? You need to set it both for the FPGA (when you create it) AND the host (default for the host is 10,000 if memory serves me correctly.)

    You'll use up the 10,000 n 40ms which can easily happen if you task switch in windows.

  12. I've got numeric indicators in my block diagram. The numeric indicators show the temperature and the graph is supposed to show the numbers running. Like for example when I put Annealing-90 degrees, Denature-60 degrees and Extension-55 degrees, the graph is supposed to plot those temperatures in order of Annealing, Denature & Extension. Anyone can help out here on what I can use to make this work?

    There are many examples shipped with labview. Take a look at "charts.vi"

×
×
  • Create New...

Important Information

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