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

Sending signal to Arduino

$
0
0

Hi 

I appreciate any help from this community, because I am almost new to Labview...

 

My Aim : I want to send digital output(square wave signal 5v on and  0v off state) to Arduino board from Labview, plus I want to change pulse duration and width and frequency in ms. 

 

Issue : I tried two program the first one(test1) worked but the second one(test2) does not send a signal to board. I used the second program because it allows me to generate my signal properly with every parameter adjusted but Unfortunately Arduino can not recieve the signal.

the issue with first program is that although it sends the signal to Arduino but I can not adjust my signal easily in time domain. for the test2 program I need the signal be recieved by Arduino.

 

test1.pngtest2.png

 


Cannot read digital waveform on NI USB-6001

$
0
0

Trying to perform digital waveform reading on digital input on NI USB-6001, Sample Clock give me error -200077, see picture below.

Analog waveform reading is OK, see the same picture. Single digital read is also OK, when Sample Clock is removed.
What is the problem? USB-6001 does not support timing for digital inputs reading? Or I am doing something wrong?

 

SergeS_0-1654874894322.png

 

Limitation in number of DMA FIFOs for multip-up parallel comm with FPGA

$
0
0

Hi

 

I am using 7820R in a project to send data back and forth between host and target. So far ,my setup was 4 and in target I have 4 SPI engines that they can run fully in parallel

They all had their own DIO for SPI and their own DMA FIFO for read and write . I have 4 DMA write and 4 DMA read to send data between host/target. Now I want to expand this code to 16UP

I don't have any limitation in number of DIOs but now I need 16 FIFO read and 16 FIFO write and 7820R only has 16 FIFOs

 

Is there any design that I can just use 1 FIFO for read/ 1 FIFO for write and I can still keep the fully parallel model so the SPI engines can run fully in parallel?

Deal with Pxi-6555 input capacitance

$
0
0

Hi ,

 

 

 

I am trying to create a high-speed channel for communication with an IC. The high-speed signal channel works fine when the PXI 6555 is talking to the IC, but when the IC is taking to PXI 6555 until 11 MHz it is fine, but after 11mhz due to the input capacitance of 6555( this is with load from PXI 6555), the data is getting corrupted and it would not read the correct data as shown in pic "20mh-load". Although when I remove the input from IC to PXI 6555 and measure its signal( this is no load from PXI 6555), it is clean as shown in pic "20mh-load".

 

 

 

so my question is,

 

 

 

1) Are there any settings to remove the high input capacitance of 6555.?

 

2) Basically I have a 1-bit error ( which means the data is shifted to the right due to input capacitance ) so can I delay the acquisition and read it right?

 

 

 

I also used some dirty methods by deleting a first bit of data so that it shift to the left and it worked out fine, but i need some good methods to deal with it.

 

 

 

or any other ideas and questions are welcome.

 

 

 

Thanks.

 

 

 

 

 

B.R,

 

Tarun

 

 

AI & DI Simultaneously

$
0
0

Hello,

 

I'm using USB-6361 and want to get 2 channels AI and 4 channels DI simultaneously.

For example, 50,000 data for each channel, and they should be synchronized. The first AI data and the first DI should be acquired at the same time and the last data also.

 

I did it for same number of AI and DI channels as below, with python code.

 

