Hi An Dong,
You can use the niHSDIO Export Signal.vi to route your clock to the clock_out pin. You can find more information about this VI, here. The Dynamic Generation with Exported Clocks.vi, which is a LabVIEW shipping example, shows how you can program your PXIe-6556 to export a clock. You can find this example by going to Help»Find Examples, in LabVIEW and navigating to the Hardware Input and Output»Modular Instruments»NI-HSDIO»Dynamic Generation»Non-Scripted section of the NI Example Finder.
I refered to this example. I want to create a new example to generate clock in attachment file but it can not run. Please tell me why it do not run?
Thanks for your help
The error message should inform you why it did not run. For troubleshooting, I would use the Simple Error Handler.vi at the end of your code to display the error message.
From looking at the screenshot that you posted, your block diagram is missing key VIs for defining the task for your HSDIO module. In order to successfully program your HSDIO module, you need to initiate, configure, acquire/generate, and close the session. The LabVIEW shipping examples show how to define a task for your PXI-6556.
Were you able to successfully run the Dynamic Generation with Exported Clocks.vi example that I mentioned earlier? I attached a code snippet below to show how I modified the LabVIEW shipping example.
I was able to successfully use the above code to export the sample clock to the clk_out pin.
The attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at:
Is it not possible to simply generate a clk from the PXI 6556 without data generation? I want to use this clk (exported to CLK_OUT) and pass it through some PLL's and feed it back as input to the CLK_IN pin and use this to acquire data. Is this possible? And if yes, then kindly let me know as to how it is.
Thanks and Regards,
With the PXIe-6556, you have to initiate a session in order to export a clock. You’ll either initiate a generation session or acquisition session.
The Dynamic Generation and Acquisition-Source Synchronous.vi, which comes with the NI-HSDIO driver and can be found in the NI Example Finder, may be the solution that you are looking for. In this VI, the generation task is used to export the clock to the DDC Clk Out terminal (you can change this to the Clk Out terminal). The acquisition session uses the clock that you feed to the Strobe port (not CLK_In).
Thank you for your time and reply!
Yes, I have seen that example, but even in that, some data is being generated. And if I use the "Initiate.vi" without assigning any of the channels for "Dynamic generation", it throws an error. So I went ahead and used the "Commit.vi" to actually send the clock out through the pin. Is this a correct way to do it?
I have another question, if the PXI is continuously acquiring data from an external source at its max sampling rate, 200 MHz, is it possible for the user to simultaneously read back that data at a similar rate? This is to make sure that none of the samples are missed out while continuous acquisition is maintained. I have setup a test bench to perform the above (continuous acquisition) but I am not able to read back at the same rate. I am able to read for a sec or 2 but after that, my code gives an error "Data requested has been overwritten in the device memory". As I lower the data rate I am able to read for longer. There is no post processing done at all in my code presently so that it reads as fast as possible. Kindly let me know if this is possible.
Thanks and Regards,
You are correct in saying that you can use the niHSDIO Commit.vi to allow your device to export the clock without generating data. The code snippet below shows how I accomplished this.
Regarding your second question, I believe you are trying to stream data from your device’s onboard memory to your controller. This will allow you to acquire datasets that are larger than the onboard memory of the device for continuous acquisition. Although your device is able to acquire data at 200 MHz, it does not mean you can stream data back to your controller at that rate. As a result, if you are unable to pull data from the onboard memory of your device, before the buffer is filled, you will run into this error. You’ll need to make sure your system’s total bandwidth allows you to stream data at your required rate.
You can use the Developer Zone article, which can be found here, as a guide for determining your system’s total bandwidth.
Thank you very much for your reply and continued support! I did make a code similar to the code snippet and it works!
One thing I noticed was, in your previous post, you had mentioned, "The Dynamic Generation and Acquisition-Source Synchronous.vi, which comes with the NI-HSDIO driver and can be found in the NI Example Finder, may be the solution that you are looking for. In this VI, the generation task is used to export the clock to the DDC Clk Out terminal (you can change this to the Clk Out terminal). The acquisition session uses the clock that you feed to the Strobe port (not CLK_In)".
Why is it that we should feed the clk only to the "Strobe" port and not the "CLK_In" port? Is it not possible to short the CLK_OUT and the CLK_IN, with the onboard clock being exported to CLK_OUT and acquisition taking place using that clock but in CLK_IN?
Kindly let me know your thoughts.
Thanks and Regards,
The advantage of using the STROBE channel can be found in the Fundamentals>>Digital Terminology»Timing and Triggering»Clocks»STROBE section of the NI Digital Waveform Generator/Analyzer Help.
However, to better answer your question we’ll need to look at the Clocking section of the Help document, which can be found by navigating to Devices»NI 6555/6556»Hardware Architecture»Clocking. In this section we see how the clock signals are routed through the clocking unit.
Since we have the acquisition session and generation session, running at the same time, the STROBE channel allows us to use two different timebases. Without the STROBE channel, we would have to specify the same clock source for both sessions. As a result, I mentioned that the STROBE channel because you mentioned that you plan to export the clock and pass it through some PLL and then import the clock again.