Quantcast
Channel: Digital I/O topics
Viewing all 2183 articles
Browse latest View live

Testing switch array with PCIe-6509. High Z mode?

$
0
0

I have a large array of physical switches and buttons to test:

  1. Upon closure, each one must be under a certain resistance.
  2. Upon release, each one must be over a certain resistance.

I am testing this by placing each line into a PXI matrix switching card which is routed through to a DMM.  The user is prompted to go through the switch array in a predefined order testing each line individually.

 

However, I would like the end user to also be able to enter a separate "quick test" mode where they are able to press any of the switches at any time and get an indication on-screen that the switch is in reasonable working order.  The idea was to splice every line into a PCIe-6509 as well as the matrix/DMM

 

However, the problem is that any line on the PCIe-6509 is only 25kΩ with any other.  Is there a way to set all lines to a HI input impedance state so that when the first test is run I can test the actual resistance of the switch in its "open" state not the 25k as seen by the DIO?

 

Any input would be appreciated.

 


connect the sensor IMU (MPU 6050) with the acquisition card BNC2120.

$
0
0

Hello,
I have a project of end of study and I am blocked how to connect the sensor IMU (MPU 6050) with the acquisition card BNC2120.
I need to rest please and I am a beginner in Labview.
Thank you

Manual control pulse generation

$
0
0

Hello, Labview community.

I'm sending a 5V signal to my multiplexer reset terminal physically with a toggle switch. Toggle ON, it stays high 5V, toggle OFF, it stays low. Can someone share an example which does the same work using NI 9401, manually control from the front panel? Thanks in advance.

Sample of DAQmxCreateDOChan have error (NI-USB-6211)

$
0
0

Hello,

 

I ran the sample program

C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Generate Values\Cont Write Dig Port-Ext Clk, but got a message as below:

 

DAQmx Error: Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.
Property: DAQmx_SampTimingType
Requested Value: DAQmx_Val_SampClk
Possible Values: DAQmx_Val_OnDemand

Task Name: _unnamedTask<0>

Status Code: -200077
End of program, press Enter key to quit

 

 

 

I'm using USB-6211 and nothing is connected to it except usb cable.

Could you give any advice regarding this error?

 

Main program is here:

int main()
{
	int32       error = 0;
	TaskHandle  taskHandle = 0;
	uInt32      data[8] = { 1,2,4,8,16,32,64,128 };
	char        errBuff[2048] = { '\0' };

	/*********************************************/
	// DAQmx Configure Code
	/*********************************************/
	DAQmxErrChk(DAQmxCreateTask("", &taskHandle));
	DAQmxErrChk(DAQmxCreateDOChan(taskHandle, "Dev2/port1", "", DAQmx_Val_ChanForAllLines));
	DAQmxErrChk(DAQmxCfgSampClkTiming(taskHandle, "/Dev2/PFI0", 1000.0, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000));

	DAQmxErrChk(DAQmxRegisterDoneEvent(taskHandle, 0, DoneCallback, NULL));

	/*********************************************/
	// DAQmx Write Code
	/*********************************************/
	DAQmxErrChk(DAQmxWriteDigitalU32(taskHandle, 8, 0, 10.0, DAQmx_Val_GroupByChannel, data, NULL, NULL));

	/*********************************************/
	// DAQmx Start Code
	/*********************************************/
	DAQmxErrChk(DAQmxStartTask(taskHandle));

	printf("Generating digital output continuously. Press Enter to interrupt\n");
	getchar();

Error:
	if (DAQmxFailed(error))
		DAQmxGetExtendedErrorInfo(errBuff, 2048);
	if (taskHandle != 0) {
		/*********************************************/
		// DAQmx Stop Code
		/*********************************************/
		DAQmxStopTask(taskHandle);
		DAQmxClearTask(taskHandle);
	}
	if (DAQmxFailed(error))
		printf("DAQmx Error: %s\n", errBuff);
	printf("End of program, press Enter key to quit\n");
	getchar();
	return 0;
}

 

Thank you.

