How to randomly select data from excel using labview.
A very good day to all. I am actually working on a system that will be selecting integer number from randomly generated set of number. If that wouldnt be possible, I would like the system to be able to select number from the set of numbers which have already been randomly generated from excel. kindly help me with the solution. To make myself clear, supposing I have set of numbers from 1 to 10, I want a labview setup that will be picking these numbers one after the other either with replacement or without from excel or self generated. I know this is possible in matlab but would prefer labview if possible. Thanks
Solved!
Go to Solution.
Most, if not all, of the languages I've run across have a rand() function that returns a random number between 0 and 1. Getting some other range is up to the programmer. Usual method is to multiply by the range you need and add an offset to adjust the mean. For instance if you need a random number between 200 and 300 the formula might look like " rand()*100+200 ". If you need an integer, you can use the round function (which will leave it as a float with no decimal pportion) or the conversion (to int). All of this is doable and straightforward in LabVIEW. Have a look: http://digital.ni.com/public.nsf/allkb/FCCDCD678EEF3A9186256D7B008054F5
If you feel more comfortable pulling from a file, try this: http://digital.ni.com/public.nsf/allkb/C944B961B59516208625755A005955F2
Similar Messages
-
How to read the data from Excel file and Store in XML file using java
Hi All,
I got a problem with Excel file.
My problem is how to read the data from Excel file and Store in XML file using java excel api.
For getting the data from Excel file what are all the steps i need to follow to get the correct result.
Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
Thanks & Regards,
Sreenu,
[email protected],
india,If you want someone to do your work, please have the courtesy to provide payment.
http://www.rentacoder.com -
How to load the data from excel file into table in oracle using UTL_FI
How to load the data from excel file into table in oracle
and from table to excel file
using UTL_FILE package
Please give me some exampleThis is something i tried in oracle apex
http://avdeo.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
Regards,
CKLP -
How to Load the data from excel file(Extension is .CSV) into the temp.table
Hi
How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
Kindly Suggest the Solution.
Regards,
SachinHello Sachin,
You can use the following metalink note:How to Read Data from an EXCEL Spreadsheet into a Form Using Webutil Client_OLE2 (Doc ID 813535.1) and modify it a little bit.
Instead of copy values into forms you can save them in your temporary table.
Kind regards,
Alex
If someone's helpful or correct please mark it accordingly. -
Problem with uploading data from excel using BDC for tcode f-02
Hi All,
I am uploading data from excel using BDC for tcode f-02. The problem here is, while recording, the values of some fields are recording twice. I dont know why it's happening so. But if I run my abap program, I have to give those fields twice in my excel sheet. Otherwise data does not upload. But it is not the feasible way. We must give those fields once in excel. Please tell me, how I can solve the issue.
With regards,
Rosaline.Hi,
in BDC each and every action is recording. If your press enter in same screen that also recorded once aging may be this is your case repeating field values will appear. we can solve the problem for repeat fields like below.
suppose in your excel having repeated field X1 X2 X3 the X2 contains repeated field X3 means delete the X3 field.
Now In your itab having X1 and X2 fields. While in the LOOP the ITAB pass the X2 field to repeated the fields.
LOOP at ITAB to WA.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'BDC_CURSOR'.
bdcdata_wa-fval = 'RM08M-EBELN'.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'INVFO-BLDAT'.
bdcdata_wa-fval = wa-X2." 1st time pass the X2 fields
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'INVFO-BLDAT'.
bdcdata_wa-fval = wa-X2." pass the same value to repeated field
APPEND bdcdata_wa TO bdcdata_tab.
Endloop.
Hope you can understand.
Regards,
Dhina.. -
How to load the data from excel file into temprory table in Forms 11g?
Hi
How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
Kindly Suggest the Solution.
Regards,
SachinDeclare
v_full_filename varchar2(500);
v_server_path varchar2(2000);
v_separator VARCHAR2(1);
v_filename VARCHAR2(400);
filename VARCHAR2 (100);
v_stop_load varchar2 (2000);
v_rec_error_log varchar2(4000);
v_error_log varchar2(4000);
ctr NUMBER (12);
cols NUMBER (2);
btn number;
RES BOOLEAN;
application ole2.obj_type;
workbooks ole2.obj_type;
workbook ole2.obj_type;
worksheets ole2.obj_type;
worksheet ole2.obj_type;
cell ole2.obj_type;
cellType ole2.OBJ_TYPE;
args ole2.obj_type;
PROCEDURE olearg
IS
args ole2.obj_type;
BEGIN
args := ole2.create_arglist;
ole2.add_arg (args, ctr);
ole2.add_arg (args, cols);
cell := ole2.get_obj_property (worksheet, 'Cells', args);
ole2.destroy_arglist (args);
END;
BEGIN
v_full_filename := client_get_file_name(directory_name => null
,file_name => null
,file_filter => 'Excel files (*.xls)|*.xls|'
||'Excel files (*.xlsx)|*.xlsx|'
,message => 'Choose Excel file'
,dialog_type => null
,select_file => null
If v_full_filename is not null Then
v_separator := WEBUTIL_CLIENTINFO.Get_file_Separator ;
v_filename := v_separator||v_full_filename ;
:LOAD_FILE_NAME := substr(v_filename,instr(v_filename,v_separator,-1) + 1);
RES := Webutil_File_Transfer.Client_To_AS(v_full_filename,"server_path"||substr(v_filename,instr(v_filename,v_separator,-1) + 1));
--Begin load data from EXCEL
BEGIN
filename := v_server_path||substr(v_filename,instr(v_filename,v_separator,-1) + 1); -- to pick the file
application := ole2.create_obj ('Excel.Application');
ole2.set_property (application, 'Visible', 'false');
workbooks := ole2.get_obj_property (application, 'Workbooks');
args := ole2.create_arglist;
ole2.add_arg (args, filename); -- file path and name
workbook := ole2.get_obj_property(workbooks,'Open',args);
ole2.destroy_arglist (args);
args := ole2.create_arglist;
ole2.add_arg (args, 'Sheet1');
worksheet := ole2.get_obj_property (workbook, 'Worksheets', args);
ole2.destroy_arglist (args);
ctr := 2; --row number
cols := 1; -- column number
go_block('xxx');
FIRST_RECORD;
LOOP
--Column 1 VALUE --------------------------------------------------------------------
olearg;
v_stop_load := ole2.get_char_property (cell, 'Text'); --cell value of the argument
:item1 := v_stop_load;
cols := cols + 1;
--Column 2 VALUE --------------------------------------------------------------------
olearg;
:item2 := ole2.get_char_property (cell, 'Text'); --cell value of the argument
cols := cols + 1;
--<and so on>
ole2.invoke (application, 'Quit');
ole2.RELEASE_OBJ (cell);
ole2.RELEASE_OBJ (worksheet);
ole2.RELEASE_OBJ (worksheets);
ole2.RELEASE_OBJ (workbook);
ole2.RELEASE_OBJ (workbooks);
ole2.RELEASE_OBJ (application);
END;
--End load data from EXCELPlease mark it as answered if you helped. -
How to upload the data from excel(3 tabs) file to sap environment
Hi all,
This is Mahesh.
how to upload the data from excel(3 tabs) file to sap environment (internal tables) while doing bdc.Hi,
The FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' makes it possible to load a worksheet into an internal table in ABAP.
However, if you want to get the data from several worksheets, I think you are stuck with OLE access to your Excel Workbook...
You can find a solution for 2 worksheets in this post :
TO UPLOAD DATA FROM 2 EXCEL SHEETS INTO TWO INTERNAL TABLES
I think you can easily modify it to handle any number of worksheets.
Hope it helps !
Best regards,
Guillaume -
Importing data from Excel using SDK!
Hi All,
Can we do a Goods Receipt and Goods Issue via SDK.
IF so any code available for the same!Secondly can we
Import data from Excel using SDK!
Thnx in advanceHi Vinayak
4 your 2nd issue: you can easily use Excel.Application COM-object. In C# exporting from Excel can be:
Excel.Application oXL;
Excel._Workbook oWB;
Excel._Worksheet oSheet;
string strTemplatePath;
strTemplatePath = Application.StartupPath + "WHRequestList.xlt";
try
oXL = new Excel.Application();
oWB = (Excel._Workbook)(oXL.Workbooks.Add(strTemplatePath));
oSheet = (Excel._Worksheet)oWB.ActiveSheet;
SAPbouiCOM.Item edDocNum;
SAPbouiCOM.IEditText specEdDocNum;
edDocNum = SBOApp.Forms.Item(FormUID).Items.Item("8");
specEdDocNum = (SAPbouiCOM.IEditText)edDocNum.Specific;
SAPbouiCOM.Item edDocDate;
SAPbouiCOM.IEditText specEdDocDate;
edDocDate = SBOApp.Forms.Item(FormUID).Items.Item("10");
specEdDocDate = (SAPbouiCOM.IEditText)edDocDate.Specific;
oSheet.Cells[2, "F"] = "¹ " + specEdDocNum.String + " îò " + specEdDocDate.String;
oXL.Visible = true;
oXL.UserControl = true;
BTW, don't forget to add Excel object in ProjectReferences
For sure, importing (reading) from Excel is the same
HTH -
How's to select data from structure data object?
Dear Guru,
If my data is kept in structure data object (not a table type). How can I select data from that kind of data object. Thank you.
Cheers,Hi,
Data cannot be stored in structure.
Structure is just like a view , so its a medium with which you can create a view relevant to your needs.
The fields that we need together , we put in a structure.
Structure is a medium where we collect all our relevant fields.
we can include the structure in internal table so that we can actually store data , process data and retrieve data.
hope this helps.
thanx,
dhanashri. -
How to write the data into EEPROM using Labview?
How to write the data into EEPROM using Labview?
You would need some sort of EEPROM programmer. Typically might
communicate with it via serial. I don't know how you would do this in
LV. You would need to have the command protocol for the programming
device to start with.
Doug De Clue
gpibssx wrote in message news:<[email protected]>...
> How to write the data into EEPROM using Labview? -
How to read the data from excel file and store into the table?
Hi All,
I have table with BLOB datatype contains a excel file. I have to read that data from excel and store into one table with all the fields in excel.
All the excel fields and my table columns are same.
Can you share with me how can acheive this using LOB's?
ThanksHi OraSuirya,
you can try with external tables .
syntax as follows
create table ext_table_csv (
i Number,
n Varchar2(20),
m Varchar2(20)
organization external (
type oracle_loader
default directory ext_dir
access parameters (
records delimited by newline
fields terminated by ','
missing field values are null
location ('file.csv')
reject limit unlimited;
For this you need to create directory
Directory Creation syntax:
create or replace directory ext_dir as 'D:\oracle\user_dir\ext_dir';
grant read, write on directory ext_dir to <User>;
please paste the excel file in the particular directory .
I hope this will help you.
Please correct me if I am wrong anywhere .
Thanks,
Tippu. -
How to take the data from excel list to sap r/3(with time interval)
hi experts,
how to transfer the data from a third party system(if it is in format of excel) to sap r/3.with that in a particular time interval,it will delete the data from excel sheet.Hi
use the Fm
'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_path
i_begin_col = '1'
i_begin_row = '2'
i_end_col = '2'
i_end_row = '500'
giving the starting row and column and passing the ending row and column name
Reward points if useful........
Regards,
Nitin Sachdeva -
How to select data from excel within certain range?
hi all, i am having an application where i am reading data from an excel sheet. in my case i am taking the date as an input from the user in range i.e starting date and end date in dd-mm-yy format( or to to from)and then i have to read the data of all dates which come between given range by the user....
how can i do it????
can anyone help......
thanks in advance.........Did you get the solution for your question ?
I have the same requirement,
1. Here, the user will provide the range like maximum and minimum values, then the VI should capture the data within the given range. ( from CSV file as attached )
2. Then VI should calcluate the average value for captured data and export it to excel.
This is my requirement can anyone help me on this.
Many thanks in advance
rc_cks
Attachments:
sample_short.csv 2439 KB -
How can I plot data from excel in a XY graph
Labview experts,
I have a really simple problem in labview:
I have some data in excel: 2 columns with a certain number data. The two columns are related to each other. So I want to plot all the points in a x y graph. Coordinates point 1: (row1,col1) coordinates point 2: (row2,col2)...
Now i want, in a first step, import this data in labview and draw the X Y graph in labview.
So the points of the first column on the x axis and the data of the second column on the y axis.
that's how i do it now: Attachment
That's only working if i'm using a waveform graph, but i want a XY graph
Is there somebody with a solution,
Kind regards,
Jelle
Attachments:
tryout.PNG 9 KBTo setup a plot of XY from dual column data in excel, select the two column including the name header for both column and then select to insert a scatter plot with the points connected by lines and Voila you have a 2 axis plot with x and Y dimensions and including the title for the trace from the column header already formatted for you. If you select more than 2 columns then the first is the X dimension and the remaindre columns all become Y axis traces for multiple plot lines for each column. This is easy folks and basic excel functions for plotting. One the graph is created and displaying the data, clear the data and save as a template. Now when you call the template and stuff the columns of data into the table fields, excel automatically updates the plot and all you have to do after stuffing the data in is save the excel file. Task done. Good luck.
-
How do you select data from tables not in the Properties table list?
Hi I am new to SAP B1.
I am amending the production order and wish to add fields from the Bill of Materials table Itt1. However this table is not in the list of tables for this report.
1. Do I have to redo the whole report in Crystal or is there a way of using the PLD report?
2. This table join needs to have 2 fields in the join the father and the child item codes. How many joins can the PLD report look after? I assume that Relate to is the first join and next segment is a second join. Am I right or not as I have been unable to find any reasonable documentation on creating and maintaining PLD reports.
3. Where can I find information if any on System Variables and what data they represent?
Thanks
ChrisHi Cris,
welcome to Sdn forum!
For question 1, i think you can do this using pld.
For question 2, to be able to view other tables, you will need to hold the ALT button and press the database table(Properties section on the lower right portion of the PLD screen), you can now view other tables. then to join other tables you will need to RELATE to and Next Segment, you can also find this under Properties and go to Content Tab.
for question 3, you will need to create a query that will lead you to the exact field name, say for example SELECT Price from POR1, this price is actually variable 81 from purchase order line and the equivalent value is the por1.price..
Regards,
Darius Gragasin
Maybe you are looking for
-
Best practice guide for Batch Load utility in Oracle UCM.
Hi, Is there any best practice guide for Oracle UCM Batch Loader utility. We are looking for information regarding batch size in terms of number and size of contents. Also is there any loading time standards considering the contents are uploaded in f
-
Hp dv5-1021et keyboard press double button at same time
my keyboard press some of the keys at same time. I tried every software update. these key are "z1""x2""c3""v4""m7""ö8""ç9"".0""space+arrow down""END+arrow left" there is not a tech.sup. neer my area, I changed my keyboard my self but same problem ram
-
Resetting air-ap1131ag-e-k9 to default configuration.
I am having a small problem resetting the AP to default config. Off course I have tried the cisco way but the AP still retains some parts of old config. Can someone tell me how to full (clean) reset the AP? Thanks, Piotr, p.s. can option 43 for dhcp
-
Droplets not working in CS2?
Hi all, I have a bunch of droplets set up for my CS2 Photoshop and now that I have Windows 7 they just don't work. I drag a file onto the droplet and the PS icon on the Windows toolbar glows a few times but the file doesn't open. Any ideas? Thanks fo
-
TS3276 mail unable to connect to yahoo server - username and password are correct as entered
Why is Mail and IPhone 4 not connecting with Yahoo servers? They both have quit.