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

NI-USB 6525 Not getting register_signal_event callbacks with cfg_change_detection_timing

$
0
0

I'm toggling inputs on an NI-USB6525 and trying to detect the change with a Python script.

I'm able to write the lines and read them successfully after the write, but I am not detecting the changes. I can set an input to True or False and then use another script to manually read the input and get the correct result. I need this script to automatically detect the change.

import sysimport timeimport nidaqmxdef readControlSimulator(niDaqDevice ="Dev1"):# On NI-USB6501 all IOs are configurable.# On NI-USB6525 port0 are outputs, port1 are inputs.
    INPUT_PORT ='port1'# read command line argumentsfor arg in sys.argv[1:]:
        niDaqDevice = arg# Set up NIDAQ line detection for all lineswith nidaqmx.Task()as task:# Will only work if using a compatible device.try:print("SET UP CHANGE DETECTION")
            task.di_channels.add_di_chan(niDaqDevice +'/'+ INPUT_PORT +'/line0:7')
            task.timing.cfg_change_detection_timing(rising_edge_chan = niDaqDevice +'/'+ INPUT_PORT +'/line0:7',
                                                    falling_edge_chan = niDaqDevice +'/'+ INPUT_PORT +'/line0:7',
                                                    sample_mode=nidaqmx.constants.AcquisitionType.CONTINUOUS)def callback(task_handle, signal_type, callback_data):print("CHANGE LINE")return0

            task.register_signal_event(nidaqmx.constants.Signal.CHANGE_DETECTION_EVENT, callback)
            task.start()except nidaqmx.DaqErroras e:print(str(e))

    time.sleep(10)if __name__ =='__main__':
    readControlSimulator()

The code should print "CHANGE LINE" if a line changes, but it doesn't.

Thanks for any and all help.


USB-6366 Digitail input ports

$
0
0

Hi,

I am trying to input Digital 12bit data(5V TTL) into USB-6366(BNC Model).

According to specification, PFI 0-11 can be utilized. However connector shape are BNC and another ports. It is not convenient. If P0.0 - P0.7 and PFI 8-11 could be utilized, it would be great. Is it possible to do such connection ?

 

6366pin.PNG

DAQmx and NI IO Trace

$
0
0

Hi All,

 

I am developing a C# program which can communicate the device through Digital I/O. 

In my PC I have a Digital I/O card. 

 

