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

I2C comms using IMU and FPGA on sbRIO

$
0
0

Hi,

 

I'm new to the I2C protocol (and any digital comms) and am currently working on a project which uses a MPU-9250 IMU. To get some basic knowledge, I've taken a look at the shipped FPGA examples and examples people have posted on here. I now have a basic working system, which seems to be reading data, however I would however appreciate some help with some tweaks to getting the system working as I would like.

  

I'm running the FPGA Host example which I've compiled and run on my sbRIO-9627. I've attached a screen shot of the modifed built-in example host VI, where I'm using a For Loop on the VI to write individual addresses and then read the data bite one address at a time. The RT loop is currently reading at 100hz which should be ok for my purposes. However, the major issue I have is that the signals I can see on the sbrio graphs are updating about 2-3secs after i move the IMU. 

 

I've tried using different clock rates and anything slower than 100kHz seems will slow down host RT loop rate. Can anyone provide some pointers to 1) identify a better method to get data from the IMU 2) what I can do to ensure the data is not lagging from input to screen update.

 

Ideally I'd like to have the system running at 1kHz but that's the next step!

 

Using LV2015SP1, RT2015SP1, FPGA,

 

Register map sheet for IMU is here: https://cdn.sparkfun.com/assets/learn_tutorials/5/5/0/MPU-9250-Register-Map.pdf

 

Thanks,
Dave

 

 


Graphing a Customizable Circle

$
0
0

Hello,

I'm new to LabVIEW and am looking for some help graphing a circle in an XY-plot. I created a For Loop which graphs a simple circle (see attached image). However, I'd like to make some additions to my program:

  1. I want to create arrays of X and Y (using the For Loop) so that the user can choose the number of elements they would like the arrays to have (up to 360)
  2. I would also like to limit the radius of the circle to between 1 and 10.
  3. Finally, I would like to slow down the program so that the user can see the circle being drawn.

If anyone could suggest ways to go about making these additions, I would really appreciate it. Thanks!

Typecasting from (char *)floatArray to floatArray in LabVIEW

$
0
0

in c++ I do this: 

 

float arr[1000];
CustomDataType dt;
int size = 4 * sizeof(float);  //bytes to read: 16
int n = read(channelID, (char *)arr, size, &dt)
//n = 16

This will read 4 floats into arr. In LabVIEW however, when I call the read function which is inside a dll, I get back the correct &dt but buffer out (second param) from the dll is:

CDA0 6D46 (hex presentation)

I labview I'm using SGL which is 4 bytes I think. 

 

Now I have tried to typecast it into a float array but it seems that either the data i'm receiving is incorrect or I'm typecasting in the wrong way. What am I doing wrong? The read function is correctly configured in LV because I also use it in the handshake procedure with expected bahaviour. 

 

labview 2016

 

 

LabView Function Guide

$
0
0

Hi,

 

I am a student that is new to LabView and I was wondering if there was a function guide or something from the Control Panel/Function Panel? Like a place that shows the images of each function, what it does, and where it can be found.

 

Thank you!

visa serial read buffer occasionally stops receiving bytes

$
0
0

Hello there fellow LabVIEW users!

 

I have been scratching my head on this one so any input would be greatly appreciated. Hopefully i'm overlooking something trivial and someone can point me in the right direction Smiley Happy

 

So i have DUT(s) that i'm communicating with through a usb to to 16 port serial converter (Digi Edgeport/416, TI chip). In order to tell the unit that you want data, you send a "start continuous" hex command. Once that command is received and acknowledged by the DUT, it will return 90 bytes of data at a rate of once a second. It will continue to send data through the port every second until the "stop continuous" hex command is sent and acknowledged.

This issue i am having is that the unit starts communicating fine but then after some time (could be minutes, hours or days), my visa serial read buffer no longer gives me data. However, i know the unit is still sending data through the port because when i split my receive line into two separate COM ports, i can see the bytes show up in my terminal emulator (Tera Term). So it appears that the LabVIEW serial read buffer is getting blocked somehow? No one is touching the computer from the time the "start continuous" is sent so the issue is occurring with the computer just sitting there, collecting data and writing to a csv file. This issue seems to be irrelevant of number of units being tested because it has happened with one unit and with multiple. When testing with multiple units, not all of the units get into this mode, only a few, the others seem fine.

Thinking it might be a driver/converter problem, I tried changing to a different usb to serial converter (serial comm 4232, 4 port, ftdi chip) but that didn't help. I am currently running my program on a Windows 10/LabVIEW 2017 machine (also had this running earlier on Windows 7/LabVIEW 2011 computer with same problem).

 

I also tried running NI I/O trace to see if it would pick up any errors when this happens but didn't see anything there either.

 

