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

PXI-6528 how to configure output voltage and pulse width

$
0
0

Hello!

I have a PXI-6528, and want to output a pulse signal when click the button, the required output voltage is 28V, pulse width is 80ms. Now I don't know where or how to set the voltage and pulse width. Can you heip me? Thanks~


9477 update rate

$
0
0

Hello,

 

I have a cDAQ 8184 chassis with a 9477 sinking DO module. In the specification stands: Update Rate = 8µs.

 

Now my question, what does it mean? I have to switch die outputs in a resolution of 1ms, but the fastest way currently is around 50ms !

 

I create a DO task for one channel, and toggle it in a while loop without any delay, calling the DAQmx Write (Digital Bool 1Line 1Point).vi. I can't get it faster as 50ms.

 

Is the update rate of 8µs relevant only with usage of a cRIO chassis?

NI 9401 configuration without Labview

$
0
0

Hi all,

 

I am using the NI 9401 module with the NI 9144 slave chassis and a third party master (Twincat). It seems to be that all 8 digital ports are configured as inputs. However for our project we also need outputs and I therefore want to reconfigure the module. I know this is possible using Labview. But because we are using a third party master, we can not use Labview to configure the FPGA. Is there another way to reconfigure the module in a way that we have four in- and four outputs?

 

Thanks for your help!

NI PCI-6542: Creating Dynamic Waveforms Using the HSDIO Library

$
0
0

Hello!

 

I am having problems understanding how to create waveforms using the HSDIO library to run on my PCI-6542 board. I need to create a program that turns one channel on for 12.5 microseconds, waits a set amount of time(i.e. 100 samples),  and turns another channel on for 12.5 microseconds.

 

This program is to be used in a phased array ultrasonic system.

 

Below is the Dynamic Generation example program that turns channels 0 - 2 on for 1024 samples.

 

/************************************************************************
*
*  Example Program:
*    DynamicGeneration.c
*
*  Description:
*    Generates a simple pattern on specified channels.
*
*  Pin Connection Information:
*    None.
*
************************************************************************/


/* Includes */
#include <stdio.h>
#include <limits.h>
#include "niHSDIO.h"

/* Defines */
#define WAVEFORM_SIZE 1024

int main(void)
{
   ViRsrc deviceID = "Dev1";
   ViConstString channelList = "0-2";
   ViReal64 sampleClockRate = 50.0e6;
   ViInt32 dataWidth = 4;
  
   ViUInt32 waveformDataU32[WAVEFORM_SIZE];
   ViConstString waveformName = "myWfm";
   ViInt32 timeout = 10000; /* milliseconds */
   
   ViSession vi = VI_NULL;
   ViStatus error = VI_SUCCESS;
   ViChar errDesc[1024];
   ViInt32 i;
   
   
   /* Initialize generation session */
   checkErr(niHSDIO_InitGenerationSession(
            deviceID, VI_FALSE, VI_FALSE, VI_NULL, &vi));
   /* Assign channels for dynamic generation */
   checkErr(niHSDIO_AssignDynamicChannels (vi, channelList));
   /* Configure sample clock parameters */
   checkErr(niHSDIO_ConfigureSampleClock(
            vi, NIHSDIO_VAL_ON_BOARD_CLOCK_STR, sampleClockRate));
   /* Query the Data Width Attribute */
   checkErr(niHSDIO_GetAttributeViInt32(
            vi, VI_NULL, NIHSDIO_ATTR_DATA_WIDTH, &dataWidth));
/* Populate waveform with ramp data */ for (i = 0; i < WAVEFORM_SIZE; i++) { waveformDataU32[i] = i; } checkErr(niHSDIO_WriteNamedWaveformU32( vi, waveformName, WAVEFORM_SIZE, waveformDataU32)); /* Initiate generation */ checkErr(niHSDIO_Initiate(vi)); /* Wait for generation to complete */ checkErr(niHSDIO_WaitUntilDone(vi, timeout)); Error: if (error == VI_SUCCESS) { /* print result */ printf("Done without error.\n"); } else { /* Get error description and print */ niHSDIO_GetError(vi, &error, sizeof(errDesc)/sizeof(ViChar), errDesc); printf("\nError encountered\n===================\n%s\n", errDesc); } /* close the session */ niHSDIO_close(vi); /* prompt to exit (for pop-up console windows) */ printf("\nHit <Enter> to continue...\n"); getchar(); return error; }

 

