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

Re: Having an executable expire

$
0
0

I would like the program to stop from being started all together after a certain date/time. 


Re: How can i fit the Gaussian curve?

$
0
0

 wrote:

How can i do this. Its not clear for me. If you have time can you show me please.


Glancing at your code for a few seconds, you first need to do a few simple LabVIEW beginner tutorials, because whatever code you have attached contains glaring race conditions, mostly due to the blatant overuse of local variables. None are needed. Even the sequence structure is not needed. For example, in your while loop, you write to and read from local variables of the same indicator in parallel and the outcome critically depends on the order of operations, but the order is not predictable. All you need is wires! If you want to see the current value, wire the indicator to it. No locals needed!

 

After that, have a look at my "Practical nonlinear fitting" page for some ideas.

 

Now about the data. It seems your data is a Gaussian if graphed on a logarithmic scale, so it is probably a different shape in linear space. Where does the data come from? What does it represent? What is the theory behind the shape?

 

Re: creating 1 million text files in labview

$
0
0

 wrote:

 the main problen is that the vi takes a longertime to create a txt file, so when i have a large data sets the vi becomes slow  and when i change the folder location it start to work normal. can any one help me in this regard?

thanks


Working with 1,000,000 files aside...

 

Is it the file creation or the data transmission that is taking too long? 

 

IF it is actually the file creation that is slowing everything down. I suggest using a Producer/Consumer architecture. The producer will collect the data and  pass it to the consumer,  that is now decoupled from the acquisition loop, so it can take its own sweet time creating files.

Re: creating 1 million text files in labview

$
0
0

 wrote:

Is it the file creation or the data transmission that is taking too long? 

 


As I have explained, the only thing slowing things down is the use of "Create file name with incrementing suffix", which does a "list folder" with each call, parsing all existing file names to determine the next suffix. This is the only operation that increases in cost with the number of existing files. The cost of all other operations is constant.

Strange Memory Leak

$
0
0

I'm working with an ActiveX API using events to capture the status of all of the I/O for a small PLC.  Essentially, the PLC contains 8 Analog I/O and 16 Digital I/O and retrieving the status of all of these is done via a single event, which requires a loop of API calls to decode the event data.  Part of this process involved querying the PLC for it's list of sources (all of the I/O names).  The API returns a variant data type for the sources, which is converted to a String Array.  This conversion every time the event fired was causing a memory leak that was proportional to the rate at which the events occur.

My question is, "Is this an expected behavior?".  It seems as though a buffer is created to do the conversion and that buffer is never freed up.  So, every time the event occurs, another buffer is created.

 

Now, In my working version of the attached block diagram, I pass the a class datatype in for the User Data, but stripped it down for illustration.  Part of that class is a queue reference for passing the data out of the callback VI.  And to work around the memory leak, I now pass in the decoded String Array as part of the class datatype, so the event doesn't have to decode it every time.

Does anyone care to comment on the Variant to String Array question?

 

Thanks,
Bruce

 

Re: Continuous Power spectrum density at 0.25 Hz resolution

$
0
0

As i understand, DeltaF = Fs/ N

 

Delta F = Fs/N

T (acquisition period ) = N*Fs

Delta F = Fs/ (T/Fs) = 1/T

 

As RavensFan stated. Just a different way of think about it. For example, a 10 s acquisition gives you a 0.1Hz resolution, irrespective of the sampling frequency.

 

mcduff

Re: creating 1 million text files in labview

$
0
0

 wrote:

The tool "Create file name with incrementing suffix" Is the only thing that is holding you back, because with every call it does a "list folder" command, which gets more and more expensive as the number of files increases. Listing tens of thousands of file names to sort out what number comes next is not a trivial operation the way it is implemented. (You can open it to see what it does!).


I haven't even looked at the code and this is instantly what I thought the problem would be.  But agree with everybody else, the shear number of files is insane.  I will side with Mark here: you really should be using a database.

Re: Strange Memory Leak

$
0
0

It does create a buffer allocation. Have you tried initializing the array before hand and using an inplace structure with that array as the type input to the Variant to String Array call?


Query the version of MySQL ODB from LabVIEW

$
0
0

I'm communicating with a database via the MySQL ODBC driver. I must deploy the software on different computers.

On the development computer I have MySQL ODBC 5.3 and on the target computer, I have MySQL ODBC 8.0.

enter image description here

Is there a simple way to determine the MySQL ODBC driver version so that I can modify the connection string as needed?

Packed library with non vi files

