LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to myrio connect sql server

I want to use myrio to connect sql server but I don't know how to do it.

help me please

0 Kudos
Message 1 of 10
(1,813 Views)

I hope you understand that the myRIO runs a real-time operating system which is designed to run without keyboard and display, that is, without directly interacting with a human operator.  It does have an Ethernet connection, so can potentially connect to a SQL Server, but it would largely have to do it without operator (or "human") interaction.

 

So why a myRIO?  

 

Bob Schor

 

0 Kudos
Message 2 of 10
(1,788 Views)

I'm studying and doing a project on machine vision, license plate verification and using myrio as a problem. I want to store license plate data in sql server (I'm Thai, not good at English).

thank you

0 Kudos
Message 3 of 10
(1,758 Views)

Thank you for providing a little more information on your Task.  Here is what I think are key elements of what you want to do:

  • Use a Camera to acquire images.
  • Use Vision processing techniques to identify "License Plates" in these images.
  • Analyze the "License Plates" and extract "Data Fields" (perhaps License Number, Expiration Date, Country, Date/Time).
  • Store Data Fields in a SQL Database.

The first three are fairly challenging problems in Image Analysis.  Nothing about this task suggests that a myRIO, a LabVIEW Real-Time platform designed for the Academic market (meaning it is relatively inexpensive and has limited on-board resources), would be a superior platform to a modern Windows PC.  In particular, because the myRIO runs the LabVIEW Real-Time Linux operating system, it has no User Interface (outside of being seen as a Real-Time Target of a LabVIEW RT Project run on a "regular" PC) and cannot independently connect to the Internet to access a SQL Server.

 

If you are going to use LabVIEW Vision tools to do the first three elements listed above, and a PC is necessary to do the fourth, why not start developing all of the project on the PC?  You will need the same LabVIEW Vision "tools", whether you are working on a PC (with a lot more memory and disk storage than the myRIO) or trying to squeeze the as-yet-undeveloped Vision Analysis tools onto the myRIO platform.

 

Bob Schor

0 Kudos
Message 4 of 10
(1,726 Views)

Aside from what Bob Schor said about Vision on the myRIO, there is no simple way to talk from the myRIO to a Microsoft SQL server.

 

Technically it is possible but in reality it is more hassle than you want to put up with. 

1) Microsoft has an unixODBC driver for Linux. But the myRIO is not your normal Linux system with Intel CPU but an embedded Linux system with ARM CPU. Embedded Linux is often already enough to make it hard to impossible to install a standard Linux package but the ARM CPU makes it definitely impossible. If you had the source code for this driver, you could try to compile it yourself but it is not Open Source. Even if you got that working you still would need to interface to unixODBC somehow. While that is possible through the Call Library Node it is a lot of work. I’m not aware of a public project that I could recommend for this and interfacing to ODBC through the Call Library Node is though work. I did it in a long ago past on Windows and ended up developing a wrapper DLL to adapt the ODBC API to a more LabVIEW friendly API that could be more easily called through the Call Library Node. But that was a large effort and only possible because a client paid for a significant part of that time, since their own proprietary ODBC driver wouldn’t work with the SQL Toolkit as provided by NI and having their own developers debug and change that driver would have been even more expensive as it was used in regulated industries and even changing a single bit on that driver would have required a full recertification for it.

 

2) The TDS protocol over TCP/IP could be implemented directly in LabVIEW with the native TCP nodes. Microsoft even has several documents describing it. But it is a binary protocol and fairly involved and you could easily make an entire project of its own out of implementing it in such a way, There is a potential gotcha since some of the security enhancements in newer SQL Server versions aren’t fully documented and would be definitely a challenge to implement natively in LabVIEW even if fully documented. Crypto stuff is hard and tricky to tackle.

 

3) There is an Open Source project FreeTDS which implements this in C. It started with information from Sybase as Microsoft originally bought the rights for SQL Server from them and then developed it further and released it as SQL Server. For a long time this driver would work for SQL Server but lagged the SQL Server protocol.considerably since Microsoft did not publish the protocol extensions introduced in newer SQL Server versions and the project had to rely on reverse engineering these things to add support for new SQL Server features.

You could grab that source, compile it for the myRIO and then create LabVIEW bindings by making VIs that call this shared library with the Call Library Node. This isn’t trivial either but definitely possible if you don’t shy away from doing your own compilations and understanding how you need to call shared libraries in general and this specifically. It’s definitely a serious amount of work.

 

Quite a few people have asked for this in the past and there where some attempts to support it. For something to just provide for free on the net it is way to much work and to specialistic. On the other hand the potential interest is very limited so that selling it as Toolkit is either making the license extremely expensive and won’t sell or the revenues won’t even pay for the effort to maintain and support it let alone to develop it!

 

This thread: https://forums.ni.com/t5/LabVIEW/Connect-to-SQL-Server-from-cRIO-with-NI-Linux-Real-Time/td-p/357935... is still the current state of affairs in this topic.

Rolf Kalbermatter
My Blog
Message 5 of 10
(1,700 Views)

Actually as far as point 1) goes, there is one project that may be interesting to investigate as far as accessing the unixODBC interface is concerned: http://sql-lv.sourceforge.net/

 

However this still leaves the issue of the MS SQL Server ODBC driver not being compiled for Linux for ARM.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 10
(1,683 Views)

If you can use MySQL, you can use this library on a M<yRIO.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 7 of 10
(1,668 Views)

Hi Mark,

 

thank you for the library !

Two files are missing:

 

Parse DSN file.vi

Parse DSN string.vi

 

Could you include them?

 

 

BTW: The NI LabView Database Connectivity Toolkit will not work on MyRIO ?

 

Thank you and 

BR

-------------------------------------------------------------------
Eugen Wiebe
Bernstein AG
CLAD - Certified LabView Associate Developer
0 Kudos
Message 8 of 10
(1,644 Views)

@EWiebe wrote:

 

BTW: The NI LabView Database Connectivity Toolkit will not work on MyRIO ?

 

Thank you and 

BR


No of course not. It uses ADO/DAO, just as pretty much every other Database library out there. This is ActiveX and therefore only works under Windows. And not enough, even if you get the sql-LV library mentioned in my last response you are not yet there. It allows accessing the ODBC manager but the native MS SQL for Linux driver is only compiled for x86/x64 Intel CPUs and can't run on the ARM CPU that the myRIO has.

 

If you are very daring and don't mind using the command line and digging into C compilers and such, you could grab the sources from the FreeTDS project, try to compile them on your myRIO after you installed the GNU development essentials with OPKG and then try to get the resulting odbc shared library installed in unixODBC and then start experimenting with the sql-LV code. However that code seems to do some DB specific stuff and might have to be expanded to also support the FreeTDS MS SQL operations.

Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 10
(1,638 Views)

Sorry for the delay in posting these.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Download All
0 Kudos
Message 10 of 10
(1,575 Views)