-
Posts
4,850 -
Joined
-
Days Won
292
Content Type
Profiles
Forums
Downloads
Gallery
Posts posted by ShaunR
-
-
Some might say that's a bad thing,
Others might say you have a life
- 1
-
Ben,
Been reading over this link. A lot of good info. Thanks.
----
This explains what is happening to me:
http://digital.ni.co...62571B5006B46E1
with problems described above(i think)
Looks like a move to a database is in order if you are shifting that much info around. Is MySQL or Access a viable option?
-
OK. I get it.
couple of things to look at.
1. What is the 100823? If it is system time (like in excel etc) I'd expect that to be 40413 for 23/08/2010. Whereas 100823 would be 15/01/2176.
2. From your images. You show 100823 with no directories afterwards. Then you show after the roll-over 2 extra directories (albeit without the 100824). Could it be that the data you are expecting in 100824 is in fact in one of these and your program has skipped when saving for this particular date?
3. Is this the only date it happens on? Does the software quite happily save as you expect but on this particular date it doesn't? You show many directories previously and after the 100824.
4. Looking over the history of results. there are many "gaps" in the data record 100722 suddenly jumps to 100820 (98 days?) , 100531 suddenly skips to 100601 (70 days?) etc. What is the reason a file wasn't saved between those periods? Could it be a case that you just didn't receive any data therefore there was nothing to save?
-
I wish I had an excuse to play around with this, it looks sweet.
You need an excuse? I thought it was our nature to play with this sort of stuff
I concur. Next time I ask myself whether or not to choose a database implementation or simple binary files to store data, I'll try to find some time to try these first...
Keep it in your palette and I'm sure you'll think of something.
-
Currently working on a project with the Requirements below.
Currently about 80% of the project is done as far.
Requirements:
Step 1: Open a .vi, Run when Opened. It reads the PC system date/time and create a new folder of the current system date at a specific directory. (E.g. 25 August 2010.) Folder: 100825 >>> Completed
Step 2: After the Folder is been created, it uses TCP/IP Connection to transmit text data from another computer into the created folder. With the folder containing the text data. >>> Completed
Step 3: With the data collected, it reads the text data in the folder according to the current system date 100825 to produce the output graph chart. >>> Completed
Step 4: The .vi runs continuously, so is the PC system date/time. Running at the time reaches 2359hrs, 100825 ---> changes to a new date, 0000hrs, 100826 >>> Completed
Step 5 (Error Occurs): With a new date/time falls, Error prompt out. The running .vi unable to return back to (Step 1) but stops at (Step 3) with Error occurs.
Need help on the (Step 5) issue.
Been try quite a number of times of ways to solve yet unavail.
Is there anyone out there able to create a simple .vi that containing with the requirements above?
As need that for help as for reference.
Regards,
david.
The Step 1 to 5 sequences keeps on running from Step 1 > 2 > 3 > 4 > 5 over and over again whenever a NEW date falls.
Regards,
david.
If you mean when there is an error condition you are getting an error dialogue when you shouldn't be, then you probably have an unwired error out cluster (or none at all) and "Enable Automatic Error Handling" is set in the offending vis "Execution" properties.
-
I understood that part (my snippet uses the transaction query VI), it turns out that my problem was that I was querying the database for all records at the end of all the INSERTs. Is there any way to speed up a SELECT?
Possibly. This release basically does a "GetRow" and has to iterate for each row. There is another method, but it isn't implemented yet. (Still trying to figure out how to do it....if it is possible in LV).
Do you have a real-time target that uses ETS?
-
This is wonderful. I've begun implementing it in a current project and need to ask about the Query Transaction function.
I was excited to read this comment because one of our current systems takes forever to write to our SQL Server DB. (~30 seconds. I imagine it's executing one SQL INSERT for each step it's reporting.) So, I thought I'd test this in SQLite:
As I played with it I came up with this to see the effect of larger SQL strings:
I've tried each of the locking modes (immediate, deferred and exclusive) but it's taking almost three seconds to complete only 5000 SQL INSERT statements. This is not as fast as the documentation suggests.
What am I doing wrong?
Its not the number of statements. Its the number of "TRANSACTIONS".
When you use the "INSERT" VI in a for loop, each iteration is 1 transaction. Additionally, the insert vi opens the file before the transaction and closes it afterwards for a slightly safer implementation. The insert is for convenience and a bit more safety.
If you want blistering speed. You need to use the "transaction query.vi". this will wrap your Insert statements in the "BEGIN...END" and execute all the statements as 1 transaction.
With the test below. I achieved 10,000 inserts in 609 ms.
- 2
-
So far nothing is working. I have tried Shaun's approach but I am not seeing any events in my top level VI. I attached the simple example that I have been playing with.
You are not generating an event.
I've had a play and it seems that the panel close event isn't really an "OnPanelClose". It is only an event generated by clicking the close button. That's not really what you are after. To also include a boolean you would have to attach to the on-value as well.....too much effort. Might as well put an event after the while loop.
Back to the drawing board
Perhaps the 'VI will be purged' event is something you want?
Ton
I never had a lot of luck with it (maybe because I don't fully understand it). But sometimes it worked, sometimes it didn't.
-
Thanks Shun. This is close but it still requires knowledge of the subVI. This requires that the calling application knows the names of the controls of the subVI for processing. Overall this is a reasonable work around but ultimately I am looking for a truly generic solution which decouples the top level VI from the called subVIs.
All I want to know is when the subVI exited. I don't want to know anything about the internals of the spawned VI nor do I want to require the spawned subVI from having to do anything special to inform the caller that it has exited. It would seem reasonable that the caller should be able to be informed of specific events of the spawned VI.
I do appreciate the suggestions though. And this callback solution could be useful for other tasks.
The example does, yes. Because you don't know what controls maybe on the front panel. But ALL vis have a generic on-close event So don't need to know anything about the sub VI. You just inspect the reference when the event comes in to find out which VI closed.
So the install callback just becomes:
Haven't been through it thoroughly and perhaps not as "clean" as you would like (I suspect you were expecting to just select it with 0 programming). But better than nothing eh?
-
Thanks Shun. This is close but it still requires knowledge of the subVI. This requires that the calling application knows the names of the controls of the subVI for processing. Overall this is a reasonable work around but ultimately I am looking for a truly generic solution which decouples the top level VI from the called subVIs.
All I want to know is when the subVI exited. I don't want to know anything about the internals of the spawned VI nor do I want to require the spawned subVI from having to do anything special to inform the caller that it has exited. It would seem reasonable that the caller should be able to be informed of specific events of the spawned VI.
I do appreciate the suggestions though. And this callback solution could be useful for other tasks.
The example does, yes. Because you don't know what controls maybe on the front panel. But ALL vis have a generic on-close event So don't need to know anything about the sub VI. You just inspect the reference when the event comes in to find out which VI closed.
So the install callback just becomes:
Haven't been through it thoroughly and perhaps not as "clean" as you would like (I suspect you were expecting to just select it with 0 programming). But better than nothing eh?
Oppps. Posted on wrong thread...lol.
-
You can attach your own "user event" on launch by using a callback function. I've only ever used it to hook the other VIs front panel controls' events, but it should be possible to hook the on-close event. You are still generating a User Event, but as the callback is attached to any VIs you launch yo'd only have to do it once, and you wouldn't have to write any code in the VI your are trying to hook.
-
Without requiring the spawned task (subVI) to post a message to a queue, can the top level application that spawned the task detect that the subVI exited? That is, if the top level application opens a reference to a vi (using a VI template) and then runs it. When it runs it it doesn't wait for the VI to complete so it truly spawns a new task. I tried catching the spawned task's close using the Application Close and Panel Close events but neither detect the close. I know that I could have the subVI generate a user event or post a message to the queue but I was trying to catch the exit in an autonomous manner. I wanted to avoid having to pass anything to the subVI (the user event reference or queue name) as well as avoid the spawned task from knowing that it was invoked by another VI. In C when you fork a process you can catch the signal when it exits without the spawned task needing to do any special processing on it's exit. It would seem like we should be able to do this but so far I haven't found it.
Check the "VI's in memory" list?
-
That's another story... I'll do it soon. Here is some preview
Can't wait for the Labview version of Halo
-
- Popular Post
- Popular Post
Name: SQLite API
Submitter: ShaunR
Submitted: 05 Oct 2010
File Updated: 05 Jan 2011
Category: Database & File IO
LabVIEW Version: 2009
License Type: Other (included with download)
SQLIte API
This LAVA Code Repository Download is no longer distributed or supported by LAVA.
Please follow this link for further support.
Description:
This is a Labview API wrapper for the SQLite dll.
From the authors of SQLite:
"SQLite is a in-process library that implements a self-contained,
serverless, zero-configuration, transactional SQL database engine.
The code for SQLite is in the public domain and is thus free for use
for any purpose, commercial or private".
More information can be found on the SQLite website http://www.sqlite.org.
The LabView API contains all the basic SQLite features but it is not a full implementation.
However, it is comprehensive enough to satisfy most application requirements for
a databse enabled application and the featurelist will grow with each new release.
Currently supported features include:
Creating, deleting, listing and renaming tables and columns.
Selecting, inserting, updating and deleting records.
Retrieving SQLite system informaion.
"Onlne" database backup.
"On Insert", "On Delete" and "On Update" Triggers.
File Import.
Query Saving.
Installation:
Unzip to a directory of your choice.
Install the pallet menu file (.mnu) provided.
Required Packages:
Labview (Win x32, x64,) 9.0 or greater.
SQLite DLL (Included).
Supported Environments.
Windows x32, x64
Known Issues.
Cannot use semicolons ";" in values when using "Query Transaction" polymorphic instance.
Workaround: Replace semicolons with another character (e.g. tilda "~") or use the standard "Query" or "Query By Ref" VIs.
Versioning:
Current version 1.2.1
New Feature: Added "Conflict Clause" to SQLite_Insert and SQLite_Insert Table.vi (allow replace, fail ect)
Performance: Changed "SQLite_Prepare.vi" and "SQLite_Bind.vi" to pass data as a U8 array rather than string.
Performance: Changed "Insert" (SQLite_Insert Row.vi) to use "Insert Table". (All inserts now use prepared statements.
Performance: Changed some low level VIs to re-entrant for better concurrency.
Bug Fix: Changed all polymorphic API VIs to show instance icon.
(some context help for VI was not being displayed when set to polymorphic VIs' icon)
Bug Fix: Exposed "Distinct" boolean on "SQLite_Select.vi". (No terminal on compane).
Bug Fix: Replaced some cursor "Unset Busy" with "Set Busy" in SQLite DB Manager.
Bug Fix: Changed "SQLite_Bind.vi" to force sqlite dll to use local copy of data.
(Fixes reported bug in LVx32 insering the same data in multiple columns).
Changes: Changed icon on "Insert Table" to make more visually discerning from "Insert".
Version 1.2.0.0
See changelog.txt.
Special Thanks to
Gepponline
MattW
Contact:
PM ShaunR on lavag.org (http://www.lavag.org)
This LAVA Code Repository Download is no longer distributed or supported by LAVA.
Please follow this link for further support.
- 3
-
It seems that the amount of work involved isn't proportional to the price you're suggesting. Why so much? I can't afford it
If it is full blown implementation then it is a lot of work. I think, however, most people only need/use the basics. I just hope its not ADO or .NET.
- 1
-
Too bad they don't have something that goes the other way.
I wonder how well this actually works.
I assume its an offshoot from their embedded tool kits (you can't run LV on for example an ARM processor). where you write stuff in LV and it generates the C code which you then have to compile using a C compiler. The other way round would be awesome.
-
Can't wait for the JKI Virus Scanner
-
-
I just realized I'm about to hit 500 posts on LAVA. I would have probably preferred if #500 was a deep treatise on some esoteric feature of LabVIEW that will change the programming world as we know it. But we all know that ain't happening anytime soon. Maybe post #1000...
Cat
Do we get cake?
-
Where can I buy one of those buttons? And does it come with LV drivers?
-
See, this is just more proof I'm not a true LV geek.
So what are you trying to say Cat eh?
-
I've used the Sick LMS200 before - it's a pretty neat sensor that's easy to integrate with: http://www.pages.dre.../sick/sick.html
$5,771.42
For that price I'd expect it to take out scud missiles from 10 km
-
Hello there...
Actually i doing a thesis about "Automated Car Parking System by using LabVIEW" ..
i have to design a system the can controlled a car in and out, counting and then will know have many parking left,
to make a driver feel convenient..
I have facing a problem to know how LabVIEW can detect physical system like sensor. and through the sensor can be a counter to counting a car in car park./
Hopefully, anyone which have a knowledge can share with me...
Thank you..
Labview is designed for interfacing to sensors.
What is your budget?
How much time do you have?
Can you build simple or complex electronic kits?
Can you program micro controllers?
Can you use a multi-meter?
Don't be frightened by the questions. I'm just trying to get an idea of your skills.
-
Hi all,
Where can I find the internet tool kit for LabVIEW 8.6(Internet toolkit 6.0.2)? I searched in NI site. But I cannot able to find it? Could you please help me for finding this?
I have 2010 toolkit. But no 6.0.2 for 8.6 version of LabVIEW
Thanks in advance,
Suresh Kumar.G
I believe 6.0.2 is the one shipped with LV2010. Its for versions 8.6 and above.
Need Help BADLY! Require a simple VI for reference. Stuck.
in LabVIEW General
Posted · Edited by ShaunR
I gave you the answer to to that in my first post. (You can press continue by the way).
Check the VI properties of all your VIs and make sure this is unchecked.