Search data in a 2d array and generate a signal when found
Hi, i am looking for an interactive way to search data from an array containing a 2d array found in a cluster. The data is in the 2d array. I have attached the vi containing the array. I want an interactive method to look up for the codes in the 2d array(found in the 1st row) and when found generate a signal to tell it has been found. The signal varies depending in which category was data code found (whether engineering, law or others). Btw the data i am looking for are in fact input using a barcode reader. Should i use a search 1d array function? or is there another method?
Solved!
Go to Solution.
Attachments:
Untitled 1.vi 6 KB
Just to make sure we are totally clear here. We are trying to find the cluster which contains a certain data point in its first row of the 2D array?
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Attachments:
Search for element.png 14 KB
Similar Messages
-
Calculate date differences in consecutive rows and generate a sequence
Hi Guys,
I am trying to implement one scenario where in i need to compare the date differences for consecutive rows and generate a sequence against that.
this is the table schema:
create table temp
id int identity(1,1),
emp_id int,
time datetime
insert into temp
values
(1, '2011-02-20 12:30:00.000'),
(1, '2011-02-20 12:32:34.172'),
(1, '2011-02-20 12:32:34.172'),
(1, '2011-02-20 12:43:21.004'),
(1, '2011-02-20 12:46:39.745'),
(2, '2011-02-20 12:48:06.004'),
(2, '2011-02-20 12:48:06.004'),
(2, '2011-02-20 12:53:07.733'),
(2, '2011-02-20 12:55:30.295');
now, I want to compare the first date-time with the second and so on. now if the date-time difference is same for two consecutive rows then the sequence should increment by 1 otherwise the sequence again will start from '00' for any unique date-time.
This sequence number should start from '00' from each employee.
I want the output to be like this
ID emp_id
time
sequence
1 1 2011-02-20 12:30:00.000
00
2 1 2011-02-20 12:32:34.172
00
3 1 2011-02-20 12:32:34.172
01
4 1 2011-02-20 12:32:34.172
02
5 1 2011-02-20 12:46:39.745
00
6 2
2011-02-20 12:48:06.004 00
7 2
2011-02-20 12:48:07.003 00
8 2
2011-02-20 12:48:07.003 01
9 2
2011-02-20 12:46:39.745 00
Please revert as soon as possible as this is a bit urgent.
Thank You in Advance. :)create table temp
(id int identity(1,1),
emp_id int,
time datetime
insert into temp values
(1, '20110220 12:30:00.000'),
(1, '20110220 12:32:34.172'),
(1, '20110220 12:32:34.172'),
(1, '20110220 12:43:21.004'),
(1, '20110220 12:46:39.745'),
(2, '20110220 12:48:06.004'),
(2, '20110220 12:48:06.004'),
(2, '20110220 12:53:07.733'),
(2, '20110220 12:55:30.295');
go
SELECT id, emp_id, time,
dateadd(mcs, (row_number() OVER(PARTITION BY emp_id, time ORDER BY
id) - 1) * 10,
convert(datetime2(5), time)) AS [Sequence]
FROM temp
ORDER BY id
go
DROP TABLE temp
Erland Sommarskog, SQL Server MVP, [email protected] -
just got a used airport base station. Set it up and getting wif signal. when I try to hook up on a computer it asks for a security key. where can I locate key?
If you mean the hexidecimal equivalent of the alphanumeric password, then you can find this via the AirPort Utility, as follows:
AirPort Utility > Select the AirPort > Manual Setup
On the AirPort Utility's menubar select Base Station > Equivalent Network Password -
I am going to acquire up to 5 samples per second of 50 channels over 30 minutes then average ten of the channels and generate a report. There are other bits of information needed to complete my task and graphs. Would it be "faster" for the PC to have one large 4d array with all the information or faster to make several separate arrays? Would it be more reliable to have one or many(fewer code lockups)?
Also,
Yes, I do mean to be using labview. I expected this crowd to have a different perspective (and I could not find LV blog).
For each channel, I want to scale per 6 other variables per channel(nominal high, mid, low, and reading high, mid low) So there is the channels and time, then there is the calibration values, then there is the calibrated readings. If I put all that along with my test information in one large matrix, it would be simpler for me to remember where in the matrix each item is, but if it is in several matrixies then the "active" matrix is smaller while the other information is not used.
The sales rep for NI was indicating the computer power is much higher than I am used to. (I have not started programming yet, I am preparing for a huge project on a "new"(2 year old)PC.) I am trying to understand just how much power I am missing from my days of gwbasic, Q-basic and our current Visual Basic 6.0 running on XP. This matrix question is new to me.
Solved!
Go to Solution.I don't see where you are getting 4 dimentions for your array. I only see 2: channel and sample.
From what you are describing, I would put any "support" information for a channel into a cluster. So you should have an array of clusters to contain your support data.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
How to save data in a 4D array and make partial plots in real time?
Hi, this is a little complex, so bear with me...
I have a test system that tests a number of parts at the same time. The
experiment I do consists of measuring a number of properties of the
parts at various temperatures and voltages. I want to save all the
measured data in a 4-dimensional array. The indices represent,
respectively, temperature, voltage, part, property.
The way the experiment is done, I first do a loop in temperature, then
in voltage, then switch the part. At this point, I measure all the
properties for that condition and part and want to add them as a 1D
array to the 4D array.
At the same time, I want to make a multiple plot (on an XY graph) of
one selected property and part (using two pull-down selectors near the
XY graph) vs. voltage. (The reason I need to use an XY graph and not a
waveform graph, which would be easier, is that I do not have
equidistant steps in voltage, although all the voltage values I step
through are the same for all cases). The multiple plots are the data
sets at different temperatures. I would like to draw connection lines
between the points as a guide to the eye.
I also want the plot to be updated in the innermost for loop in real
time as the data are measured. I have a VI working using nested loops
as described above and passing the 4D array through shift registers,
starting with an array of the right dimensions initialized by zeroes. I
know in advance how many times all the loops have to be executed, and I
use the ReplaceArraySubset function to add the measured properties each
time. I then use IndexArray with the part and property index terminals
wired to extract the 2D array containing the data I want to plot. After
some transformation to combine these data with an array of the voltage
values in the form required to pass to the XYGraph control, I get my
plot.
The problem is: During program execution, when only partial data is
available, all the zero elements in the array do not allow the graph to
autoscale properly, and the lines between the points make little sense
when they jump to zero.
Here is how I think the problem could be solved:
1. Start with an empty array and have the array grow gradually as the
elements are measured. I tried to implement this using Insert Into
Array. Unfortunately, this VI is not as flexible as the Replace Array
Subset, and does not allow me to add a 1D array to a 4D array. One
other option would be to use the Build Array, but I could not figure
out if this is usable in this case.
2. The second option would be to extract only the already measured data
points from the 4D array and pass them to the graph
3. Keep track of the min. and max. values (only when they are different
from zero) and manually reset the graph Y axis scale each time.
Option 3 is doable, but more work for me.....
Option 2: I first tried to use Array Subset, but this always returns an
array of the same dimensionality of the input array. It seems to be
very difficult, but maybe not impossible, to make this work by using
Index Array first followed by Array Subset. Option 3 seems easier.
Ideally, I would like option 1, but I cannot figure out how to achieve
this.
Your help is appreciated, thanks in advance!
germ Remove "nospam" to replyIn article <[email protected]>,
chutla wrote:
> Greetings!
>
> You can use any of the 3D display vi's to show your "main" 3d
> data, and then use color to represent your fourth dimension. This can
> be accessed via the property node. You will have to set thresholds
> for each color you use, which is quite simple using the comparison
> functions. As far as the data is concerned, the fourth dimension will
> be just another vector (column) in your data file.
chutla, thanks for your post, but I don't want a 3D display of the
data....
> Also, check out
> the BUFFER examples for how to separate out "running" data in real
> time.
Not clear to me what you mean, but will c
heck the BUFFER examples.
> As far as autoscaling is concerned, you might have to disable
> it, or alternatively, you could force a couple of "dummy" points into
> your data which represent the absolute min/max you should encounter.
> Autoscaling should generally be regarded as a default mode, just to
> get things rolling, it should not be relied on too heavily for serious
> data acquisition. It's better to use well-conditioned data, or some
> other means, such as a logarithmic scale, to allow access to all your
> possible data points.
I love autoscaling, that's the way it should be.
germ Remove "nospam" to reply -
New and Generated Business Object Not Found in BOR
Hi,
I have created, released and generated a new object in SWO1. But I could not find it in the BOR (T-Code BAPI).
So I searched for the object in SWO1 again and it was there, but not in BOR.
What is the reason for this?
Thanks in advance.
Regards,
Joon MengHi a®s,
You are right. I have mistakenly selected "Object Type" instead of "Object Type Component" for releasing the status of the method.
Problem solved and thanks very much.
Regards,
Joon Meng -
Analysing and generating a signal
Hello,
I am using NI Multisim 13.0.I want to generate a signal similar to the one shown in the attachments acquired using labview which is the output of a phototransistor.The output image contains 10 signals each contaning each acquired by using 1k samples and below freq images shows freq components only 1 signal of 1k sample.From the images it can be analysed that it has DC volatge of 2.6V but I am confused as it contains different frequenices and most(very high number) of the frequencies are lying below around 1Hz and some are lying at around 135 and others at 275 to 300 and very less number of other frequency components.
What all things to be taken to generate these kind of freq's and How to add these different kind of frequencies to the DC component so as to generate the signal that will be same as in the shown image.
I want to genearte this signal in multisim as this will used as a input for designing the filtering stage in multisim.
Thanks.
Solved!
Go to Solution.
Attachments:
Generate_signal.pdf 174 KBHi Tien P,
I am trying to read the samples in .LVM (that are saved using 'one header only while' writing into .LVM file) that has samples for more than 1 sec duration since 1sec duration has 1k samples so more samples will be there for more than 1 sec as shown in the attached file.But When I am trying to read this into the multisim uisng LVM voltage source it only showing 1 sec samples waveform (as shown it the attached image)and after that it is not plotting anything but it is supposed to plot the as many samples that are in the .LVM file.
Can I know how to read all the samples form the .LVM file.
Thanks.
Attachments:
unable_to_conts_samples-LVMfiel.JPG 92 KB
contsamplesheader1.txt 645 KB -
Get data from PL/SQL block and generate the data file in UNIX
Hi All
i was executing the following code block from Unix Shell Script. The following code was generating the file count_curdate.txt with all require infomrations. The query gives number of records , group by partition_dt
ABC=`sqlplus -s <<EOF > count_curdate.txt
uname/paswd@connectstring
SET HEADING OFF;
SELECT COUNT(*)||','||partition_dt from XYZ group by partition_dt;
exit;
END`
But now i need to change the above code to use dbms_application_info.set_module in it. Could someone let me know how to generate the file using PL/SQL block in Shell Script. I tried writing following code, but it generate count_curdate.txt file with 0 bytes.
ABC=`sqlplus -s <<EOF > count_curdate.txt
uname/paswd@connectstring
set serveroutput on;
SET HEADING OFF;
set feedback off;
BEGIN
dbms_application_info.set_module ('shm.ksh','get count by day');
FOR reccur IN (SELECT COUNT(*)||','||partition_dt as "dcount" from XYZ group by partition_dt);
LOOP
DBMS_OUTPUT.PUT_LINE(reccur.dcount);
END LOOP;
end;
exit;
END`OK, try this:
ABC=`sqlplus -s <<EOF > count_curdate.txt
uname/paswd@connectstring
set serveroutput on;
SET HEADING OFF;
set feedback off;
BEGIN
dbms_application_info.set_module ('shm.ksh','get count by day');
FOR reccur IN (SELECT COUNT(*)||','||partition_dt dcount from XYZ group by partition_dt);
LOOP
DBMS_OUTPUT.PUT_LINE(reccur.dcount);
END LOOP;
dbms_application_info.set_module (NULL,NULL);
end;
exit;
EOF`Or this:
ABC=`sqlplus -s <<EOF > count_curdate.txt
uname/paswd@connectstring
set serveroutput on;
SET HEADING OFF;
set feedback off;
BEGIN
dbms_application_info.set_module ('shm.ksh','get count by day');
END;
SELECT COUNT(*)||','||partition_dt dcount from XYZ group by partition_dt;
BEGIN
dbms_application_info.set_module (NULL,NULL);
END;
exit;
EOF`Edited by: SeánMacGC on May 11, 2009 6:13 AM -
How to do search with multiple texts across documents and rename the file with found text?
Hello:
I'm trying to do the batch search across the multiple documents and rename the file (or save as) after the found word?
In example:
I have many unique texts and would want to search across the multiple documents.
If a document is found with that unique text then, the document is either renamed or save as with that unique text.
So, I could know what unique text that file holds.
How do I do that?
Let me know.
ThanksWelcome to the forum!
When you want to post a block of code, you can enclose it with the mark ups { code }
That is the key word code surrounded by curly brackets, but without the spaces
You seem to be running a very old (and unsupported release of the database)
7.3 has not been a current release for about 10 years.
It's probably been that long since I've used this technique, but i think it should work.
You should consider welcoming your system to the 21st century by upgrading to a supported release ;-)
If you used split to chop up your export file, use cat or dd to reassemble it.
So, something like this:
mknod bk.dmp p
cat xaa xab xac xad xae xaf xag xah xai > bk.dmp &
imp SYSTEM/$PASSWD parfile=imp_bk.parfile
rm bk.dmp
$ cat imp_bk.parfile
file=bk.dmp
log=imp.log
full=y
buffer=1048576
ignore=y
commit=y let us know if still have problems.
Good Luck! -
Search for a subarray in array
Hi!
Is there a VI or a simple way to search for a subarray in array and to get the index of the subarray? The same thing does DTbl Search for Digital Pattern.vi with digital data and Search 1D Array.vi searches for just one element in the array.
Thank you!
Solved!
Go to Solution.Playing around with Gerd's idea of using the search 1D Array, I came up with this.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Attachments:
Find Subarray.png 16 KB -
How to write an array and a scalar to file?
I would like to write my data to a file but am having trouble approaching the problem. In the file I would like to write both the x and y values of my data points in two columns, however, the y data is in an array and the x data is made up of 3 pieces of information: an initial x, an x incremented value, and the number of points in my data sample. How could I go about this?
Solved!
Go to Solution.The number of points is redundant, because it will be the same as the "other" array.
Here's what I usually do:
LabVIEW Champion . Do more with less code and in less time .
Attachments:
ramper.png 13 KB -
How to store the measured data in a new array
we want to put the measured data in a new array and then use this array to plot the SPC chart. Can anyone provide some suggestions?
are you using some kind of data acquisition? If you reading in a loop you can build an array using the autoindexing tunnel (best way). Or you can use the build array function with a shift register inside a loop. Can you post an example?
BJD1613
Lead Test Tools Development Engineer
Philips Respironics
Certified LV Architect / Instructor -
The file contains file info data which cannot be read and has been ignored
We have been sending images out to contractors, and sometimes when they come back the files are having this error:
the file contains file info data which cannot be read and has been ignored
When I then try to Photoshop Script the file info it throws errors. Does anyone know what causes this error to happen?
Thank youok, Thanks!, BUT here's the bigger issue:
We use a lot of Photoshop Scripting, and the file info is how we direct all of our workflows. when a file comes back with "the file contains file info data which cannot be read and has been ignored" error, the scripts are unable to read/write to any of the file info ever again. So not only did we lose all the info already in the file, but we can't use the file at all after this.
Additonally, we tried copying and pasting to new blank documents, but realized we needed all the paths, channels, and sampler points too.
Is there anything anyone can think of to get around this probelm? A setting, or a program to fix the metadata, etc?
Thanks!!! -
Oracle client and networking components were not found.
Hello, I've installed the oracle 9i Enterprise Edition, IIS, .NET framework 2.0 on a server, but when I want to open an aspx file i have this error:
Server Error in '/kinepolis' Application.
Oracle client and networking components were not found. These components are supplied by Oracle Corporation and are part of the Oracle Version 7.3.3 or later client software installation.
Provider is unable to function until these components are installed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Oracle client and networking components were not found. These components are supplied by Oracle Corporation and are part of the Oracle Version 7.3.3 or later client software installation.
Provider is unable to function until these components are installed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[OleDbException (0x80004005): Oracle client and networking components were not found. These components are supplied by Oracle Corporation and are part of the Oracle Version 7.3.3 or later client software installation.
Provider is unable to function until these components are installed.]
System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +1054593
System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +53
System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +47
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.OleDb.OleDbConnection.Open() +37
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +41
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Do i really also need to install the client 6i on that server?
Can somebody help me?
thanksHi Guys,
I am wondering about this error as while I am using the same code to connect to the Oracle database server in my Windows program with Win Forms, the connection to the Oracle server is established and working fine.
But when I have tried to use it with Web Forms for my ASP.NET Application, it throws me out with these exceptions :
?ex.Message
"Oracle client and networking components were not found. These components are supplied by Oracle Corporation and are part of the Oracle Version 7.3.3 or later client software installation.
Provider is unable to function until these components are installed."
?ex.StackTrace
" at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
at System.Data.OleDb.OleDbConnection.InitializeProvider()
at System.Data.OleDb.OleDbConnection.Open()
at PMlitDocs_NET.checkMe.Button1_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\PMlitDocs_NET\checkMe.aspx.vb:line 32"
Can anyone help?
Trush. -
Third Party Sales Order not generating a PR when going on Credit Block
Hello Generous People,
We are having a problem with creating 3rd Party Sales Orders and generating a PR when the customer goes on a credit block and the is subsequently released from there credit block. The system enters a loop of creating a PR and then deleting it once the sales order saved and then place the sales order back on credit block. The Credit Management system has been setup to cause a block for certain fields.
We have looked at the OSS Notes that are recommended by SAP, for example 100861, 396791, etc. However we are implementing SAP ECC 6.0 with all the latest updates. I was looking at OVB5 and VOFM, but I have had no luck with these as well.
Thank you in advance for your help or advice.Hi Jurijs,
Have you checked LVKMPFZ1, LVKMPFZ2 & LVKMPFZ3 to find out if there is any code for credit checks and blocks in these user exits. Also please check FORM USEREXIT_AVAIL_CHECK_CREDIT under include MV45AFZF to find out if there is any code which is entered to not allow the availability check for blocked sales orders and therefore stopping the transfer of requirements inthe form of PR generation.
Don't worry about going into ECC 6.0. Once you will start the upgrade process on ECC 6.0, you will come to know a set of transaction codes which you can run into the system to find out the non standard ABAP code changes which exists in your SAP landscape.
Maybe you are looking for
-
Sending mail from iPad Safari: How to choose the sender account?
In iOS 7.1 and whatever the most recent version of Safari is: I'm on a web page and want to mail a link to the page to someone else. I tap on the "Share" icon (the square with the arrow coming out of it) and get the overlay with the AirDrop icon, th
-
Why can't I get my facetime activated?
Having trouble activating facetime? Every time I try signing in, I get "an error occured during activation". Very frustrated. I created my Apple ID online...and still a no-go!!
-
CA (certsrv.exe) cant find how to create a certificate
I have created a new Exchange Certificate has a reg file , when I open CA to change it to request the certificate There is not any tabs or tasks to request a certificate. not sure if there is a function missing
-
How do you delete a tag you no longer use in photoshop elements 12
I have a few tags I no longer use. How do you delete a tag in Photoshop Elements 12
-
Hi I have spent a couple of hours to make a result pagination in jsf. <h:commandLink actionListener="#{goodbyeBean.prev}" > <h:outputText value="prev" rendered="#{goodbyeBean.pageNo > -3}"/> <f:param value="#{goodbyeBean.pageNo - 1}" name="pageNo"/>