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

PXI6602 & PXIe4497 Sync Sampling with 2 Counter Tasks

$
0
0

Hello,

I've searched this board and read a lot of posts this week and still cannot find a solution for my problem. I'm trying to sample AI channels from a PXIe-4497 and syncronize that aquistion with a CI angular position and CI frequency task. My goal was to sample angular position and speed with the same rate as the AI channels. Referencing the 4497 SampleClock works for one task, but when I try to reference this same clock for the second CI task I get an error about "Invalid timing type for this channel". Shouldn't it be possible to reference the 4497 SampleClock for both CI tasks? I've read several posts about using a generated counter to use as a clock for CI tasks, I haven't tried this because referencing the 4497 Clock should be a simple way to sync both CI tasks to the AI card's sampling.

There isn't anything complicated about my setup, simply using DAQmx create channel,timing,start and read. I have LV2013 and a PXIe-1082 chassis.

I'll keep reading though the 6602 timing posts, but if anyone has suggestions please reply.

Thank You.


start digital edge not supported by 6612?

$
0
0

I am trying to support some equipment we have in the field. We are reading a linear and angular encoder trying to synchronize them. We are using PXIe-6612. I am already using the CTR7 to generate a sample clock that the two CI tasks share, wired back into an available PFI line (PFI7 I believe). That's working fine.

 

I was synchronizing the start just by calling the two "DAQ Start" VI's "at the same time" in a sequence structure (we are using LabVIEW 2014). There are questions as to whether this is adequately synchronized. In fact I found quite a difference if I would start angle first then linear, or if I would start linear first then angle.

 

Anyway, start trigger should be easy so I thought I would do that. I have an Allen Bradley PAC in the system that can output a DO and I wanted to use an available PFI line (PFI6 iirc) as a start trigger.

 

Unfortunately when the customer runs this code, the DAQmx Trigger call returns error -200452, which makes it seem like I can't use that function on this card. From what I can tell from the rest of the literature, it should actually work fine.

 

Thanks for any insight anyone can provide. Of course this is made more complicated by the fact that I don't have physical access to the hardwrare at the moment...

 

NI PCIe-6612 Digital filter

$
0
0

Good morning,

I'm using a PCIe-6612 for collecting positions from a couple of angular encoder that produce pulses with a max frequency of 240kHz. The minimum edge length of signal is guarantee to be at least 0.100 us. Unfortunatly PC is located in an environment that has a lot of electrical noise. I've adapted several strategies to avoid common and differential noises but some kind of HF noise is still coming to NI board and sometimes count become not consistent...

I've found a poor documentation and no code samples for these functions, that I suppose can help me:

DAQmxSetCIEncoderAInputDigFltrEnable

DAQmxSetCIEncoderAInputDigFltrMinPulseWidth

DAQmxSetCIEncoderAInputDigFltrTimebaseSrc

DAQmxSetCIEncoderAInputDigFltrTimebaseRate

and complementary functions for channel B.

 

For sure first function enables digital filtering, with the second one I suppose that you can setup the minimum edge width but the measurement unit of parameter "data"  is not specified, I would like to setup minimum rate to 0.75us...

Furthermore I absolutely can not figure out how to use Timebase Source and Timebase Rate functions...

Can anyone help me???

Consider that software is developed with VisualStudio in "c".

Many thanks in advance

 

Error 200279 caused by timer code

$
0
0

After adding a timer code to a larger VI that uses a cDAQ, upon trying to save the data the system VI would freeze the analog input data gathering and after pressing the stop button would return with the Error 200279. I've provided an image showing the overall section and a close up of the timer code

Overall

 

Error_200279.PNG

 

Timer

Timer.PNG

Bonjour! Je suis étudiant en licence et pour un projet je dois activer un programme labview(Vision) à partir d'un camera qui détecte une couleur oû un chrono se d’éclanche lorsque l'objet est dans le champs de vision du camera par contre il s"arrête dans l

$
0
0
Bonjour! Je suis étudiant en licence et pour un projet je dois activer un programme labview(Vision) à partir d'un camera qui détecte une couleur oû un chrono se d’éclanche lorsque l'objet est dans le champs de vision du camera par contre il s"arrête dans le cas contraire

CounterOutputEvent Callback

$
0
0

We have searched the forums and looked for examples but have not been able to find anything that works. We are working in C which makes the examples and help that much less avaliable.

 

Hardware:

NI6612

 

We are suppling an external signal "clock" (10Mhz) that we are down sampling by using a counter.

 

We are using the count edges chan function and trying to attach Register Signal Event with CounterOutputEvent so that we can get a call back. But this gives us the error "Event souce signal specified is not supported with the measurement type and/or sample timing type of the task."

 

