Hi!
I connected a loop-powered 4-20mA transducer as suggested at the page 13 of the NI 9208 guide. Particularly, an external supply is connected to Vsup and COM and the transducer is connected to Vsup and AI0. But in LabVIEW the DAQ assistant shows me a different connection diagram. It's suggested to connect the transducer to AI0 and COM. Should I just ignore the connection diagram in DAQ assistant? Is it supposed it works correctly even the connection diagram wrong? I'm asking because it's difficult to check a setup directly since the transducer is a gas detection device and there is no data about actual gas concentration. Thanks!
Connection diagram NI 9208
Time between two shots of everyNCalback is shorter than it should be according to the sampling rate
I need help with a problem I have to calculate the time of the samples I take from an NI cDAQ-9184 with an NI 9237 module.
I work in a project in which we take samples of a load cell to calculate the weight of different vehicles, in this project we are continuously taking samples and calculating for each one of them the moment of time in which it was obtained.
If I take samples at a speed of 1khz passing a buffer of 100 samples, the everyNcallback event should be fired every 100 milliseconds, however when I measure the time between shots I get about 62 milliseconds.
How can this be?
This is the code I use:
#include <Windows.h> #include <stdio.h> #include <time.h> #include <tchar.h> #include "NIDAQmx.h" #define CANT_CANALES 4 #define CANT_BUFFERS 10 #define MUESTRAS_BUFFER 100 #define VELOCIDAD_MUESTREO 1000 #define MAGNITUD_MIN -0.025 #define MAGNITUD_MAX 0.025 char AI_Dispositivo[1024] = "cDAQ9184-1BFBD04Mod2"; float64 AI_Buffer[sizeof(float64) * MUESTRAS_BUFFER * CANT_CANALES]; TaskHandle AI_Tarea = NULL; LARGE_INTEGER t_ini, t_fin; int indice; double Tiempos[CANT_BUFFERS]; HANDLE Handle_Espera; double performancecounter_diff(LARGE_INTEGER *a, LARGE_INTEGER *b) { LARGE_INTEGER freq; QueryPerformanceFrequency(&freq); return (double)(a->QuadPart - b->QuadPart) / (double)freq.QuadPart; } int32 CVICALLBACK EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData) { int32 readAI = 0, error = 0, i; QueryPerformanceCounter(&t_fin); if (indice < CANT_BUFFERS) { Tiempos[indice] = performancecounter_diff(&t_fin, &t_ini); indice++; } else { printf("Tiempos:\n"); for (i = 0; i < CANT_BUFFERS; i++) { printf("\t%f\n", Tiempos[i]); } SetEvent(Handle_Espera); } error = DAQmxReadAnalogF64(AI_Tarea, -1, 1.0, DAQmx_Val_GroupByScanNumber, AI_Buffer, MUESTRAS_BUFFER * CANT_CANALES, &readAI, NULL); if (error > 0) { printf("DAQmxReadAnalogF64 ADVERTENCIA %d\n", error); } else if (error < 0) { printf("DAQmxReadAnalogF64 ERROR %d\n", error); } if ((uInt32)readAI != nSamples) { printf("DAQmxReadAnalogF64 ERROR Muestras Leidas = %d Muestras disponibles = %d\n", readAI, nSamples); } QueryPerformanceCounter(&t_ini); return 0; } int main() { DWORD temp; Handle_Espera = CreateEvent(NULL, TRUE, FALSE, TEXT("Handle_Espera")); DAQmxCreateTask("AI_Tarea", &AI_Tarea); DAQmxCreateAIBridgeChan(AI_Tarea, "cDAQ9184-1BFBD04Mod2/ai0:3", "", MAGNITUD_MIN, MAGNITUD_MAX, DAQmx_Val_VoltsPerVolt, DAQmx_Val_FullBridge, DAQmx_Val_External, 9.0, 350, NULL); DAQmxCfgSampClkTiming(AI_Tarea, "", VELOCIDAD_MUESTREO, DAQmx_Val_Rising, DAQmx_Val_ContSamps, MUESTRAS_BUFFER); DAQmxRegisterEveryNSamplesEvent(AI_Tarea, DAQmx_Val_Acquired_Into_Buffer, MUESTRAS_BUFFER, 0, EveryNCallback, NULL); indice = 0; QueryPerformanceCounter(&t_ini); DAQmxStartTask(AI_Tarea); WaitForSingleObject(Handle_Espera, INFINITE); DAQmxStopTask(AI_Tarea); DAQmxWaitUntilTaskDone(AI_Tarea, -1); DAQmxClearTask(AI_Tarea); printf("Ingrese un numero para terminar: "); scanf_s("%d", &temp); return 0; } Result: Tiempos: 1.512656 0.061836 0.061815 0.062108 0.061618 0.064241 0.059541 0.062228 0.061497 0.062573 Ingrese un numero para terminar:
From already thank you very much.
NI -cDAQ 9174 does not power up
Hello guys,
My cDAQ 9174 is not powering up. This thing happened because I spilled my coffee. I dried the DAQ power slot with air blow gun. Still no luck. The power cable works good. Any ideas?
Thanks in advance,
Meme
NI 6211 ramp signal and two counters generating
HI All,
I would like to use my NI 6211 to generate the following three signals as the following pic shows.
my current problem is I have no idea how to sync my pulse with another two counters. I have attached my VI to this post. And any suggestions would be appreciated!
With USB-6001 and DAQmx, how many channels should I create in labview?
I am a new Labview user. I try to control a stepper motor with USB-6001. It is bipolar stepper motor. I don't understand about DAQmx. If I want to control rotation direction of the motor and its rotation number, How many channels should I add in my diagram? This is what I draw as controlling the motor.... Please help me.
NI usb 6008 DAQ / Frequency measurement
Hello Everybody,
I am working on a project using NI USB 6008 DAQ, I am mearing square signal pulses from a generator using that DAQ. everything working fine but I need to measure the frequency of that pulses in addition to the measurements I do with that DAQ.
the attached picture shows you an example of what kind of signal I measuring.
Any of you have an idea about how to measure the frequency, I have tried to use some examples but they did not work with me. I will be really appreciated your help.
Many thanks
Thoalfukar
I need help to select the PXI card and supporting hardware to test the 0-25mA output signal from our device.
We have the product which is generating the 0-25mA output current.We are planning to test it from the NI.
We have NI PXI 6259 card (AI).would you please help us, how to test it 0-25mA output current with 6259 card?
Controlling an NI-9263
Hello everybody,
I was told to purchase an analog A/O board for a project in lab. It was my first time doing anything with National Instruments, and I think I confused CompactDAQ with the "DAQ" unit I had (a USB-6000), so I ordered a NI-9263, and figured that would be that.
Do I need to order anything else to make the NI-9263 work with LabView, or can I just get a 15-pin VGA to USB cable. If that won't work, can you suggest a component that will work directly as an analog A/O with LabView?
Best,
Adam Mizes
Minimize the number of messages to send to USB-6009
Hello everyone !
I'm having an issue optimizing a software written in C.
I am using an NI-USB-6009 to communicate with a second device. To configure it I have to loop over the bits of my variable (8 iterations) to assign a high and a low current, and then do a DAQmxWriteAnalog and two DAQmxWriteDigitalLines. The data to be sent as Analog Output will vary each iteration, but the two Digital Outputs will always be the same (1 and 0) and HAVE to happen after one analog signal.
I'm looking to optimize this loop, as it will, overtime, consume a lot of time.
What options do I have ? Would I, for example, be able to put all my Analog Output in an array, send it once and have the DAQ serve the data successively to the second device ? If so, how would I integrate the digital output to be sent between each analog message ?
Thank you for your ideas !
Analog read and write with DAQ Assistant block using NI-USB 6215
Dear friends.
I´ve been having problems in my control application using LabView+DAQ NI-USB 6215.
In general, I need to read a analog input, filter this input by a LMS FIR filter and then write this filtered signal in analog output port.
The problem is that my output signal is okay in the window graph (Labview), but wrong in the output port of DAQ. To be more exact, the frequency of my generated signal is wrong, smallest than must be.
I'm setting the input port with the continuous samples mode, at a rate of 2500 Hz, with 1 sample to read for loop iteration. The output port has been configured with an on demand mode.
Somebody knows how to fix it? Maybe the the frequency of my signals were corrupted by the loop iteration time?
Multiple Counter Tasks
Hello everyone.
I am programming in LabWindows, using NIDAQmx to connect to a PCI-6351 card.
I'm trying to get multiple tasks to operate at the same time. We actually have 2 PWM (measure duty cycle) signals and possibly an encoder signal. The person buying the card was hoping a PCI-6351 would work as it has 4 counter channels. Although the card doesn't have built in option to measure duty cycle, I figured I could use two continuous tasks to read the on and off pulse times.
I can't get two tasks to operate at the same time. Through my trials I get an error no matter what I try:
- can't reference the same input line in two channels
- can't have two counter channels in the same task
- can't have two counter tasks active, using the same timer resource, and can't seem to select different timer sources?
There must be something (hopefully simple) that I am missing. What good is a 4 counter card if I can only use 1 at a time.
Grateful for any feedback!
Mande.
cDAQ-9185 Network issues
Hello All, I'm new to the NI world of DAQ and am running into some hardware connectivity issues on a cDAQ-9185 Ethernet chassis. My issue is BPDU (bridge protocol data unit) guard on my process LAN switch, this 'guard' does not like the 9185 chassis and when it detects the device is disables the port. I'm working with my local IT and have since disabled the guard on the port to troubleshoot the problem but this workaround may not fit my company's Network policies (TBD). I think this is related to the chassis TSN feature.
Has anyone experienced this problem? Is there a way to turn off BPDU or TSN settings? Perhaps there are other work around?
I appreciate the help in advance.
Best regards,
PC
Help with choosing the right hardware
I'm new to the LabVIEW environment and need some help in selecting hardware for data acquisition and control.
I have a machine that has the following:
10- Heaters
10- Thermocouples
2- Load cells
4- Directional control valves
2- Electronic Pressure regulators and
4- Proximity sensors
I need to read the inputs from the load cells, thermocouples, proximity sensors and control the heaters, directional valves and pressure regulator. what modules do I have to buy?
Please let me know if any additional details are needed.
Requiring help to replicate a LabView Interface with DAQmx
Hello everyone,
I would appreciate if someone could help me or even guide me to replicate an interface for a project in my university, it’s about reading analogue data like pressure and temperature from some sensors and shows it in a graphical environment for the people to read.
I have to work in a replica of this one and being sincere I´m not any good using LabView, I have the NI cDAQ 9174 with the NI-9219 and NI-9213 modules.
My first question would be if someone can tell me how to read at least 13 of the channels from the NI-9213 module and the currents from the 4 channels of the NI-9219 module.
I´ve seen some examples from the labview help but it actually confuse me more.
Additionally I need to save this values in an excel sheet or alike.
I would appreciate any help you could give me.
The captures of the interface I need to make are attached.
Cheers.
NI MAX
I have held off for the last few years commenting on the ridiculous changes that have been made to NI MAX over the years but I guess if I never say anything then nothing will ever change.
When I started way back in LabVIEW 5.0 I could move global virtual channels where ever I wanted to. I did not need a daq card connected to add or move global virtual channels. Now I have to have a card connected to create new channels and I cannot move them unless that same card is present on the target computer. I am not sure why I can not just make the channels I need an mover them where they need to go. I used to be able to create a loadcell channel with a scale and I could move it to any device that had a compatible AI. I was also able to create an accelerometer channel. Today I can only create an accelerometer channel if I have a system from NI that is specifically an accelerometer daq system. I thought you made LabVIEW flexible so I could use what ever signal conditioner I wanted to and not just NI stuff. Not any more to all of these things.
Another example of an issue I am having is I can not import channels unless the cDAQ device is on my computer. Why does this device need to be present in order for me to to import my global virtual channels to my development computer? I need to alter software and put the new code on the target. I usually would have no reason to connect to the cDAQ system to make these changes only now it is a requirement. How crazy is that. I am sure that NI has a reason but it has made my life much harder to support the many applications and systems that I take care of. The other issues I have is that after I lug my computer to the system, attach to the cDAQ chassis and import all my channels. I make the changes to the code and test the system. Now I go back to my desk where I am no longer connected to the cDAQ I can not delete the cDAQ chassis from my list of network devices. Why is that? It tells me I need to have ownership of the chassis to delete it. I have many systems that I take care of so having every one of them on my computer all of the time seems overwhelming. Why do I need to have ownership of a chassis to delete it from NI MAX, or to import channels or anything?
I am sure this will fall on deaf ears but I wanted to get this out there. NI MAX seems to get harder to use with every upgrade.
Tim an 18 year veteran LabVIEW user
Cross talk with simultaneous sampling (not multiplex)
Does anyone have any experience resolving cross talk issues when using a DAQ with simultaneous sampling? From what I have read, I can see why cross talk arises when using a multiplexer, i.e. a device that has to scan across channels (not simultaneous) to get all the data. I can see how having an input source with too high of impedance could be a problem for the accuracy of that channel (settling time is too long), and if the channels had to be scanned through then there is some residual voltage left, causing the next channel reading to be inaccurate. However, I'm not quite sure how this applies when the sampling is simultaneous, since it's not switching between channels.
In particular, I'm seeing significant cross talk when trying to acquire a square wave signal, presumably because the square wave is composed of a large spectrum of frequencies -- it seems that this causes "blips" to appear on my other channels that correspond with the uptick and downtick of the square wave. I think it does happen with simple sine waves and other types of signals as well, but it seems to be the most obvious/significant at least when using a square wave input.
For reference I'm using PXIe-6368 cards in a PXIe-1078 chassis.
Curious if anyone has any experience resolving issues related to this. Thank you!
A question on USB DAQ 6008
Hey all,
I have a simple question. I am trying to generate a sine wave using a waveform generator, send it to analog output and detect the same signal using analog input. However, I am having problems for this. It is giving me an error of: Write cannot be performed, because the number of channels in the data does not match the number of channels in the task. Number of Channels in Task: 2
Number of Channels in Data: 1000
I would be happy if any of you guys can help me.
Regards,
Metcik
Reserved Resource error with NI 9221 module
Hi,
I am using a NI 9221 module to read 3 analog signals in three different channels. I am reading continuously from Channel 3 in the main vi. I have a state machine diagram with case structure. In one of the cases, I am reading analog signal from channel 1 and 2 inside a subVI. I know that I can use same module for different tasks in the same VI. But as I am getting outside of main VI once I go inside the subVI, I get resource reserved error. How to solve this problem? I don't need to read signal from Channel 3 for the time period when I am reading from channel 1 and 2. Is there a way to hold reading from channel 3 only for that particular period and then resume again later. Please let me know. Thanks for your help.
Best,
Nil
SCB-100A board assembly dimensions
Is a drawing available with dimensions of the circuit board inside the SCB-100A terminal block assembly. The online CAD and dimensional drawings for the SCB-100A only dimension the outer case. But in our application we will need to remove the case and mount several of these in a custom made enclosure. I really just need the mounting hole pattern (4 hole pattern). Thank you!
Analog input to DAQ6009
Hi,
I am trying to do a project based on LabVIEW and it requires Daq6009 to be interfaced with a 3 phase induction motor. The Daq has 8 analog inputs and I can't figure out whether the analog input has to be ac or dc?
Since I am interfacing AC motor, should I convert the ac supply to a suitable dc value in order to give it as an input or can I just step down the value and give it as a voltage?
Please help me out!
Thanking you,
Abigail