Tren de pulsos 9401
Buenos días,
Me gustaría saber si puedo realizar un tren de pulsos contínuos de frecuencia 100 Hz utilizando cDAQ y el módulo 9401
Un cordial saludo
Hola flocky
Si que puedes y hay dos maneras de
hacerlo:
1.- La primera solo se puede
utilizar si estas utilizando el modulo 9401 a través de un chasis CompactDAQ
9172, y consiste en utilizar los contadores del chasis CompactDAQ para generar
un tren de pulso. Estos contadores solo son accesibles si el modulo 9401 está
conectado en el slot 5 o 6 del chasis.
2.- La segunda opción es crearte
una tarea de escritura digital temporizada por hardware, con una temporización
de 200Hz de escritura, y escribir un patrón
101010101010101010101010101010101010101010101010 por ejemplo, teniendo activada
la repetitividad del patrón. De esta manera conseguirás escribir un tren de
pulsos de 100Hz
Salu2
Similar Messages
-
Generacion de un tren de pulsos con tarjeta NI PCI 7830R
Hola me gustaria generar un pulso de la menor anchura posible,se podria llegar a el limite de 25 ns???,aquí adjunto un VI que se supone que genera un tren de pulso cuadrados pero me salen triangular?? a que puede ser debido ??'
Muchas Gracias.
Attachments:
nuevaversion.lvproj 11 KB
nuevaversion.vi 96 KBHola,
según el VI que adjuntas, desde luego, es la máxima velocidad a la que se puede generar un tren de pulsos en una FPGA, ya que en cada iteración estás pasando de 0 a 1. El motivo por el que ves una señal triangular quizás puede deberse a la sonda o al osciloscopio que estés usando, es decir, a su ancho de banda.
Si la señal generada está 25 nsg a nivel bajo o a nivel alto, tendrías que tener un equipo que pueda detectar eso. Para que pueda representar bien la señal, debería de mejorar en un x10. Por lo tanto 2.5 nsg o lo que es igual a 400.000.000 Hz de ancho de banda. ¿Tu sonda y osciloscopio soporta esto? ¿Qué frecuencia te detecta?
Espero haber ayudado
crisR -
Buenas,
estoy realizando mi proyecto fin de carrera en el que debo controlar un servomotor mediante el software Labview. Para conseguir el posicionamiento del motor, debo enviarle un tren de pulsos. Utilizo una tarjeta PCI 6221 que dispone de dos contadores y cada contador dispone de 4 pines de conexion (gate, source, out, frecuency). Mi problema está en que yo solo dispongo de dos cables que van al motor para enviarle el tren de pulsos y no se a que pines del contador debo conectarlos. Espero alguna repuesta.
Bye. Gracias.Hola,
que debes que cablear depende como quieres contar. Si cuentas solamente en una dirección es suficiente cablear un señal a source.
Si quieres contar a los dos direcciónes, tienes que cablear tambien el puerto B de contador. Ese linea controla la dirección. Para la PCI-6221 es el Pin 45 de Ctr 0 y 46 de Ctr 1
Así debe funcionar!
Salud, RMathews -
Hola:
Necesito generar un tren de pulsos para controlar un servomotor pero he tenido problemas para configurar la DAQ. Considero que usando counter para generar un tren de pulsos continuos (HW Timed updates), puede convenirme; pero el "external clock type" me pide proporcionar un "clock source" y no sé como hacerlo o configurarlo. Además intente con el tren de pulsos continuos, con las phases que necesito pero, no me manda los cinco Volts sino 2.4 o 2.8 lo que no alcanza a activar el optoacoplador (no sé porque la pérdida de voltaje, ya que se supone el nivel alto debe proporcionar 5 V). El servomotor que estoy usando es el HS322HS, tiene un cable rojo (power), uno negro (negativo) y un amarillo (señal).
Alguna ayuda?????Hola Ismael, Como comentas para controlar tu servo una de las mejores opciones es utilizar el contador. El servo esta esperando recibir un pulso cada 20ms con un ancho de pulso variando desde 1 hasta 2ms, en el cual la longitud del pulso determina la posición a la que va a llegar tu servo (puedes encontrar mas detalles de la duración del pulso en este link: http://www.seattlerobotics.org/guide/servos.html). como lo mencionas tu servo tiene 3 cables el de señal, el positivo y el negativo. La batería con la que alimentas tu servo debe de estar conectada a el positivo y negativo (debes de tener mucho cuidado con la polaridad ya que los servos son muy delicados en ese aspecto y aunque dure poco la polaridad los capacitores internos se pueden quemar muy rápido). Ahora para que hay una relación de la señal tienes que conectar la digital ground del contador también a la tierra de tu servo y el Counter Output a el cable amarillo de tu servo (en el caso de otras marcas el cable de señal puede ser blanco).
Para generar el pulso básicamente puedes hacer dos cosas si utilizas un solo contador puedes jugar con la frecuencia, dado que al servo no le importa la frecuencia sino el ancho de pulso. SI el dutycicle de tu pulso es igual con forme aumentes la frecuencia disminuye el ancho. La segunda opción es simplemente variar el ancho de pulso modificando el duty cicle.
Te anexo un ejemplo sencillo.
La caída de voltaje se puede deber a que le estés demandando mas energía de la que puede dar y por eso se genera la caída de voltaje.
Saludos
Benjamin C
Senior Systems Engineer // CLA // CLED // CTD
Attachments:
PulseServo.vi 28 KB -
How counter and frecuency measuremen​t using parallel port?
Estoy ingresando un tren de pulsos por una linea del
puerto paralelo y necesito detectar los flancos para poder incrementar un contador por cada pulso de entrada.Dear, codeman2:
I thank for infinitely its advice to him. But I must work with the parallel port because one is a didactic project and do not have average acquiring the acquisition boards. In addition to be in a stage of study and investigation all inverted time will bring futures benefits. Thank you very much by his interest and it excuses my ingles. -
Envio de Trem de Pulsos pela porta SERIAL
Olá pessoal. Eu preciso enviar trem de pulsos de frequencia de 1Hz com tempo em nível alto de 5us (micro segundos) durante uns 30 minutos pelo pino 3 da porta serial ( Tx ). Ja montei o circuito de conversao de RS232 para TTL. E no programa ja fiz a rotina basica de envio de sinal pela porta serial e ja constatei seu perfeito funcionamento. O meu problema é que nao consigo enviar um NIVEL 0 para a saida. No bloco respensavel pela escrita VISA SERIA WRITE o valor que coloco é representado em ASCII e nao consigo enviar um nivel logico zero na saida. Ja consultei a tabela e o codigo NUL que representa os bits 0 nao sai. Tentei usar o VI BREAK mas ele nao satisfaz meu projeto pois mantem o nivel baixo somente por 500ms e ocorre um certo delay.
Resumindo COMO ENVIO UM BIT ZERO PARA SAIDA PELO VISA SERIAL WRITE EM ASCII??? Desejo que minha saida fique em zero por alguns segundos.
Obrigado pessoal. Em anexo segue meu programa.
Anexos:
serial.vi 10 KBOi Thiago,
Na saída Serial, todos os valores '0' representam valores positivos e todos os '1' representam valores negativos. Para ficar mais fácil de entender, lembre que o MSB determina o sinal do valor:
0xxxxxxx -> positivo
1xxxxxxx -> negativo
Este link fala um pouco mais sobre como medir os valores da porta serial e aborda esse assunto (as imagens não estão abrindo, mas você consegue abrí-las pelos arquivos em anexo):
http://digital.ni.com/public.nsf/websearch/79B995C3638F4177862572C900593631?opendocument&Submitted&&...
Para você que está trabalhando com comunicação serial, é legal também manter esse guia:
http://www.ni.com/pdf/manuals/371253b.pdf
Espero ter ajudado!
Ricardo Ramos
Engenheiro de Vendas - Sul
National Instruments Brasil -
How can I use my NI 9401 to send a 5V signal to a solid state relay?
To start off, I am a complete novice to LabVIEW and I am working on my senior capstone project. Please, bear with me and I will try my best to help you help me.
I am wanting to use my NI 9401 to send a voltage to a solid state relay so that I can control the temperature of a heating element. Ideally what I want to do is:
1. LabVIEW sends voltage to relay.
2. Relay turns on.
3. Heating element reaches desired temperature.
4. LabVIEW does some sort of pulse to maintain that temperature.
Right now I have one wire set inside of DIO 4 (or pin 20?) because I have read that 4:7 are for outputs. I also have another wire in the first COM slot (pin 1?). I believe that these two wires will be placed in the "input signal" spots on the diagram below.Your description is not very clear for me. However, usually output lines of control boards do not have a 5V signal as required by a solid state relay. The output usually is "TTL compatible" which means that it may be anywhere between 2.8V and 5.0V in high state.
Usually solid state relays are connected to an "open collector output". Most digital outputs can be used in this mode, too. You have to wire the (+) terminal of the relay to a 5VDC source (many boards have a 5VDC output - with limited current capacity, when using an external 5VDC source the GND terminal of the latter must be connected to GND or COM of the board). The (-) output goes to the digital output of the board. When wiring this way, logic states are inverted with respect to the relay operation. The relay will be ON when the digital output is in LOW state and will be OFF when the output is in HIGH state.
Check the current limit of your output line in "sink mode" and compare it with the current requirement of the relay input. Most solid state relays require 10 to 20 milli-amps at the input which is well inside the current limit of most digital outputs (usually 24 milli-amps, sometimes 48 milli-amps). -
Varying ON time pulse train generation using NI cRIO-9073 and NI 9401 module
Hi,
I am a beginner to the Labview environment. Am using NI cRIO-9073 and NI 9401 module; and NI Labview 2013. I want to generate 64 pulses, wherein the ON time of the pulses are varying as shown below. The Pulses need to have a constant period of about 34µs. The pulses should have a constant amplitude anywhere from 5 to 10V. I am trying to do the same in FPGA interface mode but failing to do so. Please advise me..... Please also suggest pdf and video resources to learn Labview programming.
Pulse ON Time
18 µs
19 µs
20 µs
21 µs
22 µs
23 µs
24 µs
25 µs
26 µs
27 µs
28 µs
29 µs
30 µs
31 µs
32 µs
33 µs
33 µs
32 µs
31 µs
30 µs
29 µs
28 µs
27 µs
26 µs
25 µs
24 µs
23 µs
22 µs
21 µs
20 µs
19 µs
18 µs
17 µs
16 µs
15 µs
14 µs
13 µs
12 µs
11 µs
10 µs
09 µs
08 µs
07 µs
06 µs
05 µs
04 µs
03 µs
02 µs
02 µs
03 µs
04 µs
05 µs
06 µs
07 µs
08 µs
09 µs
10 µs
11 µs
12 µs
13 µs
14 µs
15 µs
16 µs
17 µst81,
It is possible to make frequency measurements with either the 9422 or the 9425 but each will have its own limitations in the range of frequency it will be able to accurately measure.
A few things to know:
1. What are the frequency ranges for each sensor (tach and MFM)? More than just knowing Hz/kHz will be helpful.
2. To what accuracy do you need to measure these signals?
The 9422 supports a specialty digital configuration counter input that can be configured for frequency measurement (see link)
http://zone.ni.com/reference/en-XX/help/372603F-01/riohelprt/crio-9422_rt/
The specialty mode is only available when using Scan Interface mode, not with FPGA.
But the max clock rate in the specifications for the 9422 is 4kHz so this may not be sufficient for the tachometer. I believe this is the max rate at which the module will update its state no matter how fast the underlying software (RT controller) is running.
The 9425 has a higher clock rate (~140kHz) but doesn't support the specialty digital mode mentioned above. It is also a software timed only device but this shouldn't be a problem if you use FPGA.
Dan -
How to communicate with a 9401 module using 9151 expansion and 7813r PXI card
Hi,
I have just started working with my 7813 R-series card. I was able to create a simple VI in which I could send and receive digital signals. Now I would like to do something similar using my 9151 expansion chassis and 9401 C-series module. If possible I would like to do all of this using windows (no RT for now). Right now I am right-clicking on "my computer" in the project tree and adding new devices to find the 7813. From there I have a rough idea of how to build a simple VI using the NI example. However, I do not know where to look for the expansion chassis or the C-series module. If any one could give me some advice or point to an example, that would be great. I have seen the examples in Example Finder for the 9401, but they seem to be using a compactDAQ system as opposed to the PXI setup.
Thanks for the help!
Solved!
Go to Solution.Hello ACE_Lab,
The steps you should take in order to configure your setup in the LabVIEW project window is as follows:
Step 1...
Step 2...This step should auto-populate with the existing PXI-7813R if it is connected. If you want to setup the target without the card connected, the you can just add a new target as follows.
Step 3...This is the point at which you will be adding the NI-9151 expansion chassis:
Step 4...
Step 5...
Step 6...If you have the module connected to the chassis, you should be able to see the module in the list:
Step 7...If the module is not connected, you can just select "New Target or Device" from the menu in step 6 and add a new target as follows:
An example from the Example Finder called "Digital Line Input.vi" should be a good place to start. Below is a screenshot of roughly where you need to start:
Regards.
Jeff L.
Applications Engineer | National Instruments -
Can i connect the NI 9401 to the 9162 carrier
Hello, can I connect the NI 9401 to the USb-9162 carrier, instead of having to buy the cDAQ-9172 for just one Module ?
ciao, grazie
M. PetrolekasThe NI 9401 is currently not supported for the USB-9162. I don't know what application you have in mind but you also might want to consider some of NI's other USB devices such as the USB-6212/6, USB-6501, or any of the USB-622x or USB-625x devices.
-
Ok, I have (4) rotary encoders (1600pulses/reve) each. I also have (2) Ni 9401's mounted in slots 5 and 6 of my C-Daq chassis. I followed the quadrature encoder measurements: How to guide with no positive results. I've set up a variety of tasks in MAX (count edges, frequency measure, angular postion, etc) All I really want to do is measure the angular velocity of each of the encoders. At most I should see around 3M encoder pulses per second when the machine the encoders are mounted to is running.
When attempting to count rising edges (on one encoder) I set up a count edges task in MAX when I run the task and I rotate the encoder REALLY slow for 1 revolution I can get ~1600 pulses. If I rotate the encoder fast I get a different and lower value. Also if I rotate in a CCW direction I get one value but the CW direction will yield a diffent count result. I am at a loss here. I've acquired the A and B encoder signals with analog outputs and they are indeed square waves 90degrees out of phase.
A couple other things. I've noticed that I cannot create a task that will incorportate all 4 encoders. Also, I was referencing the 100kHz time base initially, but the timebase cannot be used by multiple counters simultaneously. Attempts to use the 20MHz timebase have failed.
Any help would be greatly appreciated. This was supposed to be a quick job and has taken alot longer than anticipated.Thanks for the link to the spec sheet. I'm still a little confused
about the way you are acquiring the signal. The 9205 has an aggregate
sample rate of 250kHz--if you are reading both A and B inputs at the
same time that would be 125kHz/ch. To accurately characterize a square
wave you should be sampling well above Nyquist. At what rate does the
counter begin to miss pulses?
I am still leaning
towards this being a signal integrity issue--the counters on the 9172
can count edges reliably at up to 20 MHz. I would be interested to
know more about the cabling/shielding involved. Are you following the
recommended connection diagram (shown below) from the RE22 specifications?
The cDAQ-9172 product page mentions that the chassis has two counters in the Overview section--more information can be found in the 9172 User Guide and Specifications
(the counters section starts on page 40). If you let me know which
documentation gave the impression that the 9172 posesses 4 counters I
can look into correcting it.
Also, I think I might not have been clear about the 20 MHz clock. You cannot use this as a timebase to sample the
count register--as mentioned before this would require a data rate not
possible using USB 2.0 (I don't think you really want to acquire 640
Mbit/s per counter anyway). The count register itself updates based
off of an 80 MHz internal timebase and will count external signals at
up to 20 MHz. The sample clock is just the rate that you read data
from the count register, and does not affect how quickly the register
can count edges.
A 3 MHz square wave should be well
within spec for the counters aboard the 9172. The speeds you are
talking about are not absurd for counting operations. The fact that
you followed the devzone article
leads me to believe that you have the channels set up right. I would
double-check your wiring and make sure to follow the recommended
termination procedure mentioned above.
Message Edited by John P on 10-13-2008 07:12 PM
John Passiak
Attachments:
encoder_term.PNG 5 KB -
Can 9401 generate the clock frequency of 20Mhz on 4 Channels in SCTL of 40MHz
We need to use 9401 to generate the clock frequency of 20Mhz on 4 Channels
But as per trhe data sheet
4 output channels........................10 MHz
Does it means that we can get maximum frequency of 10MHz on each channel.
ThanksHello Johan!
Bad news I am afraid….
I assume you are using the Data Acquisition Toolbox from the Mathworks and when it comes to support on that interface I have to advice you to contact the Mathworks for assistance. We don't provide any support on their data acquisition interface since we have nothing to do with it.
Sorry for the inconvenience this might cause you.
Regards,
Jimmie A.
Applications Engineer, National Instruments
Regards,
Jimmie Adolph
Systems Engineer Manager, National Instruments Northern Region
Bring Me The Horizon - Sempiternal -
Hi everyone!
I think I have a strange problem with the NI 9401 modules.
My hardware is a CompactRIO and I'm using Labview 8.0.
I'm reading a 13 bit encoder with two NI 9401 modules: the first for 8 input channels and the second for the other remaining 5. input channels.
13 bits means that the slots in the outest part of the counter are 8192 so i expect my encoder to count up/down till 8192. What instead happens is that the counter goes up to 7934, then suddenly to 7860, then from 0 to 254 and then finally to 0 again and up again to 7934 and the story always goes on like this. I put the true/false outputs of the encoder in a boolean array and then, from the boolean array to a number. (see the attacched VI)
Here's how I devided the inputs between the two modules
-NI 9401 2 :
DIO0= 2^0
DIO1= 2^1
DIO2= 2^2
DIO3= 2^3
DIO4= 2^4
DIO5= 2^5
DIO6= 2^6
DIO7= 2^7
- NI 9401
DIO0= 2^8
DIO1= 2^9
DIO2= 2^10
DIO3= 2^11
DIO4= 2^12
When running the VI I suddenly realized that every time all the input for each modules should be true ( i.e. five leds on for the second module or eight leds on for the first) , the value of all the inputs goes immediately to 0 i.e. all the leds switch off . To make an example: I see 4 leds on for the second module but when comes the time of the fifth, all the leds switch off so it means all the inputs are false which i can't understand. I tried to change the pin assignments in order to read the same inputs from different pins and this did'nt change anything. I tried to use only 4 inputs for the second module and this didn't work. Every time all the inputs for each module should be true it goes up to (n-1) inputs true and the n inputs zero. More information about this strange behaviour: while a normal false input produces a voltage of 0.036 V the voltage I measured from the last pin that should be true and that should give me all the leds on for one module, produces instead -0.146 V.
This is everything I tried in order to solve this problem but now I'm at a dead end.
Could it be a kind of module setting which I didn't consider?
Due to all the attempts I've made I excluded any disfunction of the encoder so I focused my attention to the modules.
Does anyone of you have any idea?
Thanks!!
Rob_F
Attachments:
Prova_encoder2.lvproj 14 KB
Prova_encoder2.vi 155 KBThanks a lot JMota!
We just sent back the encoder to the company who sells them. They want to be sure it's not a product defect or, even worse, a problem of conflict with the NI 9401.
In the meanwhile we built up the acquisition VI for the accelerometer and the encoder. One while loop sends the accelerometer data to a DMA FIFO and another parallel while loop is used to read the encoder outputs and send these data to another DMA FIFO. I did this because I know only 1 DMA FIFO can be used for each channel. When I read the data with two FIFO.read with two parallel loops in the Real-Time I discovered that I can't make them work indipendently as i thought i.e. reading settings of one FIFO.read ( number of elements and loop timing) affects also the other FIFO.read .
Any explanation for this behavior?
Thanks again JMota! -
CDAQ 9401: 2 x CO Pulse Freq?
Hello
I have got a very simple application that uses cDAQ 9172 and a 9401 module in slot 5. Labview 8.2+NiDaqmx 8.7.
The application uses two Counters out to generate PWM so there is no need to reserve the resources as for the bidirectionnal issue of the 9401 that is documented on the forum.
For certain reasons (to treat the PWM=0% and PWM=100% border values) I need to stop and restart one task or the other and sometimes recreate the task. I have tried every single possibility that I thought about and cannot get rid of this -201133 error.
Thanks so much for having a look at the (ugly) code attached.
Christophe
Attachments:
DEBUG1 sequentiel5bisessaidernier.zip 257 KBHello again,
I just would like to add that the problem disappears if I add a second 9401 module in slot 6 and define counter out #1 in the first 9401 module and counter out #2 in the second 9401 module.
What am I doing wrong in the case of both counters out sourced by the same 9401 module?
Thanks,
Christophe -
NI 9401 edges counting forward/backward
How to pragram this application: Pulses will be generated when motor moves, 9401 can count this pulse train when plugging in slot 5 or 6 of 9172. How can i accomplish this: when motor moves clockwise, the pulses count is 1,2.....100; when you chage motor direction, let it move anticlockwise, pulses count will be 100,99.....1. BTW, the motor is brushless DC motor with hall sensor.
Hi terrycong,
You can use an external signal to control whether a counter counts up and down. The NI-DAQmx Express VI Tutorial shows how to set the count direction to an external source.
If you're using a quadrature encoder, there's some how-to information for configuring those, and the example even uses your exact hardware!
Regards,
Kyle
Maybe you are looking for
-
A lot of my Itunes library will no longer transfer to my iphone 4, even though the artist, album or genre is checked in Itunes. If I try to manually drag and drop to my iphone, the dragged song stays clear, and I don't get the green checkmark box sh
-
How to update 2 datagrids in 2 different app at the same time?
I'm very new to flex/flash builder and my question is: first I have to explain how the applications works. The first applications have a form for a customer to fill and datagrid to show the results.The data is send using PHP to a database in the serv
-
Why is mercury playback engine greyed out on the r9 290
hey everyone so i just got the r9 290 and i thought CC was meant to enable open cl but the mercury playback is greyed out
-
Header, Line Item and Cache Techniques Using Hashed Tables
Hi, How can I work with header, line item, and a cache techniques using hashed tables? Thanks, Shah.
-
Does Small photo download affect site size?
I have a trial .Mac account to hold pictures of my new home construction. http://web.mac.com/hawaiithad28 It's close to full. I've already changed my iDisk settings to allow the maximum 70MB. I turned off picture downloading on all the pages, but it