08-12-2019 09:07 AM
Hello,
what do i need to create a 100kHz Signal with DutyCyle 40/60 and 180° phase shift on two channels of the NI 9402?
Are the needed VIs part of the "normal" labview installation?
Is there an example available?
The NI9402 is in a cdaq9171 connected via USB to windows computer.
Thanks
Solved! Go to Solution.
08-12-2019 12:01 PM
08-13-2019 02:21 AM - edited 08-13-2019 02:33 AM
Thanks for your answer.
I checked the examples - can someone give me a hint which example to use?
I think it should be the DAQmx -> Counter Output -> "Counter Contionous output.vi"
I select Counter = cDAQ/_ctr0
OutputTerminal = cDAQ1/ai/SampleClock
RUN
The Active LED blinks once
What do i have to select at OutputTerminal.
How to add a second phase shifted channel? @cbutcher What did you mean wth creating patterns?
Thx
08-13-2019 02:44 AM
Hi One,
use a simple DigitalOutput example!
Then create waveforms to resemble the needed duty cylce and phase shift:
08-13-2019 03:05 AM
Hi GerdW,
is the attached screenshot the correct vi?
If yes, then i understand what you desribed and i can just copy and rotate the array.
But: Is there a way to select both lines in the "Line(s)" control and insert both values in the array?
Like (binary):
10
10
10
10
00
00
01
01
01
01
Thanks
08-13-2019 03:18 AM - edited 08-13-2019 03:55 AM
Although it's true that you can more easily set up a PWM using the Counter Outputs, I'm not sure if you can easily configure two channels with a relative phase shift using that method. Perhaps someone else has a simpler solution that uses that idea.
However, here is what I meant with Digital Outputs. I set the sample rate to 100k * N_samples (=5, so 500k) since you wanted 40%, 60%, both of which are integers when multiplied by 5.
The 9402 can output at that speed without problems, and I don't think you need an FPGA to do it (so it should be fine with cDAQ).
Tested using a 6356 USB X-series at 10kHz output rate (so 50kHz) so that I could get AI to read back the output at 200k and not have to sample too quickly.
I used the Stall Data Flow.vim to set a duration (in ms) before stopping, but you might want it to run continuously (in which case, just don't stop it, or use some sort of While loop and Event Structure with a button to stop it, etc, depending on your application.
Two channels are selected at the "Physical Channels" input to Create Virtual Channel.
The attached file is saved for 2017 and includes an analog input task. You'd need to rename the device probably to test with something yourself, and to run it on the cDAQ may be more involved.
08-13-2019 04:55 AM - edited 08-13-2019 05:01 AM
Hi,
thans for the example.
This is working so far. I changed the bool array to size 10.
In your example you have the 100k * N_Samples. So after the change i have 1.000.000 as input for sample clock
This is the problem now. I have no signal any more at the two output channels.
if i change the 100k to 10k then everything is fine (only the frequency is wrong)
I measure with a real scope at the outputs and i see the 10kHz at the outputs.
So there is a problem with the 1.000.000 sampleClock in the vi.
I opened then the MAX Testpanel and output the 100.000 khZ (using counter tab). This can be measured at the scope. So it seems not to be a problem of the 9402 hardware, or?
Do you have an idea what to change to output the 1.000.000?
Thanks
08-13-2019 05:20 AM
08-13-2019 05:50 AM - edited 08-13-2019 05:55 AM
1. No error in Labview
2. The last working frequency is 23.400 which is visible in the 300MHz / 2 GSa/s -Scope with 200us/div.
3. I changed to 10 to create the 60/40 (the - are the 180°
TTTTF-FFFFF
FFFFF-TTTTF
i think this is different to you 5 sample array:
TTFFF
FFFTT
08-13-2019 06:04 AM
1 and 2 sound good. I'm confused by 3, I think I would have thought that was 40/40, with 180deg on the second, so I suppose I misunderstood the naming.
I don't see any reason for the limit there, but I'll try running in DAQmx mode on our cRIO tomorrow if you don't get any earlier answer. It's still not the same as cDAQ but might give me a clue.