... import ctypes ... self.nidaq = ctypes.windll.nicaiu self.int32 = ctypes.c_long self.uInt32 = ctypes.c_ulong self.uInt64 = ctypes.c_ulonglong self.float64 = ctypes.c_double self.char = ctypes.c_char self.char_p = ctypes.c_char_p self.DAQmx_Val_GroupByChannel = 0 self.DAQmx_Val_GroupByScanNumber = 1 self.DAQmx_Val_Acquired_Into_Buffer = 1 self.DAQmx_Val_ChanPerLine = 0 self.TaskHandle = self.uInt32 self.AItaskHandle = self.TaskHandle( 0 ) self.DItaskHandle = self.TaskHandle( 1 ) ... samplesPerChanAI = int(maxNumSamples/3.) samplesPerChanDI = int(maxNumSamples/3.) self.AIdata = numpy.zeros( ( maxNumSamples ), dtype=numpy.float64 ) self.DIdata = numpy.zeros( ( maxNumSamples ), dtype=numpy.uint8 ) AIdata_dummy = numpy.zeros( ( maxNumSamples ), dtype=numpy.float64 ) Length = AIdata_dummy.size self.nidaq.DAQmxCreateTask("",ctypes.byref(self.AItaskHandle)) self.nidaq.DAQmxCreateTask("",ctypes.byref(self.DItaskHandle)) self.nidaq.DAQmxCreateAIVoltageChan(self.AItaskHandle, b"Dev%d/ai0,Dev%d/ai1,Dev%d/ai2" %(num, num, num), "", const.DAQmx_Val_Diff, self.float64(-5.0), self.float64(5.0), const.DAQmx_Val_Volts,None) self.nidaq.DAQmxCreateDIChan(self.DItaskHandle, b"Dev%d/port0/line0:2" %num, "", self.DAQmx_Val_ChanPerLine) self.nidaq.DAQmxCfgSampClkTiming(self.AItaskHandle, "", self.float64(sampleRate), const.DAQmx_Val_Rising, const.DAQmx_Val_ContSamps, self.uInt64(500000)) self.nidaq.DAQmxCfgSampClkTiming(self.DItaskHandle, b"/Dev%d/ai/sampleClock" %num, self.float64(sampleRate), const.DAQmx_Val_Rising, const.DAQmx_Val_ContSamps, self.uInt64(500000)) self.nidaq.DAQmxStartTask( self.DItaskHandle ) self.nidaq.DAQmxStartTask( self.AItaskHandle ) while True: bytesPerSamps = self.uInt32() self.nidaq.DAQmxReadAnalogF64(self.AItaskHandle, samplesPerChanAI, self.float64(-1), self.DAQmx_Val_GroupByScanNumber, self.AIdata.ctypes.data, Length, ctypes.byref(self.readAI), None) self.nidaq.DAQmxReadDigitalLines(self.DItaskHandle, samplesPerChanDI, self.float64(-1), self.DAQmx_Val_GroupByScanNumber, self.DIdata.ctypes.data, Length, ctypes.byref(self.readDI), ctypes.byref(bytesPerSamps), None) #break at some moment when the DAQ ends self.nidaq.DAQmxStopTask( self.DItaskHandle ) self.nidaq.DAQmxClearTask( self.DItaskHandle ) self.nidaq.DAQmxStopTask( self.AItaskHandle ) self.nidaq.DAQmxClearTask( self.AItaskHandle ) ...

 

However, when I change the number of DI channels and sampling rate for DI, the sync between AI and DI no longer matched. Total number of sample are same, for example AI 100,000 samples (50,000 for each channel) and DI 100,000 samples (25,000 for each channel) at each read. (sampling rate is 1MS/s for AI and 500kS/s for DI)

 

 

Please let me know if you have any idea or need further information.

 

Thank you in advance. 🙂

 

Best wishes,

JESuh

 

 

PCI-6515 Digital input LOAD question

$
0
0

Good Morning everyone,

 

I want to use the PCI-6515 board as a digital input to replace an array of resistors and LEDS.

 

This array shows us if current if flowing or not.

Current is flowing from the each line of the connector towards each line of the array. 

It looks like this:

 

TRasol_0-1656926843670.png

I have measured the current, it is slightly below 9mA.

 

With the pci-6515, I will replace each line made of an LED and a resistor with the digital input channels.

I have checked the specs of the PCI-6515 with the datasheet.

 

Input Voltage max is 30V. At this voltage max current is 12.5mA.

Input current max will be 10.8 mA at 26V.

