NI Home > Community > NI Discussion Forums

Signal Generators

Reply
Member
10310
Posts: 12
0 Kudos

Re: Triangle waveform

My device is PCI 6221 and my labview is version 7.1
Active Participant
Raajit_Lall
Posts: 244
0 Kudos

Re: Triangle waveform

[ Edited ]

Hi,


The PWM signal that you are seeing on your graph contains 1000 points.  You have the DAQ assistants set up to be single point only.  You can set them up for N samples instead of single points and this way all 1000 points will get written to the DAQ board.

You could also do something like include all the channels in one DAQ assistant instead of having separate assistants for each channel. 

If you look at the attached code where I am using DAQmx Vis instead of the DAQ assistant.  I can actually wire unsigned 8 bit integers or unsigned 16 bit integers and that will get written to the 8 or 16 channels that I select in my task appropriately.

That is just an option that you can try.  However to get your code working, you would need to output N samples (i.e. 1000).

As options you could combine all the DAQ assistants into one, or use the DAQmx code as well.




Message Edited by Raajit L on 01-28-2008 03:55 PM
Raajit L
National Instruments
Member
10310
Posts: 12
0 Kudos

Re: Triangle waveform

Thank you
I try to copy all of your picture "2008-01-28 DAQmx.jpg", but I can't find some function. So it's not work. Please you do interface by "2008-01-28 DAQmx.jpg" and post it to me. Thank you.
My labVIEW is version 7.1 and my device is 6221.
Knight of NI
Dennis_Knutson
Posts: 33,138
0 Kudos

Re: Triangle waveform

You've got everything you need. The only thing missing is a couple of indicators and that does not affect the program. Do you not know how to create indicators? You can create them on the front panel or on the diagram, right click on an output of a function and select 'Create Indicator'.
Member
10310
Posts: 12
0 Kudos

Re: Triangle waveform

thanks for your help !!
Now I test and get the output signal that I want. But it's only 1 line (port0.0).I didn't get the signal at the other line (port0.1 - port0.5). I want pwm1 at port0.0 , pwm2 at port0.2 ... and pwm6 at port0.5. How can I get that? Plese you tell me how to interface that.
PS.My LabVIEW is 7.1 and my device is PCI6221
thank you
Knight of NI
Dennis_Knutson
Posts: 33,138
0 Kudos

Re: Triangle waveform

[ Edited ]

Try changing your code to what is shown below. I can't provide a 7.1 VI at this time. Make sure to change your physical channel control to what I've shown as a constant.



Message Edited by Dennis Knutson on 01-31-2008 12:59 PM
Member
10310
Posts: 12
0 Kudos

Re: Triangle waveform

I try to copy your picture but I didn't get a digital signal. How can get the signal. I think I miss some function. Please you tell me.Thank you.
Knight of NI
Dennis_Knutson
Posts: 33,138
0 Kudos

Re: Triangle waveform

You are missing some fundamental understanding of DAQmx, channels, and arrays. You ignored what I said about the channel list.

For each channel, you need to provide a 1D array. If you want to write to 2 channels, you need a 2D array. What I think the DAQmx Write requires is a separate row in the 2D array for each channel. That is why I specified channels 0:5 and used a build array with 6 inputs. It makes no sense to use multiple sine and triangle wave gnerators when you are generating the same signal for all. If you get an error with my setup, you might need to transpose the array before it goes to the DAQmx Read. I could be wrong about the number of rows. It might require a separate column in the 2D array for each channel.

If you run the VI and have problems, be sure to take note of the error code and message that would be generated.

Member
10310
Posts: 12
0 Kudos

Re: Triangle waveform

Thanks for your help. It's make me understand about array and DAQMx. But I have 3 different PWM signal with different phase. It 's not the same 6 PWM signals that I last post. How can I interface that with DAQ. Thank you for your help.

Knight of NI
Dennis_Knutson
Posts: 33,138
0 Kudos

Re: Triangle waveform

Sorry, did not notice the difference phase inputs.

Still you are generating three separate signals and the front panel control is set for 8 channels. What exactly are you trying to do? How many channels do you really want? The number of dimensions in the array have to match the number of channels. Until you fix that, you will get an error and nothing will be generated.