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

Sampling rate on data acquisition

$
0
0

Hello everyone,

 

I am experimenting with interfacing a data acquisition device through its ActiveX controls. There is external software coming with the device that operates as kind of an oscilloscope, and on which you can set units, sampling rate (up to 240Hz combined) and enable/disable channels etc. The software runs in the background and the labview code exists to manipulate whatever data is observed and log it. Eventually, I will add more hardware elements etc, but the signal I will be observing will be coming out of a lock in amplifier.

For testing purposes, I disabled all but one channels so I'm sampling at a rate of 240Samples/singleChannel/second. I connected the output of a signal generator and have obtained data for frequencies ranging from 1Hz to 200Hz. I wasn't expecting anything above 80Hz maximum to even work -I was reading about the Nyquist theorem- , but I find myself puzzled on 2 fronts:

1) even on low frequencies (as low as 20Hz), the graph doesn't represent the true signal. Very few graphs in LV give out the true period (ex. the 1Hz), even when the software displays the correct data. At 240Hz sampling rate, should I have issues like that (and/or partially reconstructed waveforms that look 'broken') ? 

2) the LV code array datapoints seem to contain an ubnormally large amount of data. Keeping in mind that the way i understand it information is stored in the shift registers, RAM will eventually flood. 

 

I have attached a vi sniplet as well as several pictures showing the issues for varying frequencies, accompanied by the software equivalent pictures. I'm thinking I am either producing a timestamp in the wrong way, or I have misunderstood the way the XY graph matches data points (it also looks as in the higher frequencies data is obtained only on edge points). An express vi with the same time as x axis produces equally unmatched graphs.

 

Any advice would be appreciated,

Nafsika


Sampling frequency for a analogue pulse voltage signal

$
0
0

Hi, friends:

I have an analog voltage signal with the period of 4.3 ms, pulse width of 0.4 ms, and amplitude of 5.2 V. I tried to catch the signal by BNC 2110 & PCIe 6321, using it as a trigger signal.

 

By my design, I can see the waveform from the graph, however, the waveform got by Labview is different with the waveform from oscilloscope, just part of it. I think it means labview just caught part of the pulse, maybe the pulse width is too narrow for the labview to catch.

 

Do you have any advice? Thanks a lot.

 

Screenshot_1.png

Problem when file path is not selected to read a file when button pressed

$
0
0

Hi all,

Have programmed with event structure and while loop.

1. created a event for a button

2. when pressed it should read a file selected (I have not connected a path control)

When the button is pressed the particular folder pops up, from which user can select the file. But, instead of selecting the file, if the user clicks on cancel, the program instead of being on same front panel, proceeds to the next part of the code.

 

I want to program such that the user comes back to same front panel if he/she clicks on cancel during the file selection. How to program this?

 

Thanks in advance

 

Joystick Simulation

$
0
0

Hello,

 

I would like to build an application that can send information to windows as if it was a game controller.

It must be possible using user32.dll but I haven't found anything.

What I would like is kind of the opposite to the VIs found in the Connectivity>Input Device palette

 

Best regards

Generic Error. The file could not be loaded.

$
0
0

Hello,

I'm currently working on a project for school. I saved a VI after a few modifications, closed the program, and now it can't open at all on my computer. Does anyone know if I can recover the file, or do I have to completely restart? Here's the VI if you can open it.

FPGA project best practices

$
0
0

Hi, so I currently have a project that includes a Host VI and the FPGA VI. My project is expanding though. We're adding more digital and analog signals to the project (we're adding a new C-series module to read from). This will require updates to the FPGA, and then updates to the Host VI. We'll still need the original Host and FPGA VIs though for testing of the smaller system.

 

My question is then what the recommended way or best practice here would be. Should I create Host_2.vi and FPGA_2.vi (or something like that) within the project. Or should I just create a new project? Thanks!

I2C with USB-6002

$
0
0

Hi everyone,

I am trying to use the USB-6002 DAQ to send data to two digital potentiometers using I2C.

I have used this DAQ to control an SPI potentiometer but I don't know how to even start the I2C communication.

Any help will be really appreciated.

Thanks.

 

PS. These poetentiometers are working fine using arduino but I want to control them with the USB-6002 DAQ.

Array comparison - return element with larger amplitude

$
0
0

Hi all,

I have an array that I acquired from Peak Detection that returns all elements above a threshold. I have pretty good results but (because of some noise) I have some indexes that I want to remove because they are too close together. I want the peaks to be separated by at least 200 samples. I tried using a for loop by comparing points within 200 samples and return the higher amplitude but, since I'm very new to Labview, I can't seem to figure out how to make this work. I hope this makes sense. 

 

Regards,

Chris


Serial Communication Problem using hexadecimal

$
0
0

Hi friends;

I have a problem with serial communication.

