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

Set Pause Trigger while using DAQmxConnectTerms

$
0
0

Hi all,

I am wondering if I can set pause trigger on the connected terminal? I am using "DAQmxConnectTerms" to connect two PFI lines, and getting reversed pulses by feeding in an external pulse source. The question is can I have the reversed pulses being modulated by another PFI line using pause trigger? The idea is to have the reversed pulses only available when the modulation is high. Of course, the modulation signal will be slower than pulses. Thanks in advance for responses.


Connect all grounds together internally NI 6555

"Timeout expired before operation could complete" while using NI-9423 in Matlab

$
0
0

Hello,

I'm trying to read data from Digital Module NI-9423 installed in a CompactDAQ chassis cDAQ-9191. I have simple photoelectric sensor connected to NI-9423. 

I'm running following comands in Matlab (I named my device "net1" in NI MAX and have my sensor connected to port0/line0):

 

s = daq.createSession('ni')
s.addDigitalChannel('net1','port0/line0', 'Inputonly');
addClockConnection(s,'external','net1/PFI0','ScanClock');
data = startForeground(s);

This simple code keeps giving me "Timeout expired before operation could complete" error.

 

In NI MAX test panels everything works fine. State is changing in right port and right line when I'm putting something in front of the sensor. I can also run command in Matlab:

inputSingleScan(s)

and the answer is presented with no problems (1 when there is something in front of the sensor and 0 otherwise). But i need to work with real time data collected with startForeground command.

 I also tried simulating exactly the same configuration (NI-9423 installed in cDAQ-9191) in NI MAX and tried to work with simulated device in Matlab, running the same code as posted above. This approach works fine, I'm getting matrix "data" with zeros and ones alternately, exactly how it is presented in test panel of simulated device. But of course I need to work with real device and real data.

Can someone please tell me what I can try to fix my issue?
Any help would be greatly appreciated.  

PS. Here is output of command getVendors in Matlab containing my version of Matlab and NI driver version:

>> daq.getVendors

ans = 

Data acquisition vendor 'National Instruments':

            ID: 'ni'
      FullName: 'National Instruments'
AdaptorVersion: '3.13 (R2018a)'
 DriverVersion: '17.6.0 NI-DAQmx'
 IsOperational: true

 

Which driver (compatible several LINUX distributions) for PCI-6528?

$
0
0

Hello, I have to use the PCI 6528 on LINUX and I need a driver compatible with more LINUX distributions (Debian, Redhat, Madriva, Suze). On NI site I didn't find it.

TTL interfacing to 6514

$
0
0

I have a PXI-6514 and would like to know if it can act as a direct TTL input card with no external power supply.  The user guide doesn't really make it clear if this is a supported configuration.

 

I'm trying to use the 6514 to detect edges (To time stamp them for latency measurement).  I don't need to timestamp at much better than a few hundred microseconds and I'm using a PXIe LabView RealTime chassis.

 

Thanks,

 

XL600

Calibration of a digital module?

$
0
0

Hi,

 

I was looking at calibration procedures for a couple of NI boards, among which a few are digital. For those I haven't found any calibration procedure. Is it because I should consider the digital modules don't need calibration?

Thanks!

multiple calls to DAQmxWriteDigitalU32

$
0
0

