Quantcast
Channel: Counter/Timer topics
Viewing all 1243 articles
Browse latest View live

Duty Cycle of Digital Inputs

$
0
0

I'm trying to use counters to measure the duty cycle of a digital input so I looked at the ReadCtrFreqScalar function but I'm have having trouble finding which type of channel needs to be created for that type of read to work. I started with making a CIFreqChan and used ReadCounterScalarF64 to measure that but using the same channel to measure duty cycle is giving an error saying the read function doesn't match the channel type. Can anyone help? I just need to know which channel creation function I should replace the frequency with.

 

Note: Specifically I'm using NI cDAQ-9178 with the NI-9421 (DSub) module if that helps.


Exprot 100MHz timebase

$
0
0

How can I use Labview to export the 100MHz timebase of the USB-6363 to one of its PFIs for synchronization with a second USB DAQ (e.g. USB-5133)?

Thanks,

Chris

Counter and comparator circuit with hc393 and hc85

$
0
0
I searched for a full schematic for building a comparator circuit and counter circuit that are connected to each other, using ics hc393 and hc85 but couldnt find any. Can san someone send me a schematic of this circuit?

NI error -201133; Input and output on the NI9401

$
0
0

Former user of Matlab, it is the first time I try to work with the DAQ and national instrument. My device is a NI9401.

I want to record the position of 1 optical encoders. For this , the encoder is connected to counter in the 9401.

Here is how I proceed:
1/ I open a new DAQ session

2/ I add a counter channel, in order to make a clock (because, as I understood, to do a startForeground I have to configure a clock which will be associated with my data recording, am I right?

3/ I add a counter channel in order to have the data corresponding to the position of the encoder. But at this time I have the error message about the session reserved.

here is the code

//first I do the clock

ClockFreq=100;

sClk=daq.createSession('ni');

sClk.addCounterOutputChannel('cDAQ1Mod5',0,'PulseGeneration');

clkTerminal=sClk.Channels(1).Terminal;

sClk.Channels(1).Frequency=ClockFreq;

sClk.IsContinuous=true;

sClk.startBackground

//then
I configure the data input

s=daq.createSession('ni')

s.addCounterInputChannel('cDAQ1Mod5'),1,'Edgecount')

At this time I have the NI error -201133 message
Devices cannot be configured for input or output because lines and/or terminals on this device are in use by antoher task or route. This operation requires temporarily reserving all lines and terminals for communication, which interferes with the other task or route.
If possible, use DAQmx Control task to reserve all tasks that use this device before committing any tasks that use this device. Otherwise, uncommit or unreserve the other task or disconnect the other route before attempting to configure the device for input or output.
device : cDAQ1Mod5
Digital Port:0
Lines:3


Thus, my question is :
1/how can I configure both output clock and input counter in NI9401 directly using Matlab?

Thanks for your help.

NI9011 and NI9411 lost points from quadrature encoder

$
0
0

Hi everyone!

 

I have a big problem! I have a cRio9075 with a NI9011 to read a TTL x10 quadrature encoder (heidenhain MT1271). The module can read the encoder but it have a serious problem. When the encoder moves fast, the module lost some signals (cannot catch all signals sent from encoder) and returns wrong position values. Therefore it losts the reference (obviously). 

 

I talked with portuguese support (supported by france) and the application enginnering advices to me a NI9411. I bought that, make all connections but the problems still remain...

 

I also tried get values from scan mode, but the problem still.

 

My fpga code to get value:

 

 

http://i39.tinypic.com/14w6jkm.png

 

