Quantcast
Channel: LabVIEW topics
Viewing all 67264 articles
Browse latest View live

Is there a vi to clear warnings?

$
0
0

Just wondering if there is a built in VI to clear the warnings in the error cluster, essentially setting the error code to 0 if error status is false. It is a trivial matter to write on such VI oneself, but I am just wondering if there is any built in VI to do this. 

 

I find this function useful when propagating error cluster through out a loop. If a warning is generated by a vi inside the loop, it will get propagated into next iterations, which makes all the error out terminals inside the loop to have this warning . This makes it hard to tell where does that error comes from.


Array Function Data Collection

$
0
0
Hey all,

Does anyone know a method to only collect the last x amount of point of data in an array. To elaborate on what I am doing.. I want to be able to generate a spreadsheet using an array method of collection (for mathematical manipulations), and at any point click a control that lets me generate the last 30 mins worth of data. I am able to set it up using  a for loop easily to the point that if I prompt it to collect x amount of data before starting the test I can get 30 mins worth but can't seem to pinpoint a method to do the "at any time" report generation.

What I was thinking would be a solution was to set a restriction of the amount of cells an array has.. lets say 30 as an example. When it fills the 30 cells up the next point of data populates the top cell while removing the bottom cell, essentially shifting the array down one and populating the top. I thought of making an array constant on the front diagram but that just seems to control the indicator and not the entire data set going to the Write to Spreadsheet function.

Maybe I just didn't test out a method well enough? I have about 40 different arrays going into a build array function to allow me to manipulate the data correctly so I am not sure if using the index array will let me acheive this or will only let me get the first n amount of arrays going into the build array.

Thanks,
Sam

 

 

Stream data to disk at lower rate than sampling

$
0
0

Hello,

 

I am attempting to use a PXIe system to digitize data, implement a threshold counter via an FPGA, and stream data to disk at a lower rate than the sampling. My system uses the following hardware: 

 

Digitizer: NI 5781

FPGA: PXIe 7965R

Hard Disk: HDD 8263

 

The NI 5781 has a sampling rate of 100MS/s and I am hoping to buffer data to disk at a rate of 1 MHz to both decrease file size and speed up the analysis performed on the files. My initial idea was to have two SCTL, one clocked at the 100MS/s (using the IO Module Data Clock 0) which retrieves the data and implements the threshold counter, and another operating at 1MHz (derived clock) which sends the current count to disk (via a target to host FIFO).

 

First, I noticed that from the 40MHz onboard clock it will be better to derive a 2.5 MHz clock (1/16), which is not a big deal. Initially, I was trying to use a target-scoped FIFO to send the data between the two SCTL but I am having compilation errors related to the clocks. 


Before getting too deep into my approach, is this a good way to tackle my problem? 
Also, instead of a target-scoped FIFO maybe it would be better to use a global variable? Is there any way to sample at a lower rate intially? 

 

I had some success using case structures and only sending the data to disk only when the loop counter was equal to some value (say 100 to get a 1MHz buffer rate), and then resetting the loop counter. This felt like a hack and I thought having two clocks might be more elegant. I have attempted searching online for guidelines but haven't found anything too useful. Any help would be greatly appreciated!

 

Best

 

Nolan

 

 

 

Fixed X-axis Scaling

$
0
0

Hello,

I am currently writing a script that does data acquisition using the NI USB-6008. I have been trying to set a specific range for the x-axis that will adjust its minimum and maximum on a continuous scale as data is read into the graph, but I haven't made much progress. Does anyone have any advice?

 

 

Thanks,

 

Mmoon

average different columns (binning)

$
0
0

I have a dataset made by successive scans,  N scans will give me a N times a 2D array (XY values).

I would like to average all Y values having the same X value. It would be easy if all X were the same and ordered, but they are not. By that, I mean that sometimes a point is missed by the acquisition. Sometimes it is read twice.

 

scan1.pngscan2.png

 

These two are one scan each (actually line 2, Y data, is random but it's not important here).

As you can see, Set 1 does not have a X value at 564.000, and two at 564.001, while set 2 has no value at 564.001.

There is no way arround the problem, the instrument giving me the values is slow.

 

How can I average all Y values across all scans with a certain X coordinate? 

 

Here is a bunch of code that reproduces the behavior of the system.

Labview internal error : "lvinit.cpp" , line 1162

$
0
0

Hi, 

 

Im getting this internal error "lvinit.cpp" , line 1162 when trying to launch labview version 8.6.1 . I started getting this problem after i used system restore on my computer. Any way to solve this error? Thanks.

GPS

$
0
0

Good afternoon,
I am new to tinker with Labview.
I created a program that reads the position of a mobile by GPS and sends to the labview.
I have a big problem:
1) How to set the vectors of communication to string?
2) How to concatenate?

