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

FGV VI inside of class method that is called on array of objects in a for loop

$
0
0

I have an array of objects wired to for-loop. I call the method VI on object in for-loop. If the method uses/calls some VI with state/memory (like FGV) the state is shared for every call of method in a loop despite the called VI is reentrant preallocated. Does anybody know how to solve this problem?


Compensate for accelerometer signal decay due to AC coupling with NI9230

$
0
0

Hello LabView experts:

 

I'm trying to acquire the acceleration signal of a test sled using a PCB triaxial IEPE accelerometer (Model 356A15 - specsheet attached) and the NI9230 card mounted in a cDaq-9132. The constant current exitation is provided by the NI9230 card (internal) and the coupling is set to AC. This configuration doesn't allow for DC coupling.

The attached picture shows the measured acceleration of the test sled. However, due to the signal decay caused by using AC coupling (as shown in the second picture), the acquired acceleration signal is destorted. Do you have any recommondation on how to correct the signal in software for the decay caused by using AC coupling?

 

Any advice is greatly appreciated.

 

With best regards,

Manfred Amann 

Python client to unflatten received string from TCP Labview server

$
0
0

How do you decode, unpack a flattened string in Python which was sent by a LabVIEW TCP server?

I want to exchange data via loopback. Therefore I take a sine wave and flatten it to string and sent over the network via ServerSine.vi. Then I have to decode the incoming data in a way that I have the correct numerical values like when I plot them in LabVIEW. I did this so far in python_client.py but the values are wrong.

Does anyone know how to decode this correctly?

Problem in labview 7.1 when I opened in labview15

$
0
0

 I opned the Vi 7.1 in labview 2015 , but when I connect the transducers with acquisition data card  ( nationel instrument) , it apears that my Vi 7.1 show randoms values of the Output and not what I measure buy Multimeter for each transducer.

 

Can help me please

FPGA Adder tidbit - Optimise using DSP Adders with additional functionality

$
0
0