I need to write digital lines with a long initial pattern, followed by faster pattern. To accomplish this, I  first set sample clock timing to slow (1 Hz), and write data using DAQmxWriteDigitalU32. Next I change the sample clock timing faster (500 kHz), and write again DAQmxWriteDigitalU32. The problem is that only the first DAQmxWriteDigitalU32 writes data. The secondDAQmxWriteDigitalU32 does not write any data. What could be wrong  here?

 

    # DAQmx Configure Code
    DAQmxCreateTask("taskSrlO",  byref(taskHandleSrlO))
    # DAQmx Create Channel
    DAQmxCreateDOChan(taskHandleSrlO,
            "Dev1/port0/line0:1, Dev1/port0/line2:7",
                    "", DAQmx_Val_ChanForAllLines)
    # DAQmx Timing Setup
    DAQmxCfgSampClkTiming(taskHandleSrlO, "", 1,
                            DAQmx_Val_Rising, DAQmx_Val_FiniteSamps,
                            1+dataSrlO2.size)

    wrtSrlO = c_int(0)
    # DAQmx Write Code
    DAQmxWriteDigitalU32(taskHandleSrlO, 1+dataSrlO2.size, 0, 10.0,
                            DAQmx_Val_GroupByChannel,
                            dataSrlO2, byref(wrtSrlO), None)

    # DAQmx Start Code
    DAQmxStartTask(taskHandleSrlO)


    DAQmxWaitUntilTaskDone( taskHandleSrlO, 10);   
    print("Written1: %d\n" % wrtSrlO.value)

    # DAQmx Timing Setup changing sample frequency
    DAQmxCfgSampClkTiming(taskHandleSrlO, "", 500000.0,
                            DAQmx_Val_Rising, DAQmx_Val_FiniteSamps,
                            1+dataSrlO2.size)
    # DAQmx Write Code
    DAQmxWriteDigitalU32(taskHandleSrlO, 1+dataSrlO2.size, 0, 10.0,
                            DAQmx_Val_GroupByChannel,
                            dataSrlO2, byref(wrtSrlO), None)

    DAQmxWaitUntilTaskDone( taskHandleSrlO, 10e-3);   
    
    # Serial Out End   #####################

    print("Written2: %d\n" % wrtSrlO.value)

multiple write operations in a task synchronized with trigger

$
0
0

My goal is to write digital patterns, first a long lasting setup pattern is written, and then a faster burst of pattern is written. I also need to synchronize this task with other actions (for example, clock generation). For the synchronization, I use the trigger functionality. Thus I have two write actions in one task, and this task is synchronized to a trigger. However, with the trigger task and the write task, only the first write call DAQmxWriteDigitalU32 works, and the second write call is ineffectual. Does the second write call need to another rising trigger?

 

    # DAQmx Configure Code
    DAQmxCreateTask("taskSrlO",  byref(taskHandleSrlO))
    # DAQmx Create Channel
    DAQmxCreateDOChan(taskHandleSrlO,
            "Dev1/port0/line0:1, Dev1/port0/line2:7",
                    "", DAQmx_Val_ChanForAllLines)
    # DAQmx Timing Setup
    DAQmxCfgSampClkTiming(taskHandleSrlO, "", 1,
                            DAQmx_Val_Rising, DAQmx_Val_FiniteSamps,
                            1+dataSrlO.size)

    wrtSrlO = c_int(0)
    # DAQmx Write Code
    DAQmxWriteDigitalU32(taskHandleSrlO, 1+dataSrlO.size, 0, 10.0,
                            DAQmx_Val_GroupByChannel,
                            dataSrlO, byref(wrtSrlO), None)

    #Start output at trigger, the trigger in in taskHandle1
    DAQmxCfgDigEdgeStartTrig( taskHandleSrlO, "/Dev1/PFI14", DAQmx_Val_Rising);

    # DAQmx Start Code
    DAQmxStartTask(taskHandleSrlO)


    # DAQmx Configure Code
    DAQmxCreateTask("",  byref( taskHandle1));
    DAQmxCreateCOPulseChanTime( taskHandle1, "Dev1/ctr2", "",
                                DAQmx_Val_Seconds, DAQmx_Val_Low,
                                0.001,0.50e-3,1.00e-6);

    DAQmxStartTask(taskHandle1)

    # DAQmx Wait Code
    #DAQmxWaitUntilTaskDone(taskHandle1,10.0);

    # DAQmx Clear Code
    #DAQmxClearTask(taskHandle1);

    DAQmxWaitUntilTaskDone( taskHandleSrlO, 5);   
    print("Written1: %d\n" % wrtSrlO.value)

    DAQmxStopTask(taskHandleSrlO)
    # DAQmx Timing Setup (frequency = 50)
    DAQmxCfgSampClkTiming(taskHandleSrlO, "", 50.0,
                            DAQmx_Val_Rising, DAQmx_Val_FiniteSamps,
                            1+dataSrlO2.size)

    # DAQmx Write Code (autostart = 1)
    DAQmxWriteDigitalU32(taskHandleSrlO, 1+dataSrlO2.size, 1, 10.0,
                            DAQmx_Val_GroupByChannel,
                            dataSrlO2, byref(wrtSrlO), None)

    print("before Written2: %d\n" % wrtSrlO.value)
    DAQmxWaitUntilTaskDone( taskHandleSrlO, 50e-0);   
    print("before Written2: %d\n" % wrtSrlO.value)

 

 