case structure selector label

$
0
0

Hi people,

 

Is it possible to change the names of case structure selector label programatically like VISA Property Node does 

 

in a control, for example ?

 

I have fixed labels, but in some situations, I want to change the labels of this case structure before the software arrives up 

 

to this case structure.

 

Thank you very much

 

Henrique


Realtime, semaphores, and subvi's

$
0
0

Hi,

 

We use a handful of semaphores in our (2015) Realtime app on a cRIO.  For cleanliness, I wanted to encapsulate each semaphore in their own VI.  When I did this the semaphores didn't function correclty.  I feel like there's a basic tenet of labview that this uncovers, and I need to know it!

 

So below is more or less the standard semaphore HelloWorld program - it's similar to the Labview Simple Semaphore.vi example.  The "Numeric" and "Numeric Slow" indicators increase more or less in lockstep.

 

sem1.png

 

 

The next thing I did was create a VI to perform the Acquire and Release semaphore functions, as shown below.  You may ask "What's the point?".  Well, in my desired version of the VI the semaphore would not be a Control and instead would be "Obtained" within the VI (and thus avoiding passing the semaphore throughout our program).  For this posting (and test) I wanted to make things as simple as possible so I pass in the semaphore.  Note that the VI is non-reentrant, making it single threaded.

 

sem2.png

 

 

Using the VI in the test program is shown below (in a disabled state)

 

sem3.png

This doesn't work!  I've traced the program and the Acquire works (one thread proceeds and the other blocks), but the Release (on the 'Acquired' thread) hangs.  Looking into the Labview Release Semaphore.vi code I don't see a reason it would block (I can't add breakpoints or probes to this code).

 

Can someone make sense of this for me?

 

Thanks,

Steve

 

 

 

ocean optics Spectrometer .IIC file Firmware Upgrade HR2000+ HR2000 Plus HR2000plus HR 2000

$
0
0

Does anyone know where to find the .IIC file for a Ocean Optics HR2000+ spectrometer.  The only CD I have is Spectrasuite but I can't fnd the .icc file there. Any help would be appreciated.  Thank you. 

Memory layout of timestamp?

$
0
0

Hi all,