Questions:

How can I change the values in waveformDataU32 to create off and on states(instead of just always on)?

How do I select the channel that waveformDataU32 is applied to?

 

Thanks!

Zachary Geier

double timer

$
0
0

Hi everyone!

I've a problem to resolve on my VI (please find the pic attached). I need to control the flow rate of a pump (timered) only if it receives the signal from a DI.
the signal to the second timer (the one of the flow rate pump) is driven by a first timer that gives a boolean out (digital signal then) only when a determinate time is passed every two signals in.

The Digital inputs come from a counter, if between a signal and the other pass over "xx" seconds , the signal must be sent to the pump but with the second timer it must be temporized.

 

Actually the first timer is working well, but then the pump just starts (pump on the VI = boolean indicator) and the signal is not timed (intermittently) from the second timer!

I also tested the second timer (stand alone) and it's working...

 

where is the gap?

 

p.s. I apologize for the italian information in the panels..

NI USB 8451 with external power source

$
0
0

Hello everyone !

 

I try to figure for 2 days now why my USB 8451 gave me an error 301740 : SDA or SCL line or both are in a low state or there are no pull-up resistor.

 

I try to change a multiplexer channel in order to obtain a temperature mesurement from a sensor. I checked my SDA and SCL lines, thye're both in high state and i have 2 pull-up resistors with a value of 10K.

The only change with my older circuit is that  i use an external power supply for my electronic chip and a MUX PCA9543(texas instruments) to select the sensor of which i need the data .

 

Does anyone have encountered similar issues ?

usb 6008 digital output always low

$
0
0

I have a usb 6008 working with a compiled LabVIEW program running on the 2014 run time engine that I use to toggle relays via the digital out ports (open collector).  The circuit is such that logical 1 mean off.  The code was running 24/7 for weeks withouth a problem and then all of the logic lines went low and staid there.  The code kept running and looked fine.  If you stop, exit the code and restart it works and has been for days.  Running on Windows 7.  Any ideas?

How to get ni8451 firmware version

$
0
0

I would like to read the firmware version from several ni8542 devices in my test system.  I can not find any drivers to do this.  I do have the Ni845x.dll and it contains a function called ni8541GetDeviceFwVersion, but I can not find any reference to the function paramters ( I am assuming it would work for an 8452).

Can anyone help with this or suggest an easier way to read the firmware  number from the device?  Thanks.


adjustable digital input voltage

$
0
0
Hello,

I have a 9402 DI card I'm using in a 9139 cDAQ. I'd like to take some PWM voltage measurements and do some sort of counter scheme to back out RMS values, harmonics, etc. However, the voltage is (nominally) 220 V (on), and all I have are 100x attenuation probes, knocking my "on" voltage to ~2.2V (well below the "on" level for traditional 5V TTL). Does anyone know if there's a way to adjust the on/off threshold voltage for a 9402 card (or just general LabVIEW tricks with DI/DO)?

Thanks!

programming 6514 in C#

$
0
0

I have a 6514 and I am trying to simply set up ports for driving and sensing. I am programming in C# using the provided IVI Library. I know what methods (functions) I want to use but I am having trouble getting to them. I was able to initialize the instrument with a simple:

 

      instrument _handle =  DaqSystem.Local.LoadDevice("NI6514")  /* the NI6514 is assigned in NIMAX*/

Now I would like to go to the "DiChannelCollection" and the "DOChannelCllection" so that I can use the ports. But any approach I have used to try to access those class libraries has not worked for me.

 

I have looked at various help files but there are none in C#. If I was programming this in C it would be a peice of cake given the examples.

 

Any hints on how I might accesswhat I need?

 

Thanks

 

Kevin

Implementing SPI with a cRIO 9068 and a ni 9402 Module

$
0
0

Hi,