I have attached a snippet of my code. The event loop monitor any operator activity (e.g. user click on "start continuous" button). The bottom loop is polling the serial port every 100 ms for any incoming data, the serial logic VI concatenates the incoming bytes until 90 bytes have been received and then parses it.

 

Kind regards,

 

Serge

 

 

How to start and stop writing TDMS files using a boolean toggle switch

$
0
0

I am trying to write tdms files using a toggle switch I named 'Start Test' in the attached VI.  I have figured out how to increment files so I don't overwrite the files, but I want to be able to create a new file each time I stop and start the 'Start Test' that I currently have tied to a 'Test In Progress' boolean indicator.

I'm very new to labview so it has been pretty frustrating trying to learn everything in such a short amount of time so I'm hoping someone might have some suggestions of what I'm doing wrong.

Also I need to have the data and time in there I just hadn't gotten it in there yet.  Is it possible to have the date and time write to every data point being output by the strain gauge data in the attached VI?

Getting started with Nema 23 stepper motor, NI 9512 module with a P7000 series drive in LabVIEW

$
0
0

Hello,

 

I am using a stepper motor with NI 9512 and P7000 series drive. I have followed the "getting started.." manual and done with all the connections and settings.

 

I want to control the motor with a cRIO 9076 in scan mode. Now, I dont know how to proceed with labVIEW. How should I start programming in LabVIEW? Please suggest some examples of scan mode.

I found examples mostly in FPGA part.

 

 

Implementation of time delayed features in LabVIEW2014

$
0
0

Can someone help me out with the implementation of time delayed features in labview? I am attaching a word file with the formulaeScreenshot (41).png


Mathscript node executes the whole code all over again despite having an if cycle

$
0
0

Hi there,

 