The impedance of the PCI-6515 per line is = 2400 Ohm.

My concern is over the fact that the PCI-6515 is about to draw more current from the source than my initial circuit :

Example for 1 line:

TRasol_1-1656927482143.png

 

To reduce current drawn from source, I figured maybe I can add a resistor up front as suggested in the picture below:

 

TRasol_2-1656927560582.png

 

That way I get the same configuration as initially.

 

Can you please tell me if that makes any sense ?

Did I forget anything, or is it possible at all ?

 

Thanks a lot,

 

All the Best.

Reading IMU data with python

$
0
0

I haven't been able to track this down, but is it possible to pull i2c data from an IMU with python?  

 

I am not particularly concerned with high performance -- getting the data a few times per second is fine.   Actually, it doesn't really need to be i2c -- i just want to read roll and pitch data a few times a second, so if there is a way to go about this, I would certainly appreciate knowing about it.

 

CRIO 9053 

9403 module

The parallel acquisition problem of two acquisition cards(CRIO)

$
0
0

Hello everyone, I have a problem in data collection. I want to collect the data of NI9232 and NI9237 in PARALLEL in FPGA and read it in RT terminal. During the test, there was no problem for each acquisition card to collect separately, but when I combined the program into a FPGA, the sampling rate with one acquisition card at the RT end could not be changed (increasing or decreasing the value of the sampling rate button, the program sampling rate remained unchanged). I tried to run only one acquisition card FPGA program on THE RT side, and it can run normally. I have attached my collection program (the program is based on LABVIEW routine, the interface may be a little ugly, because I have tested it for many times and I am in a bad mood, please do not mind), I hope you can give me valuable advice, thank you!

JHUNKULI_0-1657078996962.png(RT)

 

JHUNKULI_1-1657079028671.png(FPGA)

 


Question about NI 6583 / NI 7971R DCC B clock capabilities?

$
0
0

 

So on we are using an NI 6583 (DDC B connector the 12x 73 pin LVDS connector) and we are hooking it up to a NI7971R FPGA board. Would anyone know if there is a way to get both a differential LVDS clock coming out (which seems the case with the DDC clock out or strobe pairs) but we need a differential clock going in as well. Can that be done with this configuration? Can you use one of the PFI pairs as a clock input on the FPGA?

 

NI-9215 maxinstant sampling speed?

$
0
0

Hi

 

What is the maximal sampling speed (S/s) by using the NI-9215 module with the instant method (and using simulink and real time)?

 

Best regards Arek

PXIe 6556 C/C++ Driving Multiple DIO ports at once

$
0
0

Hello,

 

I am attempting to use a PXIe 6556 card to drive multiple DIO pins within a C/C++ environment. The drivers are the most up-to-date version of the niHSDIO library. I'll include the niHSDIO.h file in the post. 

 

 

Each DIO channel needs to be driven simultaneously with a different waveform on each. 

Thus far, I've successfully set all attributes of the card (voltage logic levels, data width, etc.) and confirmed them with a scope on the DIO channel so I know that the communication line is open/working. 

 

To assign dynamic channels, I use the following function. 

 

niHSDIO_AssignDynamicChannels(genVi, temp) ----> (genVi= Vi instrument session, temp = channel name/DIO pin number)

 

To write the waveform to the card, I'm using the following function. 

 

niHSDIO_WriteNamedWaveformU32(genVi, WvfrmNms[j], WAVEFORM_SIZE, waveformDataU32))

-----> (genVi = Vi session, WvfrmNms = name of the waveform to be written under, waveformDataU32 = array of U32 int data to make up the waveform).

 

Does anyone know what the API requests look like to drive multiple DIO pins at once with independent waveforms?

 

DAQmx PFIx triggered start: How to know exact trigger absolute time ?

$
0
0

Hello,

 

I stream data out of a DAQmx card PXIe-6363.