I am trying to communicate with a Razor 9dof IMU from a cRIO 9068 and a ni 9402 module, i have tested the IMU SPI with an arduino and works like a charm, but i been trying the examples of the SPI api non-stop, and i have not being able to make it work, because i can´t use the probes or the highlight on the fpga´s vi i am running out of ideas on how to solve this, am i forgetting something? do you know a reliable example to try? or way to test the communication and what could be wrong?

 

Thanks in advance for your help

 

Kind Regars

 

Leonardo Gómez

Programming digital I/O pins on the NI myRIO-9100 for more quadrature encoder inputs

$
0
0

I am using NI myRIO for my robot PUMA 200 which has 6 motors. I want to use 6 encoder channels to obtain the positions of the motor axes. But myRIO has only 4 encoder channels. I watched the video "H-Bridge and GearedMotor Demo Walk-Through" (youtu.be/Q1UXVtVN-oQ, 6:01). At 2:59, panel of configure encoder shows the 4 encoder channels.

My question is if there is a way to program other digital I/O to get more encoder channels. Any help appreciated.

wait until done

$
0
0

my application needs to generate and acquire data simultaneously using external trigger and external clock. For generation sesion 'wait until done' command  is used for sensing the external trigger. But it prevents to configure acquisition session as the command holds the control of the program. Please suggest a solution.

driving DO lines with external clock wired to PFI lines

$
0
0

Hi all,

 

I have few issues understanding how to use hardware timing resources in M series USB6229, with particular focus on DO. I have read last couple of day all google offered on the subject but I am still straggling with some basic tasks. To cut the story short, the 1e6 dollar question:  can I set up 7 independent DO lines where (different tasks or virtual channels) where lines use same hardware timing source (eg, freqout or CO0 set to ~10kHz sampling time routed to PFI0).

Note: the reason I need 7 independent lines and not a port output (which would be obvious solution) is because I need to have (vastly) different number of samples and for each line.

 

Follow up question regarding timing: As I understood, any of PFI ports could be used and a input to the external clock which could be used to drive DO line(s) samples. I have tried to generate one DO, eg. P0\line4 by using CO0 to generate 10kHz sample rate.  The signal on the line4 is pulse with frequency of few Hz which I routed to PF6 (with actual wire) in hope to use this signal as a clock for line5. I tried this but I am receiving errors about "resources in use"

________

Possible reason(s):

Specified route cannot be satisfied, because it requires resources that are currently in use by another route.

Property: SampClk.Src
Property: SampClk.ActiveEdge
Source Device: USB-6229
Source Terminal: PFI6

Required Resources in Use by
Task Name: _unnamedTask<7B>
Source Device: USB-6229
Source Terminal: PFI4
Destination Device: USB-6229
Destination Terminal: do/SampleClock

Task Name: _unnamedTask<79>

________

 

 Apparently, many of internal clocks are routed internally to different PFI lines which mean the lines are occupied resource, and I do not know how to solve this.

I wanted to ask you does this principle sound as something that should work and if you know about some examples that would be excellent.   

 

Any help would be greatly appreciated.

Cheers, Nenad

NiFpga_ReadFifo high cpu usage

$
0
0

Hi everyone

 

I'm doing some tests with the board PCI-7811R installed in a PC with OpenSUSE 13.1 and NI-RIO 14. Using the NI FPGA C API I found some issues related to the CPU usage when my program waits values to be inserted into a Target to Host DMA FIFO of 64 bits elements.

labview.png

This is the FPGA VI that I'm using for the test. It waits a signal generated in another VI (the signal is generated at a user-defined rate), reads the inputs values and insert them into FIFO. My C++ program waits the FIFO to have the requested amount of samples (using the NiFpga_ReadFifoU64 function with infinite timeout) and do a simple change detection. The program runs as expected but it consumes 100% CPU time regardless the sample rate (tested with values between 10 and 15360 samples per second). I tried to let only the code that reads the FIFO but the problem persists.

 

Another thing that happens is the processes watchdog and kworker consumes a lot of CPU when the sample rate and the requested amount of samples is the same (this causes the NiFpga_ReadFifoU64 function to be executed one time per second).

labview2.png

 

This only happens with this program and both processes CPU consuption are not constant. They return to normal when the program is stopped.

 

I tried to use the NiFpga_AcquireFifoWriteElementsU64 function instead of NiFpga_ReadFifoU64 but it keeps returning the value -63193 (feature not supported).

 