I want to connect our experiment equipment(TruHeat HF 3010) using labview but I don`t know what is the problem.

Manual says that system communicate with pure binary. And in example, there are all hexadecimal.

I write command hexadecimal(and set display hexadecimal).

I found some document about error which is related with my labview error(frame error).

I tried all of method in here(http://digital.ni.com/public.nsf/allkb/F3E0621CB71AA16786256F970000FC57).

But it remains unsolved.

manual says that baud is 19600. But when I use teraterm, It doesn`t work. It works well in 57600. So, I set baud 57600 in labview.

 

 

20 channel chatter monitor - X series NI 6343

$
0
0

Hi All, I'm new to the forum and just getting my feet wet in developing VIs. I find that I need to make a VI that can act as a Chatter monitor. I need to set a low threshold voltage, and monitor 20 voltages simultaneously, detecting if any of them go below the threshold for longer than one micro second. If there are any events longer than one microsecond, I want to log the channel number on which it occurs, the timestamp, and then continue on monitoring. I have an X series NI 6343 to work with.

 

My question is, is something like this possible with a NI 6343?  So far I have perused through the NI 6343 documentation  (X Series Data Acquisition: 500 kS/s, 32 AI, 48 DIO, 4 AO).

 

Purely by looking at sample rate (500 kS/s) that seems like it's too slow to poll for a microsecond event, but then the documentation lists (timing resolution: 10 ns) which seems promising. What is the difference between sample rate and timing resolution in this context?

 

Appreciate any help!

 

Can't connect to raspberry pi by TCP/IP

$
0
0

Hello everyone

 

I want to use a raspberry pi 2 as a cheap external digital output module for switching relays.
I installed LINX and set up my Raspberry Pi 2 like the tutorials explain.

Also I use the recommended Labview 2013 32bit SP1 version.

The pi is found at the LINX target configuration menu.
When I create a new project, I can add it the raspberry pi a target in my project and connect to it, everything fine.
I also can run VIs, like the examples, on it without problems when putting the VI's into the Pi tree (instead of My Computer), so connection and setup of the raspberry should be fine.
But when I move the VI to My Computer and change the source of LINX to TCP, I got error 5003

LabVIEW was unable to connect to the LINX device using the following settings:

Interface: TCP/IP
IP Address: 192.168.0.1 ( like set up in the LINX configuration)
Port: 3363

I tried port 3363 and 44300 because I found these ports when searching for a solution, but I can't connect.
I enabled TCP in the Pi settings -> VI Server, also I added the IP of my desktop to VI Server -> machine access and to User access as well, but still can't connect.
Is this an access problem, or wrong port number, or what can I do to connect to the Pi by TCP?

The pi is pingable with this IP, also I can connect by putty to it.

I can't run the VI local on the Pi by moving it to the raspberry in the project tree because I have to use other VISA devices as well.

Also I guess the communication by ethernet or serial is implemented in LINX so it can actually be used.

 

Thanks in advance

Counter that only takes one data

$
0
0

Title may be misleading, but what i'm trying to do is counting how many 1's im getting, i have made this counter https://i.gyazo.com/1da22e7ee306654a3d5e11e510cd2c35.png 

Basically i'm getting 1 and 0's from a device, but the counter counts 1 reading and counts 5-6 readings basically it wont stop if the 1 is held.  

i cant figure out a way that the counter only works if the previous data is 0.  

what i thought is i have to record the previous data,and only start if it is zero.  

help thanks, i'm obviously a beginner in labvview

Why 'no of frames' and 'frames/second' is not changing with different .avi files?

$
0
0

My Goal:

1. Run .avi file and read it's timestamps at each frame.

2. Calculate total time taken in running a .avi file.(Also checking the total no of frames and frames/second)

Can someone point out what's wrong with the 'read time between frames.vi '. The 'frame and data to examine' indicator is showing the same 'total no of frames',which is 166 and the same 'frames/seconds' i.e 30  Frames/sec in all video files. Because of the unchanging behaviour, the 'total time taken ' to run a .avi file is being fixed for any .avi file.

But,if I run the  'read AVI in labVIEW'.vi to only read .avi file, it is working fine . It shows different 'total no of frames' and 'frames/second 'for different videos.

I can't understand what is the mistake in 'read time between frames.vi '

 

Difference between restarting a cRIO and repowering a cRIO

$
0
0

I have a deployed application on a cRIO 9030 (Linux RealTime with Display).

If I use the LabVIEW IDE "Restart" function to cause the remote cRIO to reboot, my RT application starts up without a problem.

But if I pull the power from the cRIO, wait, reapply power and let it boot up that way, my application encounters a problem.

 

The issue is related to the use of Ctrl Val: Set invoke nodes for setting the values of controls on a dynamically called VI front panel. LabVIEW fails to actually set the values, and although it doesn't return an error code from the invoke node itself, the control values are not being set.

 

I have the cRIO set to auto-power up when power is applied (BIOS settings) in order to allow this unit to recover from power outages and work autonomously within a production environment. The dynamically called VIs are Tests the cRIO performs on product.

 

My question is: why does pulling the power versus calling a reboot of the cRIO make a difference to the deployed code when it gets to the stage of trying use Ctrl Val: Set ?

