Need Your Help,Thanks!
I put a wait(ms) function in a while loop, and the value is set to 10 ms. I put tick counts(ms) before and after the wait function to calculate the delay time.
I found that sometimes the delay time is larger than 10 ms, sometimes can be about 150 ms. how could that be possible!
The snapshot of the VI is attached, thanks!.
LabVIEW wait function in a while loop delay time not accurate
Questions on Sampling with DMA FIFO (FPGA/ RT)
Hi All,
I am working on a cRIO project and I have some questions on the sampling. I'm not new to LabVIEW, but I am new to FPGA/ RT programming (and also the concept of sampling rate).
1. My hardware Setup
a. CRIO 9066
b. Module 1: NI 9207 (low speed voltage and current in)
c. Module 2: NI 9234 (high speed analog in)
d. Module 3: NI 9401 (digital in out)
2. Details on NI 9207:
a. Sampling rate: 500S/s non-simultaneous
b. No. of channel: 16 (8 voltage and 8 current)
3. What I want to do:
a. All 3 modules are connected on the chassis, but I am coding only for NI 9207 for now
b. To sample all 16 NI 9207 channels
c. Pass data to RT using DMA FIFO
d. Filter the data for each channel on RT
e. Find average for each channel on RT
f. FPGA sampling rate at 25Hz
g. RT loop at 1000ms (means I get 25 data point for each channel in every loop)
4. My questions:
a. Is my calculation below correct for FPGA sampling rate? If not correct, what did I do wrong?
i. 500S/s ÷ 16 channels = maximum of 31.25 data per channel every second
ii. I only need 25 data per channel and hence: 1 ÷ 40000uSec FPGA loop timer= 25Hz
b. If yes, I expect to get 25 data for each channel every time my RT loop executes. BUT, the result is not so. I only get 1 or 2 data point per channel per second. With only 1 or 2 data point, I can’t do filter or find the average.
This means that every second the buffer only gets 16 data points (1 data point for each of the 16 channels) instead of 400 data points (25 data points for each of the 16 channels). See picture below.
c. What should I change in my code in order for me to achieve what I want to do? I have attached my VIs for your reference (FPGA Test.zip).
Thank you very much in advance.
Scan mode, sampling and inner clock Crio
Hello all,
I am new with labview and have few simple questions I need to be sure with them. I am using Crio-9076 with input card NI9234 and output card NI9263.
I have simple program where I generate chirp signal 100 sample/second. The chirp signal is continued to output channel in output car. At same time I measuring acceleration with 3 sensors via NI 9234. All this are in timed loop which is synchronized to scan mode.
- The scan period is 1 ms, does this mean that the sample rate in hardware (cRio 9076) is 1 KHz even the sample rate of 9234 is 51.2 KS/s/ch and the sample rate of 9263 is 100kS/s/Ch?
- Network publishing period is 10 ms, does this mean that even the sample rate of cRio 9076 is 1 KHz, published data and the data (points) I really can handle are sampled in 100?
- The loop is synchronized with scan mode, does this mean that the loop’s rate is also 1 KHz (the data I get is anyway 100 Hz sampled)?
- When I use output and input card are channels synchronized to start sampling at same time?
Thanks in advance
Missing Sub VI NI_Database_API.lvlib: DB Tools open connection (path).vi in VI ...
Hi,
I have multiple number of VIs being called dynamically and I need a connection with the database. Everything is working fine in the development environment. I created an .exe Installer from these VIs and when I run it, it works fine until I try to go back to the main VI. When I try to go back to the main VI then it shows the error "Missing Sub VI NI_Database_API.lvlib: DB Tools open connection (path).vi in VI ...".
It would not show this error if I run the exe file and go to other VIs from the main VI but it shows this error if I try to go back from the other VIs to the main VI.
Thanks in advance for your feedback.
USB6225数据采集有问题
我用NI-USB-6225数据采集卡同时采集两路信号,labview编程时使用的DAQ助手,但是不知道什么原因,两路不同信号的输入,采集到的数据竟然完全相同。比如,我硬件接的是AI0和AI1,那么这两个信号会完全一样。如果我硬件不变,软件中的channel换成别的通道,比如AI2和AI3,那么采集到的信号还是一样的(AI2和AI3没有接任何线)。并且当我AI0上接的信号发生变化时,AI2和AI3上面的信号也会相应发生改变,不知道什么原因?
Tab Delimited Text File to Assign Tasks
Hello,
I am looking to create a text file which can:
1. Write to DAQ
2. Read to DAQ
3. Write to RS232
4. Read RS232
I'm looking for all 4 of these functions to be called top-down in any sequence as it is parsed. My idea was that a state machine can be used here, but it would require the data to be unbundled from the text file. Would anyone be able to illustrate a simple example of how this unbundle can be achieved with a tab delimited text file.
Many Thanks
Unable to Launch LabVIEW VI from Command Line with Gitlab CI
I'm currently trying to set up continuous integration with LabVIEW using Gitlab's continuous integration services. Here's my setup:
Windows 10 Virtual Machine
LabVIEW 2015
LabVIEW-CLI for LabVIEW/Command Line integration
Windows Powershell
GitLab Runner Service running as my administrator account
I'm trying to launch a LabVIEW VI from the command line that runs all the unit tests in the LabVIEW project contained within git directory of my current project.
The Problem
I can run the following command from powershell sucessfully:
PS C:\Users\diagonalley\Desktop\DA622\builds\0\project-0> labview-cli --lv-ver 2015 --verbose --kill '.\common-tools\source\run UTF tests.vi'
LabVIEW opens, loads the VI, runs my unit tests, and all is dandy. Here's the output:
Running the exact same command using the gitlab-runner service yields the following output:
LabVIEW opens and tries to load "run UTF tests" but fails and reverts to the getting started window:
The LabVIEW-cli never opens and my command times out. This is incredibly frustrating because LabVIEW gives me no indication as to why it can't open my VI, it just goes directly to the getting started window. Attempting to open the vi manually from the same getting started window works. Does anyone have any idea how to figure out why LabVIEW can't load my VI? There aren't any crash logs because LabVIEW isn't crashing. Any help would be greatly appreciated.
Cheers,
I2C write to the DAC
Hi,
I would like to address the DAC correctly
Here is the datasheet:
https://datasheets.maximintegrated.com/en/ds/MAX5380-MAX5382.pdf
Slave address is: 0x64
Can someone tell me if I am doing this right?
Thank you
Problem/Error when using search function in Express VI "File Dialog"
hi everybody,
i've encountered a problem when i want to use the search function in the express vi "file dialog".
the express vi uses the absolute path of only the last file of the search result for all other files. so if the files of the search result are in different folders/subfolders, the express vi produces an error resulting in a path array with paths that actually dont exist (see the attached vi; search for example for "TC3".)
any idea for a small workaround?
this btw doesnt happen if you're using the search function of windows explorer and drag&drop the result into labview. so the problem is due labview itself.
thanks for any help!
USB6225数据采集有问题
Programming FPGA, unable to achieve the desired sampling rate
I have the following hardware:
- sbRIO9267
- two NI 9205 C-Series Modules connected to the sbRIO via a 2-Slot C-Series RIO Mezzanine Card (RMC)
I want to sample 10 Channels on each of the 9205 modules @ 25 kHz per Channel. This is right on the edge on what the 9205 Module is able to do (250kS aggregate sampling rate). Therefore the 9205 modules are configured with a 4μs conversion time in the project explorer.
This is the Vi I use on the FPGA
FPGA vi
Since the FPGA executes with 40 Mhz I need to set a execution rate of 1600 ticks for the data acquisition loop of the FPGA vi. However, the measured true execution rate then is only 1601 ticks giving me a frequency slightly below 25 kHz.
Why is this and how can I solve it?
I quickly tested the 9205 in a cDAQ and set of 10 Channels @25 kHz and this was running without problems, so I assume my problem is a programming problem of the FPGA-VI and not a hardware limit. For every sampling frequency below 25 kHz (every execution rate higher than 1600 ticks) I get the expected sampling rate from the FPGA.
edit: corrected typos
Create .net class derived from treenode
Hello,
I try to create a .NET TreeView on the front Panel. I want to attach a Combobox to some child nodes - that works fine in C#. But I have no idea, how to create a new .net class in labview, which inherits all properties / methods of a base class (now TreeNode).
Is it at all possible in LabVIEW?
How to generate digital square wave with PXI-6251?
Hi gents,
I am trying to generate two square waveforms and my only requirement is to set frequency up to 1 kHz. Nothing more. But I tried lot of DAQmx concepts and I don't understand the principle of different forms here. If I should use some digital waveform and send it to the DAQmx write function, how to use sample clock (if even use). Basicaly I tried things with intuition, but I miss here the principles. Can you please guide me to some point or architecture I can use?
Thank you in advance a have a nice day!
Martin
Unknown Temperature Probe
I’ve learned some more about my thermistor after examining it more closely. I have a high resistance probe. At room temperature it measures about 28Mohm. I believe it has some capacitive and inductive properties as well which is making it tricky.
I was trying to build a simple voltage divider to measure the voltage drop across a resistor as the resistance of the temperature probe changed and I haven’t been getting any good results.
It’s called a general purpose probe but it doesn’t seem to me to be very simple and definitely not purely resistive. I've been supplying it with a DC voltage and it's creating AC voltage. Furthermore my "voltage drop" i was trying to create was actually increasing the voltage. I was using an equal sized resistor (28Mohm) and a 15VDC source and the voltage across my fixed resistor was 18V...
http://www.analog.com/media/en/technical-documentation/data-sheets/AC2626.pdf
Do you have ideas how I can measure temperature with this probe using LabVIEW?
I've tried measuring a current output from the probe, I've tried configuring it as a thermocouple and some of the various other options in LabVIEW but i'm new to the software so it's very possible i didn't set it up correctly.
Running VIs Simultaneously
I have system set up with a Data Translation DT9804 DAQ card (utilizing the LV-Link 3 VI library). Currently two of the AI channels are being used by a main VI program that scans the channels continuously. I would like to write a second seperate VI that would access a third AI channel that would run simultaneously with the main program. Since the main program is fairly complicated, I do not want to alter it in any way. The issue is that whenever I start the secondary program, occasionally it will work for several seconds before crashing and giving me an invalid task error (code 1021).
I was wondering if there is any way to have these programs be able to run simultaneously on the same board without interfering with one another. I saw in other threads that usually you cannot run multiple tasks on the same board due to resource reservation errors (this is probably my issue?) but it was also mentioned that there is a way to accomplish this.
Is what I want to do possible? Or do I just have to use a second DAQ board?
(I'll include a snapshot of the block diagram of the secondary program I am trying to run)
Labview will not install on W10 1703
There seems to be a problem with Labview - either version 2016 or 2017 installing on W10 1703.
I am using a clean install of W10 1703, and my Labview installation packages are held on our departmental server. Both versions 2016 and 2017 have previously and will still install perfectly on W10 1607 - but on trying to install on 1703 the installer never progresses past 0%. No NI folders get created in the programs(x86) folder - as far as I can see the installation does not even begin to start... The progress bar continuously flashes a 1mm green line on the left hand side as if it is trying to begin, but does not progress. Clicking on cancel has no effect other than to show a message "waiting to cancel. To stop immediately cancel the installer" The software bundle window will eventually close but the installer window remains open. The only way to terminate the failing installation process is to use the task manager. I have tried turning off the W10 Defender real time protection but that makes no difference.
I am reading other anecdotal reports of failing installations on W10 1703 - however I have not as yet found anything 'official' from NI...
Are there any updates on this problem??
Error -2147467259 w/ DB Tools Open Connect while using .exe
I am using LabVIEW 2015 (32-bit) and I am having an issue connecting to a SQL database while running the executable. The program works fine while in the development environment but once it's built the .exe won't connect. I'm connecting through the DB Tools Open connection default vi and feeding it a connection string from a config file.
Any help would be appreciated.
How to Send PWM signals to a Motor Controller through DAQ?
So i recently started with labview... and part of my first project on it requires that i use a motor controller to control a fuel pump.
During my searching for a compatible fuel pump and motor controller, i have found the Crytron 30A 5-30V DC Motor Driver, and the Aeromotive 11101 fuel pump.
However, while trying to work on how i plan to make connections and control these, i have run into the problem that he motor controller runs off of PWM signals, and the DAQ i have (9474) doesn't seem to output any voltage other than digital output. Im not sure if this makes sense, but i think it may be the problem i am running into.
motor controller: http://www.robotshop.com/en/cytron-30a-5-30v-single-brushed-dc-motor-driver.html
fuel pump: https://www.aeromotiveinc.com/product/a1000-fuel-pump/
the motor controller specs are listed, but as for those of the fuel pump:
"Aeromotive A1000 Electric Fuel Pump
This is the pump that started it all. Durable, reliable, good looking, and it supports high horsepower. Perfect for the daily driver that doesn't run like a daily driver. For up to 1500hp carbureted. ORB -10AN inlet and outlet ports.
Part Type: Electric Fuel Pump
Application: Universal Carbureted/EFI Applications
Fuel Type: Gasoline (including E85)
Alcohol Compatible: Yes
Diesel Compatible: No
Free Flow Rate: 600 lbs./hr.
Maximum Pressure (psi): 90.0 psi
Fuel Pressure Regulator Required: Yes
Fuel Pressure Regulator Included: No
Fuel Pressure Regulator Style: NA
Recommended Regulator: 13101 or 13109 (EFI), 13204 (Carb)
Fuel Pressure Gauge Port: No
Inlet Quantity: One
Inlet Attachment: Female Threads
Inlet Size: -10 AN O-Ring
Outlet Quantity: One
Outlet Attachment: Female Threads
Outlet Size: -10 AN O-Ring
Fuel Pump Amperage: 7-15 Amps @ 5-65 psi
Fuel Pump Material: Aluminum
Fuel Pump Finish: Red Anodized
Mounting Bracket/Hardware Included: Yes
Manufacturer: Aeromotive
Manufacturer's Part Number: 11101"
I will be using a 0-24 VDC power supply to power everything..
Generate sinusoidal waveform using feedback loop control based on NI FlexRIO (NI 7972 FPGA target, NI 5783 adapter)
Please Open the NI example of "Getting started with NI 5783" first.
In this example host VI, look at the analog output loop, you will see there is a case structure used to generate sine output signal. In the true case, you give control to the signal's amplitude, frequency, and phase.
Figure 1. true case structure
In the fault case, there are no functions in the case, that means if the case is fault, we just keep the true case parameter in memory without any change and use it.
Figure 2. Original fault case structure
It works well. I can generate a sine signal successfully. But for my system, now I need to make it as a closed loop system.
The basic idea is I directly wired AO of NI 5783 to the AI of it (Let's just assume the cable is my plant). On the AI side, using CORDIC method, I can calculate the amplitude and phase of the feedback signal, and then I use a PID controller to control the amplitude and phase, after that, I want to use the feedback amplitude and phase value being controlled to be the new setpoint for the amplitude and phase control of 'create waveform.vi'. That is to say, the setpoints are always changing every single loop. As a result, for the 'fault case', the change I made will be copying all the code in the true case and make the controlled feedback value to be the new phase and amplitude setpoint.
In the fault case, ensuring the setpoints can be updated every single loop, instead of using the real feedback value, as simulation, I use control values to be new setpoints for amplitude and phase to see if my thought works well using FlexRIO:
Figure 3. Modified Fault case structure
The result is that the AO cannot output a good sinusoidal signal. For example, if I set the frequency to be 25MHZ, the output waveform has a 25MHZ signal, but also with variable frequency harmonics(lower or higher than 25MHZ, close to 25MHZ stronger). So I wonder if it happends because these streaming things and FIFO cannot support the data is updated every cycle...
I have asked person in NI about this, they say this kind of FIFO structure might not be realizable, they asked me to generate waveform point directly at FPGA side. But using that way, for the reason that I need my FPGA loop to be updated quickly, it's hard to generate points in a single cycle timed loop without timing violations in FPGA VI.
So I want to ask if there is anyway to realize my thought using the FIFO and streaming structure? If not, any other good ideas?
Thank you.
Array manipulation
Hi!
A brief intro to my problem first:
A portion of the project I'm working on creates an XY graph to show the sound wave that is being acquired/read, easy enough. Now I need to change the graph so that it takes the 4 parameters: total time, seconds to ignore at the start of the file and at the end and finally, parts of the file that need to be ignored in between. I need to show the parts of the file that need to be ignored in red.
My idea was to initialize an array with the boolean constant true so that it shows up in green and then maybe use the insert into array function to insert a false boolean constant at the parts that need to be ignored so that those parts show up as red.
I ran into a problem because one of the parameters is an unsigned long integer while the first 2 parameters are dbl. I can't create an array, what is the right way to go about creating a waveform graph that shows the parts of the file that are ignored in red and the parts that need to be considered as green?
Thanks!
M