DAQmxCreateTask("",&taskHandle);

DAQmxCreateCICountEdgesChan(taskHandle,"/Dev1/ctr1","",DAQmx_Val_Rising, 10, DAQmx_Val_CountDown);

... (other configuration to enable reset and specify port to reset on)

DAQmxRegisterSignalEvent(taskHandle, DAQmx_Val_CounterOutputEvent, 0, CallBack, NULL);

 

 

Currently we are getting the counter to reset to original value when it reaches zero and count down again. This happens in hw and we dont need to monitor the counter. We have tried to set the counter output to pulse so that we can do change detection on a different port but this did not work. the O-scope did not show a signal being generated so that may be the reason change detection event did not trigger.

 

Please help us on how to get a callback when the counter reaches zero.

Synchronization

$
0
0

How can I synchronize two CompactRIOs (9035, 9067)?

6683H GPS Synchronization Questions

$
0
0

Hello,

 

I am using a 6683H in a 1085 Chassis (Gen 2) and want to synchronize it to GPS as tightly as I can, and I came across some device behaviors I wanted more information on (I tried going through the manuals beforehand):

 

System:

1085 Chassis

6683H Card

PXIe-PCIe 8388 

NI-Sync 14.5

NI Visa 15.0

Ni LabVIEW 14.5 SP1 f3

 

1.Looking at the block diagram of the card (nice diagram!):BlockDiagram.PNG

in the Synchronization Clock Generation and Routing section, I see a connection from the PXI chassis clock (PXI_CLK10), and one from the GPS receiver feeding it.

 

How are they operating clock-wise when I am programming the 6683H to output a future time event (using CreateFutureTImeEvent), in terms of driving the circuitry to output a trigger at that time?

More specifically, if I am receiving a GPS signal and I am not connecting the 6683H clock out to the PXI_CLK10 in, which clock is driving/synchronizing the future time event generation...the GPS derived one, the TCXO (which may be disciplining to the GPS signal?) or the PXI_CLK10?

(I assume it's the TCXO as the manual states "The PXI trigger outputs may be synchronized to CLK10 except when routing future time events" but wasn't sure if there was additional synchronization going on elsewhere I should know about)

Also, is the clock driving the future time event the BoardClk?

 

 

2.I have a GPS module that outputs a very stable 10 MHz output and I wanted to try to use it on the 6683H to increase the stability of my system, so I tried following the guide here for clock routing (very nice!): http://www.ni.com/tutorial/53314/en/

(My thought process is to take that module's 10 MHz out and drive/discipline the 6683H's clocks with it)

 

For some reason, I can't seem to follow the "route the PXI_CLK10 to the BoardClk" step here:

Route.PNG

as it seems the Test Panel on my system doesn't recognize the PXI_CLK10 in this test panel

ClockIssue.PNG

 

However, when I route the clocks using the VI "Route Clock.vi" I get no error in doing this:

RouteClock.PNG

is there anything obvious I am doing wrong here?

 

I know there's a TCXO in the 6683H from the documentation, and I'm assuming it's by default linked to the OnBoardClk, but am unsure of what the current clock connection to BoardClk is (is there a way to query this?)

I am primarily interested in this for the CreateFutureTImeEvent and CreateClock functions.

 

 

3.I believe I can improve my antenna setup, but before I do so, I wanted to know what exactly is going on here:

No matter how long I wait (in the presence of more than 4 satellites), the self-survey never seems to complete

SelfSurvey.png

 

However, from the GPS tutorial: http://www.ni.com/tutorial/53314/en/ it says that when the self-survey is complete, the Time Reference Present indicator should be true, and it is although the survey is not complete as shown here:

RefPresent.png

 

Does this mean the time reference is valid, but the self-survey is not complete, and if so, are there any specs for performance degradation in this state? (I want to see if I need to move that antenna...)

 

Thanks for any help/input regarding these questions.


Counter complete on PCIe 6321

$
0
0

I'm trying to send a count complete output pulse to a PFI channel when a counter reaches zero (Ex. Start at count 10 and counter down). The counter appears to be running without error, however the PFI output does not toggle. I know this can be done with an event callback, unfortunately the sotware latencey is insufficient for our application. Any ideas?

 

DAQmxCreateTask("", &_taskCounter);
DAQmxCreateCICountEdgesChan (_taskCounter, "/Dev1/ctr3","", DAQmx_Val_Rising, 10, DAQmx_Val_CountDown );
DAQmxSetCIFreqTerm(_taskCounter,"","/Dev1/PFI5");
DAQmxExportSignal(_taskCounter,DAQmx_Val_CounterOutputEvent,"/Dev1/PFI15");
DAQmxStartTask(_taskCounter);

