Pulses generator on pci-6259 with QNX6
I have PCI-6259 DAQ device and I'm programming with QNX6 operating system.
I need make generator of pulses with 100kHz rate on PFI or static outputs.
Does anyone know how to do this or where can I find any examples "C++" code?
Many thanks,
Vsevolod
Hi Vsevolod-
If you are using the M Series MHDDK you can use the attached example. It configures one of the general-purpose counters on the board to output a pulse train that is produced by dividing down the 80MHz timebase on the device. See the function PulseTrainConfigure() for more information.
Hopefully this helps-
Tom W
National Instruments
Attachments:
gpctex5.cpp 10 KB
Similar Messages
-
Writing to digital port disrupting counter on PCI-6259? (nidaqmxbase)
Hello,
I've set up my PCI-6259 with an angular encoder counter, as per the C code example at http://zone.ni.com/devzone/cda/epd/p/id/5735
This appears to work great, but I would also like to use my PCI-6259's digital lines to control a TTL switch on the encoder it's measuring (among other things). If I set up a separate task in the same program and install a new DOChan to the task, it works great: I can control the TTL and measure the encoder position at the same time.
However, I would like to be able to control the digital lines, e.g., via a script, while leaving the encoder readout running continuously. I tried running the angular encoder counter example code, and while it was running, I ran the dio/writeDigPort example.
First of all, the writeDigPort took about 3 times longer than usual to run. It wrote to the digital line successfully, but as soon as it had, it corrupted the counter somehow. The angular encoder example began to spit out garbage, rather than the measured angle.
Is this just a limitation of nidaqmxbase, wherein I cannot use the PCI-6259 resource from multiple processes? I can imagine this being the case, since I think the counter setup is using a DMA.
Or is there a workaround? Any advice is much appreciated, thanks!
-ChaseI think what was meant is that DAQmx Base is not multi-thread safe. From the readme:
NI-DAQmx Base is not multi-thread safe. In LabVIEW, use the error cluster to
force execution order. In C, use only one thread to make API calls; especially
for task/channel creation and deletion.
So, if using DAQmx Base, all of your functions should be in the same thread (i.e. don't make parallel calls to the driver).
Having said this, I notice you're using the PCI-6259 which is supported in DAQmx for Linux. You didn't mention what OS you're using, but if you are able to use the full version of DAQmx I would recommend doing this. DAQmx is multi-thread safe, and provides more functionality and better performance than DAQmx Base.
Best Regards,
John Passiak -
Hello everyone,
We are trying to get on the screen the aquired pulses from our PCI 6602 with a 2121 BNC connector board, from several devices. We are able to read the data and save without problem, but we cannot look at it while we are measuring. Anybody has an idea to how program this in C++ ? Any suggestion is welcome!
Thanks for the helpHi,
try to look for some example programs and Tutorials:
Examples Results
http://search.ni.com/nisearch/app/main/p/bot/no/ap/tech/lang/en/pg/1/sn/catnav:ex/q/DAQmx%20C%2B%2B/...
Tutorials Results
http://search.ni.com/nisearch/app/main/p/bot/no/ap/tech/lang/en/pg/1/sn/catnav:tu/q/DAQmx%20C%2B%2B/...
You should also have a look at the "C Reference Help" which is installed with the NI DAQmx driver.
Acquire N Scans (Visual C++ 6.0, CW++, NI-DAQ)
http://zone.ni.com/devzone/cda/epd/p/id/207
Continuous Analog Acquisition with Producer Consumer Architecture in C#
https://decibel.ni.com/content/docs/DOC-4253
Good Luck!
Matteo -
Generate two different pulses or more continuous​ly with a PCI -6602
I have a PCI-6602 and Labview 8.0. I need to create a complex wavefrom output and I don't know how to create this waveform with the 6602, I know that I can create this pulse format by using the Agilent Pulse Generator but I would like to use the National Instruments. If somebody has an idea about how many counters and the physical connections that I need, also about how can I use labview to generate a complex waveform output.
I've attached the waveform that I need to generate continously and I hope that I can use the PCI-6602 for this purpose.
Attachments:
Pulse format.doc 24 KBThis is a duplicate post, for the main post please see:
NI Discussion Forums: How to generate two diferent pulses and re-trigger such pulses continously
Regards,
Dan King -
Quadrature encoder with PCI-6259 DAQ board (driver for QNX)
where can I find any example for connecting Quadrature Encoders with M Series DAQ Boards ?
The only more or less suitable example I found in nimseries DDK, is
"Count pulses from an external source using an external signal to control
the count direction" (nimseries\Examples\gpctex2.cpp).
But this example is not working correctly with Quadrature Encoders
(encoders with two shifted on 90 degrees phases A&B).
i.e. in case of using this example code I get some extra count while encoder is on vibrant motor
what means enums
typedef enum {
kG0_Up_DownHardware = 2,
kG0_Up_DownHardware_Gate = 3,
} tG0_Up_Down;
and
typedef enum {
kG0_Encoder_Counting_ModeId = 1,
} tId;
in (nimseries\ChipObjects\tTIO.h) ?
What initalization procedure I need to work with Quadrature Encoders?
I have PCI-6259 DAQ device
and I'm writing programm under QNX6 operating systemHello alexey_3269,
If you want to read a quadrature encoder start with gpctex1.cpp and follow the thread.
I give you my code:
BEGIN CODE
==========
boardGpct->G0_Mode.writeG0_Load_Source_Select(tTIO::tG0_Mode::kG0_Load_Source_SelectLoad_A);
boardGpct->G0_Load_A.writeRegister(InitialCount);
boardGpct->G0_Command.writeG0_Load(1);
boardGpct->G0_Load_B.writeRegister(0);
boardGpct->G0_Load_A.writeRegister(0);
boardGpct->G0_Input_Select.setG0_Source_Select(9); //see above for choices, PFI8=9, 100 kHZ=18
boardGpct->G0_Input_Select.setG0_Source_Polarity(1); //0=CCW, 1=CW
//If using 80 MHz timebase
boardGpct->G0_MSeries_Counting_Mode.writeG0_MSeries_Alternate_Synchronization(1);
boardGpct->G0_MSeries_Counting_Mode.setG0_MSeries_Encoder_Counting_Mode(3); //3 for X4 encoder counting
boardGpct->G0_MSeries_Counting_Mode.flush();
//Enable Input Pins
boardGpct->G0_MSeries_ABZ.setG0_A_Select(9); //PFI8=9,
boardGpct->G0_MSeries_ABZ.setG0_B_Select(21); //PFI10=21
boardGpct->G0_MSeries_ABZ.setG0_Z_Select(10); //PFI9=10
boardGpct->G0_MSeries_ABZ.flush();
boardGpct->G0_Mode.setG0_Gate_Polarity(1); //invert=1
boardGpct->G0_Mode.setG0_Output_Mode(tTIO::tG0_Mode::kG0_Output_ModePulse);
boardGpct->G0_Mode.setG0_Loading_On_Gate(tTIO::tG0_Mode::kG0_Loading_On_GateNo_Reload);
boardGpct->G0_Mode.setG0_Loading_On_TC(tTIO::tG0_Mode::kG0_Loading_On_TCRollover_On_TC);
boardGpct->G0_Mode.setG0_Gating_Mode(tTIO::tG0_Mode::kG0_Gating_ModeLevel_Gating); //kG0_Gating_ModeGating_Disabled
boardGpct->G0_Mode.setG0_Gate_On_Both_Edges(tTIO::tG0_Mode::kG0_Gate_On_Both_EdgesBoth_Edges_Disabled);
boardGpct->G0_Mode.setG0_Trigger_Mode_For_Edge_Gate(tTIO::tG0_Mode::kG0_Trigger_Mode_For_Edge_GateGate_Starts_TC_Stops);
boardGpct->G0_Mode.setG0_Stop_Mode(tTIO::tG0_Mode::kG0_Stop_ModeStop_On_Gate);
boardGpct->G0_Mode.setG0_Counting_Once(tTIO::tG0_Mode::kG0_Counting_OnceNo_HW_Disarm);
boardGpct->G0_Mode.setG0_Reload_Source_Switching(tTIO::tG0_Mode::kG0_Reload_Source_SwitchingAlternate);
boardGpct->G0_Mode.flush();
boardGpct->G0_Command.setG0_Up_Down(tTIO::tG0_Command::kG0_Up_DownHardware); //kG0_Up_DownSoftware_Down
boardGpct->G0_Command.setG0_Bank_Switch_Enable(tTIO::tG0_Command::kG0_Bank_Switch_EnableBank_X);
boardGpct->G0_Command.setG0_Bank_Switch_Mode(tTIO::tG0_Command::kG0_Bank_Switch_ModeGate);
boardGpct->G0_Command.flush();
boardGpct->Interrupt_G0_Enable.setG0_TC_Interrupt_Enable(0);
boardGpct->Interrupt_G0_Enable.setG0_Gate_Interrupt_Enable(0);
boardGpct->Interrupt_G0_Enable.flush();
END CODE
========
I hope this code is appropriate to you.
FV1234 -
Pulse patterns with 512us repetition cycle through PCI 7811 with compac RIO
Can we generate specific pulse pattern of 15 to 30 pulses (500KHz frequency and 0.5us pulse width and patterns are transmitted repetedly with 512us interval) using PCI 7811 with compac RIO. I am having hardware but donot find any help in this regard. If some body send a small vi. for help. I shall be really thankful
Yours sincerely
Solved!
Go to Solution.Here's a VI I put together quickly that outputs a fixed pattern. It's barely tested, but it does compile on FPGA. Outputting more than one pattern will require more code, especially since all arrays in FPGA must be fixed-length. If you need to do multiple patterns, and I'm guessing that you do based on your other forum thread, I would look into using a memory block. I am assuming here that the output during the interval between patterns is equivalent to filling that time with false values (no pulse). If that is not the case then you will need to explain what the output should be during that period.
However, if I've correctly understood that the false case is equivalent to no pulses, then it will be easier to use the digital hardware from your other thread instead of FPGA to do this. Just write a pattern that is 512us long - extend your digital pattern with false values to make it the full 512us period.
EDIT: There are a couple of logic errors in this code. It should count to 255, not 1023, and the pattern isn't right on the first iteration. I hope it's enough to get you started, though.
Attachments:
FPGA test.vi 36 KB -
Why is my executable VI not working with a PCI-6259?
I have bought a PCI-6259 which has referencing trigger capability. I wrote a VI for acquiring the data and tested the VI on my PC that has the full developmental LabView 8.2.1 package installed. The trigger is a 1 volt level that is triggered by a potentiometer ranging from 0-5 volts that I control manually. The VI works exactly how I want it to, however, now I want to use the Application Builder to create an executable to distribute the VI to the testing station PC. I then removed the PCI-6259 from the developmental PC and installed it in the testing station PC and loaded the executable VI along with the LabView 8.2.1 Run Time Engine. I open the program and it runs but I cannot get the program to trigger using the same potentiometer so it runs in an infinite loop. I'm pretty sure everything is loaded correctly and the only difference between the two stations is that one has the full developmental LabView package and the other is an executable. Would anyone know why my executable is not working?
Thanks,
Matt KostyalHey Matt,
Thanks for contacting National Instruments support. One thing I'd like to see you try in the DAQ diagnostic utility. I do not suspect a bad card, but it is an executable that we can try that we know was properly built. If it doesn't work that will give us some more insight into the problem if it is truly hardware or software.
Let me know what you find.
Regards,
Kenn North
Senior Product Manager - Search, Product Data
http://ni.com/search -
How to generate a delayed retriggerable pulse using only one counter with PXI 6070E card
Hi
I have a problem in generating a retriggerable delayed pulse with a single counter(triggered through a signal at gate) using PXI 6070E card. VI was developed in NI LabVIEW traditional DAQ Ver.7.1. I have used the "delayed pulse generator config" VI and a "Start counter" & "Stop counter" VIs for the purpose. But there is no output seen at the out terminal of counter. So I introduced a "wait" VI and set it to 1 sec. Now the pulse output appears but some pulses are missing mometarily after every 1 sec interval. (any solution for this)
I have gone through a few similar requests in the forum but they suggest either to use two counters or to generate a finite pulse train which does'nt fit my application. Moreover PXI 6070E has only 2 counter timers. I am already using one counter to measure the frequency of a pulse train(signal 1). The application requires to generate a delayed retriggerable pulse for every pulse in signal 1. So I have only one counter left.
Can I measure the frequency of signal 1 by analog means.? so that I can use two counters for pulse generation. (Signal 1 is a TTL signal).
Request some help.
Thanks in Advance
RegardsA finite pulse train (N_Pulses >= 2) does require the use of 2 counters on most of our older hardware including your 6070E. If you're just talking about generating a single retriggerable pulse, you would only need one counter.
Here's an example in Traditional DAQ that shows you how to set a retriggerable pulse generation (it also allows you to adjust the characteristics of the pulse on-the-fly).
If you're writing a new program, you might consider switching to DAQmx as it supports NI's latest hardware and recent OSes should you ever need to upgrade. Traditional NI DAQ is no longer in active development. Here's an example of how to implement a retriggerable pulse generation in DAQmx. You should take note that you can't use the two drivers to simultaneously talk to the same piece of hardware, although you should be able to go back and forth by resetting the Traditional DAQ driver before switching to DAQmx.
Best Regards,
John Passiak -
DIAdem dac combined with NI PCIe 6259 doesn't send out data
Hi,
I have a NI PCIe 6259 card & DIAdem 11.2.0 (2010 version) on a windows 7 PC.
Analog inputs & analog + digital outputs are configurated in MAX 9.8.0f0. (Global virtual channels)
When I run a dac, analog inputs works perfect.
Both analog and digital outputs doesn't work. Only one of the four analog outputs give out the value which was send out.
In the past I had the same problems with this DIAdem version in combination with a thirth party USB card, but this was solved by new firmware & software drivers.
Someone who had similar problems?
Thanks.
Solved!
Go to Solution.Hello,
I Tried the testpanel. Both analog and digital outputs works correctly.
I have no experience with labview. So this card isn't tested with labview.
One time the digital outputs works with DIAdem, mostly it didn't work. Analog outputs are OK.
GfsDAQ driver version is 11.2.0.
I suppose that this has caused by driver problems. -
Can I run use the traditional NIDAQ Driver with PCI-6259 M
I'm trying to run the Matlab signal processing toolox with my PCI-6259 M series DAQ card. I know that
I can't use the DAQmx driver and Matlab signal processing toolbox together. NI is obviously in competition with
Mathworks b/c there aren't any mathworks products listed although VB are listed. Is there a way I can use the traditional NI-DAQ driver with my card. Yes, I've read the discussion about using the NI commands in Matlab using a the dll. I have signal processing toolbox and I want to use it b/c it's a lot easier.
Thanksnsm...
Unfortunately the answer is no, you can't use the 6259 with Traditional DAQ. It is only supported in DAQmx
StuartG -
Temperature Measurement using Iex Thermistor with PCI 6259
Hello All,
I am having some difficulty measuring temperature using MAX with Iex Thermistor setup, and would like to know if I have missed any thing important. I am using external current excited thermistor with 2 wire configuration and PCI 6259 card with MAX.
This is a channel that was originally configured to Voltage measurement and MAX measures about 900mV from this channel OK, the voltage converts to Temperature to be around 30C. Then I added a new channel and configured it to measure temperature directly using MAX default Iex Thermistor setup. This is when the problem show up: I will get a constant -273C instead of 30C as expected when run the channel in MAX. I must have been doing something wrong here.
Your help is greatly appreciated!
Bryan
Solved!
Go to Solution.Hi Ravens, thank you for taking the time on this problem. I am sure the issue was not caused by the A, B, C parameters being wrong, as when I ran the channel in MAX, I am getting a constant -273.15 value, and it was not updated as a real measurement.
To your 2nd question, this is a case of measuring 1 thermistor value using the Iex Thermistor method vs. Voltage measurement. If I set it up to measure Voltage directly, I can see the realtime updates of the measurement values of voltage, which converted to Temperature in my VI to be reasonable values of temperature.
Bryan -
PICe-6259 with DasyLAB 9 - How to do Analog Output
Hi,
I'm trying to get a small project working in DasyLAB 9.0.2 and I need some serious help.
I'm working with a PCIe-6259 and NiDAQmx 8 is installed. I simply want to create a program that uses a slider to adjust the analog output on 4 channels and read the slider value on a meter. This is a fresh installation of DasyLAB.
Here's the program that I setup and the errors that I get.
I select: Modules -> Input/Output -> NIDAQ -> Analog Output.
I adjust the properties of the DAC module to include channels 0,1,2,3 and select OK. (I don't adjust any of the other properties)
I then select: Modules -> Control -> Slider
I adjust the properties of the slider to include the same channels as above.
I then select: Modules -> Display -> Analog Meter
I adjust the properties of the meter to include the same channes.
The meters and Analog output are wired in parallel.
I get the following errors:
NI-DAQmx: Error Message
Driver: Task DA00, Version: 0.15
Possibly Reason:
-> The module can process the number of "values to be written".
File: ProcessData_KONTINUIERLICH.H, Line: 39
When I press OK I get:
NI-DAQmx: Error Message
Driver: Task DA00, Version: 0.15
Possibly Reason:
-> The driver does not use all NI-DAQmx task channel names. This is not valid, reconfigure the module to use all task channels.
Note: A NI-DAQmx task for analog / digital / frequency output must not have more than 16 channels. If you need more than 16 channels for the output, you must use more NI-DAQmx tasks.
File: MODUL_DA.C, Line: 2131
Any help to point me in the right direction would be greatly appreciated.
The next part of my program will include acquiring data from the analog channels, but I need to get the AO working first. I've run into some issues with Analog Input as well, but I thought I should start with AO first.
Thanks in advance!
ChrisHere's what I did using the NI-DAQmx simulation mode:
- create two tasks
Analog Output - 4 channels, 1k output rate, 100 samples to write, Continuous
Analog Input - 4 channels, 1k input rate, 100 samples to read, Continuous
Save them. Start up or synchronize DASYLab (Under Measurement Boards Settings - NI-DAQmx - Synchronize with... in earlier versions, it's under Hardware Setup)
- Create Slider. Open Slider properties, click on Options, Synchronize to the AO task that you created. This step is really important - it ensures that the data rate matches what NI-DAQmx is expecting.
- Connect Slider to NI-DAQmx AO module, configured for 4 channels.
- Create AI module. Connect to the AI task that you created.
Press Start. It should run. I can't verify absolute accuracy in simulation mode, but, I received no errors.
Your first error is probably the result of the timing being wrong - the Slider defaults to the "Driver" timebase. The rest of the errors seem to be a cascade off the first.
Note - my simulation did not work without the Analog Input. It generated no data. That may be an artifact of the simulator, but, once I put an Analog Input on the worksheet, it ran okay.
I hope this helps.
- cj
Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab. -
How to use counter using PCI 6259
Hello, users,
I have a PCI 6259 board and use Labview 7.1.
I'd like to repetitively count the photon signals at 10ms integration time. I want cumulative counts in every 1 sec (1000ms) (or 1 min (60000ms)) And I want to save counts into txt.file which is open in excel program.
I am a beginner to use counter using PCI 6259 board.
1. Could you explain default NI-DAQmx counter terminals, i.e., CTR 0 SRC, CTR 0 GATE, CTR 0 AUX, and CTR 0 OUT?
2. How do I use them or how can I connect to count TTL pulse using PCI 6259?
3. As I mention my purpose above, which example is the first step to start working my purpose?
4. If you know good example, could you tell me about that?
5. If anyone has labview example which is similar to my aim, could you give me some tips or your examples?
Any hint, comment or advice would be appreciated.
Thank you so much for your response.
Leek2I have never used the PCI 6259 but have used counters many times with labview, the coding should be the same independent of the board. What you want to do is finite buffered edge counting using a internal clock. The best way to do this is to look at the examples programs and use the express vi to get started, then you can use this code to customize your program exactly as you need.
To address your questions:
1. CTR0 means "counter 0" the name of the physical resource sometimes listed at GPCTR0. Each counter has 4 connections to the outside world:
source "src"(for counting input TTL signals),
gate (for synchronizing to external clocks and edges),
out (for pulse-train out operations)
and aux (specialty operations such as up/down counting and encoding)
2.For event counting with internal clocking you will only use the src this is the input from the signal you wish to count (ie PMT discriminator for photon counting).
3,4,5. Look at the count edge examples, there isn't one that does exactly what you want but I have done this with a 6602 (it has e counters) where I use one set of counters to set up a finite pulse train in your case 1000Hz with 1000 pulses, and another counter to edge count on an external pulse, with the source of this pulse routed from the out of the other counter. Then you can start the task and read when 1000 samples are in the buffer (about 1 second later).
Hope this helps,
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA -
Pci 6259 real time windows target matlab
Hello everyone,
I want to buy 1 NI PCI-6259, 2 Cables(SHC68-68-EPM Cable (2m)) and 2
Connector Blocks (SCB-68 - Shielded).
Would you please tell me do I need another hardwarefor
this product?
I want to this product with Matlab Real Time Windows Target.
Would you please tell me do I need what software for
this product to work with Matlab Real Time Windows Target?
Best regards,
NaserHello Olivia
I want to measure impedance of a device.
I want to generate a chirp signal and measure impedance this
device by NI PCI 6259.
My frequency is about 10KHZ to 300KH.
I use Windows xp for this task. I want to use Matlab software.
So, for MAtlab software only DAQmx
driver is needed?
Best regards
Naser -
Hello,
Would you please tell me do existence a tutorial or video for using of
NI-PCI 6259?
Thank you for your attention and time.
Best regardsI want to measurer impedance of a device.
I use a resistor in input of device and I generate a sine voltage with
Analog output of PCI 6259.
Then I measure voltage of resistance and I can measure current of circuit.
Then I divide voltage of device to output current and impedance calculate.
My interested frequency is (10 KHz-500 KHz)
I want to know do Analog output of PCI 6259 can generate a sin wave
with frequency 500KHz and do Analog Input of PCI 6259 can measure a
sin wave with frequency 500KHz?
Please find the attached file
Attachments:
impedance.JPG 8 KB
Maybe you are looking for
-
How do I link pages similar to my e-edition newspaper? I subscribe to an app version of my complete local newspaper. When reading an article on page 1a I can click a link to continue to read on page 4a. Then it flips through the paper to page 4a. Onc
-
How to create dimesion using these IO's
Hi all, Sorry for the simple question I have the following IO's, I want to create a cube how can i arrange these IO's in dimesions 0CO_AREA Controlling area 0CO_DOC_NO CO Document Number 0CO_ITEM_NO Line Item of CO Document 0CURTYPE
-
Please help with LRU algorithm....
I need some help finding an algorithm to achieve the Least Recently Used (LRU) paradigm in memory swapping... Please assist if you have anything to achieve this.... Does java put a timestamp on an item placed in memory?... if so how do I reference th
-
Cannot view third party flash (windows 7)
I've been trying to check the box to enable me to allow third party content but it will not check no matter what I do. I've seen people post about this before, but the other posts were from users with different operating systems. I'm running windows
-
ks01 transaction code i used while create cost center first error is no standard hierarchy so i used kkop code then i gave hierarchy name gave enter but error is hierarchy name does not exist.-->how to solve this error can any one answer this ?