Jump to content

ErikTheRed

Members
  • Posts

    17
  • Joined

  • Last visited

Posts posted by ErikTheRed

  1. I'm running a queue controlled multi-loop many master/many slave data parser (among other features), and gosh darn it if it isn't mostly working!  However, one issue that I'm running into is an extremely un-reproducible error in the serial data read/write loop out to a USB Telegesis module.  I can't seem to replicate it, and when it happens, it may happen a few times in a row, but usually upon a software reset, disappears again.  This software will be running for a significant period of time without user intervention, so I can't afford to have this happen when someone's not around to fix it.  Any ideas?

     

    The Error:

    -1073807360,Property Node (arg 1) in ...(my top level vi).vi

     

    The Code:

    post-21933-0-40733600-1367349204_thumb.j

     

    Thanks for the help!

  2. I had previously tried googling the error codes to no avail. However, when I was generally googling around, I found a post where someone was complaining about LV using only a few recordset identifiers per connection. It turns out that recordsets were overwriting each-other when multiple parallel loops were executing queries. I opened a new connection to the database for each loop I had running, and I have not seen the error return.

    TLDR: Don't perform multiple actions on a database with the same connection at once. Multiple connections to the database will allow concurrent transactions.

  3. Hello, I'm having a fair bit of difficulty tracking down these errors that I'm getting. I'm not sure exactly what to provide to get the best help here, so I'll post the errors and start prepping some code snippets if they are needed.

    I recently migrated from an Access database to an SQL database, my code has a number of read/writes on the same connection (i.e. I open the connection at the beginning of the software with multiple parallel loops, and utilize that connection, sometimes in parallel loops, without closing it until the end). I'm running into errors with a few of the simple recordset and properties functions as follows:

    -1/18/2012 4:13:10 PM------------------1,-2147217906,NI_Database_API.lvlib:Rec Move To Next Record ®.vi:2->Tag_Data to Cluster.vi:1->Device Table DB - Return Router EUIs and Positions.vi->LE - Package v4 for Learning Factory (no RYG) (SQL).vi->BuzNet TopLevel 4.2.3.vi<ERR>ADO Error: 0x80040E0EException occured in Microsoft OLE DB Provider for ODBC Drivers: [Microsoft]

    Invalid bookmark value in NI_Database_API.lvlib:Rec Move To Next Record ®.vi:2->Tag_Data to Cluster.vi:1->Device Table DB - Return Router EUIs and Positions.vi->LE - Package v4 for Learning Factory (no RYG) (SQL).vi->BuzNet TopLevel 4.2.3.vi

    -1/18/2012 4:15:43 PM------------------1,-2147352567,NI_Database_API.lvlib:Rec Get Recordset Properties ®.vi:2->NI_Database_API.lvlib:DB Tools List Columns.vi:2->Device Table DB - Return Device Data for EUI.vi->LE & Device Table DB - Log Location Calculation (SQL).vi->LE - Package v4 for Learning Factory (no RYG) (SQL).vi->BuzNet TopLevel 4.2.3.vi<ERR>ADO Error: 0x80020009Property Node (arg 2) in NI_Database_API.lvlib:Rec Get Recordset Properties ®.vi:2->NI_Database_API.lvlib:DB Tools List Columns.vi:2->Device Table DB - Return Device Data for EUI.vi->LE & Device Table DB - Log Location Calculation (SQL).vi->LE - Package v4 for Learning Factory (no RYG) (SQL).vi->BuzNet TopLevel 4.2.3.vi

    These errors occur at random intervals, though it seems that the first one ([color=#000000]-2147217906) happens much more frequently. I've been swatting these two bugs (i.e. suppressing and logging) and ultimately was faced with a third error:[/color]

    [color=#000000]1,1,"NI_Database_API.lvlib:Rec Delete.vi"<ERR>Object 0x000000 is not valid.[/color]

    [color=#000000]--that ultimately killed the program.[/color]

    I think it might be something with synchronous selects/writes but it's very hard to tell given the data I have...

    [color=#000000]Can anyone help me with a next step?[/color]

    [color=#000000]Thanks![/color]

    [color=#000000]Erik[/color]

  4. post-21933-0-36765100-1310745290_thumb.p

    Does anyone have a solution for the above behavior given that i'm using the ring picture control?

    (Besides playing with the order and placing some sort of background image that stencils the picture control out of the front panel?)

    Thanks for the continued help :)

    Erik

  5. Ah, I did not notice that the circle was filled with alpha (partially transparent) pixels. This is going to be significantly harder to do. As far as I know, except for "draw grayed out rectangle", you can not have alpha pixel in a picture control. You can simulate this behavior though by:

    1. preserving alpha information in your image once loaded into LV (LV tend to strip this).
    2. inspect the pixel behind the alpha pixels and blend them with the alpha one yourself.

    Doing the alpha yourself will works fine, but you will need to invest some time to get it going.

    Based on all I (now) know of your requirements, I will recommend another approach. Have a set of different sized circle (use png images to have alpha pixel) and load each png image in a pic ring (your alpha pixel will be preserved). You can then select the right size and move the pic ring as needed. This would be the quickest and most efficient approach. What you loose in flexibility (only a few sized circle available) you gain in performance and coding time.

    PJM

    Thanks so much for the advice. This seems like a (near) perfect fit for what I want to do. I'm sorry that it took so long to detail all of the requirements, but thanks for sticking with me!

    Please vote for this idea to add support to Alpha channel in picture control

    http://forums.ni.com...ol/idi-p/917415

    Dany

    Done.

  6. The control on top should receive the click event and not the one underneath.

    Tim

    Okay, so really I will have to have a singular transparent picture indicator that i can transfer my current mouse gestures onto. However, I don't know how to get the behavior of 'Graphics & Sound\Picture Functions\Draw Grayed Out Rect.vi' (i.e. the partial transparency) for a circle...

    I'm looking for documentation for the opcodes... 15 appears to be 'greyed out rectangle'...

    Thanks,

    Erik

  7. Use another "floating" picture control just to do that "Google map like indicator" and move the transparent floating picture control on top of your other control as needed.

    PJM

    I would like to make the image below the transparent floating picture control still clickable... Will the overlapping of controls preclude an event from being generated when I click on the image? Or can I make picture control effectively invisible and non-interact-able with a property node?

    I will potentially be using more than one "accuracy circle", so my thought was to overlay an equally sized transparent picture control on top of the current picture control and update that as needed with a multitude of circles... however, a few floating picture controls might be more efficient.

    Erik

  8. Just use the "set color" tool and "paint" it transparent.

    post-121-0-30509600-1311018541_thumb.png

    About performance, I am pretty positive that if you have no anti-alias that you should not notice any performance issues. Just make sure the you are redrawing only what needs to and only when need to. Additionally, defer panel update could be used if needed.

    PJM

    Thanks, I had no idea what that 'T' was. I'm utilizing the panel updates, but there's a fair amount of image transformation and updating to reflect mouse pressing and other updates to the system. I'll try it out and see what the performance is like :).

  9. Nothing that you can't Google as well as I can. This one does look useful: https://decibel.ni.c.../docs/DOC-15025. You'll want search the dark side forums as well.

    Like you, I'm much more familiar with the 2D picture control, but this really blows it out of the water, which I think is one of the reasons the 2D control doesn't seem to get a lot of love from NI in terms of new features.

    Thanks much, I'll take a look and see if I can post an update touting my success :).

  10. Like mje says, you can use a transparent picture control and just draw the circles in it. For such simple thing the performance will be fine. Now, if you want to implement the "blur" (aka anti-alias) this will definitively requires a lot of effort (and result in performance penalty but it should still be fast enough).

    Note: If you thing NI should have the anti-alias native in the picture control, go vote for this idea: Add Antialias support in picture control

    I'm not exactly sure where the transparency can be set in the picture control, but I'll check it out. That might be my best option, though everything I add keeps slowing it down!

    If you want to draw with good performance, the LabVIEW 3D Picture control uses OpenGL which should be using your machine's GPU. The learning curve looks a bit intimidating, but I think once you get going it won't be too bad.

    I took a short look and was intimidated! Do you have any favorite/recommended tutorials to get me started?

    Thanks for the advice!

  11. I am trying to create a custom indicator (currently a boolean) that approximates the blue ring with central dot that exists in Google maps (particularly the mobile version, see image below) to show uncertainty. Is there a way to create the indicator so that I can change the size of the outer ring, while keeping the dot in the middle the same size?

    The google maps circle:

    post-21933-0-40973800-1310744749_thumb.p

    The desired indicator:

    post-21933-0-91084000-1310744990_thumb.p

    Other ways to approximate this behavior that I've thought of are to have two different sized rings for the true and false cases on the boolean indicator that i'm moving around... if there are ways to do more than two cases for an indicator, I could use this instead.

    Additionally, I thought of drawing the "blur" around the indicator on a background image, but this seems like it'd be too slow (as this is happening in real time). Or of potentially having two separate indicators that I move around (though this would also be slower).

    In a related problem, if I'm working with these indicators over an image, is there a way to cut off any piece of the indicator that goes outside of the image?

    i.e.

    post-21933-0-36765100-1310745290_thumb.p

    Erik

  12. Thank you, this is extremely helpful!

    All right, let's start from the beginning, what I call an action engine is also sometimes called a FGV (functional global variable) or USR (un-initialized shift register) or LV2 global, if you search the forum for these terms you'll find clear definitions for them.

    But basically, the block diagram I posted is a subVI that you call once at the initialization of you application in "init" mode and feed it with the panel ref of your main front panel (here I'm assuming you have mono-front panel user interface), then the shift register will keep that panel ref during all the execution of your application AND it will also retain the last state you set, therefore from anywhere in the application you can call again this subVI to set the defer panel update ON or OFF and the change will be made only when necessary.

    Here's a hint :

    post-7452-0-10478500-1306506031_thumb.pn

  13. Thanks for the response.

    I'm only slightly confused on what an action engine is... is this a state machine or an event structure?

    The program that this is inside is quite complicated with quite a few loops, so it's almost impossible to utilize shift registers since other loops need to defer updates as well. (Would this work if I added another event loop?)

    Also, just trying to understand your provided diagram... is the while loop that you've provided, that is a one-time-run (true on the stop terminal), made to keep those shift registers populated within a subVI? Does this require any settings to work?

    Thanks again!

    Don't report, simply report your message to moderator and ask for the post to be moved.

    Regarding your question, here's my suggestion :

    post-7452-0-08525400-1306501215_thumb.pn

    When you start your application, put the panel ref into an action engine (init case) and then where-ever when-ever in the application call the action engine to set which-ever state (deferred / un-deferred) you want.

    Hope this helps

  14. In my front panel, I defer updates frequently to prevent piecemeal updates. I have a subVI to defer/un-defer updates, sometimes when the VI comes to this piece of code, updates have NOT been deferred (in other pieces of code). Is it more efficient and faster to read from the 'DeferPanUpdts' property and if it is false, already, skip the rest of the code? Or is it better to just blindly write false to the 'DeferPanUpdts' property... Blindly writing false will cause a single Write action, checking would cause always a single Read, and sometimes a Write. (sometimes is likely a decent percentage of the time...).

    Images below:

    post-21933-0-64065600-1306498955_thumb.j

    Checking the Defer Update before writing false.

    post-21933-0-38302000-1306499055_thumb.j

    Defer SubVI.

    Thanks!

    EDIT: I realize this might better be posted in the GUI sub forum... if a moderator could move it, that would be fantastic, if not... please accept my apologies for posting in the wrong forum, I question whether I should repost...

  15. This sounds fairly standard to me, not quite as complicated as you make it out to be. My usual approach is to make the GUI the top-level VI and call the processing/acquisition VI(s) as subVIs, usually running in independent execution subsystems, with a cluster of queues, notifiers, or user events to handle communication between the GUI and the processing. The GUI may have several loops - one for handling events, another that constantly reads data from a queue and displays it.

    I recently inherited a system with a very different architecture; the GUI itself is fairly lightweight, and each hardware device has its own subsystem with a GUI that runs in a subpanel, again with queues and user events to pass data back and forth. The main executes sequences by sending commands to the hardware subsystems in the appropriate order.

    Can you be more specific about why your subpanel doesn't load? It should not be an issue of "too complicated." Do you get any error when you try to load it?

    Thanks for the reply ned. I suppose that it seems complicated due to the sheer number of loops involved (i.e. event driven master/slave (2 loops) plus the data acquisition loop, and a slave parser loop then adding the event driven real time gui (3 loops). I have been working on labview for a while, but am only recently getting the hang of it from a development standpoint (and sometimes wishing I were back in C!), so I don't know how well LV will handle all of these tasks in parallel. I was trying to simplify the code size of the GUI by splitting the two up... but it seems like the best approach might just be to put them together.

    The loading of the subpanel gives no real error. Just that none of the controls/colors/indicators or anything else shows up... it's the same blank screen as before it was "loaded." I can, however, load some smaller VIs that have only simple controls (the current gui does a LOT of image work). Also the fact that I'm using system and custom controls may be an issue? I don't exactly understand the utility of subpanels in this instance, it seems like putting it all together might be the best option...

  16. I'm writing a fairly complicatedlabview program that includes data gathering, computation, graphical display, and an easy-to-use (but cool-looking) user interface.

    The program is currently modular. i.e. The GUI can run in parallel with the data acquisition/computation.

    The GUI is event driven, but longer computations will queue triggered states for processing so that these events will not slow down event processing and gui responsiveness. The GUI will also have to periodically read from a database and do processing on the data that is returned, which in turn, causes updates to the front panel and image.

    The data acquisition is based on a periodic serial read/write as well as writes to a database and calculations on data coming back.

    -What is the best way to do this?

    -Does anyone have any experience with very complicated code architectures and can offer tips?

    -I was thinking about placing the GUI into a subpanel within the daq/parser, but it doesn't load (possibly too complicated?)

    Thanks, any help is greatly appreciated!

  17. Hi all, this is my first time posting and I'm looking for some advice on how to scale and superimpose two images into one picture control. The behavior that I'm looking for is shown below.

    The first figure is the two images (imagine that they're different images instead of the same image scaled at these two different sizes).

    post-21933-0-20341200-1299509964_thumb.j

    The next image is the desired output. Both images have been rescaled to the same (smaller) size. The text on top is just text labels that do not necessarily need to be included in the transform.

    post-21933-0-61607800-1299509975_thumb.j

    Thanks in advance for any help!

    Erik

×
×
  • Create New...

Important Information

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