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.
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.
04-15-2014 05:00 AM
LabVIEW 2013
SQL Server 2012
I have a VI that reads an image directory and the user can cycle through the images with a next and previous button. The image directory is stored in the SQL database just wondering how would I cycle through the images and display the information on the images that is stored in the database sequentially as the user cycles through the images?
04-15-2014 06:47 AM
04-15-2014 06:49 AM
04-15-2014 07:04 AM
Hi PauldePaor,
May be displaying the image info over the image is a tough task,but you can display that info beside the image.Intially you need to read the whole database in one go and store that info in a global variable.For that please keep a flat sequence and keep the database reading part in the first frame.Then in the next frame you put the logic of sequencing thorugh the images by pressing the next button or previous button and at the same time please read the information from the global variable as well...
I cant place the code at the moment as i dont have database connectivity toolkit...
Regards,
SrikrishnaNF
04-15-2014 08:07 AM
Wow. Er - PauldePaor, don't do that!
SrikrishnaNF: The data is already in a data structure (database) so pulling that all into working memory is pointless. I even have demonstrations that show SQL is faster than working memory for very large datasets. A global variable, and sequence structure? These are not on the list of best practices, espescially with small applications like this!
PauldePaor: Am I thinking correctly that a database record will resemble:
Table Images [File path, info field 1, info field 2, info field 3]
I would reccommend starting from the New... Event driven producer consumer pattern
The consumer will be responsible for reading a database entry and displaying data in indicators, and the event structure captures user input.
This should do away with all of your local variables (passable exceptions would be for initialising input / control values)
Currently you have some data processing in your event structure. What you have is OK, but to maintain a responsive UI, the Event structure should be minimal.
04-15-2014 08:12 AM
Attached is a copy of the database layout. I would like to be able to cycle through the images and each element in the database corressponds to that image. As the user is cycling through the images the data from the database updates with the change of image.