06-13-2017 02:46 AM - edited 06-13-2017 02:48 AM
how can we create a database or questions { a place where some set of pre-defined data is kept } and also to retrieve information randomly and display n the front panel??
Anyone please help me out in creating a pre-defined database and retrieving that information randomly
Solved! Go to Solution.
06-13-2017 06:10 AM
You already started down the simple route: use a simple text file. Each line in the text file should be a new question. If you right-click on the Read From Text File, you will see an option to "Read Lines". Enable that and set your number to read to -1 (read all lines). You will now have an array of questions.
Now you just have to figure out the randomization. There are plenty of examples on that, but see how far you can get and let us know where you are stuck.
06-14-2017 01:26 AM
though.. i select read all lines also , the obtained result form the text file to labview is in different language i.e i mean the result is showing in different format not as it is given in the text file also how to obtain randomly those queries from the text file ?? help me out how to randomise if possible provide some info abbout randomisation methods ??
06-14-2017 02:11 AM
Hi ivan,
the obtained result form the text file to labview is in different language i.e i mean the result is showing in different format not as it is given in the text file
Does LabVIEW translate the text from one language to another language? I don't believe this… 😄
Does you text contain any Unicode characters? LabVIEW isn't good at handling such char encodings and reads your text as plain ASCII by default!
(Maybe you should provide your VI and an example text file to help us solve your problem…)
help me out how to randomise
There is a random() function in the numerics palette…
06-14-2017 02:28 AM
different language means .. there is a different format showing in string (result) indicator
06-14-2017 02:40 AM
06-14-2017 02:48 AM
here i selected some random question in the text file .. also with previous version vi
06-14-2017 05:57 AM
07-02-2017 12:50 PM
Greetings !
i would like to select a random line from the given text file without taking the empty spaces .i.e it is taking empty spaces also though i specified read lines in read from text file icon .
Is there any option to make like 'it should only take the lines upto which i specified but not going beyond which results in empty spaces in the display.
07-02-2017 01:17 PM - edited 07-02-2017 01:17 PM
I have a VI that specifically goes through the array of strings and removes the empty strings. This is what I recommend you do.
