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

example code for interfacing with PCIe-6343 in linux/matlab?

$
0
0

Hi, in the past I've interfaced with NI DAQ devices using Matlab's data acquisition toolbox on windows machines.

 

I'm now working with matlab R2021a on a linux machine (running Ubuntu 20.04.2). Matlab's DAQ toolbox isn't supported on linux machines, so I'm starting a bit from scratch and am not really sure where to begin.

 

Could anyone point me to a guide or some example code showing how to interface with an NI DAQ device in matlab running on a linux machine?

 

Thanks in advance for any help.    


PXIe-6738 Analog Output response too slow.

$
0
0

Hi, I'm trying to generate a 3V 1.25kHz analog arbitrary waveform using PXIe-6738 analog output port and reading data from a CSV file. But the frequency obtained is only 800-900Hz.

Using Digital output port, i can set the Rate in MAX to 10Khz and obtain the frequency of 1.25V but the amplitude is 5V. 

Other than using a clamping diode on the digital output or buy another PXIe card with output level control function, what other ways can i generate the signal that i want?

python doesn't recognize devices

$
0
0

Hello

I am trying to use python nidaqmx to acquire data from NI devices

for starters I am trying to acquire data from a simulated device. the device is recognized by NI max, but python doesn't seem to recognize it.

 

I am attaching screenshots of my code, the error message and my NI MAX screen. I also tried replacing "cDAQ1_1" with "cDAQ1Mod1_1" and got the same error message.

 

would be thankful for any assistance.

Nathan

Terminology for digital IO - "dry contact", "wet contact"

$
0
0

I am a software developer, and have implemented support for various digital I/O devices (via TCP/IP, such as ModBus). I am about to write some documentation for internal use, and the terminology being used around is kinda confusing.

These devices used ports that are either active low or active high (or, configurable to either). In some cases, "dry contact" and "wet contact" are being used. So, are these statements correct ?

  • Dry contact = active low = pull to ground to set HIGH

  • Wet contact = active high = needs a voltage to set HIGH.

Simple way to control speakers via analog output

$
0
0

Hello to all,

My institution has several NI tools for my thesis.

 

We have a chassit 1033 and two NI 44-98 cards allowing the recording of vibration in a sample via accelerometers.

 

We have recently acquired a NI 6323 card and two SCB 68A.

 

The AO ports of the two SCB68A are connected to amplifiers connected to speakers.

 

I would like to find a simple way via python to emit the desired signals, to transmit them to the amplifier which itself will transmit them to the speakers. This allows me to have a total control of my source.

 

For the moment, I can't find any example in python similar to what I would like to do.

I started to code a piece of code, but it doesn't work.


import nidaqmx
rate = 40000 # Sample rate in Hz
duration = 10 # Duration in seconds

samples = int(rate * duration)
list = []
for x in range(samples):
list.append(x % 2)
with nidaqmx.Task() as task:
task.ao_channels.add_ao_voltage_chan("Dev1/ao1")
task.timing.cfg_samp_clk_timing(rate)
task.write(list, auto_start=False)
task.start()

 


Do you have any examples that I could use as inspiration, or any ideas?

Sincerely,

 

Thomas

How to detect board(PCI-6503) is in protected/fail-safe mode and to leave it

$
0
0

Hi, 

 

I am looking to see if there is a way to detect if a DIO board (PCI-6503) is in fail-safe mode after a power surge via software and to be able to reset/leave that mode. 

Where is the Lock-In Demo user manual?

$
0
0

Hi,

I am looking for "Lock-In Demo User's Manual" but I couldn't find it.

If anybody could give me that document?

Best regards.

PXI-1065, measurement 0 issue.

$
0
0

Hello, guys~

 

I have a PXI-1065 controller that is used for ProbeCard in semiconductor industry.

I got a problem about measurement.

Measurement output is 0 again and again.