OK to put in 5V TTL into a LVTTL devices

$
0
0

Hi all,

 

I'm using an NI 9402 (spec PDF here) in a cRIO which says it has LVTTL input (low voltage TTL, seems like 'high' is 3.3V) but maximum input voltage is 5.5V. Would it hurt to use a 'standard' TTL - customer says they have TTL on a BNC, which I think means 0.8V is low, and 5V is high. Maybe my issue is the 9402 says 0.8V is the maximum 'low'.

 

If not, I'd imagine I can just use a voltage divider or a COTS part?

 

Thanks! I'm more of a digital weenie - I just don't want to break this nice card Smiley Happy

 

- Rick

Using PFI pin to generate PWM Signal

$
0
0

There is application where I need to generate 5 PWM Signals from my USB 6343. The device has only two counters, which means I can only generate two PWM signals.

My major concern is that, can I use any of my PFI pins on the hardware to generate PWM signal.

Digital Output to Motion Controller

$
0
0

Greetings,

 

I'm using the digital output from a NI-9401 to provide input to a motion controller to enable preprogrammed moves like stop, start, and motion profile. There is a sequence required by the controller , stop, then profile set, then start inputs. I am using a state machine to sequence through the steps and the logic works for the first move. But, I am having trouble resetting the logic for the start before the next move and am looking for advice. Adding  an addition sequence frame, seems to prevents any moves.

 

Physical trigger for a pulsed UV Laser

$
0
0

