Greetings everyone, for datalogging purposes, I need to query data from a DAQ, add a timestamp and post-process data, then save it all to a .tdms file. I also need to create a data buffer for a certain event, which I intend to store using a 3D array, I only need 1 cycle of data, so it would have 2 pages, 1 current and 1 backlog. Problem is, for some reason, it is only storing a single row of data, instead of whatever amount I send from the post-processing loop, I can have a 2d array of 2000 rows per 6 columns, and it will only store 1 row, what am I doing wrong?
Insert 2d array into 3d array
Strictly typed Enum reference "is not a simple up or down cast" of strictly typed enum reference
Running into a weird problem with Enums. I'm trying to dynamically populate an enum to allow for some dynamic dispatching during a user input phase. I'm almost done, and this happens:
The front panel on the right is the "Setup Enum" vi. On the left is the main VI, with a strictly typed enum control reference going into that VI. I've attached the vi hierarchy; open "Choose Curve.vi" to troubleshoot.
How to synchronize measurement data based on an input analogue signal as trigger?
Hello,
I am using a DAQ (NI USB 6351) to record my signals. AI 0 records a sinusoidal measurement signal and AI 4 is a trigger ramp signal. I’m trying to synchronize the start of the measurement signal to a voltage level based on the ramp signal. In other words, I would like the measurement signal to start recording and save to a text file only when the trigger signal satisfies the voltage condition of: .
Currently, the measurement signal is not triggered properly, observed with the recorded voltage level from text file, where the starting voltage (at time = 0 sec) ranges from 3.5 to 2 V.
Is this problem caused by DAQ2 (Received ramp signal) sending in data faster before the comparison operation has been carried out? Or ..? How to fix this ..?
Please see attachment for the current VI build.
Thank you for the help,
Best,
How do you use local variables?
Hey everyone!
How do you guys use local variables when programming in LabVIEW?
I've been wondering about the ways that local variables are typically used in real-life LabVIEW applications. I'm familiar with how they work and some of the caveats and warnings that come with them, but was interested in specific examples and applications/design patterns in which you've found them helpful. (Keeping this rather vague on purpose to see what examples you all might have!)
Any descriptions, use cases, or code snippets you'd be willing to share?
Thanks a bunch!
Passing two hex numbers as a byte variable in dll calls
I imported a DLL, which functioned well when it was called from C++ codes. However, a couple converted VIs did not function properly. The original functions were supposed to write a set of two hex numbers (one byte in size) to a specified address in form of two characters. Somehow after these functions were converted to VIs, they only wrote the first hex number and ignored the rest. My speculation is that since this variable is declared as a byte type, the VIs might only take the first hex number as a character (also one byte in size) and ignored the following hex number. Has anyone encountered similar issues?
Need to double check value set by VI server?
I've come across code recently that is using VI server to manipulate controls in other LabVIEW-built applications and they are setting a value and then checking that value immediately afterwards. This seems strange to me. I would assume that if the value didn't get set then there would be an error coming from the property node that is being used to set the value.
So, is there any reason why you would need to check the value of a control that you just set via VI Server?
Strange web-based installer behaviour (LabVIEW 2015 SP1 platform 32bit)
Hello,
I wonder if others had similar experience with the web-based installer. I selected the required modules in the beginning, and I started the pretty long and boring download process (total size to download is 25136 MB) The problems which I have encountered:
- During the download often the web-based installer dialog window "starts to hang": a click on the "Pause" and after on the "Resume" button helps (and no, not my internet access is the problem, I am connecting to a 1GB university line and I do not see any problem with using internet browsers for example).
- After reaching 99% of total download, the process seems to slow down to a kind of level it seems like the paradox of Achilles and the tortoise...
See the two screenshot, time between them was 10 minutes...pfff...
- I tried to "speed up" the process from this state, so I tried the "Pause/Resume" sequence again. Effect: every time I did this sequence, the percentage of the indicator (and so the data) dropped! So first it went from 99% to 95% or so, after second attempt it went down to 88%
Whaaat?
- Right now I try to leave it for a longer time, and do not play any more with the Pause button...lets see what happens...
( System: Windows 7 Enterprise x64 )
EDIT:
The installer reached the 100%, hmm, actually even better, 25165/25136 --> 100.11 % !!
It is still showing the same dialog now for some time, but I will not touch it... if I was at home, I would open a beer at this point...
EDIT2:
Still downloading further...
swipe left or right
Hi, I'm writing a program that will have two buttons persistent on the GUI 'next' and 'back', so the user can go forwards or backwards through a series of settings pages.
What's the best way of implementing this?!
I am considering showing and hiding the pane decorations for each each page, when the next/back buttons are pressed, perhaps using the booleans to increment or decrement the page number (and the associated indices for all the decorations). .. putting it all in a display consumer loop as part of an event driven producer consumer structure.
Just wondered if there's a better way.
Thanks
Graham
PID VI output looks like On/Off signal
Hi all,
I am new to PID applications, and am currently starting a project involving PID control of an indoor air heater. I ran into some problems and I will really appreciate any suggestions here
The setup consists of a cDAQ-9174 with a RTD module (e.g. NI-9217) and a current output module (NI-9265). The process variable is the temperature incoming that is read from the RTD, and the current output module sends the PID output of 4-20mA to the heater block, 4mA is equivalent to heater off, and anything above that will turn the heater on to different levels accordingly.
I found an example program on the NI website which I modified to suit my setup. PID loop rate is 10Hz, and for this I used software timing (please see the attached VI). The output range for the PID VI is set to 4-20mA.
Upon running the program, we can see the RTD working well (process variable is updating correctly), but the output signal from the PID VI varies between the two extremes (either 4mA or 20mA), which seemingly turned into an On/Off model instead of PID (please see the screenshot "On-off MV.jpg" attached). This resulted in the system oscillating in an undesired manner.
I have looked at the example programs in LabVIEW itself, ran some of them and they seem to work fine. I have also looked at their block diagrams, and apart from a different output range setting (default is -100 to 100), I can't see any important differences for other parameters to the PID VI.
Was there anything that I have set incorrectly, or was there something I missed out? All help will be greatly appreciated... Thanks!!
Best regards,
Victor
Waveform + Simulated data_phase detection
Hei,
Guys,
I am trying to do a phase detection. First, data is from lab and wanna to add extra data over (by basic functon generator). Every time data should update, I am not sure for the lab data, because it never change in time, but the basic function generator data should change in time, i.e phase. The problem is that I am trying to multiply data and get a mean of them and to see how every time when I change the phase I should see a different value of mean, but it does not work for me. Frequency should be constant and amplitude as well. Maybe anyone have ideas what is the problem? "Basic generator" is in the cycle, but the phase does not show the reaction. The first data should be all the same as are before, but the simulated data should change all the time, i.e changing by the phase and why the mean is not responding to the phase changes? LabVIEW code added here it is over 6mb
Thanks
Send Email Express VI works, SMTP VI's dont
I cannot get the "Send" VI from LabVIEWSMTPClient.lvlib to work. I get error" Possible reason(s): LabVIEW: The network is down, unreachable, or has been reset."
I have also tried using the "Send Email using SMTP Client" example program and I get the same error.
My initial thought was maybe the firewall at my company is blocking the traffic, however the "Send Email" Express VI works just fine with exactly the same configuration and credentials.
Does anyone have any insight why I might be seeing this behavior?
Thanks
How to use LabVIEW to collect Temperature vs Frequency data in a Tunnel Diode Reasonator experiment?
Hello fellow NI forum users. I am currently working on a Tunnel Diode Resonator experiment. We are currently using a Lake Shore 350 Temperature controller with Cernox thermometers and a BK Precision 1832A Frequency counter and are needing to put together a LabVIEW program to collect Temperature and Frequency data, give an output graph, and save the data list to a .txt file from this equipment. This program must also control the change in temperature. I am pretty new to LabVIEW and therefore do not know exactly how to go about either meshing the monitoring programs we are already running or to create a whole new program. My thought is put our current programs in a loop as sub VI’s and take the output values (T and F) to create the chart and collect the data. However, this program must control the T of the experiment as well. Currently we have to manually change and tune T by using a temperature controller program and the PID loops. So this change in T actually comes from the amount of heater power we are putting in. Therefore, the goal would be for example: to choose to collect 500 (frequency and temperature) data points along the way from say a chosen heater output value from 0-40% on Range 4 or 5. This data then would display in a graph as well as in a data list and after we could then save the information to a .txt file. If someone could give me guidance if I’m headed in the right direction on using some of what we already have as sub VI’s in some kind of loop or if I need to rethink the direction I’m headed. Also in the same program If someone could give me advice on how to control the temperature and store the entire data set and save it as a .txt file that would be much appreciated. I apologize for my lack of knowledge of LabVIEW but I guess we all have to start somewhere right?
How To Combine 3rd party installer and LabVIEW-generated installer?
I am developing a software that controls a thermal controller via USB cable connection. I use NI-VISA to communicate with it. The controller uses a USB chip, for which a 3rd party USB driver is required. (I downloaded it from here: http://www.ftdichip.com/Drivers/D2XX.htm)
Now the software is complete, I built the application successfully. In my installer, I am hoping to include the 3rd party USB driver so single installer does it all, instead of running 2 installers.
LabVIEW's installer build specification property dialog seems to only support NI drivers. Is there a way to include the USB driver in my installer?
Thank you in advance
Variants: are they explained in any labview course?
I have discovered that my licence allows me to have access to online training? Do you know if variants are explained in any of the available courses?
Release notifier outside of consumer loop
Hi all,
I am using a notifier for a stop button. My stop button wasn't stopping in one of the cases(Error 1 occurred at Wait on Notification in Main MTTF.vi). I highlighted the code and noticed that when I pressed stop, the notifier was being released before notifying the consumer loop. When I released the notifier outside the consumer loop, my error was gone.
It seems like a simple fix which is great, but ine everything I have read or seen so far, the release was outside the producer loop. Is there any disadvantage to doing it this way?
Reading 115vac 400Hz
I am working on reading 115vac 400Hz power supply using an PXI-4472.
I got it working, but if the signal gets lost the loop crashes.
How do I stop it from doing this?
Anyone got an example of reading ac voltage even if its 0volt?
how to convert right array to plot Smith Chart?
Hi gentleman,
How do l read R and X data from csv file to plot on Smith Chart? I attached csv file and Smith Chart. Could you please kindly teach me how to convert csv file to right array to plot it.
Best regards,
Victor
application will not build because it cannot write the icon file to the application (Error 1 occurred at AB_Engine_EXE_Call_Write_Icons.vi -> AB_EXE.lvclass:Build.vi)
Error 1 occurred at AB_Engine_EXE_Call_Write_Icons.vi -> AB_EXE.lvclass:Build.vi
This error happens with the default icon and with custom icons.
Display Picture From Video Recording.
Hello everyone, I'm very new to Labview (not too new to programming in general, though), but I'm having a problem.
I was given a program to modify. The program is a constantly running video camera, and you can press a button to take a picture and a different button to start recording video. The program works fine, but my problem is that when taking a picture, the picture saves to the specified folder and that's it. What I need to happen is I press the button, the picture is saved, AND the picture is displayed on the screen so I can mess with it later. I'm using IMAQ Write JPEG File, inputs being the video and the constructed filepath, all inside a case structure for the button. And the problem with that is that there's no output, that's just the end of the code, so I can't grab the filepath from it after it saves (I can easily grab and display a picture given it's filepath). I tried grabbing the path before it went into the IMAQ Write and I got stuck in an infinite while loop.
My workaround was to find a way to display the last created picture, but that seemed like too much work for something as little as "push button, save and display picture". The computer with labview does not have internet, so if this is unclear, I can take a screenshot and post it tomorrow. Thank you for any suggestions.
Spawning Multiple Sensor Threads programmatically?
Hi all,
In designing an acquisition system, I'm running up against a design problem; I am trying to abstract the notion of a sensor via LabVIEW OOP, but the acquisition aspect still confuses me. The way I would traditionally do it is, given some number of sensors, put down a While Loop for each sensor and use a queue or a User Event to indicate an acquisition to the main loop, where it is processed accordingly. But if, say, you don't know how many sensors are going to be used at build time, how would you accomplish this? Using Property Nodes and VI References, perhaps? If so, how does one open a VI reference to different instances of the same class VI?
On that note, if you have two instances of the same Sensor subclass (lets say you're using two temperature sensors from the same company), will you face problems of reentrancy? Or does each instance of the sensor class have its own separate reentrant behavior?