I have a question about how LabVIEW stores Timestamps in memory.  Based on the timestamp tutorial (http://www.ni.com/tutorial/7900/en/) and relevant manual page (http://zone.ni.com/reference/en-XX/help/371361M-01/lvconcepts/how_labview_stores_data_in_memory/#Time_Stamp) I expect two sequential 64-bit integers in memory. The first being whole seconds (I64) and the second being fractional seconds (U64).

 

However, when I pass a Timestamp into MoveBlock, I see these in the opposite order (see attached screenshot). But if I pass it into the Type Cast node, I get them in the expected order.

 

test_timestamp.JPG

 

Why do these two approaches give different results? I am interested in passing the Timestamp into a CLN, hence checking with MoveBlock, but I want to make sure my observation is correct.

 

Cheers,

Martijn

Running two myrio devices from single labview VI

$
0
0

Can a single labview VI runs/controls two myrio devices at the same time? Or I should only run one device, and make it communicate wirelessly with the other one?

SubPanel Doesn't Contain Front Panel of VI Started by `Start Asynchronous Call' VI

$
0
0

I am building a modular user interface by embedding smaller UI VIs into SubPanels in my main VI. If I start the VIs with the "Run VI" invoke node, there are no issues:

 

invoke.PNG

 

If, however, I start the VI asynchronously using the `Start Asynchronous Call' VI, the front panel in the SubPanel control doesn't seem to be connected to the running instance of the VI I just started and the front panel in the SubPanel control does not refer to a running VI as I can edit the labels on controls, etc. All VIs are not set to be re-entrant, so I would have expected there to be only one version of the VI running and for it to be the VI in the SubPanel. Furthermore, the help-text for the ``reference out'' connector on the `Start Asynchronous Call' VI says: ``reference out returns reference unchanged.'' Therefore, I would have expected the reference that I pass to `Start Asynchronous Call' to be the same as that which I pass to the SubPanel invoke node.

 

async.PNG

 

All of the VIs that I am embedding in this way take no arguments and produce no output, while also running forever (they all are just a bunch of controls with an Event Structure in a While Loop feeding some Functional Globals). Therefore, I was happy to use the `x100' calling code for opening the VI reference as it would call asynchronously, but also stop the VIs and remove them from memory when the parent VI closed. I understand that using `x100' instead of `x80' can be bad if the VIs produce output and finish early but the output is never collected, but since my VIs neither produce output nor stop early I thought this would not be an issue.

 

I don't need to use the latter approach, but since I'm using it to start other background processes that do not have UI components I was hoping I could have just one approach to start all of my asynchronous tasks and not two. I would also like to better understand why the `Start Asynchronous Call' approach doesn't work.

Unfortunately, I cannot provide my full source code here, but unless there is a simple behavioral answer to my question I am willing to build a minimal working example to show off my issue.

 

sound analysis

$
0
0

 

Hi Everyone, I have one microphone, cDAQ-9181, NI-9234 Module, NI sound and vibration toolkit.

I'm new to sound analysis.

 

 

I'm testing the sound analysis of the electric oven by putting a microphone inside the electric oven.

After I turn on the electric oven, I intend to measure the sound level within the electric oven.

If the sound level is in spec, the oven is "OK", If the sound level is out of spec, the oven is "FAIL".

 


By the way, I found that the electric oven is not soundproof. it's semi-soundproof.

During the test is progress, When I clapped my hands outdoors, the dB Level(amplitude) of the 1/3 octave analysis graph change a lot in all frequency range(20Hz ~ 20kHz).


When I clapped  my hands, the external loud noise level exceed the sound level within the oven.

 


Here, I have a question.

Is it possible to do the sound analysis of an electric oven under the external loud noise environment?

 


Aditionally, Is it possible to remove the noise like "clapping my hands"?

 

Thank you in advance...

 

Configuring input/output of NI9401 in labview FPGA

$
0
0

Hi,

 

I am very new to the Labview FPGA. I am actually trying to implement the very first example introduced by NI for learning Labview FPGA. I have to connect an input from one NI9401 to an output from the other.

However, when I drag and drop the input/output units, they both act as inputs:

Capture.PNG

I have also changed the propties of one of the NI9401 to act as output. But the issue still persists.

Capture.PNG

 

This is the example I am trying to build.

I will appreciate any suggestion.

 

https://www.youtube.com/watch?v=mv112V-P030&index=1&list=PLbCk9hRe-ziECXQjE--fN29C_kcx7CHnA

 


Reading digital input signal and finding gap width with out a clock?

$
0
0

Hey I've been trying to make a vi that can find the time it takes between a falling edge and a rising edge. So far this is what I have come up with but it seems to give a minimum time differance of 5ms. Is there a way to fix this without using a second clock. 

 

Here is a plot about what I'm talking about:

whatimtalkingabout.png

this should give me a time between clicks of about .00001s not 5ms.

I'm usinging a NI myDAQ.

I have also attached the Vi if you want to take a look.

 

 

Thanks

Ryan

Question for High School Team

$
0
0

It is possible to manipulate a RC Car to run on LabVIEW? Are there any toys that can run on LabView Besides Lego Robots?

RS 232

$
0
0
I am controlling keysight power supply by Rs 232,i am getting an error time our experied

Questions on LabVIEW block diagram

$
0
0

Hello sir, i am new to LABVIEW, but I have seen all videos and lectures related to LABVIEW. I have to make 3 models of LABVIEW. But i didnt able to understand the blocks used  and unable to find in library. i have attached model here. plz see to it and help me.

matlab code not working in matlab script

$
0
0

Hi,


I am trying to run a piece of software written in matlab, through a matlab script node. It consists of a class interface to C++ code which creates a mex file. This then allows a number of modules to be run, to control both a projector and a webcam. Some of these modules work when I run them, but the key one I want will not work, which takes an image for the webcam.

 

The key point is that all of this works when I run it directly through matlab. However when I run it through matlab script in Labview, then the matlab command line crashes. I have tried to track this error down, but all I get is that there is something wrong with my mex file.

 

My understanding is that when you run a matlab script it calls matlab directly. I have 64bit matlab 2015, but I am running 32bit Labview, although i dont think this should cause the problem.

 

Does anyone have any ideas why something may work in matlab as normal but then not in matlab script via labview? Could it be a memory allocation issue, as the C++ code allocates a set amount of memory for the image to be taken.

 

Thanks,
Dan

Viewing all 67264 articles
Browse latest View live


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