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

Multi-channel Sequential Controlling Pulse Generator Design

$
0
0

Hello, all,

 

I need to design a Labview problem as a Multi-channel Sequential Controlling Pulse Generator and output through DAQ card (NI6259). The required digital pulses are showns in the attachment.  Time scale values are shown on the top as an example. CLK's duty cycle is 0.5. x1 and x2's value need to be programable. 

 

Could anyone give example codes? Or, give me any idea to program these pulses?

clock.png


Change Output State if Connection is Lost

$
0
0

Hello,

I am using a USB-6341 XSeries multifunction DAQ system to control an experiment involving a heated pipe.  I am using MATLAB to read a number of analog sensors, and the Digital Outputs to activate relays to control some heaters and a pressure relief valve.  My problem is that if I lose power, someone kicks a cable, or my computer crashes mid-test, I want the relays to turn off (ie return all the digital outputs to 0), for safety reasons.

 

I have figured out how to have the default output on power up be 0, but I havent come across anything describing how to do the same thing if a connection with the computer is lost.  Is there a property inside the DAQ that I can program to do something like this?

 

Thanks

Jimmy

Slow digital output on USB-6009 using NIDAQmx

$
0
0

I have a USB-6009 device that I am controlling with the .Net NI-DAQmx interface.

It appears that each call to "WriteSingleSamplePort" takes exactly 1 millisecond. For those not familiar with the .Net interface, this is equivalent to writing an integer value to a digital port, thereby setting the digital output state for all pins in a DO port at the same time.

Now, I assume that the NI-DAQmx software interface is what is limiting the output speed. Is this true, and if so, can anyone provide a reference to this limitation? (In the USB-6009 spec, I can see rate limits for Analog input and output, but not digital output.)

 

Is this 1-ms limit only true for the USB-600x devices, or is it true for digital output with Ni-DAQ-mx in general?

Is there any way to remove this limitation? Is there a way to increase DO speed by e.g. writing to a single pin instead of the whole port?

 

Is this speed limitation put in place because the hardware itself can take up to 1 ms to respond? If so, why is the DO operation so slow? Even if digital output is slow, I don't like the fact that the software locks the thread for the full millisecond. I would like to be performing continuous analog input at the same time as digital output, and it appears I will only be able to do this by using a multi-threaded approach where analog input is occuring on a separate thread because the digital output locks its own thread for a full millisecond during each pin change. (Edit: I suppose I can avoid explicit multithreading by using the async BeginWriteMultiSamplePort function etc)

 

Thank you for any help or advice you can provide regarding this.

generate LVDS using C# coding

$
0
0

I am a C# programmer and I don’t have much knowledge in electronics or RF. But I need to generate some LVDS for PXI 6562 using c# coding. I am trying to use the .net wrapper(nihsdio.cs) for this but as its a vast wrapper I am unable to find out the required function from this wrapper. I have also attached the .net wrapper here in .txt format. Just save this file as .cs and u can use it. If anyone can help me in this case pls reply to me. 

Thanks in advance……..

 

Half Period shifted Signal without copying code?

$
0
0

Hi everyone!

 

Here is the code which generates accurate PWM for Half bridge Control with programmable dead-time, now here is the issue i want to shift the same signals on two DIO's with half the period of the signal. i ve tried following:

 

1. I copied the same code in FPGA and delayed it with half period using a wait( but it is consumes double resources and some times the half period phase difference is also not accurate).

 

 

I need some other technique to shift the same signal by half-period( or copy paste the same signals onto 2 other outputs by not copying the same code and thus saving resources). Any help is appreciated.

 

 

Best regards,

azy

SPI and I2C Driver API

$
0
0

Hello All,

    I am trying to use an NI 9402 module to utilize I2C communication to talk to a compass sensor as it is stated possible here: http://sine.ni.com/nips/cds/view/p/lang/en/nid/210637. 

     The fpga layer compiles succesfully, but I am recieving no indication that the communication is successful (there are lights that are supposed to blink), and the read returns nothing but 255.   I have attached a screenshot from the front panel showing the parameters I am using.  Taking an oscilloscope to the scl pin reveals a regular square wave as expected.  The SDA line also shows data being actively changed as well (the program is indeed outputting).

 

The datasheet for the sensor I am using including expected communication results is shown here.

http://www.elechouse.com/elechouse/images/product/GY-26-USART%20Digital%20Compass/gy-26%20manual.pdf

 

Any help that could be given to get this sensor up and running would be greatly appreciated!

Thanks,

Daniel