I recently noticed an unusual behavior of a Mathscript node in Labview. In Matlab for instance (and in the majority of other programming languages) you initialize variables before the if the cycle in the code (let's assume there is only one cycle). And then when the cycle condition is fulfilled, these variables will be inside the if loop to undergo some operations. The code won't pick up the initial values of the variables that were specified outside of the loop (in the beginning). But will continue to execute the cycle while the if condition is fulfilled.
But not in Mathscript. For instance the code in the pics.

 

loop_1.PNGloop_2.PNG

 

 

Even when the if the cycle is fulfilled, Labview will run the whole code from the beginning. Hence will write -7 to "c" and only after that will execute the if cycle and "c" becomes 0. Whereas in Matlab under these conditions "c" always will be zero (and it is just logical).
Of course, this code is only one example, but I need to know this crazy logic to troubleshoot my main code. Am I doing smth wrong here, this is the way how the node works? Thank you in advance.

Stack of 64 2D arrays - get median 2D array out of it

$
0
0

Hello all, 

 

I've got a sensor - you can compare it with an image sensor - that takes values into a 2D array. The dimension of this 2D array 1960*2588.

In total I need to acquire 64 of these 2D arrays, resulting in a 3D array of 64*1960*2588

 

I need to get the median 2D array [1960*2588] out of these 64 2D arrays. 

What would be the fastest way to do this? 

 

I've attached a vi with two possible implementations I've created but it takes almost 8 seconds to complete. 

One of the implementations fails with 'not enough memory to complete this operation'. 

I'm convinced there are better ways to do it, but analysis and filtering is not my strongest competence... I'm hoping so of you can help me or point me in the correct direction! 

 

Looking forward to some suggestions on how this can be improved. Thanks in advance for all the suggestions!

Note: I'm limited to work in LabVIEW version 2014 SP1 32 bit

 

Averaging signal based on condition

$
0
0

Hi all,

I am  new Labview user so I don't have much experience to do with it.

 

I am using LabVIEW to measure vibration from a moving object. I got the vibration signal with noise in it and I want to remove noise from the signal using averaging. However the vibration signal also depends on the position, so to get the true signal I have to do averaging signals at the same position. This means that I have to store signal at the same position to average them and repeat this for several times at different position.

How can I store the signals at the same position to do averaging efficiently (I want to average signals 15 time so for each position I have to get vibration signal at least 15 times)? Could you please suggest me any solution.

 

Thank you so much!

NI Vision - Copy overlay issue

$
0
0

Hello,

 

I would like to know why exactly this does not work:

example.png

 

What I want is to keep the overlays on the picture. But it removes the past overlay every loop. How can I use Copy Overlay correctly?

 

Thanks,

David

Change items in combo box while running in an executable

$
0
0

Dear all,

 

I'm trying to change items in a combo box based on the selection of the previous combo box. While running in Labview everything works fine, but as soon as I've build the executable the list of items is no longer updated. I've been trying several options including the Invoke node with "Reinit To Default", but that will give me and error during exe mode.

Below a part of the code I'm currently using.

Combo-box.png

This code is inside the Event structure with "Valve.Type": Value Change trigger.

I do get the changed value from Valve.Type and this trigger is fired but the Valve.Size items just don't change!

 

Best regards,

Jeroen

NXG 2.0 installation error

$
0
0

Hi everyone,

I'm trying to Install NXG 2.0 using the package manager and get an "invalid checksum..." error (attached).

Any similar experiences or proposed solutions?

 

Thank you

 

 

ListBox MutiLine

$
0
0

I am using a listbox control in my VI

I am populating it with strings that are created within the VI

My problem is, if the string length is too long I cannot see it in the listbox, it runs out of width.

When I right click on the control I can select multi line input but this only seems to work if I wanted to manually enter.

How I can I make it 'wrap'?

Thank you in advance

Lee


[ERROR] Sending email on labview (Gmail)

$
0
0

Hi,

I am using the built in Labview example "Send Email using SMTP CLIENT" and i am trying to send email using gmail server.

I have made basic changes into the gmail settings watching this video https://www.youtube.com/watch?v=D-NYmDWiFjU

But i am getting the error in connection with the host server. I have attached its picture so you can have a better idea of it.

Can anyone please guide me what shall i do to overcome this error message.

Thanks in advance

Problem Creating File Mapping Object in Memory Mapped FIles

$
0
0

I'm actually working on Image processing and things.
I have written a labVIEW code that pass image from LabVIEW to Python via TCP/IP socket communication, but the time overhead is very high for a big files.
So,I searched through the NI forums and found Memory Mapped Files are the best way to do Inter Process Communication(IPC) from here : https://forums.ni.com/t5/Developer-Center-Resources/Inter-Application-Communication/ta-p/3523015 .
and I also found a LV code for Memory Mapped File here: https://forums.ni.com/t5/LabVIEW/memory-mapped-file-access-problem/m-p/1213533 . But,it's not working. Create new Memory Mapped File always returns NULL. I also attached the code below

 

Any help?.

Thanks in advance.

 

extracting multiple arrays from a 1D array

$
0
0

I have an analoge signal of low voltage noise and square signals. I want to extract all square signals from the 1D array and put them in a 2D array. The distances between the square waves are not identical. That's why, I cannot divide the 1D array into multiple 1D arrays and search for numbers bigger than the range of the noise. I would be very thankful for any help!

dependency missing when I build exe

$
0
0

I have a top-level VI that allows the user to point to a directory.  Inside that directory are several plug-ins that I want to be able to dynamically load into a subpanel during execution.  Each plug-in calls a few sub-VIs, along with some LabVIEW primitives (for this example, each plug-in calls Traverse for GObjects).  Traverse for GObjects shows up in my project dependency list inside the vi.lib folder.

 

When I run this program inside the IDE, it works fine.  However, when I build an exe and load the VIs into the subpanel, it never finishes loading.  The image of the front panel of the subVI shows up, but I can't interact with it.

 

I turned on the remote debugger and was able to view my block diagram while the executable was running.  Here's what I see where I should see Traverse for GObjects (see attached...a big question mark where the VI should be).

 

So I take that to mean that when I build the exe, I must not be including my dependencies correctly.  So I went into my build settings and have tried several things there, all to no avail.  The other thing I did was take the default Support Directory (called data in my case) and place it directly alongside my output executable...my understanding is that if the exe is looking for a given VI, it will first check its own directory.

 

I also tried - in the Source File Settings option within the build properties - I set the Dependencies destination to be my executable (i.e. select dependencies, check the box that says "Set destination for all contained items", then choose my exe from the drop-down...shouldn't that effectively build anything listed in 'dependencies' directly into the .exe??).

 

A couple of things puzzle me:

1. the obvious, what am I doing wrong?

2. why doesn't the exe give me an error when I run it if it can't find it (if this is a setting that hides error messages, how do I turn it off)?

 

Thanks in advance for any help.

IVI Driver Issue with Agilent N5770A

$
0
0

Hi,

 

I recently downloaded the IVI driver for the Agilent N5770A DC Power Supply. On the website, it says that the Driver is for the N5700 Family and is compatible with N5770A. 

 

But in my NI-MAX, I see only N5700 as the supported model. 

 

I tried writing a small code to just set a 12V Output and Turn the supply on. The code runs without any errors but the instrument doesn't execute any of the instructions.

I can communicate with the Supply well via VISA using the specific drivers written for it. Its just the IVI Driver not being able to control the instrument. 

 

Here are a couple of screens of my test code and the Web page and the NI-MAX compatibility lists. 

 

Can i even use this IVI driver with N5770A? If not, is any other driver for it available?

 

Appreciate any help! 

 

Viewing all 66678 articles
Browse latest View live


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