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

NI USB-6211 for Microsoft Excel VBA

$
0
0

Hi! I am trying to make a program using Excel VBA to generate and acquire voltage using USB-6211. I prefer to use Excel VBA for quick analysis on the results like slope calculation. I hope anyone can help. Thank you very much.NIDAQ_USB-6211-removebg-preview.png


PCIe-6535B DAQmx N-samples callback can crash the PC (bluescreen)

$
0
0

When registering the N-samples callback with DAQmxRegisterEveryNSamplesEvent on a PCIe-6535B card after committing the task the PC will bluescreen. With a PCI-6534 everything works. Even if one is not supposed to do this, a bluescreen is a potential security risk and can often be exploited to gain control over the machine in order to install root kits for example. A usermode application should not be able to crash the PC, by design.

 

I hope this bug-report/description will save someone else days of tracking down this problem.

 

Here's nidaqmx python code to reproduce the problem:

 

==============================================================================

import nidaqmx
from nidaqmx.constants import AcquisitionType
import numpy as np


def callback(task_handle, every_n_samples_event_type, number_of_samples, callback_data):
print('Every N Samples callback invoked.')
return 0


with nidaqmx.Task() as task:
data = np.zeros(1 << 16, dtype=np.uint32)
ch = task.do_channels.add_do_chan('Dev1/port0:3', line_grouping=nidaqmx.constants.LineGrouping.CHAN_FOR_ALL_LINES)
task.timing.cfg_samp_clk_timing(10000, samps_per_chan=len(data), sample_mode=AcquisitionType.FINITE)
task.control(nidaqmx.constants.TaskMode.TASK_COMMIT) # this leads to a crash
task.register_every_n_samples_transferred_from_buffer_event(int(len(data) / 4), callback)
#task.control(nidaqmx.constants.TaskMode.TASK_COMMIT) # this instead does not lead to a crash
task.write(data, auto_start=False)
task.start()
task.wait_until_done()
print('task.out_stream.total_samp_per_chan_generated', task.out_stream.total_samp_per_chan_generated)

import nidaqmx
from nidaqmx.constants import AcquisitionType
import numpy as np


def callback(task_handle, every_n_samples_event_type, number_of_samples, callback_data):
print('Every N Samples callback invoked.')
return 0


with nidaqmx.Task() as task:
data = np.zeros(1 << 16, dtype=np.uint32)
ch = task.do_channels.add_do_chan('Dev1/port0:3', line_grouping=nidaqmx.constants.LineGrouping.CHAN_FOR_ALL_LINES)
task.timing.cfg_samp_clk_timing(10000, samps_per_chan=len(data), sample_mode=AcquisitionType.FINITE)
task.control(nidaqmx.constants.TaskMode.TASK_COMMIT) # this leads to a crash
task.register_every_n_samples_transferred_from_buffer_event(int(len(data) / 4), callback)
#task.control(nidaqmx.constants.TaskMode.TASK_COMMIT) # this instead does not lead to a crash
task.write(data, auto_start=False)
task.start()
task.wait_until_done()
print('task.out_stream.total_samp_per_chan_generated', task.out_stream.total_samp_per_chan_generated)

==============================================================================

 

System Info:

Microsoft Windows 10 Enterprise 2016 LTSB

Model NI PCIe-6535B

NI-DAQmx Device Driver 21.3.0f165

NI-DAQmx ADE Support 21.3.0

NI-DAQmx MAX Configuration 21.3.0

 

The bluescreen happens in ninshsdk.dll

 

KMODE_EXCEPTION_NOT_HANDLED (1e)

EXCEPTION_CODE: (NTSTATUS) 0xc0000094 - {EXCEPTION} Integer division by zero.