I tried to troubleshoot that like under list.

 

  1. Lambda PWR Supply Swap
  2. Replacement of PXI Tester Accessory Board
  3. Change the PXI Soft Program
  4. The cable swap
  5. MUX0/1 and SMU0 were self-tested and all passed.

Somebody help me please.

 


Need DIO (NI 9403) Example Code

$
0
0

CVI 2019, Win10. 

 

Can somebody send me some example code for a DIO card/module, in particular how to set bits or nibbles for different directions.  C language, DAQmx function calls please.  The only vaguely related information I have seen so far is old, like 2008, and I don't trust it.  (Talks about reserving a task)  I have not seen anywhere how to select bits or nibbles.

 

Is it true that for a DIO module such as the 32-ch 9403 one has to create both an input task and an output task, that one task to do reads and writes does not work?

 

I understand the function calls to create a task, set up the 32-bit path as a single channel for reads, and separately for writes, start the task, and how to read and write 32-bit UINTs to the device.

SPI Read/write PXIe-6537

$
0
0

Hello
I'm looking into the possibility of implementing SPI write/read data with an NI PXIE-6537 board.
I wanted to test the example: SPI Generation and Acquisition using HSDIO Hardware (654x) 

but I still have problem with SDW.lvlib library.

Can you confirm the possibility of implementing an SPI bus with the PXIe-6537 card?
Do you have examples of code (Labview or other) allowing a send/receive bytes in SPI?

 

Thanks in advance.

PWM generation using digital output

$
0
0

I have NI PXIe-6363 and PXIe-6535 cards. I want to generate PWM signals to drive a 3-ph inverter using digital output pins(not counters). The PWM should be generated by comparison of a sine wave(50 Hz) with a sawtooth carrier wave( around 20 kHz). Is it possible to generate the above PWM signals using digital pins on the mentioned cards? If there is any sample vi or example or technique to do so, please share. 

 

Thanks in Advance

Reduce USB-8452 SPI script frame delay

$
0
0

Hi,

 

When creating SPI script I observe ~16us delay between frames, independent from set communication frequency. Is there a way to reduce or negate this delay? I use 20.0.0 driver.

spi--00000.png

Thanks

DAQmx synchronize digital input and digital output task

$
0
0

Hello.

 

I need to synchronize digital input and digital output on NI6229 or NI6535 device, for emulating i2c-like protocol receiver.

Looks like only way - use PXI_Trig or PFI lines for synchronize tasks start, but if I don't understand how to do it without hardware modifying.

 

bool CheckAck(const char *devDataLine, const char *devClockLine, bool *ackReceived)
{
//Data, Clock - low
//Clock high
//Data high
int32 error;
TaskHandle clkHandle = 0;
TaskHandle dataHandle = 0;
bool result = true;
int32 samples_written;
int32 samples_readed;
int32 bytes_per_sample;
uInt8 clock_out[] = {
0,
0,
1,
1,
0,
0,
};
uInt8 data_in[sizeof(clock_out)];

samples_written = 0;
samples_readed = 0;

DAQmxErrChk(DAQmxCreateTask("", &clkHandle));
DAQmxErrChk(DAQmxCreateTask("", &dataHandle));

DAQmxErrChk(DAQmxSetDOLogicFamily(clkHandle, "", logic_family));
DAQmxErrChk(DAQmxSetDILogicFamily(dataHandle, "", logic_family));

DAQmxErrChk(DAQmxCreateDOChan(clkHandle, devClockLine, "", DAQmx_Val_ChanPerLine));
DAQmxErrChk(DAQmxCreateDIChan(dataHandle, devDataLine, "", DAQmx_Val_ChanPerLine));

DAQmxErrChk(DAQmxCfgSampClkTiming(clkHandle, "", (double)i2c_clk, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, sizeof(clock_out)));
DAQmxErrChk(DAQmxCfgSampClkTiming(dataHandle, "", (double)i2c_clk, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, sizeof(clock_out)));

DAQmxErrChk(DAQmxWriteDigitalLines(clkHandle, sizeof(clock_out), 0, 10.0, DAQmx_Val_ChanForAllLines, clock_out, &samples_written, NULL));
DAQmxErrChk(DAQmxReadDigitalLines(dataHandle, sizeof(data_in), 10.0, DAQmx_Val_ChanForAllLines, data_in, sizeof(data_in), &samples_readed, &bytes_per_sample, NULL));

DAQmxCfgDigEdgeStartTrig(clkHandle, "PXI_Trig0", DAQmx_Val_Rising);
DAQmxCfgDigEdgeStartTrig(dataHandle, "PXI_Trig0", DAQmx_Val_Rising);

DAQmxErrChk(DAQmxStartTask(clkHandle));
DAQmxErrChk(DAQmxStartTask(dataHandle));
//how to software trigger PXI_Trig?
DAQmxErrChk(DAQmxWaitUntilTaskDone(clkHandle, 10.0));

error:

if (error_log)
{
if (DAQmxFailed(error))
{
char descr[1024];
DAQmxGetErrorString(error, descr, sizeof(descr));
printf("%s\n", descr);
}
}

if (clkHandle != 0)
{
DAQmxStopTask(clkHandle);
DAQmxClearTask(clkHandle);
}

if (dataHandle != 0)
{
DAQmxStopTask(dataHandle);
DAQmxClearTask(dataHandle);
}

return result;
}