I am currently working with the NI PCIe-6259 card which is connected to a BNC-2110 board. The goal would be to control a pulsed UV-Laser which emits in the range between 10-1000 Hz. Therefore I need a trigger because the laser emits accordingly to the trigger signal repetition rate. I just tried to create a digital trigger signal which switches between 0V and 5V with the frequency I would like to have. Unfortunately LabVIEW always shows error-200303 that says that an external source is needed (I added a picture of the blockdiagram.). Furthermore I tried an example which was already discussed in the forum (https://forums.ni.com/t5/Digital-I-O/Can-I-send-a-digital-waveform-with-a-PCI-6259-or-a-PCI-6602/td-p/1212567). Trying this didn't lead to an error message but I couldn't measure any signal. 

 

Does anyone have an idea how I can create the trigger better or see a possible mistake I made?

 

I would appreciate your help.

Marion

 

TriggerControl.png

PXIe-6570 connectors (VHCDI)

$
0
0

I use a 68-Pin, Right-Angle VHDCI Connector, NI PN 778914-01 with a PXIe-6570 Digital I/O card.  The through hole pins from this connector are very fine pitch, about 0.05". This stresses the PCB and is not very robust for STS production test.

 

Does anyone have a connector for the SHC68-C68-D4 cable with 0.1 inch spaced holes to the PCB? Any ideas appreciated.

How can i read DI states if task timing is Change Detection and no change states of lines?

$
0
0
How can i read the di port lines after Start Task without closing and re-opening the task if Task Timing is Change Detection and no change states of lines? For example it is necessary to get the initial state of lines without loss of any state!!!
See attached example! -> When I push the "Read DI Lines" button i would like to be able to READ DI LINES EVEN IF NO CHANGE ON DI LINES!
There could be one option: The possibility of an event generating programmatically that is equivalent to a Change Detection Event. That would be the most correct solution.
 
This should be a basic opportunity...

Hardware trigger problem with NI PCIe 6535b

$
0
0

Hello everybody,

 

I have been confronting a problem with the PCIe 6535b DIO working in slave mode and want your help.

 

I notice that when the card works in slave mode (i.e., I use a function generator to trigger the card for digital output), the trigger signal from the function generator will be affected by the card.  Without connection to the line PFI4 (which I am supposed to use to trigger the card), the trigger signal from the oscilloscope is perfect. After I connect the cable to the function generator, the trigger signal is getting weird. The amplitude is a summation of the trigger signal itself and some signal from the card as shown in the attached pictures. What's worse, the trigger signal is getting very noisy which makes it impossible for me to use the same function generator to trigger other devices.

 

I checked that the card didn't send out signals through line PFI4 which made sense because it worked in slave mode. So what's the problem here? How can I remove the noise caused by the card?  

 

For your information, I use the NI SHC68-H1X38 cable to connect the card and my device. The connection should be fine.

 

Any suggestions will be welcome. Thank you in advance.

 

 

 

I use the NI SHC68-H1X38 cable to connect the card and my device.


NI 9482 minimum current rating

$
0
0

 Hello,

I have an application with two signals to be switched:
1.2-1.8A 18V
<1mA 3,3V (logic input with a 10k pull-down).

I would like to use a single device for both signals and NI 9482 meets the higher-current requirements, but it has no specification of minimum current nor details about relays or their contacts. Can I use this module? If not, what module could I use? I can use either CompactDAQ or USB interface devices.

 

Thank you.

VHDCI adapter

$
0
0

I have a NI 6535 PCIe and 1 meter VHDCI cable that I would like to connect to some custom hardware, however I have the following wiring problems:

There are very few mating connectors for this cable (I cannot find an inline or panel mounted VHDCI connector for this).

The VHDCI type cable is short at only 1 meter and I cannot find a NI 2 meter long VHDCI cable.

I found an NI adapter (195846-01) that will convert the cable to a more compatible SCSI connector, however this adapter is not a one to one adapter, and I cannot find any NI documentation on the internal wiring of this adapter. Is there any internal wiring information for this adapter or will I have to painfully point to point this myself?

 

 

Error 200294 and 200621

$
0
0

Hi,

 

My application is to be able to switch writing AO from single analog to finite analog signal (in the form of waveform) using the usb6001. 

Mode Setup and Stop write single analog 

Mode Run = write waveform

 

When I run it with my laptop, it has no issue but when I run Application on a Surface Pro I get

 

Error 200294 : Not enough samples were written to satisfy the initial data transfer request condition

When I switch from single analog to waveform *Caveat, this sometime works

 

Error 200621 : Onboard device memory underflow. Because of system and/or bus-bandwidth limitation, the driver could not write data to the device fast enough to keep up with the device output rate.

When I switch from waveform to single analog

 

Conceptually I think is because there is no data in the buffer for it to write??  I am not sure 

 

Any pointer would be much appreciated!

 

Edit: Sorry I meant to add the topic to Motor Control

Maximum frequency to PXIe-7856R RDIO

$
0
0

Hello, 

I am using digital I/O from PXI-7856R on its RDIO connector, which is rated to output 80 MHz maximum in the datasheet. I have tried to output 50 MHz and it looks OK using the SHC68-C68-RDIO2 shielded cable. However, when trying to apply a digital signal to an input from a signal generator (50 Ohm output impedance) the maximum frequency is barely 20 MHz. It looks the 80 MHz rating applies in one direction only, and there is significant capacitive loading in the cable. How can I drive a digital I/O at higher speeds? 

Thank you for your help.  

Konstantin

 

Two scope traces attached - 20 MHz square wave from a generator, and the same when applied to a DIO of PXIe-7856R. 

Control digital output using nidaqmx in python

$
0
0

Hello

 

I am new to the combination of python and NI Daqmx. I managed to downlaod all needed packages/libraries and want to controll 3 digital outputs using python.

I am aware that the page http://nidaqmx-python.readthedocs.io/en/latest/index.html

exists, however, the syntax there is unclear to me and I would need some examples in order to understand the syntax on that webpage.
I am familiar with C, C++, and Matlab.

 

System:

Device: NI USB-6008

Python 3.6.4 (using PyCharm)

Windows 7

 

What I want to control: port 0 line 0:2 as digital output

What should it do: Set digital output on or off in order to switch connected relais.

 

My questions:

1) How can I address a channel? e.g. port 0 line 0

2) How do I tell a channel whether it is input or output?

3) How do I tell the Daqmx that I want to switch the state (off -> on)?

 

Thank you very much for your attention and I am glad upon each feedback.

Viewing all 2182 articles
Browse latest View live