Quantcast
Channel: All LabVIEW posts
Viewing all 203053 articles
Browse latest View live

Plotting a subset of data

$
0
0

I have two 1D subarrays which I have made to go to an index length of 30K.

So I want to plot from 70k-100k and I don't know how to make the arrays start from 70k and go towards 100k for the 30k index length?

Instead what happens is that I just get the first 30k indexes going from 0-30k.

 

 


Re: Indexing an array

$
0
0

 wrote:

Sorry I have two subarrays which I have made to go to an index length of 30K.

So I want to plot from 70k-100k and I don't know how to make the arrays start from 70k and go towards 100k for the 30k index length?


Your description makes absolutely no sense. Please attach a small VI to show that you have and what you want.

 

  • What is a subarray? That is not a native datatype.
  • What is the meaning of "going to an index"?
  • Arrays always start at index zero, but you can of course manipulate the index calculation for a custom mapping.
  • Are you looking for a data manpulation or just cosmetics (plot). For the plot, I already told you how to change the x-scale.

Re: Function generator compatible with LabVIEW

$
0
0

You can purchase an NI USB-6002, a multi-function DAQ device, that can be connected to a PC running LabVIEW and generate LabVIEW-generated waveforms using two Analog-output channels.  Other companies also make DAQmx-compatible devices -- a Web search (look for multi-function DAQ devices) will find others that fit your budget.

 

Bob Schor

Re: Plotting a subset of data

$
0
0

Well, you didn't attach your "sub-arrays", and I don't understand what you mean by "made to go to an index length of 30K" and "want to plot from 70k-100k".  Are you saying that you want to plot your 30k plots so that, on the plot, the first point is labeled "70k" and the last point is at "100k"?  If this is so, have you looked at the Plot Properties?  Do you know what all the Properties mean?  [If not, do you know how to use the LabVIEW "Help" option to "explain it all to you"?].

 

Bob Schor

Re: LabVIEW 17.0f2 Development System has stopped working

$
0
0

@BobSchor  
Sorry, I did not want to be impolite, I thought it would be a good idea to publish more about my problem, anyway thanks for the advice.

Re: Plotting a subset of data

$
0
0

Please don't create duplicate posts.  People are already trying to help you in your other post.

Re: 3D floating bar chart / Gantt chart / candlestick type plot

$
0
0

I wouldn't want to say "No", but I suspect it will be a lot of work.  It might be more appropriate to use LabVIEW to gather/generate/process the data and to export the data in a file appropriate for whatever Plotting Routine produced that rather nice and interesting picture.  Note that you might be able to specify axis names, colors, etc. that the Super Neat Plotting Routine needs, so it acts like a Fancy Rear End (hmm, that came out wrong -- I was going to call it a "Front End", but LabVIEW is acting as the "Front End" for the Super Neat Plotting Routine, so that makes the SNPR the "Rear End" for LabVIEW -- maybe "Back End" sounds better, but has yet another meaning ...).

 

Bob Schor

Re: ECG beats per minute help please

$
0
0

What circuit is that?  So far you've only talked about your LabVIEW VI.  You haven't shown us any electrical circuits yet.  That is a completely different problem.


Re: Having issue VISA Read reading entire serial response

$
0
0

 


 wrote:

 wrote:

Tried out the new method. Attached the .vi below. Results still intermittent.  No, you didn't.  You attached a VI that reads the Text file, while we need to see the VI that creates the Text file, that reads a Script, sending each line to the device, gets the (multi-line?) responses, and creates the text file that shows both the Questions and the Answers.!

My bad. Here is the correct VI attached. To further clarify for you, the stages of the code as far as vi's go are:
read_qspi_flash_test_script_from_file:

 - reads each line from text file which are commands to be sent one by one and sends it out as an array

send_QSPI_Flash_cmds:

- takes in the array of command strings from "read_qspi_flash_test_script_from_file".vi and VISA Writes them one at the time. Waits for the multiple responses received from the command and puts it out into an array of responses from each command and checks for "keyword" matches to Pass/Fail.

 

 


You will notice that in the "Correct_Response" file, the Visa Read captures:
=> sf probe
SF: Detected s25fs512s with page size 512 Bytes, erase size 256 KiB, total 64 MiB  You provide no indication what the situation was that led to this "correct" response.  How did it differ from the "incorrect" response?  Did you do exactly the same thing and get two different answers?  Did you do two times in a row, and it worked the first (or second) time and failed the other?  We have no idea!!  You have all the information and haven't shared it with us.

As I have stated in my original post, the behavior is intermittent and 50% of the time when I run my VI it outputs the "correct response" and the other 50% of the time it produces the "incorrect response". I do not do anything to elicit the change hence labeling it as intermittent...

I have attached a zip folder with the text file of the commands, the .vi which reads the txt file, and the .vi which writes/reads the commands then checks for matches in the response.

 

I have also attached a text file to show what responses are expected to be returned from each command.

Re: Bit loss in QAM demodulation

$
0
0

What version of labVIEW are you using.  Can you get the vi example to 2014 or higher?

Re: Indexing an array

$
0
0

I meant array subsets with a set index length which I imposed.

 

I guess the big question for me that you listed is the index manipulation.

 

Like I said I have two 1D array subsets which I would like to manipulate the index.

Re: Want to measure resistance by using DAQ-9184 with analog output and input modules

$
0
0

Thank you for your reply. I think you are right about 9205 and 9201, they probably can only measure voltage. So I changed my set up like the following sketch. I connected a 5k ohm resistor with my soil sample ( 2k to 10 k ohm) in series, and measure the voltage for both parts, so I can calculate the resistance of my soil sample. I hope I am right about this since the last time I was learning circuit was in high school physics class. Also, I have updated my LabVIEW file a little bit.

 