usrp2 and simulink

$
0
0

Hi guys, i tried to use two USRP2 boxes and two host computers to  build a radar system, and then used simulink  to simulate the system. i have built a transmitter in Matlab and its doing fine, but i am having problems to build the receiver. All i can see at the reciever end is noise.Can anyone give me some idea or any sample diagram on Matlab. thank you.

como se conecta un danfoss de presion en un modulo 9208/ how to connect danfoss in NI9208

$
0
0

Estoy intentando conectar un danfoss MBS 3250 en un modulo NI9208. Alguien sabe como se deberia conectar?


trigge one camera GigE with one stroboscope

$
0
0

Hey everybody,

 

I would like to trigge one camera GigE with one stroboscope.

 

I want to connect stroboscope to my PC with one jack plug -BNC connector to my PC and the camera by GigE.

 

I have to use the DaQmx, but I don't to know how I have to trigge my camera with my stroboscope.

 

Could you help me?

 

Thanks.

Best regards.

Types of PFC Microcontrollers

$
0
0

 

Hello ,

 

This is my first post .

 

Can any direct me to a resource which talks about various flavours of microcontrollers used for Active PFC in SMPS ? Design is for power loads rated upto 60 kVA .

 

 

Connection between square waveform and digital module

$
0
0

Hello,

 

The VI file attached is related to drive control of DC motor using the cRIO using fuzzy logic. The output of the square wave generator is connected to the waveform graph (at the right extreme end). Now I want this output to be connected to the digital I/O module 9401 (MOD3/DIO0 as shown in the diagram).  The type of output from the sqaure waveform is of waveform type whereas the input of the digital module is of FPGA type. How do I make this connection?

 

Also there are 3 terminals to the digital module (FPGA I/O IN, FPGA I/O OUT, I/O READ). Which of these terminals do I connect the output of the square waveform to?

 

I am connecting a DC motor to MOD3/DIO0 on the crio in order to control it with the PWM output fro the square waveform generator.

 

PS:You cannot run the VI because it needs a '.fs' file too which I am unable to upload. Only please clarify the connection to be made as described above.

 

Thank you

counter channels for NI 6343 DAQ

$
0
0

I have the NI 6343 DAQ using labview 2013.  When I try to create a counter channel it lists channels ctrl0 through ctrl3.  However they are not listed on the pin out for the DAQ - what physical channels are they on the pin out?  I'm assuming they are part of the PFI0-15.  

9402 DAQmx C: Write Clock and Data on two diferrent lines.

$
0
0

I am working with NI 9402 (4 I/O lines) and coding with DAQmx c (I AM NOT USING LABVIEW).

 

I am trying to output the the data signal by port0/line1. Period required of each bit: 1us.(1 MHz)

 

At the same time I am trying to output the clock signal by port0/line0. Period of each bit: 0,5us (2 MHz).

 

For that purpose I have tried to write the data on port0/line1 with DAQmxWriteDigitalLines() and use the function DAQmxCfgBurstHandshakingTimingExportClock() to export the clock to port0/line0. 

 

 

DAQmxWriteDigitalLines(taskData,DATA_SIZE,1,30.0,DAQmx_Val_GroupByChannel,data,NULL,NULL));

DAQmxCfgBurstHandshakingTimingExportClock(taskData,DAQmx_Val_ContSamps,2000000,1000.0,"cDAQ1Mod1/port0/line0",DAQmx_Val_ActiveHigh,DAQmx_Val_Low,DAQmx_Val_ActiveHigh));

 

When exectuing I get this error message:

 

DAQmx Error: Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.

Property: DAQmx_SampTimingType

Requested Value: DAQmx_Val_BurstHandshake

You Can Select: DAQmx_Val_SampClk, DAQmx_Val_OnDemand

Task Name: taskData

Status Code: ­200077

 

I guess that this mean that function DAQmxCfgBurstHandshakingTimingExportClock  is not supported on NI 9402..

 

As I have not been able to solve this problemI decided to use DAQmxCfgSampClkTiming() instead of DAQmxCfgBurstHandshakingTimingExportClock().

 

Since I will be using a SampClkTiming function I have created 2 separate tasks, with different clock rates for each one, and try to write separately the clock and the

data arrays in line0 and line1.

 

I am having troubles when I try to write both lines at the same time, this is the important part of the code I am using:

 