The generation starts when my card see a digital rising edge on PFI0.

It works great (confirmed with scope).

 

My questions is: I need to know the exact time the generation started. Currently I am recording the timestamp when I start the task, but the task could wait a second or two before it see a trigger. Is there a DAQmx property that records that? I am running the "DAQmx Wait Until Done.vi" at the end of generation, maybe I should record the end of generation timestamp and count backwards? Is there a better way?

 

Thank you in advance for your ideas.

NI PXIe 6544 Acquire synchronous serial port signals

$
0
0

Hello 

 

I want to use NI PXIe 6544 Digital Waveform Instruments to Acquire synchronous serial port signals(SSP). The synchronous serial port signals inlcude 10MHz  CLK, ENABLE and DATA are generated by FPGA.

 

What should I do to achieve it ?

 

 

  

6570_Large Vector Memory (LVM) is 128M vectors,how to understand the vectors?

$
0
0

the 6570 large Vector Memory is 128M vectors, Does it means the 6570 can load and burst the pattern can‘t exceed 128M bit? or can't exceed 128M lines?

 

 

Encoder Simulation with cDAQ

$
0
0

Good day!

 

We want to simulate (generate) two A/B endocers by using cDAQ hardware. We have a cDAQ-9185 chassis and two NI-9474 modules to accomplish the task (or other modules if needed).

 

What would be the right apporach to achieve:

  • Synchronized A/B signals which are 90° phase shifted
  • Two A/B signal pairs are completely independent (frequency, activation)
  • No side effects when changing parameters of one signal pair to the other signal pair.
  • Voltage level: 24V | Max. output frequency: 100kHz 

 

Many thanks for your help!


LabView 2020 HSDIO PXI-6552 use of PFI1 to PFI3 for Trigger or Pattern Clocks

$
0
0

I cannot seem to find a LabView NI example of the HSDIO PXI-6552 using PF1 to PFI3 as an input Trigger or Pattern Clock.  Yet I know it can be done, because I've seen it done in LabView Proprietary Code which I am not permitted to open up and look at (Block Diagram).  I am trying to communicate with a Microcontroller by toggling the PFI1 to pass binary pattern data to LabView.

PXIe-6738 Analog Output Update Rate, Banks vs. Channels

$
0
0

Howdy Folks,

 

I am trying to understand the update rate for the PXIe-6738. The online documentation provides different update rates depending on how many channels are in use, and in a footnote, it states:

 

"All analog output channels are grouped into banks, as shown in your device pinout. Each bank consists of four AO channels using one DAC. Any channels being used within a single bank will update simultaneously."

 

I am trying to determine if the PXIe-6738 is capable of simultaneously updating 32 distinct outputs. I am skeptical of the statement that any channels within a single bank will update simultaneously because the block diagram from the user manual (below) shows a single DAC associated with each bank of four channels. Does anyone know if the PXIe-6738 is actually capable of simultaneously updating 32 distinct outputs? Or is it effectively limited to simultaneously updating 8 outputs? Any clarity or insight would be greatly appreciated.

 

Thanks folks.

 

From the device manual:

 

PXIe-6738 manual screenshot.PNG

9375 - external power supply for DO

$
0
0

Hello,

 

I have to use the 9375 module (digital outputs) to supply three relay coils independently.

I only have one 24Vdc power supply, which is already used to supply the cRIO 9057.

Is it possible/safe to connect the same 24Vdc power supply to 9375 pins Vsup and DOCOM? Is it required a different floating power supply?

 

Thank you

USB-6525 and Linux

$
0
0

I would like to know if there is any way where I can communicate the NI USB-6525 from a Ubuntu 20 distribution. As it is not a complex device (isolated industrial binary IOs), this should not be impossible.

 

Even though the device manual says that only Windows is supported, the same manual directs you to check a website with the DAQmx Base version 15.1 (discontinued, with the last version in 2015). This is done specifically by the following phrase present in the Installing Software section of the manual:

 