FAULTING_IP:
ninshsdk!nNINSHSD100::iMemoryMappedBufferSupervisor::___CPPKRLCast+e233
fffff80d`3a0146f3 48f7b3f0000000 div rax,qword ptr [rbx+0F0h]

EXCEPTION_PARAMETER2: 0000000000000b6a

BUGCHECK_STR: 0x1E_c0000094

 

LAST_CONTROL_TRANSFER: from fffff80280846172 to fffff802807d2940

STACK_TEXT:
fffff802`82fd2488 fffff802`80846172 : 00000000`0000001e ffffffff`c0000094 fffff80d`3a0146f3 00000000`00000000 : nt!KeBugCheckEx
fffff802`82fd2490 fffff802`807dad2d : fffff802`809ca000 fffff802`80676000 0004d670`0081b000 ffffcc07`aa8f2000 : nt!KeRegisterNmiCallback+0xce
fffff802`82fd24d0 fffff802`8077b4a1 : fffff802`82fd4000 00000000`00000000 fffff802`82fcd000 fffff80d`35383820 : nt!_chkstk+0x5d
fffff802`82fd2500 fffff802`8077a2c4 : fffff802`82fd33e8 fffff802`82fd3130 fffff802`82fd33e8 fffff802`82fd32b0 : nt!KeQuerySystemTimePrecise+0x3041
fffff802`82fd2c00 fffff802`807e2a02 : 00000000`00000002 fffff802`80978928 00000000`00000002 00000000`00000014 : nt!KeQuerySystemTimePrecise+0x1e64
fffff802`82fd32b0 fffff802`807dc9c6 : fffff802`82fd34a0 00000000`00000000 00000001`ffffffff fffffff6`00000002 : nt!setjmpex+0x6ea2
fffff802`82fd3490 fffff80d`3a0146f3 : 00000000`00000000 fffff802`806f2429 ffffcc07`a5fd51c0 00000000`00000000 : nt!setjmpex+0xe66
fffff802`82fd3620 fffff80d`3a0256b9 : 00000000`00000000 ffffcc07`ab651b98 00000000`00000000 fffff802`80602779 : ninshsdk!nNINSHSD100::iMemoryMappedBufferSupervisor::___CPPKRLCast+0xe233
fffff802`82fd3680 fffff80d`3a024ab7 : 00000000`9200c002 ffffcc07`a5835590 00000000`00000002 fffff802`806025f0 : ninshsdk!nNINSHSD100::iChip::operator new+0x105e9
fffff802`82fd36b0 fffff80d`3a0231e6 : ffffcc07`a5de0be0 fffff802`82fd3910 ffffa101`3c065050 00000000`00000000 : ninshsdk!nNINSHSD100::iChip::operator new+0xf9e7
fffff802`82fd37b0 fffff80d`34f42df3 : 00000000`00000000 fffff802`809b5180 0000055f`a41ca284 fffff802`8071f18b : ninshsdk!nNINSHSD100::iChip::operator new+0xe116
fffff802`82fd37e0 fffff802`806ea385 : 00000001`4dd75ee2 fffff802`809b5180 ffffcc07`aae8f320 ffffcc07`aae8f320 : nipalk!tBusFlavorSync::tBusFlavorSync+0x2c63
fffff802`82fd3810 fffff802`806e9910 : 00000000`0000003e ffffcc07`accd0e40 00000000`00140001 00000000`00000000 : nt!KeSetEvent+0x3335
fffff802`82fd3960 fffff802`807d5f9a : 00000000`00000000 fffff802`809b5180 fffff802`80a30940 ffffcc07`a642c080 : nt!KeSetEvent+0x28c0
fffff802`82fd3be0 00000000`00000000 : fffff802`82fd4000 fffff802`82fcd000 00000000`00000000 00000000`00000000 : nt!KeSynchronizeExecution+0x263a

 

Greetings from Austria

PXIe-6571 PPMU

$
0
0

PPMU by most ATE manufacturer definition is Per Pin Parametric Measurement Unit. By this it means each digital channel pin has its own Parametric Measurement Unit.

For the PXIe-6571, it is quite misleading to say it has PPMU but actually each bank of 8 digital channels has a shared Parametric Measurement Unit.

It should be renamed SPMU (Shared Parametric Measurement Unit).

yerfoeg_1-1645261070841.png

 

 

HSDIO Channel Acquisition Order

$
0
0

I am using a PXIe-6545 to acquire 16 bit data. The hardware engineer, for whatever reason, didn't order the bits correctly. So instead of having DIO16 = LSB, DIO15 = LSB+1, ... , DIO31 = MSB, the bits are all random on DIO16-31. I am able to pull all the data from the fixture just fine, but the data bits are all out of order. I am basically using the HSDIO Continuous Acquisition - Stream to Memory.vi in the example to get my data. Is there a quick way to modify the VI so that I can put the bits in the correct order? I'm dreading having to re order all of the data manually. I was hoping that if i just listed the channels in the order I wanted it would order them that way. It doesn't seem to have worked.

 

Thanks

PXI-6570 Max Safe Voltage

$
0
0

Hi All,

 

What is the maximum safe voltage for a PXI-6570?

 

I know that 6 V is the maximum voltage that PXI-6570 can output, but what is the maximum voltage that it can withstand?  Can it withstand 8 V?

Stream writing digital output in python with nidaqmx

$
0
0

Hello,

I am using a NI PCIe-6321 to write digital commands to external hardware. I need a stream writer running in the background while my python code does something else. I seem to have the stream writer working (timing works out), but my external hardware doesn't change. I think the device is writing the wrong type (integers) when the task needs booleans, and I'm not sure why that isn't automatically converted in DigitalSingleChannelWriter.write_many_sample_port_byte.

 

Please advise what data type I need to send to the device in order for digital stream writing to be effective - or whatever I'm doing wrong here. Basic code just to run the stream writer is below.

screenshot.PNG

Many thanks!

PXI-6562

$
0
0

Hi,

 

I am looking for used PXI-6562 or 6561 board. Since they are obsolete, I couldn't manage to find one yet.

If any one wants to sell, please contact me.

 

Regards,

Zeki

 

FlexRIO Adapter MDK

$
0
0

I'm trying to determine what the difference between the two models listed under the FlexRIO Adapter Module Development Kit for Modular I/O. I'm specifically trying to develop a custom adapter for the NI-7952. 

 

PN: 780711-01 and PN: 787353-01

 

Do I need both? If not, what is the difference between these two parts?

 

 

 


Open drain for I2C communication using a PXIe-6341?

$
0
0

Hi all,

I am trying to set up a variant of I2C communication using a PXIe-6341 (and a SCB-6A). The Sensiron SHT-75 sensors use open collector (open drain) digital communication similar to I2C, but without multiple device addresses.

 

I want to communicate with 3 of these sensors. I plan to wire them up with a common clock and a separate digital line to the data pin for each sensor. Since it is recommended to provide them with 3.3V for calibration reasons (they will run on 5V) I was also thinking of using an analog output line for the power. Each sensor has a maximum current draw of 1 mA and the analog out is rated to 15 mA. I can use the 5V power line, but as I say, the manufacturer recommends 3.3 V.

 

The precise software I am planning on running is here: https://forums.ni.com/t5/LabVIEW/Sensirion-sht7x-labview/m-p/901063#M406440

 

I cannot find the specs anywhere on the type of DIO offered by the 6341. I have gone through the spec sheet with a fine toothed comb and found nothing. Am I looking in the wrong place? Why is this not a listed spec for the digital IO lines? How to I find out if this DIO hardware is open drain as opposed to push-pull (active drive)? I have the sneaking suspicion that I am missing something. . . ?

 

To sum up, can I carry out open drain communication to multiple SHT-75 sensors using a PXIe-6341? (And why is this not in the hardware specs?)

 

Thank you in advance for any assistance.

Output PXIe-6535 signals to PXI_TRIG of PXIe chassis

$
0
0

I are planning to utilize PXIe-6535 to generate 10KHz pulse signal ( 100us width and 10us pulse width) for some specific application :  this signal not only outputs PFI<0..5> , meanwhile can output same signal to PXI backplane PXI_TRIG<0..7>  to trigger other instrument in the PXIE chassis.  We have several questions on PXIe-6535 and don’t know how to do it.

 

  1. Can PXIE-6535 route same generated signals to  any  PXI_TRIG<0..7> bus on PXI backplane ? It seems OK according to NI PXIE 6535/6537 speciation: page 12).
  2. If the answer of question 1 is yes and can output the signal to PXI_TRIG<0...7> without phase delay, how to control PXIe-6535 device ( over nidaqmx interface) to make it happen?  Further more
  3. Do you have sample code/snippets  , such as: configure  and output PXIe-6353  data pattern signal(s)    to PFI and  PXI_TRIG ( PXI backplane) pin(s) at the same time;  real-time enable/disable this signal over the API etc.

 

Look forward to hearing from you soon.

 

Thank you 

Connection RACKNI

$
0
0

Bonjour je fais l'intégration d'un USB6501, je souhaite récupérer la bonne dll et un wrapper C#, je ne trouve pas les informations. Pouvez vous m'aider?

NI-DAQmx Python for NI 6501 (USB)

$
0
0

Hi.
Is it possible to set 3.3V Active Drive state for NI 6501 (USB) with NI-DAQmx Python API?

Understanding NI6528 - Reading back Output directly with Input - doesn't work

$
0
0

Hi all,

 

For selftesting my equipment I'm trying to usa a NI 6528 output in Open/GND configuration and read this output back with an Input on the same NI 6528.

Why doesn't this work?

 

NI 6528
┌───────┐    ▲ +24V
│       │    │
│ P2.2+ ├────┘
│       │
│ P2.2- ├────┐
│       │    │
│ P3.7+ ├────┘
│       │
│ P3.7- ├────┐
│       │    │
└───────┘    ▼ GND

 

Any help is greatly appreciated.

 

Thanks in advance

 

Balze

linux with USB-6501 - no devices found

$
0
0

Hi, 

 

I cannot see devices after installing the drivers.

No idea where to look now.

 

Trying with python:

local_system = nidaqmx.system.System.local()
driver_version = local_system.driver_version
print('DAQmx {0}.{1}.{2}'.format(driver_version.major_version, driver_version.minor_version,driver_version.update_version))

 

outputs:

DAQmx 21.3.0

 

So I think drivers are installed successfully. When trying to read some levels:

with nidaqmx.Task() as task:
task.ai_channels.add_ai_voltage_chan("Dev1/ai0")
task.read()

 

I get output:

nidaqmx.errors.DaqError: Device identifier is invalid.
Device Specified: Dev1

 

I cannot see any devices, output of nilsdev command is empty. I tried various device identifiers.

 

lsusb shows the device is connected:

Bus 001 Device 002: ID 3923:718a National Instruments Corp. NI USB-6501

 

modules loaded:

nipxirmk 303104 1
nimru2k 774144 2
nimxdfk 593920 4 nimru2k
nidimk 376832 5 nimru2k,nipxirmk
nimdbgk 466944 6 nimru2k,nipxirmk,nimxdfk
niorbk 122880 5 nimdbgk,nimru2k,nipxirmk,nimxdfk,nidimk
nipalk 1241088 9 nimdbgk,nimru2k,niorbk,nipxirmk,nimxdfk,nidimk
nikal 126976 7 nimdbgk,nimru2k,niorbk,nipxirmk,nimxdfk,nidimk,nipalk
ni_usb6501 16384 0

 

kernel version:

5.13.0-37-generic

 

dmesg

[ 4.812858] usb 1-1: new full-speed USB device number 2 using xhci_hcd
[ 4.964832] usb 1-1: New USB device found, idVendor=3923, idProduct=718a, bcdDevice= 1.00
[ 4.964857] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.964866] usb 1-1: Product: NI USB-6501
[ 4.964873] usb 1-1: Manufacturer: National Instruments
[ 4.964879] usb 1-1: SerialNumber: 0201B133

 

What am I missing now? 

NI-9149 - Modbus TCP

$
0
0

I have a setup as follow, 

Comm. Resource Name

Device name

Type

Physical Comm. Resource Name

Rack 1

 

 

192.168.1.1

 

Slot0

NI-9149

192.168.1.1

 

Slot1

NI-9208

192.168.1.1

 

Slot2

NI-9208

192.168.1.1

 

Slot3

NI-9208

192.168.1.1

 

Slot4

NI-9208

192.168.1.1

 

Slot5

NI-9208

192.168.1.1

 

Slot6

NI-9208

192.168.1.1

 

slot7

NI-9361

192.168.1.1

 

slot8

NI-9361

192.168.1.1

Rack 2

 

 

192.168.1.2

 

Slot0

NI-9149

192.168.1.2

 

Slot1

NI-9361

192.168.1.2

 

Slot2

NI-9361

192.168.1.2

 

Slot3

NI-9425

192.168.1.2

 

Slot4

NI-9425

192.168.1.2

 

Slot5

NI-9476

192.168.1.2

 

Our Architecture is to communicate the IO with Kepware KEPServerEX 6 via Modbus TCP. In the older IO we could do this via MAX once configured we can already assign address, however now we have added the IO via LabView (image below) but can’t seem to get it on KEPWARE over MODBUS TCP.

 

New setup MAX

Haizam_0-1648283587584.png

 

New setup LABView

Haizam_1-1648283587590.png

 

 

Clarifications:

  1. Is there anything else required for us to configure?
  2. Do we need FPGA or all can work on Scan Interface? As for NI9361 would indicate not supported in Scan Interface (image below)

Haizam_2-1648283587596.png

 

  1. Is there a Modbus Master or Slave (server or client) built into the NI 9149?

 


Digital trigger

$
0
0

I want to make sure that data from the channel is read (or written) when a signal comes to the trigger. Trigger is digital.
However, it turns out that the trigger does not work and the program waits for a signal, and then gives an error about a long wait. What am I doing wrong?

I tried to connect everything in series, but it did not help either.

KNikita_0-1648562909027.png

KNikita_1-1648563867978.png

 

 

pulse train on digital out

$
0
0

I am writing a program in C# that controls hardware with fixed channel connections to a PCIe-6323 card. on one of the channels, P0.3, I need to generate a pulse train of 50Hz frequency at 2ms per pulse. From what I understand I cannot route a counter to a non PFI channel, so is there a way to do this or am I stuck here? I've seen many examples using DigitalSingleChannelWriter with ConfigureSampleClock, indicating that timing can be attached to non-PFI channels, but I can find nothing about how to send pulses instead of bytes. the timing is not extremely critical, as long as I am getting 50 pulses of ~100ms cumulative duration per second I should be ok.

NI USB-6008 - Triggering on digital inputs

$
0
0

Hello,

 

I've a NI USB-6008 module on DAQMX on c# application.

 

Is there a way to get an event on Falling/Rising edge signal input ?

 

And if yes... how ?

 

Thx.

F.

Solenoid valve control

$
0
0

Can I control solenoid valves using 9401 module?

 

Are there any actuators compatible with 9401 module? Looking for a two port valve.

USB-6501 Detect an External Trigger

$
0
0

I have an external trigger I want to wait and detect with the 6501.  I've tried the following ( based on NI example code 😞

ret = DAQmxCreateTask( NULL, &tsk_hndl[ indx ] );

ret = DAQmxCreateDIChan
(
tsk_hndl[ indx ],
"Dev1/port2/line0:7", //"Dev1/port2/line7"
NULL,
DAQmx_Val_ChanPerLine
);

ret = DAQmxCfgChangeDetectionTiming
(
tsk_hndl[ indx ],
"Dev1/port2/line0:7",
"Dev1/port2/line0:7",
DAQmx_Val_ContSamps,
1
);

 

and the DAQmxCfgChangeDetectionTiming gives me an error of -20077 ( DAQmxErrorInvalidAttributeValue ) and the error string isn't very helpful.  I tried using just line 7 vs lines 0-7.  Since this wasn't working I tried setting it up as a counter ( that same line Port 2 / Line 7 is also CTR0 ) and that also errors.  Right now I'm setting it up as a digital input ( without the change detection ) and reading it continuously in a thread but believe triggers are being made ( trigger appears to have occurred looking at the external equipment via oscope ) and being missed by that approach.  

Viewing all 2183 articles
Browse latest View live