TaskHandle  taskData=0,taskClock=0;

              /*********************************************/

              // DAQmx Configure Code

              /*********************************************/

              DAQmxErrChk (DAQmxCreateTask("taskData",&taskData));

              DAQmxErrChk (DAQmxCreateTask("taskClock",&taskClock));

              DAQmxErrChk (DAQmxCreateDOChan(taskClock,"cDAQ1Mod1/port0/line0","clkOut",DAQmx_Val_ChanPerLine));

              DAQmxErrChk (DAQmxCreateDOChan(taskData,"cDAQ1Mod1/port0/line1","",DAQmx_Val_ChanPerLine));

 

              DAQmxErrChk (DAQmxCfgSampClkTiming(taskData,NULL,1000000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,DAQmx_Val_ContSamps)); //to define the 1 micro secnd Time of bit.

              DAQmxErrChk (DAQmxCfgSampClkTiming(taskClock,NULL,2000000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,DAQmx_Val_ContSamps));

//2000000 because I want the clock array to be sent twice faster than the data array

/*********************************************/

              // Set data & clock Arrays

              /*********************************************/

Define the clock array:             

              for(i=0;i<1000;i++)              {clockD[i]=i%2;} /'1' and '0'

Define data array:             

              for(i=0;i<1000;i++)              {data[i]=1;} // or whatever random values..

/*********************************************/

              // Write digital lines

              /*********************************************/

 

while(1)              {

                            DAQmxErrChk (DAQmxWriteDigitalLines(taskData,1000,1,30.0,DAQmx_Val_GroupByChannel,data,NULL,NULL));

                            DAQmxErrChk (DAQmxWriteDigitalLines(taskClock,1000,1,30.0,DAQmx_Val_GroupByChannel,clockD,NULL,NULL));

              }

After executing this code I get the error:

DAQmx Error: NI Platform Services:  The specified resource is reserved. The operation could not be completed as specified.

Task Name: taskClock

 

Status Code: ­50103

 

Nevertheless, If I just  use one of the DAQmxWriteDigitalLines function, the program works fine, and it send out the information ).

 

By the way I noticed that if I Write a digital line in a for loop instead of while(1), if the number of iterations of the for loop is low (i.e. 10), I get the same error even if I just write call the DAQmxWriteDigitalLines() function once.

 

Could these two errors be related ?

 

To sum up:

Could anyone give me a clue how two output a data signal and a clock signal  to 2 different ports with different clock rates for each signal ?

 

Thank you very much

sbRIO9642 analog I/O connector

$
0
0

Hello, 

 

I am using sbRIO-9642 to measure the value of voltage and current.

What I thought is using J7: analog I/O connector as the input of voltage.

The question is: choose which module in Labview as the signal input? I used sbRIO-9642 -> FPGA Target -> ModA -> ModA/AI1 as voltage signal input, but I meet this problem:

Capture.JPG

 