Another thing that i cannot understand is chassi clock. In website appears 400MHz (http://sine.ni.com/nips/cds/view/p/lang/pt/nid/209757) but in projects only 40MHz is recognized:

 

http://i42.tinypic.com/2u5xdw7.png

 

Regards,

 

Rúben Jerónimo

Software Developer

Streak, Automation Engineering

iviCounter class compliant specific driver using daqmx functionality

$
0
0

Are there any plans for NI to create IviCounter compliant specific driver for any of NI Counter/Timer HW like 

NI PXI-6602 ? In our application it is mandatory for us to use IviCounter interface which means we will have to create

counter class compliant specific driver using daqmx calls. We're trying to map IviCounter interface to daqmx interface,

which is not always straight-forward. Any suggestions ?

 

Thank you,

Radek Pozdnicek

multiple counter recording with NI9401

$
0
0

I am about to buy a NI9401 which will be connected to a NIcDAQ-9171. But I am now testing the NI9401 with a NicDAQ-9172.

My objective is to record simultaneous the position of 2 encoders (using 2 counters input of the DAQ). With the NIcDAQ9172 I have, there is only 2 counters; but there are 4 in the NIcDAQ 9171.

 

My problem is that, will it be possible to record both counters simultaneous with the NI9401, using the session based interface in Matlab. This is important to me because some NI engineer told me so, but testing with the NIcDAQ9172, i have problems to record only one encoder in the same time as a clock input (that seems to be necessary in order to measure counter position) : I obtain a message saying "the hardware associated with the session is reserved..." . I don't know how to proceed to solve this problem and I am afraid 

 that this could be the same with the NIcDAQ-9171.

 

 

Thanks for your help, because that will really be helpfull to be chure of my material choice.

 

 

 

 

 

Is it feasible to generate a quadrature signal with an NI 9742 module?

$
0
0

I need to generate a low frequency (<1KHz) quadrature signal and am considering the NI 9742.  Does anyone know of code example to generate a quad signal that would suit well with this module or similar?  Ideally we'd be able to programmatically vary the duty cycle but it's not mandatory.  Is the NI 9742 a good choice or should we use some other cDAQ series module?


counters synchronization

$
0
0

Hello everyone
So, here is my problem..
I want to generate 4 synchronized continuous pulses and I have a NI 9401 plugged in a cDAQ 9171. My thought was to create a pulse generation task with four counters and in order to synchronize them I trigger the three counters to the fourth. I have tried that before using another device (usb 6351) and it worked. However now, i get an error...

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

Then, with a cable I connected one counter with another non-counter terminal in order to use this as my trigger source and then i got another error...


"Lines 4 to 7 of this port are configured for input. Cannot configure these lines for output at this time"

It's like the device doesn't support bidirectional operation of the channels.

Is there any way I can finally synchronize my pulses, or I have to change the device? I' attach the code if you want to check it.

Thanks in advance




Monitoring Digital IO

$
0
0

I am pretty new to labview programming and am needing some direction. I am currently trying to setup a simple program to monitor the status of a few digital io. I need to start a timer when one input goes high and stop and record the time when the other input goes high. This needs to be looped in order to constantly monitor cycle time.I have included what I have done already. I currently only have the program running for one cycle and then stopping. Would anyone be able to help improve this?

 

Thanks

John.

multiple TTL finite pulse trains

$
0
0

Dear NI forum members,

 

 

We just got a NI PXIe-1073 Chassis with a NI PXIe-6361 switched in PXI1Slot2 and a shielded connector box BNC-2111. Aim is to generate three TTL pulse trains to control a laser, a sound and a shock via Matlab Application. I use the NI-DAQmx C API together with Matlab MEX to integrate the C code in Matlab.

I came up with the following code from the C examples to generate a finite time-based TTL pulse train:

 

float64 initialDelay;
float64 lowTime;
float64 highTime;
uInt64 periodsPerTrain;
float64 taskMaxTime = (lowTime+highTime)*periodsPerTrain + 2*initialDelay;

// Configure Pulse
DAQmxErrChk(DAQmxCreateTask("", &taskHandle));
DAQmxErrChk(DAQmxCreateCOPulseChanTime(taskHandle, "PXI1Slot2/ctr0", "", DAQmx_Val_Seconds, DAQmx_Val_Low, initialDelay, lowTime, highTime));

// Configure Pulse Train
DAQmxErrChk(DAQmxCfgImplicitTiming(taskHandle, DAQmx_Val_FiniteSamps, periodsPerTrain));

// Start Train
DAQmxErrChk(DAQmxStartTask(taskHandle));

// Wait for execution
DAQmxErrChk(DAQmxWaitUntilTaskDone(taskHandle, taskMaxTime));

// Clean up
DAQmxStopTask(taskHandle);
DAQmxClearTask(taskHandle);

 

I am stuck with two problems:

1.) PXIe-6361 has 4 counter signals ctr0-3. With the above code, I can generate separate tasks for each TTL signal and evoke them consecutively with DAQmxStartTask. But in that case I guess the tasks are not synchronized. Can I use the forth clock signal to synchronize the other 3, so the tasks on each is triggered at the same time? What will be the right way to do that with the C API? The smallest discrete time step in the exapmle is 500ms. See the attached image to check how the TTL signals should look like.

 

2.) What is my physical connector on the BNC2111 to outsource those signals. 

/PXI1Slot2/ctr0 -> PFI12/P2.4

/PXI1Slot2/ctr1 -> PFI13/P1.0

but what about ctr2 and ctr3? how can I set the outsource physical connector? Is there a function to specify that?

 

Thank you in advance for any tips, suggestions and direction!

 

cheers,

go9kata

 

