LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Monitoring database updation / LAN connection

I have a database (SQL) installed in server and all other PC is connected throught LAN. I am running one application in remote PC in which continous testing is running and status is updated in database.

 

During testing if LAN is disconnected then database updation will be failed and hence record won't be added to database.

 

How to ensure record I am writing to database is written without reading it back?

 

My only objective is to ensure that LAN is connected and record is continously updated 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 1 of 14
(2,472 Views)

You can change the write to a Transaction which should give higher security. If the transaction fails it wont write and you'll get a message so you can try again later or write to a file in the mean time.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 14
(2,466 Views)

I read  somewhere about DB transaction but I am not sure how to implement it? How it gonna help me.

 

Can you please elobrate !!!

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 3 of 14
(2,444 Views)
Transactions are useful for making multi-step operations atomic. The most reliable way of accomplishing what you want is through a process called Replication. For this to work, you have an instance of the free version of SQL Server running on your PC. That is the only database you application ever talks to. You then setup replication between SQL Server on the PC and SQL Server on the network. At that point SQL Server will handle the transfer of data automatically and your application doesn't need to know anything about it. Try Googling it, there's a lot of information available online.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 4 of 14
(2,437 Views)

Let me say again few more words about my application,

 

At one stage testing will be running and serial number along with other information will be updated to server, at later stage other application will check whether same serial number is present or not?

 

If somehow during testing LAN disconnected then record wont be added to database and later stage it will generate error becasue same serial number is not updated(although its been tested but not updated in server becasue LAN was disconnected ) 

 

Hence I want is if inbetween LAN disconnected then during writing it should say error.  I had a choice that I can read the error out value and if it is non zero then I can say fail but if any other warning occured than also it will generate error 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 5 of 14
(2,432 Views)
I don't understand what issue you are trying to solve. Being able to trap a non-zero error value (warning or error) is trivial. I would recommend the suggestion of storing locally as well. I did this with 50+ test stations and designed a similar set-up for a 1000 station deployment.
0 Kudos
Message 6 of 14
(2,423 Views)

@Dennis_Knutson wrote:
I don't understand what issue you are trying to solve. Being able to trap a non-zero error value (warning or error) is trivial. I would recommend the suggestion of storing locally as well. I did this with 50+ test stations and designed a similar set-up for a 1000 station deployment.

Ok lets say error out value approach is trivial but how storing locally will solve my problem?

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 7 of 14
(2,420 Views)
You would update the database from the local storage. If your network is down, you have the data. You could have s separate program that just checks for a valid connection periodically and updates the remote database.
0 Kudos
Message 8 of 14
(2,406 Views)

@Dennis_Knutson wrote:
You would update the database from the local storage. If your network is down, you have the data. You could have s separate program that just checks for a valid connection periodically and updates the remote database.

Thanks, but instead of making seperate program its better to read it back and check.

 

I was looking for simple alternative. 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 9 of 14
(2,399 Views)

If you want a simple solution, that is replication. You see replication works both ways. The network database keeps your local copy updated with new data that it has and which you will need, and your local copy keeps the network database updated with new data that you generate. You don't have to do anything, the two copies of SQL Server handles it all between themselves.

And for what it's worth, I have been using databases with LV for over 20 years and have never seen a single instance where an INSERT or UPDATE ran error-free to completion and the data wasn't in the database. If that's your concern, there is nothing to worry about.

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 10 of 14
(2,372 Views)