Re: ECG beats per minute help please

$
0
0

Thank you for the offer to help on the circuit but I was referring to the VI.  Our circuit works perfectly.  The beats per minute portion of my VI is not accurate with the tone measurement.  I asked the professor for help and he suggested using the spectral analysis to get an array of data then look for the peaks of that array. I tried that.  attached is what I have so far with that.

Preserving Parent Class Data When Instantiating a Child Class

$
0
0

Hi all,

 

It has been brought up before (at least here and here if not in other places) that when using "To More Specific Class" to cast a child to a parent class, the parent's class data is not copied to the child class.  I have a use case where I won't know which child to use until a while into the code, but I still want to access parent data and run parent methods before that cast to a specific child.

 

The only suggested solutions in the above forums were to copy the original parent instance's data to the new child instance.  This works, but it's kind of cumbersome given that the only way I know to do this is with bundle/unbundle functions or property nodes or accessor functions, all of which won't accommodate automatically including new class data items and will break if you remove class data items.  (The former is a much bigger problem than the latter since it will silently fail to include the added class data.)  Basically, I want a stable cast function that can copy the existing parent's data to the new child. 

 

I looked into it a bit more and wrote a quick, hacky workaround involving the flatten/unflatten XML functions, where I get the new child object's XML representation and the parent's XML representation.  I take the portion of the parent's XML that represents the class data I want to maintain and simply copy that into the right part of the child's XML class data.  I then unflatten the hacked together XML back to the child object type, and it actually works.  I can read the original parent's data and can call my abstract parent methods and see that the correct child is dynamically dispatched and returns the child's class data.  Of course, this just proves that what I want can be done.  It is not a tested or production-worthy solution.  It also doesn't answer the question of should it be done.

 

I hope (but can't seem to prove) that there is a more elegant way to programmatically get all of the values of a parent class's data and write them to a child class.  I tried playing with the Data Type Parsing palette, looked in Hidden Gems and Open G, and otherwise poked and prodded to see if there was a better way to do this and didn't get far.  (In fairness, those palettes would likely all just be doing XML manipulation, too, but at least I could blame bugs on others!)

 

Could I architect my code to not write to class data until I've determined which child to call?  I mean, yeah, but is there actually a good, compelling comp sci reason why I shouldn't be able to choose which child I want to use after having called parent methods and written to class data?  Is there a nicer way to copy all of my parent data to the child at once without me having to update the method if class data contents change?  One side of me thinks:  "If it's this awkward, you probably should do this," and the other thinks, "But why not? Are you missing something really simple?"  Hoping to get your thoughts.

 

Thanks!

David

Re: ECG beats per minute help please

$
0
0

There's something I don't understand here.  You say that you know what the EKG signal looks like, but then seem to be modeling it by "running a signal generator on triangle wave" and "it works".  Do you think a triangle wave is a good model for an EKG signal?  Please run your EKG_4 routine with the EKG hooked up to one of your team members (could be yourself) and post it here -- maybe this is the source of your problem!  [Some of us will be able to recognize an EKG ...]  In four seconds, you should be able to get a few heartbeats ...

 

Incidentally, do you know IBM's Famous Slogan?  (You could look it up ...)

 

Bob Schor


Re: ECG beats per minute help please

$
0
0

Hmm... I had to google "IBM Famous Slogan" too

Re: Want to measure resistance by using DAQ-9184 with analog output and input modules

$
0
0

Thank you for your reply! Sorry for my confusing question, I was typing it in a hurry last Friday. I am very new to this NI system as well as this forum. I was hoping maybe someone who had done the similar task or having a similar system in the forum can give me some idea. I think 9201 and 9205 can only measure voltage, not resistance or current. So I changed my set up to the following sketch. My soil sample resistance is from 2k ohm to 10k ohm. I haven't try if this set up is working or not, need to order a 5 k resistor.

Sketch.jpg

Re: Indexing an array

$
0
0

 wrote:

I meant array subsets with a set index length which I imposed.

 

I guess the big question for me that you listed is the index manipulation.

 

Like I said I have two 1D array subsets which I would like to manipulate the index.


Still makes no sense. You cannot "manipulate" the index of an array, only the data of an array. You can have arbitrary ramps that map into the index of the array, but this has nothing to do with the array itself. The index is always a I32 integer, zero for the first element and incrementing by exactly one for each additional element.

 

Again, we cannot help unless you attach some code showing exactly what you have and what you want to get out of it. Until then, you are on your own. Sorry.

Re: TwinCAt labview integration - error 1172

$
0
0

OK, the problem it seems, is due to a missing task containing MAIN in the Sample07 TwinCAT PLC project. 

 

As you can see, without any modification if I compile the project, MAIN is grayed out as it is not referenced by any task. 

Sample07_initial.PNGOriginal without referenced task

After adding a new task (Task3) and creating a corresponding reference task (Task_3) in the Sample07 PLC project to which MAIN is assigned, everything works ( or sort of, the complex cluster doesn't work 100% but that you should be able to debug :-D )...

Sample07_withTasks_LV.PNG

Re: Want to measure resistance by using DAQ-9184 with analog output and input modules

$
0
0

You block diagram looks acceptable, although, you certainly don't need both a 9201 and a 9205. Also, do you realize that the max output current for the 9263 is 1mA? (Why not use a simple power-supply?)

Have you actually put any design thought into this project?

What range of current are you expecting from the Soil sample box?

Given the above current range, have you calculated the voltage drop across the resistor? Is that voltage range with-in the voltage range of the 9201/9205?

Have you calculated the power dissipation of your sense resistor? Is it sized (wattage wise) correctly?

How would you even calibrate something like that? Bake the soil then add known amounts of moisture?

Viewing all 203053 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>