I think most people are aware that we can use DSPs for multiplication, right?  Did you know they also have built-in adders?  They can add numbers up to 48 bit in width.  The path to unlocking the functionality is using the XIlinx IPCores (I use a target compiled with the ISE compiler so I don't know if the same functions are available in Vivado or if they are different).  It's worth the learning curve.

 

How many people have done the following in FPGA code?

 

2016-09-30 18_10_01-Conditional Adder.vi Block Diagram on Nanonis V5.lvproj_FPGA V5 _.png

The above code usilised 33 LUTs.  The following code uses zero LUTs (1DSP).

2016-09-30 18_10_44-Conditional Adder.vi Block Diagram on Nanonis V5.lvproj_FPGA V5 _.png

 

It gets even better, the DSP also supports a Bypass node where Input b is simply copied to Output s (respecting latency settings).

2016-09-30 18_11_51-Conditional Adder.vi Block Diagram on Nanonis V5.lvproj_FPGA V5 _.png

 

 

And if you knew that, did you know it can be configured for Adder / Subtracter operation also?

2016-09-30 18_12_41-Conditional Adder.vi Block Diagram on Nanonis V5.lvproj_FPGA V5 _.png

 

 

Finally (or at least the final piece I am going to write today), the DSP has input and output REgister built-in which can be used for pipelining at no LUT cost (Registers are purely internal to the DSP).

2016-09-30 18_14_06-Conditional Adder.vi Block Diagram on Nanonis V5.lvproj_FPGA V5 _.png

 

The LUT examples listed are for 32 bit values, if the values were actually 48 bit, the resource savings would be even greater (50% more).

 

So if you find that your code is running out of LUTs, it might be worthwhile looking at palces where you may be doing some of these operations.  Especially the conditional add is a nice function to be able to implement fully with a DSP.

Apply custom scale and add bolean so I can log on demand

$
0
0

Hi

 

I have a problem adding my custom scale to the code. I have a pressure transducer that is working in the range of 4-20mA. So I made a custom scale as you can see in the code and tried to wire it to the custom scale name on the DAQ.mx. That does not seem to work any suggestions? 

 

Another problem I have is that I want to be able to log on demand with a bolean button. How do I do that if I want to keep the option to only write data at a specific time interval? 

 

Greetings 

DP

Averaging over loops

$
0
0

Hello NI community.

 

I built a VI that basically outputs voltage from some maximum voltage to some minimum voltage back to that maximum in n steps (all user specified) and measures an input voltage at each step. This is all contained within a for loop to have multiple scans.

 

I would like to average the input voltages over all of the scans for each step and display it on an XY graph as the VI runs*. My idea is to have an array built for each step and each time a scan passes through that step it adds to that array. Then I can run it through a mean.vi and display it. I was hoping for advice on how to impliment this. Thank you for any that you guys can give and let me know if there is anything I need to clarify.

 

*Each scan passes through the output voltages twice but the input voltages will be different for scanning down vs up due to the physics of the experiment so I do not want to average the parts of the scans.

Producer loop enqueue element timing

$
0
0

Hi,

 

I am trying to build a producer-consumer data acquisition VI, but I am having some trouble getting the enqueue element timing to work properly.

 

I am using the Elapsed Time function for timing, but it does not seem to be working as expected. My producer loop can poll data from a Keyence laser displacement sensor at about 550 Hz (this seems to be the rate at which a counter increases in the producer loop without any wait functions.) I am trying to enqueue data from the sensor at a user adjustable rate while still polling at a fast rate. The timing I am using for the enqueue element is shown here:

 

Producer loop enqueue timing.png

For some reason, the rate at which the elapsed time function turns the case structure to true does not seem to match the logging frequency. For instance, when I set the logging frequency to 200 Hz, the final log file appears to only have a logging frequency of about 113 Hz.

 

I am not sure whether or not the elapsed time function is meant for high-speed use or if the issue is somewhere else in my code. I have also attached the VI. 

 

To end the producer-consumer loops, I enqueue a stop boolean true onto the end of the queue (after exiting the producer loop) which stops the consumer loop (once all the previous queued data is processed) and then destroys the queue.

 

Any ideas on how I can adjust the timing functions to enqueue elements more quickly?

 

Thanks.

 

Best regards,

 

Victor


MSB first or LSB first

$
0
0

I have byte "00011100 " but I want to swape this byte to " 00111000" . what should I do ?

ps. I try to use tool box " swape byte"

polynomial evaluation vi giving inconsistent results

$
0
0

I was looking at an easier method to do a polynomial evaluation, rather than using the formula nodes that i currently use.  I found the "Polynomial Evaluation vi" which one would think based on the help would be able to calculate the result of a multi exponent polynomial.  

Currently i would do something like the following in a formula node:

 

float64 D1=0.387481063640E-01;
float64 D2=0.332922278800E-04;
float64 D3=0.206182434040E-06;
float64 D4=-0.218822568460E-08;
float64 D5=0.109968809280E-10;
float64 D6=-0.308157587720E-13;
float64 D7=0.454791352900E-16;
float64 D8=-0.275129016730E-19;


DC= (V*D1)+(D2*V**2)+(D3*V**3)+(D4*V**4)+(D5*V**5)+(D6*V**6)+(D7*V**7)+(D8*V**8);

 

I tried the same calculation by writing a small VI that used the polymomial evaluation vi and get seriously incorrect results.  (my vi attached.)

Looking into the polynomial evaluation vi, i dont honestly know how it's supposed to work, unless it's trying to do somethign completly different than i'm doing.   (Using labview 2015)

 

I'm open to any suggestions here.  Thanks!  Mitch

 

 

 

Trying and failing at performing velocity measurements

$
0
0

Can someone explain to me how the CI Linear Velocity module is supposed to work?  I've been trying with no successt for some time to use it to take velocity measurements using a counter input.  I'm using an NI 9411 Digital Input card to accept a signal from a radar system that outputs a measured speed as a frequency (that just so happens to work out to a rising edge every 0.176 inches moved).

 

Everytime I run the VI I get an error out of the Create Channel module that is as follows:

Code: -200431

Source: DAQmx Create Channel (CI-Velocity-Linear).vi:2530001<append>
<B>Property: </B>CI.MeasType
<B>Requested Value: </B>Velocity:Linear Encoder
<B>Possible Values: </B>Frequency, Period, Pulse Width, Semi Period, Two Edge Separation, Pulse Frequency, Pulse Time, Pulse Ticks, Position:Angular Encoder, Position:Linear Encoder, Count Edges

<B>Task Name: </B>_unnamedTask<6>

 

Which, on a similar topic, is there a document anywhere that lists DAQ chassis module and DAQmx measurement compatability?  Cause I cannot find this documented anywhere that is obvious...

Help transitioning from express VIs to DAQmx data acquisition - buffer overflow error.

$
0
0

sample_code_snippet.png

The attached code snippet is taken fairly directly from a VI in the example finder - I am just trying to wrap my head around how hardware sample rates and buffers interact with software sample rates and buffers. No matter what input I choose for 'sample rate' and 'samples per channel', I always get the error:

 

"The application is not able to keep up with the hardware acquisition. Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem."

 

I am using a simulated DAQ to generate the data and my computer's hardware clock to set the sample clock. This is not an issue I have ever encountered in my use of the express VI's. I have tried using breakpoints and probes to debug - no help so far though. Any insights would be appreciated.

Allocating Host (PC) Memory to do a DMA Transfer

$
0
0

Hi

We have an application where we need to have a custom PCIe board transfer data to the PC using DMA.

We are able to get this to work using NI-VISA Driver Wizard for PXI/PCI board.

The recommended approach is to have VISA allocate memory on the host (PC) and have the PCIe board write to it (as seen below).

9-30-2016 6-14-20 PM.png

While this approach works well, the memory allocated by VISA for this task is quite limited (~ around 1-2MB) and we would like to expand this to tens of MB.

Note: The documentation (and help available on the web) regarding these advanced VISA function (for instance "VISA Move out 32" and "VISA Move In 32") is parse. If someone has some deep knowledge regarding theses, please feel free to share how we could allocate more memory. 9-30-2016 6-36-01 PM.png

Since we are not able to allocate more memory using the VISA function at this time, we investigate doing the same operation using the LabVIEW Memory Manager Functions which allow us to allocate much larger memory block.

Below is the resulting code.

9-30-2016 6-20-29 PM.png

Unfortunately while we can validate that reading and writing to memory using this work well outside the context of DMA transfer, doing a DMA transfer do NOT work (although the board think it did and the computer is not crashing).

We are wondering why this is not working and would welcome any feedback.

Note: the DMA transfer implemented on the board requires contiguous memory for it to be successful. I believe that the LabVIEW Memory Manager Functions do allocate continuous memory, but correct me if I am wrong.

To troubleshoot this, I did allocate memory using the LabVIEW memory manager function and try to read it back using VISA and I got a "wrong offset" error (Note: This test may not be significant)

Another data point; while the documentation for DSNewPtr do not talk about DMA transfer, the one for DSNewAlignedHandle does. Experiment using LV memory manager Handles has not got us anywhere either.

We would welcome any feedback regarding either approach and about the LabVIEW Memory Manager Functions capabilities in that use case.

Thanks in advance.

PJM

Note 01: We are using LabVIEW 2014 if that matter at all.

Note 02: This question has also been posted on LAVA.

Transparent button disappears on the color tools

Retriggerable analog input with two counters

$
0
0

Dear Community,

 

I have been trying to use retriggerable option for the data acquisition. my understanding of using two counters is not very clear.

 

What I want: Acquire data once every ten seconds.

 

After reading help online, here is the idea.

1. Use retriggerable option for the analog input using two onboard counters (PXI 6254)

2. One counter generates sample clock for analog input

3. Second counter generates the trigger (freq = 0.1 Hz) 

 

Attached figure is the screen shot of my program. The program gives errors but before that I am not sure whether my implementation is wrong or the idea is wrong . Is there any need for external connections or everything can be done internally? 

 


Report Generation Toolkit Compatibility with Microsoft Office 2013 and LabVIEW 2011

$
0
0

Hello,

 

I design the LabView 2011 Version to test for the solid state device and need to create the test data after this device tested.

 

When I save the test data in Excel setup after running Laview program, it created an error as "Error - 41007 occurred at NI_report.lvclass:New Report.v -> ...NI reports; You musr have the LabVIEW Report Generation Toolkit for Microsoft Office Installed to create this type of report. The toolkit musr also have an activated license or be in evaluation mode." 

 

Questions: Do I need to install LabView Report Generation Toolkit for Microsoft Office in my computer?. If yes, what is the LabView Report Generation Toolkit for Microsoft Office Version. Where can I find this software?. I use Labview 2011, Window 7, MS 2013 in computer.

 

Thanks,

Jonathan Tran

 

 

Plot the angular position of two motors

$
0
0

Hi, I would like to plot the angular position of two motors (X,Y) in a single graph. It means plotting the angular position of motor X along x-axis &  angular position of motor Y along y-axis in LabVIEW. Can anyone suggest me any VI, or how to implement it in LabVIEW.

SubVI front panel opens in different window

$
0
0

Good day!

 

I have made a sub-vi and used in it another VI.

 

Now, in the sub-vi I have a indicator, I want to show that indicator in my front panel 

I don't have the indicator from the subvi on my own panel, I can only open another

front panel when I double click the subvi.

When I copy that indicator I just get the indicator without all the logic that's made in the subVI.

 

How can I make a connection to my front panel?

 

 

Access is Denied to Documents and Settings when trying to access .wav files

$
0
0

Hello,

 

I am buliding the piano stairs that AshLu posted on the community and I am having problems with the code ( https://decibel.ni.com/content/docs/DOC-12384 ). If I try to use the .wav files that come with the download I get the error that they can't be found and access to C:\Documents and Settings is denied.       Error 7 occurred at Sound File Read Open.vi->Sound File Read Simple.vi->myDAQ8.vi

 

I have tried seaching File Explore for the Documents and Settings but it doesn't pop up.

I have also tried creating a File called Documents and Settings but then it says the file all ready exists and mereges them.

I have also tried replacing the built in .wav files with my own .wav files but then I get error waveforms have different dt values.

 

Any help would be apprecated.

Thanks

Arduino HX711 Interface

$
0
0

Ok, i have arudino UNO connected to HX711 board, i have LINX package installed and able to communicate with arudino, however i can't found a way to read the hx711 load sensor output in to lab view (because of it's analog output) i did searched the forums and found that this is unsolved problem

 

https://forums.ni.com/t5/LabVIEW/Connect-Hx711-in-a-NI-USB-6009-or-Arduino-UNO-in-the-Labview/m-p/3095504

 

https://forums.ni.com/t5/LabVIEW/labview-code-HX711/m-p/3217221

 

on the other hand there seems to be someone who did managed to do that

 

https://www.youtube.com/watch?v=Z3BCwk7Z7tI

 

as you see in the video, i want to do exactly as in that video, sadly he didn't post and code or vi to learn from, so help is really needed here

 

thankyou

Viewing all 66969 articles
Browse latest View live


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