High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

Clock source configuration


Hi ALL.

I'm trying to provide the possibility of clock source choice for a user. According the reference help the attribute which is responsible for this operation is NISCOPE_ATTR_INPUT_CLOCK_SOURCE with the list of valid values:

NISCOPE_VAL_NO_SOURCE  ("VAL_NO_SOURCE")
 
NISCOPE_VAL_RTSI_CLOCK  ("VAL_RTSI_CLOCK")
 
NISCOPE_VAL_PFI_1  ("VAL_PFI_1")
 
NISCOPE_VAL_PFI_2  ("VAL_PFI_2")
 
NISCOPE_VAL_PXI_CLOCK  ("VAL_PXI_CLOCK")
 
NISCOPE_VAL_EXTERNAL  ("VAL_EXTERNAL")
 
NISCOPE_VAL_CLK_IN  ("VAL_CLK_IN")

 

What value should I set to make the scope use the internal and external clock?

I guess NISCOPE_VAL_NO_SOURCE and NISCOPE_VAL_EXTERNAL correspondingly, but I’m not sure.

Could anybody confirm or refute the supposition?

0 Kudos
Message 1 of 13
(8,600 Views)

Hello Babay,

This function sets the source for the reference clock that your device will Phase Lock (PLL) to.  "VAL_NO_SOURCE" means that the device will not PLL, and "VAL_EXTERNAL" is actually the same as "VAL_CLK_IN".  This is to maintain compatibility with the older versions of NI-SCOPE.  You can also accept an external reference clock from the PFI lines, the RTSI Clock, or the PXI Clock depending on the device.

If you want to provide an external Sample Clock, you would use the NISCOPE_ATTR_SAMP_CLK_TIMEBASE_SRC attribute.

Let me know if you have any further questions.

Regards,
Sean Close
PSE, High Speed Digitizers

Message 2 of 13
(8,594 Views)
Thanks a lot. I'll check it tomorrow.
0 Kudos
Message 3 of 13
(8,584 Views)

Hi Sean C. ,

 

I have another question concerning external clock. If I set the NISCOPE_ATTR_SAMP_CLK_TIMEBASE_RATE to, lets say 100000000, do I need to set this value to NISCOPE_ATTR_HORZ_SAMPLE_RATE as well (in case if I want the scope to acquire the date with 100000000 samp/sec speed)?

0 Kudos
Message 4 of 13
(8,564 Views)

And in addition.  NISCOPE_ATTR_SAMP_CLK_TIMEBASE_SRC has:

NISCOPE_VAL_CLK_IN

NISCOPE_VAL_NO_SOURCE

NISCOPE_VAL_PXI_STAR

 

So  NISCOPE_VAL_CLK_IN  - External

      NISCOPE_VAL_NO_SOURCE - Internal.

Am I right?

I strange but when I set mentioned attribute to NISCOPE_VAL_CLK_IN it returns me an error...

 

Message Edited by BABAY on 11-17-2006 07:30 AM

0 Kudos
Message 5 of 13
(8,562 Views)
If you are using an external sample clock, you do not need to set the NISCOPE_ATTR_HORZ_SAMPLE_RATE attribute.  The frequency of your external sample clock determines your sample rate.  You can divide down your external sample clock to a slower rate using the NISCOPE_SAMP_CLK_TIMEBASE_DIV attribute.
 
What is the error that you are getting when you try to set the NISCOPE_ATTR_SAMP_CLK_TIMEBASE_SRC attribute?  What hardware are you using?

Message Edited by Sean C. on 11-17-2006 09:44 AM

Message 6 of 13
(8,550 Views)

Hi Sean C. , thank youu for you help.
I've found out the interesting thing. When I try to read the current clock source through the command:

char chClock[13];


ViStatus rc = niScope_GetAttributeViString (this->sessionId, VI_NULL, NISCOPE_ATTR_SAMP_CLK_TIMEBASE_SRC, sizeof(chClock), chClock);


it returns me a warning (rc = 14). This is becouse of chClock is too small, we need at least size of 14 (this is the problem witch I told you before). Afterwards I'm trying to extract the warning like this:


char acqMsg[512];
niScope_GetError(sessionId, &rc, sizeof(acqMsg), acqMsg);


and it returns the empty acqMsg buffer + rc = 0.

Does it mean that the function niScope_GetError works with errors only???
Regards, Valery.

0 Kudos
Message 7 of 13
(8,523 Views)
Hello Valery,

You must provide a ViChar array to serve as a buffer for the value. You pass the number of bytes in the buffer as the bufSize. If the current value of the attribute, including the terminating NUL byte, is larger than the size you indicate in the bufSize, the function copies (bufSize – 1) bytes into the buffer, places an ASCII NUL byte at the end of the buffer, and returns the bufSize you must pass to get the entire value. For example, if the value is 123456 and the bufSize is 4, the function places 123 into the buffer and returns 7. If you want to call this function just to get the required buffer size, you can pass 0 for the bufSize and VI_NULL for the value. If you want the function to fill in the buffer regardless of the number of bytes in the value, pass a negative number for the bufSize.

The defined behavior occurred without error or warning. That is why there is no elaboration.

Regards,
Sean Close

Message 8 of 13
(8,513 Views)
Hello, Sean.
 
Thank you very much.
 
Regards, Valery.
0 Kudos
Message 9 of 13
(8,503 Views)
And another problem:)
 
I don't want to create a new topic, thus I'm asking here. I've found some strange dependence between NISCOPE_ATTR_HORZ_MIN_NUM_PTS and NISCOPE_ATTR_MIN_SAMPLE_RATE attrebutes. When I consistently increse the first one it couses an increase of the second one. Eventually when the NISCOPE_ATTR_HORZ_MIN_NUM_PTS becomes equal to 400000 I'm getting the error:
If you want a higher sampling rate and have a repetitive signal, enable RIS by setting the Enforce Realtime property to False.
 
Device: Dev1
Property: Min Sample Rate
Invalid Value:  12.499750 e12
Maximum Value:  250.0 e6
 
Status Code: -200420
I found the solution in forcing the NISCOPE_ATTR_MIN_SAMPLE_RATE to valid value (lets say 125MS/sec) after I change NISCOPE_ATTR_HORZ_MIN_NUM_PTS. But it looks strange to me and I'm wondering maybe you have an explanation for it.
 
Regards, Valery.
 
PS: all these operations are made in case of EXTERNAL clock source...

Message Edited by BABAY on 11-21-2006 02:33 AM

0 Kudos
Message 10 of 13
(8,501 Views)