LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Philip C.: Question for you.

Hello,
 
You once helped me answer a question about DB Connectivity Toolset and MS Access.
 
I have this VI that is supposed to enter the data (slope,y-intercept) into MS Access table.
 
My VI has nothing wrong with it(as far as wiring error), but when I highlight execution, the execution is not going through my subVI that gathers my slope and y-intercept from notepad and it also is not execution the insert.vi.
 
I believe you have DB Connectivity Toolset installed and you are a NI employee, so I figured you would be a good person to try to answer my question.
 
Thanks for your help.
Download All
0 Kudos
Message 1 of 7
(3,235 Views)
Well hello Robot,

I'll help you with your VI but for that I need you to submit the missing "slope-yintercept.vi" SubVI so I can troubleshoot what's going on.

From what I have now I can tell you that the code including SubVIs inside the loop WILL execute as long as "Numeric" is at least 1. If "Numeric" is 0, then the loop will NOT execute. Is that the issue?
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Message 2 of 7
(3,195 Views)

Hello,

Nice to see your e-mail. Thanks for getting in touch.

I will attach the slope-yintercept.vi.

I was looking at the other questions in the forum, and I noticed some that maybe I could learn from.

My question, in addition to the above, is what does the connection reference in, connection reference out supposed to do when I run it. I can make it run, but I do not see anything in my Front panel.  I ask because this may be a link that could tie things for me conceptually.

Thanks for your patience.  I have to admit, as I understand LabVIEW more, I am beginning to enjoy it.

 

Download All
0 Kudos
Message 3 of 7
(3,177 Views)

ExamplefromForum.vi came from:

http://forums.ni.com/ni/board/message?board.id=170&message.id=155785&query.id=58146#M155785

I just wanted to know in the grand scheme how this vi would fit to work and the results reflected in Front panel. 

But my main question for you was how to get my calibration(in notepad) that I had created into a vi(slope/yintercept.vi) to be written into MS Access.  I hope my question is clear.  I believe I have created a vi that writes into the database but for some reason it does not reflect this when I run it in Front panel.

Thanks for your input. 

0 Kudos
Message 4 of 7
(3,156 Views)
Hi Robo,

Sorry, but I'm not sure I understand what you're going after. However, I see some issues in the VIs you have submitted. The "file path" connection in the "slope-yintercept.vi" is supposed to point at a spreadsheet file, but in the "DATA.vi" you are passing it a the "connection information" that is used to specify the file that stores the connection information to the database. For a Microsoft Data Link file this must have a .udl extension. The database Data Link file is completely different from the spreadsheet file that you can read in a simple text editor. You will have to use seperate paths to point at the spreadsheet file and the database Data Link file.

The "ExamplefromForum.vi" executes a query in the database - it doesn't save any new data. That's not the behavior that you are looking for, right?

The "DATA.vi" seems to be close to what you are looking for if you just use two different paths as described above. Notice how the "connection reference" is used to pass between the database VIs to keep pointing at the same database. You really can't use the "connection reference" on the front panel of the VI to other than as a terminal if the VI is used as a SubVI.

I hope this makes sense - otherwise, please let me know.

Have fun - and more of it with LabVIEW 8!
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Message 5 of 7
(3,125 Views)


Philip C. wrote:
Hi Robo,

Sorry, but I'm not sure I understand what you're going after. However, I see some issues in the VIs you have submitted. The "file path" connection in the "slope-yintercept.vi" is supposed to point at a spreadsheet file, but in the "DATA.vi" you are passing it a the "connection information" that is used to specify the file that stores the connection information to the database. For a Microsoft Data Link file this must have a .udl extension. The database Data Link file is completely different from the spreadsheet file that you can read in a simple text editor. You will have to use seperate paths to point at the spreadsheet file and the database Data Link file.

The "ExamplefromForum.vi" executes a query in the database - it doesn't save any new data. That's not the behavior that you are looking for, right?

It is the behavior I am looking for in this query. I do want to save all the new data, slope/yintercept everytime that I open & read the dialog box for 'slope-yintercept.vi.'  That is why I am using the insert.vi so that any new data from my subvi, slope-yintercept.vi, is immediately written and stored in my table in Access.


The "DATA.vi" seems to be close to what you are looking for if you just use two different paths as described above. Notice how the "connection reference" is used to pass between the database VIs to keep pointing at the same database. You really can't use the "connection reference" on the front panel of the VI to other than as a terminal if the VI is used as a SubVI.

I hope this makes sense - otherwise, please let me know.

Have fun - and more of it with LabVIEW 8!

I am! Thanks for helping.




0 Kudos
Message 6 of 7
(3,097 Views)
Hi Roboticstudent,

As I said, by specifying the correct path to the SPREADSHEET file in the path connected to slope-yintercept.vi inside DATA.vi, you should be able to save the slope and intercept to the database. From what you say, you do NOT need to perform a query! A query is used to search for existing data in the database.

What happens if you create an additional path control to specify the path to the spreadsheet file inside DATA.vi? Does it work?
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Message 7 of 7
(3,045 Views)