connect the sensor IMU (MPU 6050) with the acquisition card DAQ NI 6212

$
0
0

Hello,
I have a project of end of study and I am blocked how to connect the sensor IMU (MPU 6050) with the acquisition card DAQ NI 6212 ?
I need an answer please, and it was possible an article to understand better and I am a beginner in Labview.
Thank you.

USB M-series without OnboardClock

$
0
0

Hello to the community

 

I am still trying to choose a board to generate frames at 1666.67Hz, but this time with an USB device

I was thinking about a USB_6289

However in simulation, the generation with OnboardClock throws an error (-89120)

With the FrequencyOutput, I think I can't get the good frequency (only 100kHz/16).

Is there any other way to do it ? Or should I buy a USB_63xx

 

Thank you

Cédric

PLZ664WA kikusui Drivers

$
0
0

Hi,

I came across PLZ664wa or kikusui. I want to install the drivers for the same and work on simulation as I don't have the hardware.

Please convey how can I install the drivers and then simulate it on NI MAX.

I am new to NI MAX

Increasing 9375 current output

$
0
0

I am wondering if you can parallel outputs of the 9375 module to increase the output current capability for a single load like you can with a 9472 module?


Error -1074118579

$
0
0

I have an issue that I have not been able to figure out.

 

I have multiple test stations that are configured exactly the same. They have the same test equipment and the same software. However, one station is giving me the error -1074118579 when it runs the niHSDIO Is Done.vi. There are no errors on any of the previous steps. This is the only vi that generates that error code and message.

 

Why would it work on the other stations, but not this one?

 

The DIO card that the stations use is the PXI-6556

NI PXIe-6556 (HSDIO) configure for High speed MIPI interface

$
0
0

Hi

 

I am having issues when we want to increase MIPI frequency to 2.1 spec of 52MHz.

 

Our interface uses soft dock with 6ft long cable from the PXIe Card. When we connect Oscilloscope we see that we are getting data but that is delayed by 3/4 cycles (of sample clock) . 

Ideally I would like to configure data acquisition with certain delay from falling edge of SCLK line. But the configure VI allows us to only configure delays from on board strobe or on board sample clock.

 

Is there any work around for this problem?

Can any cRIO modules provide open-collector outputs?

$
0
0

I am trying to emulate the open-collector output of a fan tachometer, which outputs either Low or Hi-Z, with a cRIO module.  I haven't been able to find any, however, that will accomplish this; the best I could find was switching the IO direction on a 9401 between input and output, but four of the eight channels must be set to input/output at a time and the switching time between directions is unspecified.  Am I overlooking something?

NI 9472 is not generating a pulse train correctly with 500Hz

$
0
0

Hello,

 

I have a NI-9472 inserted in the slot 6 of a cDAQ-9189 chassi. I am trying to generate a PWM, however I am facing some difficulties. When in frequencies around 150 Hz, I obtain correctly the pulse train, but as I increase the frequency it looks like the signal takes longer to go to low level.

I tryed to get the waveform with an oscilloscope connected directly to the output of the NI-9472, and the attached images show the situation I have described.

I looked at the manuals but couldn't find any clue. I think the module should be able to generate higher frequencies but I couldn't do it. Does anyone had this issue before or what should be done?

 

Thanks in advance.

 

Best regards.

 

Digital waveform output pulse counter

$
0
0

Hello people!

I am working on an application for testing solenoid valves in pulse mode. The idea is to be able to register the number of cycles and to change the opening pulse duty cycle during the test.

The idea is to use a "for loop" to generate a 100 position array for digital output, so duty cycle can be easily adjusted. I placed the digital write function inside a "while loop" to use the loop counter as the cycle counter.

 

Because I wanted to know exactly the number of opening cycles, I initially used the DAQmx Timing vi wired as finite samples outside the writing loop, but this solution did not work. Several writing errors shown up as I tried to test different "auto start" input configurations, regeneration mode and task start/stop alternatives.

 

Merging some hints from the forum I got to 2 stable solutions:

