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

USB-6501 maximum number of tasks?

$
0
0

I have an application that has quite a few single input/outputs and a counter. The tasks are created in the beginning for the I/O and the task is created later in the code. What I recently observed is the task create for the counter now returns an empty string for the task and no error. What would cause this? The code had worked before. Some additional I/O was added in the earlier initialization as well as a second USB-6501 to the system. The code for the counter was not modified. I can't post the whole application but why would I get an empty task from the create with no error? Obviously, the counter is not working at this point. So, is there a maximum number of tasks that can be created on this device? If so, what is the number?


cDAQ sample rate

$
0
0

Hello everyone,

 

I'm using a cDAQ 9174 with a 9401 module to output a finite sequence at a specific rate to trigger some devices. However, the actual sample rate seems to differ from the expected rate.

I made some measurements using the attached vi to compare the expected with the actual effective sample rate.

ExpectedActualActual-Expected
11,196240,19624
55,924260,92426
1011,74851,7485
2022,98282,9828
3033,78123,7812
4043,81523,8152
5054,12084,1208
6062,89372,8937
7071,89161,8916
8080,58220,5822
9088,9891-1,0109
10096,6605-3,3395
120112,182-7,818
140125,938-14,062
160139,997-20,003
180158,569-21,431
200171,392-28,608

 

There should be an increasing overhead since I'm stopping and restarting the task after each iteration. But as you can see, below ~90 Hz, the actual effective sample rate is even higher than expected! What's happening here?

DAQ_Sample_Rate.png

Strange Output of PCI-6289 DO

$
0
0

I'm using Python(nidaqmx package) to control phi-6289. I want to generate a digital pulse of given length on port 0, line 0 of PCI-6289, but I get some really strange results on the oscilloscope.

My code is as: 

import nidaqmx
import numpy as np
from nidaqmx.stream_writers import DigitalSingleChannelWriter
from nidaqmx.constants import AcquisitionType
from time import sleep


def done_event(*args):
print('measurement done')
return 0


def pulse(time):
waveform = np.ones(time, dtype=np.uint32)
ending_sequence = np.zeros(100, dtype=np.uint32)
waveform = np.append(ending_sequence, waveform)
waveform = np.append(waveform, ending_sequence)
return waveform


if __name__ == '__main__':
virtual_task = nidaqmx.Task()
do_task = nidaqmx.Task()
# create a virtual analog input channel
virtual_task.ai_channels.add_ai_voltage_chan('Dev1/ai0')
virtual_task.timing.cfg_samp_clk_timing(1000, sample_mode=AcquisitionType.CONTINUOUS)
virtual_task.start()
# configure the digital output task
do_task.do_channels.add_do_chan('Dev1/port0/line0:31')
do_task.register_done_event(done_event)
do_task.timing.cfg_samp_clk_timing(1000, source='/Dev1/ai/SampleClock') # set digital sampling time
do_task.write(pulse(500),auto_start=False)
print('start to write')
do_task.start()
# start the measurement
sleep(3)
virtual_task.close()
do_task.close()

(the parameter of pulse() is the central length of the pulse, and I add 100 zeros on both side of the pulse)

I wire the port0line0 to the oscilloscope and get:

pulse(100): three 0.1s pulses, separated by 0.2s each

(looks like the code is executed for three times)

pulse(300): two 0.3s pulses, separated by 0.2s

(looks like the code is executed twice)

pulse(500): singel 0.5s pulse and the output is not returned to zero

 

Does anyone know what is going on here? Thanks. 

IMG_0874.JPG

IMG_0875.JPGIMG_0876.JPG

How to use the NI 9206 digital output?

$
0
0

Hi,

 

I have a WLS 9163 with NI 9206 and i need to use the digital output, but i can't see this output port in MAX (version 5.6), only analog inputs.

 

NI 9206 have one digital output but how use it?

 

Thanks

8 PWM signals with 9401

$
0
0

Hello,

 

I am looking into producing 8 PWM signals using an NI-9401 in a cDAQ-9174. Ideally each PWM signal would be able to have a different duty cycle, but run at the same frequency (25kHz). From what I've read in the link below, I cannot accomplish this using counters.

 