Screen Shot 2014-02-07 at 1.49.05 PM.png

 

edge counting inaccurate

$
0
0

I'm getting inaccurate results from my USB-6210 edge counting check from MAX. I have a TTL source that generates four pulses that is connect to PFI0 through a simple RC filter (390 ohm and 0.02uF). I start the edge counting from the test panel in MAX choosing PFI0 as the edge source. When I trigger my four pulses I receive a much larger count (sometime up to 20 counts) from the MAX test panel. Only when I remove the RC filter do I receive an accurate count (4 pulses exactly). I need to use the RC to filter out some 45KHz noise generated by another piece of equipment in the lab. I know I can set up the USB-6210 to use a time-based filter but I thought a simple RC filter would be a quick solution.

I have tried this with a USB-6211 with the same results. Only the USB-6009 preformed as expected with accurate counts. The USB-6009 edge count is not affected by the RC filter. 

 

 

Any thoughts?

 

Thanks,

 

 

wind turbine overspeed guard

$
0
0

Hello,

 

I bought a Arduino uno board and labveiw bundle to replace VOG (vestas overspeed guard). i'm basicly looking for a pulse counter that will trip a relay when it counts to many pulses in a certain amount of time. I have no experience with labveiw and on a schedule, can anyone help me out?

9401 Frequency Rate

$
0
0

Hi guys! Can everyone tell me what is the real scanning DIO frequency? (Actually i only use 4 DIOS). 

In datasheet, for 4 inputs is announced 16MHz, but this value is not correct because i cannot catch all points of a quadrature encoder at max encoder frequency (100khz). 

 

Thanks in advance

 

Regards,

 

Rúben Jerónimo

 

Software Developer

Streak, Automation Engineering

 

measuring varying frequency with 9401

$
0
0

I need to measure a varying frequency with a 9401 in 9178 chassis.  I am using an Express VI.  I have the input connected to the 9401 terminal and can read counts just fine expect that the counts per second vary.  I compared this to a scope and see that the pulse width varies and thus my frequency varies.  When I attempt to measure frequency, I get errors that no data was measured.  I also see the note in the Express VI to connect the input to PFI0.  This I do not understand.  Can someone help me?


retriggered single pulse

$
0
0

I am using NI-DAQmx C/C++ API. How can I set up a counter to produce a retriggerable single pulse? That is, I need to trigger an output pulse, and while the pulse is being generated, if a new trigger comes in, it resets the counter so that the pulse timing is extended.

 

Is that what the DAQmxSetStartTrigRetriggerable property does? I'm guessing that the ability to do this depends on the hardware being used?

 

Thanks!

USB 6008 DAQ Read switch wiring

$
0
0

Hi i am looking to wire a magnetic read switch into the 6008 DAQ. The switch has just two wires and im just using it to count events.

If anyone could help that would be great.

Attached is the lab view progrem i have written for this task.

regards Gerry

continous loop

$
0
0

i have developed a program to postion probe drive using stepper motor. in this program m calculating pulses required to given to stepper motor and then using daq m generating the pulses, but i am not able to run my vi in continous mode, i need to stop it to repeat motion. kindly, someone help me to get in continous mode.

counter input using PFI0

$
0
0

Hi everyone,
I am trying to make frequency measurement using PFI0 or PFI1 in the cDAQ-9188 and DAQmx
is it possible to do so ???
can i have guide for that ?
thanks 

PXIe-6674T OCXO to PXI_CLK10_In Issues

$
0
0

Hello,

 

Currently I have a PXIe-1082 chassis, PXIe-8101 controller and a PXIe-6674T timing card installed in slot 4. What I want to do is connect the oscillator on the timing card to clk10_in to improve the accuracy of the 10MHz reference clock.

 

So here's the weird thing, for the most part when I run my labview program it fails to connect saying "PXI_Clk10_In is available as a destination terminal only for devices in a system timing slot. Move your device to a system timing slot." and will give the error code -1074118597. When it fails I try running the example code to connect to PXI_Clk10_In and using MAX and it will give me the same error, but every so often it will work without giving a single error.

 

Every time I power up the chassis the first thing I do is check to see if I can connect the clock, and if I can it gives no problems, but if I can't it seems like nothing I do will fix it and it will remain so for periods of time spanning a few weeks to a few months. When it does work, the longest it has lasted has been a week.

 

I was wondering if anyone has run into anything like this before or has any suggestions on how to get it to work consistently?

 

Also whether I can connect to PXI_Clk10_In or not I'm able to divide the DDS and output it to ClkOut so it's not a complete failure of the module just of the ability to connect to Clk10_In.

Viewing all 1243 articles
Browse latest View live


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