1) To wire the Timing vi as continuous samples and let the Write vi to run freely inside the loop;

2) To remove the Timing vi and use the  Write vi as "on demand".

 

The 1st solution is elegant and nice in therms of buffering the output and repeatability of the generated signal, but it has absolutely no control of the number of pulses neither the duty cycle.

The second solution works great for duty cycle control and number of pulses recording, but because it relies on OS for requesting the writes, pulses are not repetitive and I always have to explain to my boss that I has nothing to do with the valve under test.

 

So, after that, my question is: Is it possible to have the best of all solutions buffering the output with finite samples timing configuration?

 

Hardware: cDAQ9189 + NI 9485 Solid State Relay module

 

Digital Output.png

Set data width using DAQmx and PXI-6534

$
0
0

Hi,

 

It might be trivial question, but I have search the forum, manuals etc and I couldn't find an answer so far. I generate signal using 'Digital pattern' setting. According to the manual for NI 6534, I can select between a width of 8, 16 or 32 bits. At the moment, the default value is 8-bit for the way that I select physical channels. How can I change it to 32-bit? Can I do this programmatically? Or do I need to select channels somehow differently? Initially I thought that I might be able to access it via property node, but I tried it (as you can see...) with no luck. Here is the code:

 

CodeExample.png

and a simple drop down control which I use to select channels:

ControlExample.png

 

Cheers!

How to generate hardware-timed TTL signal with a PCI-6289

$
0
0

I would like to to generate a hardware timed TTL signal on Ni PCI-6289 and manually configure the sample rate to some lower value as 1k or 10k. I'm using the python API for NI-DAQmx. When I run a simple demo like:

import nidaqmx
from nidaqmx.constants import LineGrouping
from nidaqmx.stream_writers import DigitalSingleChannelWriter
import numpy as np

delay = 3*(10**3)
a = np.empty(delay, dtype="uint32")
for i in range(delay):
    a[i] = 0
    a[delay-1] = 1
with nidaqmx.Task() as task:
    task.do_channels.add_do_chan("Dev1/port0/line0:0", line_grouping=LineGrouping.CHAN_PER_LINE)
    task.timing.cfg_samp_clk_timing(1000)
    writer = DigitalSingleChannelWriter(task.out_stream, auto_start=True)
    writer.write_many_sample_port_uint32(a)

(environment Python 3.7 with PyCharm, nidaqmx 18.5, Windows10)
It will raise an error:

Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Program Files\JetBrains\PyCharm 2018.2.4\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "C:\Program Files\JetBrains\PyCharm 2018.2.4\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/LYCLab/PycharmProjects/Labctl/di_test.py", line 15, in <module>
writer.write_many_sample_port_uint32(a)
File "C:\Users\LYCLab\PycharmProjects\Labctl\venv\lib\site-packages\nidaqmx\stream_writers.py", line 930, in write_many_sample_port_uint32
self._verify_array(data, False, True)
File "C:\Users\LYCLab\PycharmProjects\Labctl\venv\lib\site-packages\nidaqmx\stream_writers.py", line 113, in _verify_array
channels_to_write = self._task.channels
File "C:\Users\LYCLab\PycharmProjects\Labctl\venv\lib\site-packages\nidaqmx\task.py", line 168, in channels
self._handle, flatten_channel_string(self.channel_names))
File "C:\Users\LYCLab\PycharmProjects\Labctl\venv\lib\site-packages\nidaqmx\_task_modules\channels\channel.py", line 118, in _factory
check_for_error(error_code)
File "C:\Users\LYCLab\PycharmProjects\Labctl\venv\lib\site-packages\nidaqmx\errors.py", line 127, in check_for_error
raise DaqError(error_buffer.value.decode("utf-8"), error_code)
nidaqmx.errors.DaqError: External sample clock source must be specified for this application.
Task Name: _unnamedTask<0>
Status Code: -200303

This script works without the cfg_samp_clk_timing() function (set delay to 10**7). but according to oscilloscope the real delay is only 0.3s.

 