https://forums.ni.com/t5/Digital-I-O/Compact-Daq-cDAQ-maximum-PWM-outputs-PWM-output-module/td-p/3710596?fbclid=IwAR3JuRo4d3xpKebijDgak-oVOXSP8SwFmeLVaxYL4ZIX_rI1dWYVyuVntWM

 

I am thinking there is a way to do this by coding the digital outputs to run off the 20MHz hardware time base, but I'm not sure if this is feasible. I would appreciate it if someone could give me a quick answer as to whether my suggestion is possible or if I'm wasting my time.  

 

Thank you.

Problem Regarding Sine PWM

$
0
0

I am using a NI9401 in Crio 9067 to produce sine PWM signal which will be fed into an inverter. The problem is that the output PWM signal is of 2.2V while i need the output voltage to be around 5V for the functioning of IGBTs in the inverter. Can anyone help me regarding this problem?

PYTHON - NI9401 - sending two different PWM through two different DO at the same time

$
0
0

Hello averyone !

So I have two different PWM and I'd like to send one through one DO of my ni9401, and the other one through another DO of my NI9401 (and read the first one with one DI and the other one with another DI).

 

I'm using Python, and I already know how to create a multichannel task (with cDAQ)/Mod1/line0:4 for example), but after that, how do I tell it to write one PWM through only one of theDO and the other PWM through another DO. And I must write those at the same time.

 

So first, is it possible ? If so, I'd be glad to have some help.

 

Thanks in advance.

 

Below is my code, where sig_e1 and sig_e2 are my two different PWM to be wrtitten through two DO, and sig_r1 and sig_r2 are the same PWM but after being read by two different DI.

 

I tried to create one master task with 2 slave tasks (well, I tried something...).

with nidaqmx.Task() as master_task, nidaqmx.Task() as slave_task1, nidaqmx.Task() as slave_task2:
    master_task.di_channels.add_di_chan("cDAQ1Mod1/port0/line4:5")
    master_task.control(TaskMode.TASK_RESERVE)
    master_task.timing.cfg_samp_clk_timing(int(fe), sample_mode=AcquisitionType.CONTINUOUS)
    slave_task1.do_channels.add_do_chan("cDAQ1Mod1/port0/line0")
    slave_task1.control(TaskMode.TASK_RESERVE)
    slave_task1.timing.cfg_samp_clk_timing(int(fe), sample_mode=AcquisitionType.CONTINUOUS)
    slave_task2.do_channels.add_do_chan("cDAQ1Mod1/port0/line1")
    slave_task2.control(TaskMode.TASK_RESERVE)
    slave_task2.timing.cfg_samp_clk_timing(int(fe), sample_mode=AcquisitionType.CONTINUOUS)

    slave_task1.write(sig_e1)
    slave_task1.control(TaskMode.TASK_COMMIT)
        
    slave_task2.write(sig_e2)
    slave_task2.control(TaskMode.TASK_COMMIT)
        
    master_task.control(TaskMode.TASK_COMMIT)
 
    slave_task1.start()
    slave_task2.start()
        
    master_task.start()
    sig_r1, sig_r2 = master_task.read(number_of_samples_per_channel=len(sig_e1))

    slave_task1.stop()
    slave_task2.stop()
    master_task.stop()
    

 

 

NI9401 module: compatability with SENT (digital communication protocol): internal pull-down and external pull-up

$
0
0

Good day,

 

Background

I am planning on using cRIO platform to decode a SENT signal (position sensor) and drive our product's motor while recording various analog input data.

 

This is to replace an existing custom embedded solution for future development. 

9063 (basic cRIO with 4 slots)

9401 (decode SENT position feedback signal)

9205 (analog inputs)

9505 (dc motor driver )

 

In our existing designs, we use the SENT J2716 approved electrical interface (in particular, a 51 kOhm pull-up). 

SENT_Network_with_NI9401.png
Though the acceptable values are 10-51Kohm as long as INPUT HIGH minimum / INPUT LOW maximum requirements are met.

 

My concern is the internal pull down of the NI-9401 module.

It has an internal pull-down of 47KΩ according to 