After I made the write code base on the DAQmx example, the code doesn't give back error, but I can't see anything in the NI IO Trace. (I've started capturing...)

The example program does the same issue.

 

I don't know what the problem is. Nevertheless, If I push the start button on the test panel I can see the captured communication lines. Smiley Sad

 

Please help me whether the example code wrong or the NI IO Trace.

 

The example source code as below or in the attachement:

 

private void writeButton_Click(object sender, System.EventArgs e)
{
Cursor.Current = Cursors.WaitCursor;
try
{
using (Task digitalWriteTask = new Task())
{
// Create an Digital Output channel and name it.
digitalWriteTask.DOChannels.CreateChannel(physicalChannelComboBox.Text, "port2",
ChannelLineGrouping.OneChannelForAllLines);

// Write digital port data. WriteDigitalSingChanSingSampPort writes a single sample
// of digital data on demand, so no timeout is necessary.
DigitalSingleChannelWriter writer = new DigitalSingleChannelWriter(digitalWriteTask.Stream);
writer.WriteSingleSamplePort(true, (UInt32)dataToWriteNumericUpDown.Value);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
Cursor.Current = Cursors.Default;
}
}

No DAQ Assist Icon on Labview

$
0
0

Hi,

 

First of all, I am pretty new, I have never used NI's system.
I am trying to capture the Digital signals via USB-6366 on Labview. However I can not see the DAQ assist icon on Labview.

I believe this USB-6366 is recognized on MAX, and see digital signals via Test Panels.
How to come up the icon on Labview?

My ultimate goal is to capture digital signals and put into DSP(like Low Pass Filter and so on).

 

Thanks,

Control a stepper motor using nidaqmx and digital output in Python

$
0
0

Hello,

I have a problem using nidaqmx digital output to control a stepper motor in Python. I have read through the Python documentation (http://nidaqmx-python.readthedocs.io/en/latest/index.html ) and this example (https://github.com/ni/nidaqmx-python/blob/master/nidaqmx_examples/do_sw_timed.py) already, but I am running into issues getting the stepper motor to rotate. So far it seems like the digital output is being sent to the motor, but the motor is only vibrating and not rotating.

 

System:

Windows 7, Python 3.7, NI USB-6009

 

The code:

import nidaqmx
import time
from nidaqmx.constants import (
    LineGrouping)

with nidaqmx.Task() as task:
	task.do_channels.add_do_chan('Dev1/port1/line0:3')
	task.start()
	while True:
		task.write([8,0,0,0])
		time.sleep(.002)
		task.write([0,8,0,0])
		time.sleep(.002)
		task.write([0,0,8,0])
		time.sleep(.002)
		task.write([0,0,0,8])
		time.sleep(.002)

 When I run the code, the stepper motor will vibrate but it will not rotate like I want it to. Any suggestions to fix this problem? I have already tried changing the length of the pause from .002 to .02 to .2 (and values in between). I have also tried writing different values of bits such as [8,0,8,0] and [0,8,0,8]. Changing the length of the pause will change how frequently it vibrates, but I cannot get the motor to actually rotate. I assume it is an issue with what bits I am writing to the task, because the digital output works.

 

For reference, here is a version of the code in matlab that works like it is supposed to on the same computer/system:

 

clear all
close all
clc
pt=2/100;
s=daq.createSession('ni')
%%
addDigitalChannel(s,'Dev1','Port1/Line0','OutputOnly');
addDigitalChannel(s,'Dev1','Port1/Line1','OutputOnly');
addDigitalChannel(s,'Dev1','Port1/Line2','OutputOnly');
addDigitalChannel(s,'Dev1','Port1/Line3','OutputOnly');
n=0
while(n<100)
outputSingleScan(s,[1 0 0 0]);
pause(pt)
outputSingleScan(s,[0 1 0 0]);
pause(pt)
outputSingleScan(s,[0 0 1 0]);
pause(pt)
outputSingleScan(s,[0 0 0 1]);
pause(pt)
n=n+1
str='loop'
end
clear all
close all

Thanks in advance, any advice is appreciated.

7811R PWM and Digital IO

$
0
0

Hello everyone,

      I want to use PXI-7811R  to realize PWM generate and duty test in Veristand,but I donot know if someone has done that. Can you share your custom device and labview project with me? Thank you!

Accessing I/O

$
0
0

Is there any way to access the digital IO on the sbRIO-9637 without having to use LabView?

#DO card NI - 6512 darlington driver IC A2982SLWT got damaged

$
0
0

Hi everyone,

While testing application with NI - 6512 DO card, Diver IC A2982SLWT for first Bank(P0) got damaged(Burned). So after that i had checked wiring but i didn't found anything wrong with the wiring.

 

I have attached file for understanding exact problem.

 

Please have a look and hope for instant reply.


USB-6501 如何把一脚设为高阻态?

$
0
0

有一个项目, 要随时控制一个引脚: 处于数字输出, 处于高阻态(HiZ) 如何处理? 

我尝试把这个脚设为AI状态, 给出错误提示: 

200430:
I/O type of the physical channel does not match the
IO type required for the virtual channel you are creating

 

我用的是VB6

DAQmxCreateTask("", taskHandle)
 DAQmxCreateAIVoltageChan(taskHandle, "Dev1/port/line0", "", DAQmx_Val_InputTermCfg_RSE, 0, 5, DAQmx_Val_VoltageUnits1_Volts, ByVal 0&)

 

另外, 如何随时 把这个脚 数字输出, 数字输入, 高阻断开?  实验中发现, 输出高时, 再去读时会自动把输出变为低.

9469 Setup - cannot discover connections

$
0
0

Hi,

 

I have 3 CompactRIO chassis 9057's each with a 9469 card in slot 2.

I have tried to configure the cards within MAX but i am unable to discover any signals connected to any of my chassis.

I currently have the cards setup in a daisychain configuration

 

Thanks Cat Very Happy

Which model should be used to replace USB-6501 , to generate fast Digital signal ?

$
0
0

I want to use VB6 control USB-6501, but I can't find very detailed datasheet.
I can only find some simple examples. But there is no more detailed information.
For example, I want to know how to change the delay after the output of DAQmxWriteDigitalLines()?
If USB-6501 can't do this, what model should I use?

It seems that USB-6501 cannot set the frequency of the output signal.
It seems that the frequency is 1K, and I cannot change it !


USB-6501 needs to delay 2ms after sending a signal, which is TOO slow for me!

I want a product that only delays 2us after sending a signal.

Ni Module Suggestion

$
0
0

Hi Ni Experts,

 

I am having trouble deciding which NI module suits me better. I am trying to do data acquisition temperature, pressure, and valve. In addition to that I need to implement PID controls (for example, valve will respond to  pressure setpoint). 

 

I seem some examples where people have used NI-9220, 9201, USB-6216 to do this because they have the "control" capability where as the USB-6003 for example, does not. 

 

Could anyone provide some advice/comment on the NI-9xxx series or the USB-6xxx series as to which one I should go with? 

Labview FPGA cRIO-9014, NI-9403 pulse generation

$
0
0

Hello everyone,

I don't have any experience with LabVIEW  FPGA and I hope someone can help me with the questions below. I have 5V TTL NI-9403 DIO module and I want to generate some pulses with the module. I made very basic program and I connected the module's DIO 01 channel to the oscilloscope's positive prob and module's COM channel to the oscilloscope's negative prob. According to program when it is sent true signal to the DIO module, would I see 5V pulse on the oscilloscope?

I couldn't see any pulse on the oscilloscope.

How can I generate pulse from the digital module with Labview FPGA programming?

Kind regards,

Kaan

 

How to read a 12-bit digital input using LabVIEW

$
0
0

I am wondering how to read 12-bit digital input using a USB-6008 DAQ and LabVIEW. I want to connect the MAX6675 thermocouple amplifier (https://www.maximintegrated.com/en/products/sensors/MAX6675.html) to the USB-6008. The MAX6675 outputs the temperature as 12-bit digital data that is read-only and SPI compatible. The data is outputed on the MAX6675 serial data output pin.

This is from the data sheet for MAX6675 (https://datasheets.maximintegrated.com/en/ds/MAX6675.pdf):

"The Typical Application Circuit shows the MAX6675 interfaced with a microcontroller. In this example, the MAX6675 processes the reading from the thermocouple and transmits the data through a serial interface. Force CS low and apply a clock signal at SCK to read the results at SO. Forcing CS low immediately stops any conversion process. Initiate a new conversion process by forcing CS high. Force CS low to output the first bit on the SO pin. A complete serial interface read requires 16 clock cycles. Read the 16 output bits on the falling edge of the clock. The first bit, D15, is a dummy sign bit and is always zero. Bits D14–D3 contain the converted temperature in the order of MSB to LSB. Bit D2 is normally low and goes high when the thermocouple input is open. D1 is low to provide a device ID for the MAX6675 and bit D0 is three-state."

CS is a pin on the MAX6675, and CS stands for Chip Select. SO is the serial output pin. SCK is the serial clock input.

 

Using LabVIEW, how can I create a serial clock input? How can I read the 12-bit digital input using LabVIEW? What is conversion in this context? What does it mean for a bit to be three-state? How can I create a LabVIEW program that correctly reads the digital input?

 

Thank you! I am a newbie in LabVIEW

数字模块的Update Rate是否导致无法并行输出数字电平?

$
0
0

想通过NI-9403数字模块输出两路PWM信号,其中一路设置比另一路延迟2微秒触发,但通过示波器观察实际延迟为7微秒(该值为NI-9403 Update Rate),是不是虽然FPGA可以并行计算,但是数字模块无法并行发出多路PWM信号?

下图是LabVIEW FPGA程序界面

image.png


pxi 6515 output not working in NI Max

$
0
0

Hi,

I am trying to test my pxi6515  digital io and i cant get it to output a voltage in the SCB100A terminal (P7.0 and P7.1) I am operating it through NI Max, Vcc is connected to 24V (pin 96) and ground to P7.GND (pin 97), . The digital input tests fine in NI Max.

 

Does anyone have an idea what the issue could be? Any settings i need to change? The pin numbers seem to be correct.

 

Cheerio, Peter

PCI-6503 on a PCI-e port with an adapter

$
0
0

Hey guys,

 

We have a PCI-6503 card and we wish to use it with a CPU motherboard which has only PCI-e slots. My IT guy is unable to procure a CPU system which has a PCI port and suggests that we should get a PCI-e to PCI adapter similar to the one below:

https://www.amazon.com/StarTech-com-Express-Adapter-Card-PEX1PCI1/dp/B0024CV3SA?tag=georiot-in-default-21&ascsubtag=tomshardware-1227363769657819765-20

 

Can someone help me out and let me know if the PCI-6503 card will be able to work using such an adapter.

PXI 6512 continuous waveform generation

$
0
0

My PXI 6512 task is giving an error saying that its not supported. Is it not possible to generate a continuous pulse using PXI-6512 ? I am using onboard clock as clock source. What should be the clock source?  Example program given in LabVIEW for Digital IO continuous waveform generation is also giving an error for PXI-6512?

PCI DIO 96 power off condition

$
0
0

I am sharing an appliance which contains LEDs that either of two PCI DIO 96 cards can sink the LED to turn it on - a 'wired-or' condition. This works great as long as both of the PCI DIO cards stay active.

When one system containing the DIO card is powered off, the LED at the appliance illuminates overriding the chance of the other system using it.

is there a way to command (or strap) the PCI DIO 96 card to go to a 'high impedance' or HIGH state when powered off?

 

No driver for PXI-6514 ?

$
0
0

Hi there,

i look at NI website and did not find any driver (wether it's IVI or Labview or something else) for the DIO PXI 6514.

Any idea ?

 

Best Regards,

Colin.

Viewing all 2180 articles
Browse latest View live


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