From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I write to 4 different tables in database at the same time

I have .mdb file which has 4 tables for each hardware, I have a labview main program which calls 4 sub programs for each hardware, all these 4 subprograms run parallely.

 

One might finish one test early or late by milli seconds or seconds, the data has to be written to database file which has 4 tables inside.

 

I am planning to open reference in main program and use the reference in sub programs, I will write to Table 1 for first sub program , table 2 for second sub program and so on,

 

My question is can we write into one database file having 4 tables parallely/simulataneously? If no why?

0 Kudos
Message 1 of 4
(2,278 Views)

Try it.  It should work.  As long as you are opening the database once, and passing the reference around, I don't see how it would not work. 

 

You may run into troubles if two subvi's are trying to write simultaneously.  If so, use semiphores to lock out the action until done. 

 

Or you could use a producer consumer architecture where the producer would queue up the table name and data, and the consumer would write to the database.  The producer can be replicated in each subvi.  In other words, each subvi will contain its own enqueue code.  All subvi's and the consumer loop would have to run in parallel.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 4
(2,269 Views)

It shouldn't be a problem, although Access (.mdb) isn't well known for it's multitasking performance.


I'd suggest switching to SQL server, the free SQL Express should be plenty in this case in case you dont have the big one.



/Y
Message Edited by Yamaeda on 04-29-2010 10:11 PM
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 4
(2,257 Views)

could you explain me how you are inserting the measurement data...? in samples or 1 seconds for each?..

 

because i already tried to insert  the raw data, i means  i was try to insert the 1000samples per seconds data in to sql server 2000, it shows error.

 

it was not inserting yet.

 

can you suggest me how to insert bulk data (lets say 1K samples/ second) using SQl server....?

 

 also i would search my data by time base. 

Regards,
Balaji DP
0 Kudos
Message 4 of 4
(2,239 Views)