Cable selection for PXIe-8431/16 (RS-422)

$
0
0

Hello,

 

I am having trouble finding a compatible twisted-shielded RS-422 cable for the PXIe-8431/16 with the VHDCI connection. I have located a few twisted-shielded cables from NI, but the twisted pair does not match the pinout of the PXIe-8431/16. The NI product search is not bringing up more than one cable option for a twisted shielded VHDCI cable, and I know NI has more than this.

 

I have no requirement for the other end of the cable, though keeping it smaller would be nice.

VB Code for state change

$
0
0

Hi Team,

 

I am newbie to this section and i got the requirement to convert attached task to VB.

 

I am able to set Input/output channel direction. After changing to output how can i change the state to All High ? i didn't find any code in examples. Please help me how to set the values.

 

Attached the image which has my requirement.

 

NI.jpg

 

Thanks in Advance.

Pavan


USB DAQ 6001 Resolution

$
0
0

In USB DAQ 6001, when collected data using analog input, 14 mV signal is coming without any actual input.  

 

 

How I can correct this issue?NI.jpg

Braincorr kollam

$
0
0

Braincorr-The Infinite Brain is a Digital Marketing & Web Designers in Kollam specializing in Social Media Promotion and SEO.
We were founded on the premise that to have a scalable business, it’s important to keep your margins and costs under control.
Everything we do is structured to ensure we make optimum use of our resources.

 

 

Value change detection of a NI 9402 DO line using a LabVIEW event structure.

$
0
0

Is it possible to detect a change in the value of a NI 9402 Digital Output line using a LabVIEW event structure?

Connect I/Os using SCB-100A with PXI-6515

$
0
0

Dear all, 

 

I'm planning to use the PXI-6515 modul with the SCB-100A break out box. I couldn't find a detailed pin out for the SCB-100A except of the picture below. Does someone has a document or a sketch showing how to connect digital inputs as as well digital outputs?

 

Thanks in advance.

Best,
Steve

Steve_21_0-1644418010434.png

 

NI845x and C#: NI Package Manager indicates "installed", BUT not in Visual Studio Reference selections

$
0
0

NI Package Manager indicates NI-845x v21.3.0 is installed.

Ni845x.dll is in C:\Windows\System32.

 

Visual Studio 2019 does NOT offer anything with NI845x as a Reference for adding to a C# project.

Attempts to browse and install either ni845x.dll or ni845x.lib result in "A reference [...] could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.".

 

Examples and instructions for use advise to "add to project...", with no explanation (including what name to look for).

 

Please advise known reasons for not finding a Reference, when installation software indicates the driver was installed successfully.

 

Thank you!

Viewing all 2178 articles
Browse latest View live


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