I just start to use sbRIO and Labview :(

 

Thanks for your answers.

Cheapest way to generate a PWM for a relay with LabView2010 and a Laptop

$
0
0

Hello there,

like mentioned in the title I'm searching for the cheapest way to generate a PWM signal for a relay. I want to use a Laptop and LabView2010 for it. I read through several  topics but after time it just got more confusing. For example the NI USB-6008 OEM seems to be a cheap solutiion, however I'm not sure if I can use for the PWM signal generation as this thread says it's not possible:

http://forums.ni.com/t5/Multifunction-DAQ/Using-PWM-on-NI-6008/m-p/231860/highlight/true#M13339

But then again this thread right over here makes it seem like it's do-able:

http://forums.ni.com/t5/Digital-I-O/Generating-a-PWM-using-USB-6008/m-p/421654/highlight/true#M5527

 

So again in short form.

 

What I need:

- the cheapest way to generate a PWM signal to control a relay

 

What I have until now:

- LabView2010

- Laptop

 

 

 

If possible it would be great to have two channels for two seperate signals, but this is of lower importance right now.

 


pattern match with PXIe 6536

$
0
0

I currently have 2 different versions of DIO in my system. I have a PXI-6533 with code that operates as advertises with my current code. I built a new system that has the PXIe-6536 and I am trying to use the same code to run a specific test. I am having trouble with the PXIe-6536 working like the PXI-6533 and I am trying not to have 2 different versions of code. I have attached my VI for reference. The problem I am experiencing is related to the trigger, I trigger on a zero and capture the next 11 samples to match a pattern. With the PXI-6533 this works great but not with the PXIe 6536 any help or recommendations would be great. Also please keep in mind that I am using 8.6 LabVIEW..... I know ancient and archiac but its what i use right now.

HSDIO PXIe-6556 Hardware compare for large files

$
0
0

 

I'm developing a system with Labview2013, TestStand2013, PXIe-6556 and HSDIO driver 2.0

 

The system diagram is:

 

Pxie-6556 >----------------------- 12 channels ------------------------------------ 4 channels ------> Dut1 (jtag 3ch out 1ch in)

Hardware compare mode                                         |-------------------- 4 channels ------> Dut2 (jtag 3ch out 1ch in)

                                                              |-------------------- 4 channels ------> Dut3 (jtag 3ch out 1ch in)

 

The goal is to develop a hardware compare mode test for a very large test vector file >10Gbytes

 

The issues are:

 

1. How to convert this file from csv or vcd to hws using the Digital waveform editor 3.0? (split in files of the xx Mbytes?)

2. How to implement the hardware compare mode. Load the file from disk in steps of xx Mbytes in a loop?

 

Thanks,

 

 

                                                             

TTL Triggering Camera

$
0
0

Hi! 

 

I'm trying to trigger a HS camera using myDAQ. At the moment I'm not trying to do anything fancy, just take a single picture that I've triggered using LabView.  I have the camera wired to the DIO and I'm using the DAQ assistant VI, but nothings happening.

 

Thanks!

 

Acolel 

About sbRIO 9606

$
0
0

Hi,

 

I am looking at sbRIO-9606. Spec says it has 256MB RAM and 96 FPGA IO.

 

1. Is it DDR2?

 

2. What is throughput of this RAM?

 

3. Is the RAM connected to processor or FPGA?

 

4. Can FPGA I/O level be 2.5V if 2.5V supply is provided on RMC connector?

 

5. Can FPGA use external clock via IO on RMC connector? I can not tell which IO is GCLK IO of FPGA.

 

Thanks,

NI9402: WriteDigitalLines within a for loop().Some or all of the samples to write could not be written to the buffer yet.

$
0
0

 

I am writting two different signals with NI9402, one for the clock and the other for the data.
I have created two channels, one for the data and another for the clock.
My goal is to test the DAQmxWriteDigitalLines function within a loop with different payload each time. From (0 to 4000 bytes).
In each iterations I calculate the size of the payload and send the signal out. The Clock 101010.. would go by line0 and the payload (111...) will go by line1.
There is a simplified version of the code:

 

DAQmxErrChk (DAQmxCreateDOChan(taskData,"cDAQ1Mod1/port0/line0","dataOutClock",DAQmx_Val_ChanPerLine));
DAQmxErrChk (DAQmxCreateDOChan(taskData,"cDAQ1Mod1/port0/line1","dataOutData",DAQmx_Val_ChanPerLine));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskData,NULL,2000000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,DAQmx_Val_ContSamps)); 

 

for(i=0;i<4000;i++){

ClockAndData=(i)*2; // *2 because of the clock
free(data);
free(infoVect);
infoVect=malloc(i); //the useful payload of this iteration
data=malloc(ClockAndData);

printf("Clock : ");fflush(stdout);
for(k=0;k<ClockAndData/2;k++){
data[k]=k%2;
printf("%d",data[k]); }

 

printf("Info Vect : ");fflush(stdout); //I set the 'i' bits of payload to 1
for(k=0;k<i;k++){
data[ClockAndData/2+k]=1; // the firsts ClockAndData/2 bits are for the channel 1 (clock)
}
DAQmxErrChk (DAQmxWriteDigitalLines(taskData,ClockAndData/2,1,30.0,DAQmx_Val_GroupByChannel,data,NULL,NULL)); 

}

If I start by a small 'i' in the loop, after the firsts iterations of the loop I get the error listed below. On the other hand if I start with a high value of 'i', let's say 200, The NI9402 succesfully write all the sample with the variable payload.


DAQmx Error: Some or all of the samples to write could not be written to the buffer yet. More space will free up as samples currently in the buffer are generated.

To wait for more space to become available, use a longer write timeout. To make the space available sooner, increase the sample rate.
Property: DAQmx_Write_RelativeTo
Corresponding Value: DAQmx_Val_CurrWritePos
Property: DAQmx_Write_Offset
Corresponding Value: 0

Task Name: taskData

Status Code: -200292

 

Does anybody know how could I fix this ? I have tried to put sleep() before each write, but I still get the same error.. could it be a problem of the clock DAQmxErrChk (DAQmxCfgSampClkTiming(taskData,NULL,2000000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,DAQmx_Val_ContSamps));  ? 

 

Thank you very much

Viewing all 2178 articles
Browse latest View live


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