09-25-2018 01:39 PM - edited 09-25-2018 01:42 PM
I have send data from xilinx to pc via usb port, and use usb raw bulk to get data
.
Is There any way to get frequency of input signal?
09-25-2018 02:52 PM
I don't know anything about reading from USB devices, but here's a few suggestions.
1) You need to move the VISA open outside the loop
2) What freq are you expecting? Hz, kHz, MHz?
3) The high resolution timer is probably a good start.
4) String to byte array? Are you sure that's how you should convert the data for plotting.
Anyway, here's an example timer and fixed VISA loop.
09-25-2018 10:23 PM - edited 09-25-2018 10:27 PM
Thanks for reply
@cstorey wrote:
I don't know anything about reading from USB devices, but here's a few suggestions.
1) You need to move the VISA open outside the loop
2) What freq are you expecting? Hz, kHz, MHz?
3) The high resolution timer is probably a good start.
4) String to byte array? Are you sure that's how you should convert the data for plotting.
Anyway, here's an example timer and fixed VISA loop.
the output of visa read is string of characters as i know, so i have to change them to byte array.
the frequency range from Hz-MHz
09-26-2018 09:03 AM
Ok, so did that work for you?
09-27-2018 10:46 AM
No Sir, It did not work, When i change frequency from xilinx, i have to change the number of bytes to read in visa read component.And it is not efficient way.
What i did i build DDS In Xilinx and send data to PC via cypress USB.
Below is the schematic of my board.
and as you see in "waveform_gen.vhd" i have done this by putting reg [31:0] phase = 32'hD1B71; at line "27" to get 20 kHz.
In this way when i put bytes to read to 1000000 i get 20 Hz, and when get phase = 32'hD1B71; (27 kHz) i have to change bytes to read to (20/27)*1000000=740740 to get 27 at labview.
09-28-2018 02:17 PM
Hi, there is something I don't quite understand. Why do you have to change the number of bytes you are reading when you change the frequency?
Why don't you have a fixed number of bytes to read?
09-29-2018 12:01 PM
Ok, I am with you Sir,No problem what is the packet size, But that is what i have noticed.
when i fix the packet size for frequency, i have to change it for the other. i can not figure out ?
10-01-2018 09:18 AM
If you read the value of the phase register in LabVIEW before trying to read the frequency, you might be able to use that value to programmatically change the input of the VISA read function. That way you could do the appropriate reading for every test. Do you get my idea?