Anyone knows how to solve it?

 

My program code:

NiFpga_Status status = NiFpga_Initialize();
if (!NiFpga_IsNotError(status))
{
	cout << "error: " << status << endl;
	return 1;
}

NiFpga_Session session;

status = NiFpga_Open(NiFpga_DAQ_Bitfile, NiFpga_DAQ_Signature,
	"RIO0", NiFpga_OpenAttribute_NoRun, &session);
if (!NiFpga_IsNotError(status))
{
	cout << "error: " << status << endl;
}

NiFpga_Reset(session);

// sample rate
status = NiFpga_WriteU32(session, NiFpga_DAQ_ControlU32_SamplesPerSecond, 2048);
if (!NiFpga_IsNotError(status))
{
	cout << "error: " << status << endl;
}

NiFpga_StartFifo(session, NiFpga_DAQ_TargetToHostFifoU64_SamplesFIFO);

status = NiFpga_Run(session, 0);
if (!NiFpga_IsNotError(status))
{
	cout << "error: " << status << endl;
}

uint64_t buffer[2048];

uint64_t old;

while (true)
{
	size_t nSamples = 2048;

	status = NiFpga_ReadFifoU64(session, NiFpga_DAQ_TargetToHostFifoU64_SamplesFIFO,
		buffer, nSamples, -1, &nSamples);
	if (!NiFpga_IsNotError(status))
	{
		cout << "error: " << status << endl;
	}
	else
	{
		for (int i = 0; i < nSamples; i++)
		{
			// change detection
			if (buffer[i] != old)
				printf("Samples %llx\n", buffer[i]);
			old = buffer[i];
		}
	}

}

NiFpga_MergeStatus(&status, NiFpga_Close(session, 0));

/* must be called after all other calls */
NiFpga_MergeStatus(&status, NiFpga_Finalize());
return 0;

 

 

Thanks for the help

 

Luiz Carlos


How to set a I/O channel in NI PXIe-6556 to ground when in PMU mode

$
0
0

Is there a way or API call in LabVIEW to set any one of the channels to ground within the PXIe-6556 when in PMU mode?

Generate single pulse on multiple channels from external trigger on High Speed DIO

$
0
0

Hello,

 

I am attempting to set up a system using a PCIe-6535B connected to a SMB-2163 high speed DIO.  The system needs to be set up to work with a camera sending a trigger (at the start of each exposure) to PFI4 which in turn sends a single pulse out  three digital output channels to lasers.  Each digital output has its own specific delay and width.  There are no counters on the SMB-2163 so I think I need to use Pulse Width Modulation (PWM).  I saw this example and adapted it to my system:

 

https://decibel.ni.com/content/docs/DOC-8010

 

However, when the source going into the DAQmx Sample Clock VI is set to PFI4 (instead of the onboard clock)  to receive the input from the camera, the behavior changes.  The Sample Rate going into the Sample Clock VI is ignored and instead each element of the digital waveform is triggered.  I need the entire sequence to complete after each trigger.

 

I have attached a quick schematic of the timing sequence.  Any suggestions on how I can achieve this type of triggered event? (Using LabVIEW 2013)

 

Thanks,

 

Mike

 

CLAD

 

 

Timing_Sequence.png

PWM_Attempt.PNG

DAQ signal accessory 50-pin I/O not working

$
0
0

Why is the 50-pin I/O in my 6014 DAQ not working? please help guys

 

when I use the analog channels available on my signal accessory, it works. however, if I use the analog channels on the 50-pin MIO, it does not work at all.

 

do i need to enable it or what?

ni 9381

$
0
0

Does anyone know the value of the resistor inside NI 9381 for the DIO or else what is the short circuit current from the digital output. NI manual for NI 9381 is silent on it and does not specify current rating except for specifying output logic voltages at 100uA current. Can someone provide some information on current output ratings for the digital output of this DIO part of the multifunction module NI 9381

Output current capability of DIO output of NI 9381

$
0
0

What is the output current rating for the DIO output? Is the output short circuit protected due to the internal resistor shown in the manual. What is the value of this resistor?

Viewing all 2178 articles
Browse latest View live


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