I have tried some alternative methods, such as specified the source as "Dev1/10MHzRefClock". However, it will raise another error which suggests either use OnBoardClock or change the sample rate according to the clock timebase.

 


Continuous PWM with NI 9375

$
0
0

Hi,

We have NI 9375 (sits in C-DAQ 9184). We need to generate continuous puls train being able to alter time of high and low states (pulse quote) as well as frequency "on the fly".

 

The number of relevant examples is huge but even this number is dissolved among irrelevant examples. Please advice how to do the work in LabVIEW.

Humidity and Temperature Data Fetch

$
0
0

Hi guys.

I collecting data from hih-6130-i2c and when i wanna convert incomings bits to number my temperature sits but humidity never. I think its problem in first byte.

image.png

 

S0 is status bit so it does not affect the resulting value but when i read firts byte i get wrong number.

image.png

127 is wrong right ? I need cut first bit ?

 

My other question is on the getting right forms 14 bits data.

image.png

 

Can I do that like this ?  

 

Equation.

image.png

PXI 6528 Digital output not working

$
0
0

Problem: I have a PXI 6528 and I can't get the Digital Outputs to work. 

 

Background: I've tested all the digital inputs using the +5V and ground on the board and they all work. I can't get the outputs to output any voltage using NI MAX. I've tried hooking the "+" and "-" to a multimeter and I used the test panel to force all the out puts high but that didn't work. I tried "+" and "ground" and I did the same thing forcing all outputs high but no luck. I'm not sure what I am doing wrong unfortunately I'm having trouble understanding the manual for hints on how the digital outputs are suppose to work. I had assumed when sent high they would output a +5V or +3.3V signal. Any help would be appreciated.

 

Equipment

I have a NI PXI 6528 going into an SCB 100 break out module. I'm using Labview 2014 and NI MAX version 15.0.x.x.

 

NI 9403 cRIO overcurrent status detection

$
0
0

When the 9403 detects an overcurrent condition all channels are tri-stated (inputs and outputs).  This overcurrent mode would prevent an application from reading the state of any input channels (as I understand). Is there a way for an application to detect/determine if the overcurrent mode is active? e.g. is there a status register indicating errors?

Trouble with DIO !

$
0
0

Hello everyone !

I've just bought a NI-9401 for some stuff I'm working on. I'm using Python with this device and I'm having trouble. I spent the last 3 days searching everywhere online and I couldn't seem to find any answers (I'm fairly new to both Python and NI btw).

 

So here is the thing : I want to test the device by transfering some floats from a digital output to a digital input.

 

Here is my code so far :

 

import nidaqmx as ni
import numpy as np
import matplotlib.pyplot as plt
from nidaqmx.constants import (LineGrouping)

## Emission ##
fe = 44100
f = 440
T = 0.05
t = np.linspace(0, 0.05, fe*0.05)
sig_E = np.sin(f*2*np.pi*t)

plt.figure()
plt.subplot(211)
plt.plot(t, sig_E)
plt.title("Signal Emis")
plt.tight_layout()

with ni.Task() as task:
    task.do_channels.add_do_chan("cDAQ1Mod1/port0/line0", line_grouping=LineGrouping.CHAN_FOR_ALL_LINES)
    task.write(sig_E)

## Reception ##

with ni.Task() as task:
    task.di_channels.add_di_chan("cDAQ1Mod1/port0/line4", line_grouping=LineGrouping.CHAN_FOR_ALL_LINES)
    sig_R = task.read(number_of_samples_per_channel=len(t))
    plt.subplot(212)
    plt.plot(t,sig_R)
    plt.title("Signal Recu")
    plt.tight_layout()
    plt.show()

So it's 5 seconds of a sine at 440 Hz and I want to send it from the DO to the DI (linked with a cable). But the error message I get is that the "write" function can only send boolean samples and obviously I want to send floats.

 

So how can I send my sine through the digital output (and read it from the digital input)? What are the appropriate functions ?

 

Thank you in advance for your help.

Best regards.

Viewing all 2183 articles
Browse latest View live


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