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

Which DAQ do you suggest?

$
0
0

Hi,

 

I posted few days ago about it, but i changed my concept.

I would like to create a real-time PID regulation in LabView. There is a hydraulic cylinder with a load cell in the end of the rod.

I would like  type the force value in LabView, for example: 10kN and via DAQ, i would like to do real-time PID regulation.

 

The load cell and the hydraulic pressure relief can also receive tension signal.

 

Which DAQ do you suggest? I guess I need an AIO DAQ, but there are so many.

 

Thanks!

 


How to built waveform chart from CSV data

$
0
0

Hi,

I got the comparison waveform for two methods as follows.

 

ZN.png

 

 

As we right click on waveform chart and export data to Excel, and then Choose  the CSV format.

a CSV file is generated.

 

I want that, same CSV file can be used to display the waveform chart as it is (for further analysis).

 

I am using the following Code but not getting results.

 

New Bitmap Image.png

Please suggest the modifications, CSV Data file and VI is attached, for reference.

Regards

MMS79

Start a VI from a defined Point (like a Breakpoint)

$
0
0

Hi people,

 

i have a lets say VI (Q'ed State Machine Template) with a lot of user input to be made. As the development goes further i want to avoid doing all the user inputs in the front.

 

Now sure i can do this by doing a little trick around, but my question is:

 

Is there a way i can set a Breakpoint as a "startpoint" and safe all the User Inputs into this Breakpoint? The behaviour would be like, when i hit the start button the code executes from this point.

 

Thanks much for your advice in advance

 

cheers chris

 

export data to excel from mixed signal graph using invoke node method

$
0
0

Hi,

I am writing a code in which selcted poertion of the waveform graphs gets added to mixed signal graph.

 

Now, I am trying to export the data to excel from mixed signal graph using the invoke node method. ( I have attached block diagram and Front panel)

 

But once I run the code, I get an error ( Exception: Access violation (0xC0000005) at EIP=0x04BF1C47) attached and my code gets closed. 

 

I request your help to solve this bug.

 

Thank you.

 

Few points observed,

-- I don't get any error while mixed signal graph has no data. I only get the error when graph gets populated with the data as attached in the image.

-- I am getting same error if I try to export the data manually instead of invoke node method.

Create and commit large number of shared variables - dsc

$
0
0

Dear all,

 

 

I have a small problem with the DSC engine and the creation and commitment of many shared variables.


I guess it is well known that these two processes can take a lot of time depending on the number of variables. I have no problems with that. As long as one can abort this process and / or show the user that the system has not crashed.

 

For this I wrote a small VI (in LV 2014 SP1) to check the behavior of the Create Shared Variable.vi and the Commit Shared Variable.vi.


First the variables are created in buffer mode (the commit mode takes far to long for a larger number of variables). Then I collect all and try to commit them.


First, I will say a few words about what we expected: Before testing these VIs we actually thought that the Commit Shared Variable.vi is somehow not delaying further execution of the VI. So we thought Commit Shared Variables.vi only triggers the actual commit procedure in the background and then the code in this VI continues. This could lead to the problem that at a later point other parts of the source code try to connect to a variable which is not there. To overcome this we thought we can just use the Get Shared Variable List.vi in a loop and check wether all variables are there and delay further execution. This could also include a button for the user to cancel the operation and show him for example how many variables are already there and how long the whole commitment process will approcimately take.

 

 

Nice idea, but obviously it is not working like that. You can use the VI in the attachments and set probes at the marked positions to obtain time information. I tried it with 1000 to 30000 variables. Unlike our assumption the Commit Shared Variables.vi seems to stop the VI for several seconds. On my PC and with 30k variables it needs 9 s, which is much faster then expected by us. Actually we expected several minutes. For us this is a good sign.


But: The Get Shared Variable List.vi which is executed in the next step needs increadible long (over 3 minutes in the case of 30k variables). And once it is finished, it shows all variables. The conclusion would be that the variables are in fact NOT commited when the Commit Shared Variable.vi finished its execution. Something is still happening in the background preventing the Get Shared Variable List.vi from working.


As a next step I tried to write a number to one of the variables once the Commit Shared Variable.vi is finished (this is the other case in the conditional disable structure in the loop). Try to use this with 10 variables and it works (at least on my PC). With 1000 it is not working. He cannot find the variable.

 

 

So, my question at the end of this long text would be: Is there any way to find out when all variables are commited and ready?

 

 

Thx for reading and for your help


Greetings Dennis

FFT analysis and vector averaging

$
0
0

I have AM modulated (Carrier 250 kHz sampling) signal which I send it to USB 6218 DAQ. Then I measure the FFT using vector averaging to increase SNR. The whole program is in sequential form so that the signal generation is done and repeated in a loop and the next sequence FFT is computed. 

 

If I do measurement on the same DAQ and with the same sampling frequency for input (250 kS/s) then I am getting correct frequency spectrum but if I use two different DAQ, one for signal generation (AO) and second for measurement (AI) then I think I have synchronization problem because the averaging does not work. However, when I am using the same DAQ and I don't do any sync. 

The reason I would use two DAQs is sampling limitation of my card which is 250 kS/s and I have to go beyond that which is 300 kS/s.  I am stimulating with sound and measuring vibration. So the input sampling rate can be far less but when I go with lower sampling I have aliasing problem and again non-sync. 

 

I would appreciate if you share your experience about it!

 

Best regards, 

 MGH

Database Connectivity Toolkit PROBLEM: ignoring adLongVarChar and adLongVarBinary ADODB types

$
0
0

Using LV2013.

in ADODB, 'adLongVarChar' is the datatype for "TEXT" and 'adLongVarBinary' is the datatype for "BLOB". 
NI_Database_API does not implement them, in the VI "vi.lib\addons\database\Auxilliary.llb\DB Tools Type and Dir to ADO.vi" it is always 'adVarChar' and 'adBinary'. This is wrong.
For some DBMS  this might not be a problem, but for SQL Server this is a big problem. 
If you don't specify its an adLongVarChar, SQL Server right truncate data to 8000 bytes, indeed it gives an error and drop the changes. 

This error seems to be ignored due old versions of SQL Server used to support only up to 8000 bytes in a row column, but now if you specify VARBINARY(MAX) - you will need to use adLongVarBinary to use the 2TB MAX of space, or if you use TEXT (which is an alias to VARCHAR(MAX)) you will need to use adLongVarChar to use the 2TB MAX of space in row column. 


I've made fixes in the NI_Database_API by myself for it to work. I feel like NI_Database_API is abandoned.

I usually don't use this API, only when I need ODBC connectivity, usually I use SQLlite for my applications.


I've found out the problem by reading this http://stackoverflow.com/questions/1074428/how-to-write-to-a-varcharmax-column-using-odbc


Attached the fix done, now inserts of long text and blobs working.

write data to a logbook file only when a boolean indicator changes

$
0
0

Hello

I need to write my local variable state to a simple txt file only when it's true or false state changes.
for example, when my local variable 'temperature too high' is true, I need something like: temperature too high.
When it changes back to false i need: temperature OK. This with a date stamp.
It already worked to get a date stamp and to write the true or false state down but it always gets stuck in a while loop so the program keeps writing the same sentence.


change graph text spacing to division markers

$
0
0

Hello,

 

How do you go about changing the text spacing to the division markers on y-axis on a graph.  In the attached image, the numbers cover up the graphical ticks on the y-axis.

 Capture.PNG

 

Thanks,

hiNi.

Discrete slide values from array

$
0
0

Hello. I have a 1D array of double e.g. [1, 2.5, 3, 6.8, 10] and I would like to make a slide control, where user can choose only these exact values. Please note, that this example vector is very small and in reality I have "time" vector long more, than 100 numbers, so some manual inserting is not an option :smileyhappy:.

I have already searched in "property node", but did not find anything useful.

Thank you in advance.

Simple Bluetooth Server/Client on the same machine

$
0
0

Hello everyone,

i have a simple question about the Simple Bluetooth Server/Client example. Maybe the answer is obvious and i'm just an idiot but nothing is written about it in all the topics i read:

 

Simple Bluetooth Server.vi and Simple Bluetooth Client.vi can be run on the same machine?

Why do some items in "Open Existing Project" have just the project name and others have the entire file path?

$
0
0

I have LabVIEW 2012 SP1 and on the main LabVIEW screne I selecrt "Show Projects"

 

Why do some items in "Open Existing (Project)" have just the project name and others have the entire file path?

 

Examples of two lines in the Projects List.

 

Ping.lvproj (With a path: C:\Users\mlevine\Documents\MPCE EQT\EQT Software\Ping.lvproj)

C:\Users\mlevine\Documents\Common Mission Package Trainer (CMPT)\SUW Surface Warfare\Weapon Authorization Panel (WAP)\WAP LabVIEW Software\WAP Fire Authorization Server Apr 28 2015

 

Any chance it is because I made a copy of the that software and stored it off on a network drive and ran it out that network drive?

So if LabVIEW sees two or more versions of the same software it decides to use the full path name to distinguish between them?

 

I'd still rather it show just the project name and if you hover over the name it shows the full path.

 

Thanks,

Mark

 

 

 

 

write table to SAP (BAPI, ActiveX...)

$
0
0

Hello everybody,

 

I have to do a SW that interfaces with SAP. I already have functions to login/out, read/write a single parameter, and read a table (all this trough BAPI ActiveX), but I’m not able to write in a SAP table.

 

Does somebody already have done this job?

 

Many thanks for any advice!

 

Pierre-Alain

 

(LV2010SP1 or 2014SP1, W7, SAP Business Client 3.5)

distance along an ellipse arc (nD Nonlinear System Solver (VI).vi)

$
0
0

I'm hoping to get some help solving an issue I've come up against. I appreciate that what I'm asking requires some of your time, so I've tried hard to do my due diligence before posting here. I'll really appreciate any help I can get. I'm using LabVIEW 2014 Professional on Windows 7.

 

I've stripped away all the details of the specific application I'm working on and tried hard to isolate just the issue that is causing me difficulties.

 

I've posed the problem below and I attached some investigation code (sorry, there is quite a bit) that represents my current solution (with the issue).

 

Problem: Given an ellipse (with a major and a minor axis and a frame of reference), a distance to travel and any point on the ellipse, calculate the end point on the ellipse where the elliptical arc length between the two points equals the given distance to travel.

 

I'll restate the problem, but with physical values. Given an ellipse, centered on the origin, with axes of 10mm and 8mm, and a starting point (5mm, 0mm); what is the end point on the ellipse after travelling 1 mm along the ellipse?

 

This initially seemed like a simple calculation (and it is for a circle), but for an ellipse, the math turns out to be somewhat more complicated and requires numerical computation.

 

Issue: I was given some python code that solves this problem and embarked on a LabVIEW solution. The python code uses the function optimize.fsolve from the scipy library to solve one aspect of the problem. I'm not too familiar with the LabVIEW VIs available to do the equivalent, but settled on "LabVIEW 2014\vi.lib\gmath\zero.llb\nD Nonlinear System Solver (VI).vi" (my code still has other options disabled in the code). When I use this solver VI, I do not always get the same answer from this VI. Sometimes it finds one root and sometimes two. For points separated by less than half the circumference of the ellipse, there should always be 2 roots (one in the clock-wise and one in the counter clock-wise direction). Any ideas why the solver does not always return 2 roots?

 

Current Solution: My investigation VI takes two points on an ellipse (defined by a start angle and end angle) and calculates the distance between them along the ellipse. Then, I take the start point and the distance and try to calculate the end angle (which I can use to find the end point). Run once, it usually finds the right answer, but run 100 times it often returns the answer 19. I should mention that I'm not 100% positive there are no issues with the code used to support this calculation and I'm open to any suggested changes or improvements, but the issue currently causing problems is the inconsistent operation of the solver VI.

 

Again, I appreciate this is long and thank you for reading this far; I hope you find this as fun a problem as I do! :smileyhappy:

 

Chris

Unexpected result when saving image of front panel in EXE

$
0
0

Below code is used to save an image of the front panel of a VI. The front panel shows an XY graph with two plots.

 

Save front panel.png

 

This works perfectly in the development environement. With the EXE, the plots of the graph (only the plots) are invisible.

 

Have you already encountered this unexpected behaviour ? Many thanks for any advice.

 


cannot find application builder

$
0
0

Hello,

 

I have read many old posts on this but have ben unable to find something helps.  I have Labview 8.6 and am trying to build an application from a project.  When I right click on "build specifications" in the project and choose "New", my options are "Source Distribution" or "Web Service".  I have tried putting in the software CD and re-installing the application builder, and it seems to proceed normally with the re-install, but still no "Application" under the build specifications menu.

 

Any suggestions on where to go next?  I appreciate ANY help you could offer here.

 

Thanks!!!

multicolumn listbox scroll to the last row - with autosizing on

$
0
0

Hi, Everyone:

 

I have a question about scrolling to the last row of a multicolumn listbox with a little twist: Autosizing Row Heght is on.

 

I've checked this out - multicolumn listbox - scroll to last element - but if one or more rows have been autosized to have more than one line, then the actual number of visible rows differs from the numrows and the calculation ends up incorrect.

 

Has anyone figured out how to do this?  If there was only a property to find the heght of a row in lines...

 

Thanks!

Persistent Subpanel - Video Pop out problem.

$
0
0

I want to have it a video display on my main vi that can be "popped out" when a button is clicked. To do this I thought to run the pop out window as a subvi and embed it in a subpanel on the main vi until the user presses the pop out button. However, I can't figure out how to make it so that when the vi isn't running for the subpanel to show the front panel of the subvi. Is this persistent subvi subpanel behaviour possible? 

 

Regards,

 

Craig

Continuous sampling of data

$
0
0

I have multiple DAQmx channels being sampled at 1kHz, others being sampled at 10kHz.  I also have network data (timestamped) coming in asynchronously with changes at a maximum rate of 200Hz.

 

These are all being pulled in and recorded on a LV RT PXI chassis.

 

I would like to extract live data for viewing by the test operator on a remote PC.  They will want to view selected waveforms continuously..

 

Since all of these are coming in at effectively different rates, what is the typical design pattern for gathering live preview data (All aligned in time on the display)?  I suspect strip charts will be the basis, but those require the same dt and t0 for all input wave data.

 

Thanks,

 

XL

How to perform Bubble Sort

$
0
0

I am looking for a way to create a VI that works its way through the elements of an array, compares adjacent element and if the first element is smaller than the second, swapping them over. When the swap reaches the end of the array it goes back to the beginning and repeats until everything is in order a maximum of N-1 times. It would also be great if you could advise me on how to combine this with a VI that generates random numbers. Many thanks

Viewing all 67286 articles
Browse latest View live


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