https://forums.ni.com/t5/Multifunction-DAQ/9401-pull-down-value/td-p/2908932

 

Question

With that pull down of 47KΩ, and pull up of 51 KΩ, I will get close to ~2.5V at the input pin of the NI9401 when there is no sensor output.

 

That's getting  close to an ambiguous value (NI 9401 minimum HIGH voltage is 2V) .

 

Is there anyway to disable to internal pull-down resistor?  Or any other recommendations for including an external pull-up with NI-9401 module?

 

I don't see any high speed C-Series modules with configurable pull-up/pull-down resistors. 

 

 

From my understanding, the NI-9401 is the module of choice for this application.

https://forums.ni.com/t5/Example-Program-Drafts/SENT-Communication-Protocol-Reference-Example-in-LabVIEW-FPGA/ta-p/3536003

 

Thanks in advance for your help!

 

Matt Lawson


Question about the operation between sinking type output and sinking type input devices

$
0
0

Hi all,

 

I have NI 9478, NI 9474 and NI 9426 module. I have tested the operation by connecting each other. 9478 is a sinking output module, and 9474 is a sourcing output module. 9426 is a sourcing input module.

 

If I connect 9478 and 9426 and set True to 9478 in LabVIEW, 9426 also read this signal as True. Up to this point, it is considered normal operation. However, when 9474 and 9426 are connected, 9474 is read as False when 9474's output is True, and 9426 is read as True when 9474's output is False. Is this the right behavior? Since the sourcing output and the sourcing input devices are connected together, a pull-down resistor is applied to the digital signal line. I also uploaded the hardware wiring diagram that I used. (Red is Vsup Node, and Blue is GND. Green line is digital siganl line.)

 

image.pngConnection between NI 9478 and NI 9426

 

image.pngConnection between NI 9474 and NI 9426

 

 

There is little experience with digital I / O interfacing. I wish I had someone to help.

Dynamic digital output

$
0
0

Hi all,

 

I am using a CompactRIO and am trying to dynamically control output data for an automatic test sequence, for example I want to turn on and off outputs for a certain length of time automatically without having any user input other than to start the program. Is there any examples of how I would go about doing this? I have already went through the examples in the help section and I could not find anything similar

 

Thanks Cat Happy

LabVIEW with DAQmx ==> USB-6509 ==> SCB-100 in DIO/passthrough mode: Signals from different IO pins interfere with each other.

$
0
0

Hi, I am using the NI DAQmx VI's in LabVIEW to write to and read from a circuit board for testing purposes. The hardware setup is the USB-6509 with SCB-100 in DIO/passthrough mode. The USB-6509 is switched to "LOW" in the rear of the box. In NI MAX, the pins are all set to "Tristate".

 

When I write unsigned 64-bit data to P3.2(pin44) and P3.3(pin42) at the same time, both signals come out "distorted"(when probed at the screw terminals of the SCB-100). Normally, the Highs are around +5V and Lows are around 0V with nothing in between. However, these unclean signals show another level of around +1.7V in addition to the +5V & 0V extremes. Also, the signals do not match the inputted data in LabVIEW. Same thing happens between P3.6(pin36) and P3.5(pin38). If anyone has encountered this before or knows how to correct this issue, I would love to hear from you. Thanks in advance.

VirtualBench - digital RS232

$
0
0

Dear all, 

 

I want to decode RS232 digital data by VirtualBench 16. Unfortunately in Digital menu are only I2C, Parallel and SPI communications. Is there any possibility to add also RS232?

NI VirtualBench 16.1.0.jpg

Thank you

Radek

segnale PWM

$
0
0

Goodmorning,

I'm quite new in the NI community and it's the first time that I use a NI usb-6002.