$
0
0

Hi,

I'd like to use a PPL containing non vi files in a  application.

As configured and expected, the build folder for the PPL is the following :

- Build\myPPL.lvlibp

- Build\Resources\anyFile.nonvi 

If I include the lvlibp in my application project on the same computer there are no problem.

 

Now If I copy/paste both the PPL and the application projects on a other computer and open up the application project, I've got a warning indicating that the non vi file from the lvlibp is missing (the path shows the absolute path from the first computer). 

Is there any workround for marking non vi files relative to the output PPL in the fist place?

 

Regards,

Tomer.

Re: Strange Memory Leak

$
0
0

Mark,

Thank you for the quick response.  I don't 'think' initializing the array is a valid option, since the customer has different versions of these PLC's, I can't for sure know how many entries there would be from system to system.  And it wouldn't be future-proof in the event that they migrate to a different version of the PLC down the road.

 

I think you did answer my question though, but I'm curious why LabVIEW doesn't eventually free that buffer up once that event callback is complete.  Is this a bug in LabVIEW that I'm having to work around?

 

 

 

Ni- Scope How to change the time base?

$
0
0

We recently purchased our first NI USB oscilloscope. (USB-5132)

 

Instead of a bunch of dedicated VI's like I would get with a stand alone O-scope the NI devices use the NI-Scope VI set. 

 

Changing the time base seems like a very basic function for an oscilloscope, yet I have gone through all of the examples and in every single one of them there is no way to change the time base

 

The " Configure Horizontal Timing" vi. only allows me to change these things:

  1. min sample rate
  2. min record length
  3. reference position
  4. number of records
  5. enforce realtime

How do I change the horizontal time base?

Do I have to do some kind of crazy math involving the sample rate and record length?

Re: Need a Labview Core 2 Course manual ( > 2015 )

$
0
0

Yes, Bob is right. The first page of the exercise guide says that it may not be reproduced or transmitted in any form.

Re: Continuous Power spectrum density at 0.25 Hz resolution

$
0
0

 wrote:

As i understand, DeltaF = Fs/ N

 

Delta F = Fs/N

T (acquisition period ) = N*Fs

Delta F = Fs/ (T/Fs) = 1/T

 

As RavensFan stated. Just a different way of think about it. For example, a 10 s acquisition gives you a 0.1Hz resolution, irrespective of the sampling frequency.

 

mcduff


I understand that. But my query is, is my implementation of circular buffer correct? Because, results what I am getting is not matching with expected results.

Re: creating 1 million text files in labview

$
0
0

Even the OS is probably not very happy with so many files in one folder. Just opening an explorer window, potentially sorting, showing the correct icon, etc. Is a big job. Same for the search indexer.


Re: Packed library with non vi files

$
0
0

In the build specification for the PPL, you can specify the "Support Directory".  Any non-LabVIEW files should end up in there.

Re: where can I download the DSC Run-Time System 2016 or 2013?

$
0
0

Hello, i am Thierry TEMGA. I have installed Labview software 2013 by a CD. I have download 2018 DSC module via my ni account. Please where can find the evaluation version of 2013 DSC module?

Re: Continuous Power spectrum density at 0.25 Hz resolution

$
0
0

I do not see a circular buffer in your examples, you are just enqueuing data. You need to think about how you want to implement your buffer, it is lossy, do you want to skip adding points to it if it is busy processing, etc.

 

There are lots of other things in your example that could be fixed, but I do not know whether you just put it together for an example.

 

Attached is a real hack of the program that will get it to do what you want, but I highly suggest you just look at it to see what can be done and rethink you problem.

 

mcduff

Re: Strange Memory Leak

$
0
0

It is the mysteries of how LabVIEW managemes memory for you. You could try adding a call to the "Request Deallocation" VI however this is just a suggestion to the memory manager. There is no guarantee any memory will be filled after making the call. However it does give the memory manage a clue that it could do some cleanup at that point.

 

As for preallocating you could have a parameter that you pass in, with some reasonable default value, that would provide enough space to contain the PLC data. At startup the application could read a value for the number of parameters you are getting from this particular PLC and then preallocate the array using that value. This would help to future proof the code some. Though I'm not sure if you would see the same issue with the preallocated array. It may have the same result.

Re: Extract string within parenthesis into a numeric array

$
0
0

Thank you so much for responding so quickly!  This solution worked perfect!!! I can't believe the formatting was that simple.  I feel so silly. 

Viewing all 203560 articles
Browse latest View live