"Note: For information about non-Windows operating system support, refer to ni.com/info and enter rddqld"

 

It makes sense that the Base library was discontinued since the new versions for DAQmx (not the DAQmx Base) are supported by Linux distributions, including Ubuntu 18 and 20.

 

P.S.: I have past posts without with similar issues, but without finding an answer:
https://forums.ni.com/t5/Instrument-Control-GPIB-Serial/USB-6525-Linux-system-with-Visa-Modules/m-p/1509562

 

https://forums.ni.com/t5/Instrument-Control-GPIB-Serial/USB-6525-not-controllable-by-VISA/m-p/3356697

 

 

That being said, now, my question is: is there any possibility that, with the current tools offered by NI, I am able to develop a device driver for USB-6525 in Ubuntu? Are there any starting points on that? 

NI-DAQ register signal event isn't functioning in C++ (Error -200982)

$
0
0

I'm currently attempting to have a NI-DAQ read an external trigger in the digital input PFI1, but I get an error -200982 when I run the line:

(DAQmxRegisterSignalEvent(taskHandle, DAQmx_Val_SampleClock, 0, SaveViconData, NULL));

The error states

DAQmx Signal Events are not supported by your device. DAQmx Signal events include the Counter Output event, the Sample Complete Event, the Sample Clock Event, and the Digital Change Detection event.>

but I have created this function using MATLAB fine so I don't think there's an issue with the hardware so I believe I must be making a mistake somewhere as I am quite new to using C++.

The code used is:

int32       error = 0;
static TaskHandle  taskHandle;
int32       read;
float64     data[1000];
char        errBuff[2048] = { '\0' };
using namespace std;
int32 CVICALLBACK   SaveViconData(TaskHandle taskHandle, int32 signalID, void* callbackData)
{
    using namespace std;

   cout << "Function triggered\n";
   DAQmxStopTask(taskHandle);
   DAQmxClearTask(taskHandle);
   cout<< "taskHandle\n" <<  flush;
   chrono::seconds dura(1);
   DAQmxStartTask(taskHandle);
    return 0;
}

int main(void)
{
    DAQmxErrChk(DAQmxCreateTask("", &taskHandle)); //d = daq("ni");
    DAQmxErrChk(DAQmxCreateAIVoltageChan(taskHandle, "Dev1/ai0", "Voltage", DAQmx_Val_RSE, -10.0, 10.0, DAQmx_Val_Volts, NULL)); //ch=addinput(d, "Dev1", 'ai0','Voltage');
    DAQmxErrChk(DAQmxCfgDigEdgeStartTrig(taskHandle, "PFI1", DAQmx_Val_Falling)); //addtrigger(d, "Digital", "StartTrigger", "External", "Dev1/PFI1");
    DAQmxErrChk(DAQmxCfgSampClkTiming(taskHandle, NULL, 500.0, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000)); //change to finite if this doesn't work
    DAQmxErrChk(DAQmxRegisterSignalEvent(taskHandle, DAQmx_Val_SampleClock, 0, SaveViconData, NULL)); //https://www.ni.com/docs/en-US/bundle/ni-daqmx-c-api-ref/page/daqmxcfunc/daqmxregistersignalevent.html
    DAQmxStartTask(taskHandle);
    DAQmxWaitUntilTaskDone(taskHandle, 10); // Wait for action to be completed


Error:
    if (DAQmxFailed(error))
        DAQmxGetExtendedErrorInfo(errBuff, 2048);
    if (taskHandle != 0) {
        DAQmxStopTask(taskHandle);
        DAQmxClearTask(taskHandle);
    }
    if (DAQmxFailed(error))
        printf("DAQmx Error: %s\n", errBuff);
    return 0;
}

and I'm using a USB-6003 NI-DAQ. Any help would be appreciated

Viewing all 2195 articles
Browse latest View live


Latest Images