Counter in USB-6501 cannot reset with the Matlab command "resetCounters" anymore

$
0
0

Hi everyone,

Hope you can help me.

I have build a GUI in Matlab to control daq with the counter in the USB-6501 interface. The counter counts in loops for a specified time interval, and after each loop the counter is being reset. This is done by the command "resetCounters" in the daqtoolbox for Matlab. It worked perfectly, BUT after the program and interface were moved to another computer, it stopped working - also on my machine, when the interface is reconnected. Any ideas what is causing this annoying problem? 

 

Thomas

Counter in USB-6501 cannot reset with the Matlab command "resetCounters" anymore

$
0
0

Hi everyone,

Hope you can help me.

I have build a GUI in Matlab to control daq with the counter in the USB-6501 interface. The counter counts in loops for a specified time interval, and after each loop the counter is being reset. This is done by the command "resetCounters" in the daqtoolbox for Matlab. It worked perfectly, BUT after the program and interface were moved to another computer, it stopped working - also on my machine, when the interface is reconnected. Any ideas what is causing this annoying problem? 

 

Thomas

AsyncCallback with CounterReader deadlocks daqmx tasks

$
0
0

 

I have a scanning microscope system that reads in frames using a NI 6321 board.  Everything is working, but I would like to read out a quadrature encoder synchronously with frames.  I also have this mostly working, but I have some strange deadlocks that I suspect are due to my inexperience with DAQMX and .NET programming. 

 

My current acquisition thread:

 


while (gettingFrames)
{
    do
    {
        status = getFrameReadyStatus();
        Sleep(1);
        
    }while(status == STATUS_BUSY && !previewThreadStop);
        
    CopyFrame(framebufpointer);
}

 

I added a new function readQuadDecoderPostion() right after CopyFrame that reads the current position of a quad decoder hooked up to the microscope.  If I do this in the same thread using ReadMultiSampleDouble to read out the last few positions, everything works, but my maximum frame rate is limited because of the variable delay for ReadMultiSampleDouble.  Makes sense.

 

So now I am trying to do this using async IO.  I've added the following:

 

 

void readDecoderPostionAsync()
{
    System::String ^ path = "C://path//to//save//data"
    
    //feed the callback and path to the the CounterReader class
    counterReader->BeginReadMultiSampleDouble(numberOfSamples, ascX, path);
}

void CounterSaveCallback(System::IAsyncResult ^ar)
{
    array<double>^ counterXData = counterXInReader->EndReadMultiSampleDouble(ar);
    
    //write out samples (few KB of data)
    ...
    
    //setup the read for the next frame when it triggers
    counterReader->BeginReadMultiSampleDouble(numberOfSamples, ascX, (System::String^) ar->AsyncState);
}

void setupAsyncCounter()
{
    //setup the counter to trigger when the frame is ready
    myXCounterTask->Timing->ConfigureSampleClock("/Dev1/PFI0", hz, SampleClockActiveEdge::Rising, SampleQuantityMode::ContinuousSamples, numberOfSamples);    

    //setup couter readers that will return the positions of each frame
    counterReader = gcnew CounterReader(myCounterTask->Stream);

    //setup a callback to handle data saving
    ascX = gcnew System::AsyncCallback(this, CounterSaveCallback);
    myXCounterTask->SynchronizeCallbacks =false;    //doesn't seem to do anything?
}

 

What I think should happen is that each counter read will be handled using a thread in a .NET thread pool, leaving my main worker thread free to handle display updates without lag.  Each counter read callback will then setup the read for the next frame. 

 

What actually happens is that I get through about 5-6 frames and then my scanners completely deadlock and stop triggering for new frames, and then eventually the daqmx task handling the frame scanning times out.  My theory is that somehow doing this asynchronously disturbs the NI board in a way that doing it in a single thread does not, but I can't see how that happens.  My understanding is that the daqmx software is all thread safe, and I've tried to follow the guidelines here: 

 

http://zone.ni.com/reference/en-XX/help/370473H-01/mstudiowebhelp/html/eventscallbacksthreadsafety/

 

What am I missing?

 

NI 6001 device, counter physical channel problem

$
0
0

Hi,

I am an undergraduate student and a beginner in Labview and learned the basics of labview. I want to measure temperature by K-type thermocouple with my NI 6001 DAQmx USB device. I am not an engeneer in electronics but learned a little on how SPI(serial peripherial interference) works. I found and downloaded from ni.com a vi code that is for temperature measurement. I don't use DAQ assistant instead I use DAQmx. My problem is when I connect the USB to computer the physical channels for DI and DO lines immediately appear, however, for Counter channel it does not appear therefore I cannot choose any channel. Where is the mistake I am doing? I tried many times and coud not solve the problem. I hope any of experts can find an answer to my problem.