I need to generate a PWM signal by using Labview to control an electric engine (it's an engine for drones application). Someone can help me to do this?

Thank you

Digital Waveform Editor "Fill >> Fill With Value" feature

$
0
0

Hi,

 

I'm trying to figure out whether I'm using the Digital Waveform Editor V3.0 "fill with value" feature in the correct way.

 

I have tried with both compare and drive signals, when I enter a value (e.g. 55AA) the highlighted portion of the selected waveform goes high. This doesn't look correct to me. I feel like I'm missing something even though there are a small number of settings to configure with this feature. I cant seem to find any documentation to support this and there is little discussed on NI forums.

 

Any help would be greatly appreciated.

 

Thanks,

Sam

How to use digital output in elvis (1st generation)

$
0
0

Dear Expert,

Currently I'm still using old version of NI Elvis. The problem is, I was trying to connect the push button from labview to real LED which are available on the NI Elvis board. As usual, I used DAQ Assistant to set up the digital line output for LED. There are three groups of port available. Which output is suitable to be used?. The board has 4 PFI/O, 8 Digital output and 8 Digital input. Which output can be used to connect with digital device such as LED or buzzer. Thank you


Drive strength of NI8452 USB interface

$
0
0

I want to know the push pull drive current capability of SPI MOSI and MISO DIO lines of NI8452?. Is there any pullup resistor being used on SPI MOSI and MISO?. Can you please specify the PUSHUP/PULL strength, my board is having an weak pullup.

HSDIO 6555 hardware comparison with acquisition delay

$
0
0

Hello!

I am developping a Labwindows /CVI automatic test

My goal is to simulate a burst of digital signal ( around 100KHz) and acquire it behind my DUT. I have to check that the signal is received within 1.5µs.

I want to generate the stimulus from a file and do the hardware comparison with a response file as per the example code :ErrorRateTest

For now I use the same niHSDIO PXIe6555 board to generate and acquire. My hardware setup do not let me use clock and event export on the connector

 

So that, I use a free DIO to generate a "flag" which trigger the acquisition as the acquisition is configured with "niHSDIO_ConfigurePatternMatchStartTrigger(vi,...)" function. As soon as the acqusition see a rising edge on that specific channel, it starts the acqusition.

My channels dedicated to generation pattern are triggered on onboard clock rising edge

My channel dedicated to lunch the acquisitions is triggered on onboard clock rising edge

My channels dedicated to acquisition are triggered on onboard clock rising edge + acquisition delay

It works. I can check how many sample error and read back the reply using niHSDIO_FetchWaveformU32 to visually compare it with my expected pattern.

 

But as soon as I add acquisition delay, very small (0.01), it seems that I miss the first sample.

I think the delay must be a section of the sampling period. For my neeed, 1.5µs is about 0.15 to 0.45 depending my sample frequency (100 - 300 KHz).

Am I doing wrong with the delay? or is there something I have to take into account?

 

 

 

 

Use PFI pins as DIO in Simulink/MATLAB

$
0
0

Hi there

We are using PCI-6221 I/O module connected to a NI SCB 68A. We try to read in/out digital signals from and to Simulink. For the screw terminals P0.0 to P0.7 we get a signal, since we need further digital signal ports we want to use the PFI ports as DIO but don't know how to configure them correctly. For better comprehension of our problem take a look at the attached figure. (green means: is working/ red: does not work/we don't get any signal)

Did anybody have similar problems or experiences? We'd be thankful for any advice.

 

 

USB-6509/PCI-6509

$
0
0

For the USB-6509 and PCI-6509 ... I need to write to discrete outputs at an interval of less than 100 microseconds.  Can either or both of these products support the required speed?

Thanks!

Help with time delay between subsequent DAQmx Write commands...Switching digital out high/low states throughout a task with NI 9401?

$
0
0

Hello, I am hoping someone can help point me in the right direction..

 

I have a 9401 module that I am using to write some high/low signals on each of the 8 lines. The VI creates a channel and writes a boolean array of high/low values out of the port0 of the module. This is inside of a "for" loop and can be stopped manually. The task continues on to the next Write command inside of another "for" loop.

 

I want to change from one boolean state to the next without having to click stop buttons on the previous "for" loop. I haven't found any DAQmx functions that allow me to insert a time delay between each Write command. My only thought is to use a Timed Sequence structure, but I don't have the experience to know if that's a step in the right direction.

 

Can anyone please provide their input here? Any help is greatly appreciated. I'm trying to learn the ropes of DAQmx.

Viewing all 2181 articles
Browse latest View live


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