Does a programmatic reboot clean up something on the way out? Can anyone throw some details on this internal process?

 

Additional info: This invoke node is quite a way into the software, it's not at the beginning, so the code runs a lot of other stuff first, quite OK, before it gets to this stage. This includes firing up a dozen or so actors, interacting with a database, reading local configuration files. So the application is largely working, it's only falling over when the Ctrl Val: Set invoke is called.

 

I also show the Front Panel before I call the invoke node.

 

VISA and UDP working together and synchronization VISA's string

$
0
0

Good morning! 
I'm a beginner with labview, I see some tutorial online, but I want to use it for comunicate with two device in parallel. I have built a sensorized tool for a robot, and I comunicate with bluetooth with it (HC05 module). The comunication is set with a VISA loop, some char activate some function to the microcontroller kit (pSoc 5 LP CY8CKIT-059) and a string is received, put in the spreadspeed to array, and work, not elegantly, not fine every run. the string from psoc is putted by 100 millisecond interrupt, I syncronize but I'm not sure, with the same timing in the loop, so if start well it seems to be stabile, butI have to try some runs, because the string is maybe half sent by the time of the run.
So, and sorry for the long message, first question I would like to ask: Can I use a more efficent way for cumunicate correctly the string?
After, the code can be made better?
And know the question of the title: Can I comunicate an UDP together with the first? (UDP is for the robot, via ethernet) 
I have a file for it and it works but I can't put together with the other. The program simply open two port for reading (receiving status of the robot in one, and the position in the other) Furthemore the second port for reading give a feedback on what the robot see. It give a feedback in base of the command "send correction" activable by boolean. 
It work fine, I would like to have the same udp read write on the other file...

I thank everyone who will also just read this, for answers I will be gratefull
Thanks a lot


On mouse click want to get the Y co ordinate value on XY Graph

$
0
0

Hi all,

I need yours suggestions on how to get the Y co ordinate value displayed on XY Graph with a mouse click.

´For example: As in the image in the attachment.

 

Thanks in advance

 

Control with time

$
0
0

Hi,

 

To simplify my problem: the VI contains a boolean indicator (representing the ON/OFF status of a pump) and a numeric control (representing the measured pressure of the system).

 

The boolean indicator needs to be ON during a certain time (for example it stays ON for 10 seconds and then turns OFF again). But if the numeric control goes over a certain limit, the boolean must turn OFF (even if it did not reach the given time). But when the control goes lower than the limit again, the boolean must turn ON for the remaining time.

 

For example:
Time for which the boolean must be ON = 10 seconds
Upper limit for the numeric control = 5

The numeric control stays at 4, boolean turns ON. After 6 seconds, the numeric control goes to 6, so the boolean turns OFF. Eventually the numeric control goes back to 4, so the boolean must turn ON again for the remaining 4 seconds. 

 

Does anyone know how to solve this on LabView? 

 

Thank you.

Programmatically get installed software

$
0
0

Let's say I created some dll in LabVIEW, which uses i.e. XNET. I want to have a function, which checks whether the richt Software and the right Version is installed. How is it possible programmatically?

 

Background: I give the dll to a third-Party Partner, and he has installed only LabVIRE Runtime Engine. I want to be able to popup a message at the dll call, what is missing.

 

Madottati

Scaling of shared variable using NI 9237 and Loadcell

$
0
0

Hello,

 

I have installed a new loadcell to measure load on a machine controlled by a cRIO-9022. The loadcells are connected to an NI-9237 module located in an NI-9144 EtherCAT chassis which in turn is connected to the cRIO. 

 

I have the calibration certificate of the loadcells (attached) and I have the option to Enable Scaling for the shared variable that reads in the load data (screenshot attached). However, I am not sure what values to input in the Raw Zero and Full Scale and in the Engineering Zero and Full Scale and whether the Scale Type should be Linear or Square Root. 

 

Can anybody advise me on the correct parameters? 

 

Thank you! 

cDAQ-9184 (Ethernet) modules are not recognized after PC reboot

$
0
0

Hello!

 

Some colleagues face an annoying problem, and they asked me to help them. Their system: a cDAQ-9184 Ethernet chassis with two modules: NI9217 and NI 9211. OS: Win10 32bit. LabVIEW 2016, 32.

 

Every time they reboot the PC, the connection is lost to the modules. It seems the ethernet connection is OK between the chassis and the PC, but the chassis does not recognize the two modules. They were using DHCP settings, I changed this to static IP connection, but as I expected, this did not solve this problem.

Actually this is not a huge issue, but quite annoying: every time, if you need to reboot the PC, then you must open MAX, and click on the modules with the mouse. Magic: the chassis recognizes the modules now...

 

Can this annoying problem to be fixed somehow? See two screenshots below, the first what we see after reboot in MAX (our LV application of course reports error about the missing cDAQ modules), the second is when we click on the module entries in MAX, and they magically get recognized...

 

unrecognized_cdaq_2.png

 

after_mouse_click.png

Viewing all 66957 articles
Browse latest View live


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