this is the link for the vi code:

http://ftp.ni.com/pub/devzone/epd/serial_wfm_1_0_1_lv82.zip 

 

Thanks in advance

Synchronization USRP-2920

$
0
0

Hello. I need help about work with USRP-2920. First guestions: transmitter and receiver must starting at the same time. Second guestions: Next generation of transmitter must be only after when the receiver is reseived and processed in the previous package. Please help!!!

 

Elapsed Time VI Not resetting at specified time

$
0
0

Hi. I am using the USB-6215 counter. In labview I have an elapsed time express VI that should reset my while loop after my specified time has elapsed. However, if the counter is waiting for counts to come in, my elapsed time lags and will actually go over my specified time before resetting the while loop.

 

I hope there is some way around this because timing is very important for my project.


timer

$
0
0

Hello everyone, 

I'm a student and i'am looking for help, l learned the basics of labview but not too much i also sow some videos but i'am pressed with time now and i couldn't find a solution.

However, i was assigned to collect the break time of each machine in a production chain in a factory.the supervisor wants to see the break time of the machine processing  when emergency stop button is pressed (true) and when it is not (false) , he wants to stop the timer and display this time.I will join a screenshot of what i did. I use it as a subVI but the problem is that i didnt know how to display the time when the button is not pressed for now i put a null constant in that case until i'll find a solution .Could you please help me getting through this.

 

Timer's error

$
0
0

Good afternoon~ I have some troubles.Could anybody in the forum can help me?

When the timer interrupt,it chose timer overflowing interrupt while it didn’t spill over and enter into interrupting the service function. I would like to ask the following questions: Does timer overflowing interrupt enter into interrupting the service function before time-delay? Or time-delay befor interrupting the service function? void TIM5_Int_Init(u32 psc,u32 arr) {        TIM_TimeBaseInitTypeDef TIM_TimeBaseInitstruct;         NVIC_InitTypeDef NVIC_Initstruct;                  RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM5,ENABLE);                //使能TIM5时钟         TIM_TimeBaseInitstruct.TIM_Prescaler=psc;                //时钟预分频         TIM_TimeBaseInitstruct.TIM_Period=arr;                //设置自动重装载值         TIM_TimeBaseInitstruct.TIM_CounterMode=TIM_CounterMode_Up;                //向上计数模式         TIM_TimeBaseInitstruct.TIM_ClockDivision=TIM_CKD_DIV1;                //不太清除这个的作用         TIM_TimeBaseInit(TIM5,&TIM_TimeBaseInitstruct);         TIM_ITConfig(TIM5,TIM_IT_Update,ENABLE);                //定时器中断使能                  NVIC_Initstruct.NVIC_IRQChannelPreemptionPriority=2;                //设置抢占优先级为2         NVIC_Initstruct.NVIC_IRQChannelSubPriority=2;                //设置副优先级为2         NVIC_Initstruct.NVIC_IRQChannel=TIM5_IRQn;                //TIM5中断通道         NVIC_Initstruct.NVIC_IRQChannelCmd=ENABLE;                //TIM5中断通道使能         NVIC_Init(&NVIC_Initstruct);                  TIM_Cmd(TIM5,ENABLE);                //TIM5时钟使能 } This is initialize function when my timer interrupted.

 

All you suggestions will be appreciated!

Wishes!

http://www.kynix.com

Create short (ns) pulses with a timer/counter

$
0
0

Dear all,

I am currently looking into purchasing equipment for a new test setup.

I will need to create 5 ns long pulses as a sync signal for a laser. The repetition rate will be ~20kHz.

Can I create a 5 ns long pulse with a timer/counter like the PXIe-6614? Or should I use something else.

I need a very reproducable start time of the pulse, this is why I am thinking of a timer/counter.

 

Any advise in this is much appreciated.

 

PCI-6601 female screwlock

$
0
0

I need to know dimensions for female screwlocks (missing screws) that go into the PCI-6601's d-shaped connector. Also need to know dimensions for a missing screw for the SH68-68-D1 Shielded Cable that screws into the female screwlock.

 

Thanks!

Digital filtering on input channels (counter input) on 6601, DAQmx, .net/C*#, 200µs filter

$
0
0

Hi

 

Anyone know how to setup digital filtering using DAQmx on 6601 input channels. Maximum default filter is 5µs but i need a 200µs filter.

 

The channels to filter are input channels on X1 linear encoders (on A, B and gate inputs).

 

I am using DAQmx in .net/C#

 

Thanks,

 

Simon

 

Viewing all 1243 articles
Browse latest View live


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