EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
<== Date ==> <== Thread ==>

Subject: RE: USBCTR08 ch0 scaler counts missing
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: Keith Surrena <ks2339 at cornell.edu>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Mon, 28 Aug 2023 15:16:01 +0000

Hi Keith,

 

  • In case it’s helpful to know, we experienced similar difficulty with the 20ns CLKO for triggering devices during flyscans and have been using a SRS DG645 for timing sensitive stuff or a microcontroller with buffered I/O for the less sensitive. We had a major computer upgrade last summer and replaced all of our NI hardware with the USB-CTR08 without any major issues, although we use it primarily through SPEC.

We are currently building a little external box with a one-shot chip and R-C time constant adjustable with a pot to select pulse widths of 1-100 microseconds with either polarity.  That should work for most experiments.  We may use the SoftGlue Zynq module for more complex applications.

 

Mark

 

 

From: Keith Surrena <ks2339 at cornell.edu>
Sent: Monday, August 28, 2023 10:04 AM
To: Mark Rivers <rivers at cars.uchicago.edu>; tech-talk at aps.anl.gov
Subject: RE: USBCTR08 ch0 scaler counts missing

 

Mark,

 

I tested mine with the same frequency inputs and found that my ORd counter output produces a 6-7 ms active low pulse at the start of the scan regardless of the input frequency. I modulated the preset count by a few different decades and found that didn’t yield any change either.

 

In case it’s helpful to know, we experienced similar difficulty with the 20ns CLKO for triggering devices during flyscans and have been using a SRS DG645 for timing sensitive stuff or a microcontroller with buffered I/O for the less sensitive. We had a major computer upgrade last summer and replaced all of our NI hardware with the USB-CTR08 without any major issues, although we use it primarily through SPEC.

 

Keith

 

From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: Thursday, August 24, 2023 6:33 PM
To: Keith Surrena <ks2339 at cornell.edu>; tech-talk at aps.anl.gov
Subject: RE: USBCTR08 ch0 scaler counts missing

 

Hi Keith,

  

  • Do you utilize the prescale mcs functionality with your boxes?

 

Yes, we do.  Typically that is used for dividing stepper motor pulses by N for on-the-fly scanning.

 

  • If so, is ch0 the prescale counter if it’s the only available counter output?

 

No, we use CH7 output for the prescale.  I misspoke earlier, we do bring out CH7 Out to the BNCs on our box.  That is the only counter output we bring out.  The CH0 output is hardwired to CH1-7 Gates inside the box.  For MCS prescaling CH7 Out is connected to clock in (CLKI).

  • I noticed that the counter output waveform differs in that with the measComp driver the counter output waveform is a square pulse of a defined count time whereas with spec, there is usually a 150us initialization pulse that precedes the counter output timing pulse.
  • Could you confirm another behavior for me? If I’m using the preset counters on ch 1-7 with the idle state low, the counter output waveform goes high and then stays high even when the count completes. If I initiate another count sequence, it will dip low at the start, go high for the duration of the count, and then stay high until I once again doing another count. Is this typical or perhaps 

another incompatibility of my patch panel.

I looked at CH7 Out on a scope when I counted for 1 second using the normal CH0 clock.  I observe something interesting.

  • If there are no pulses going to CH7 In then I observe a 200 ns negative pulse output when counting is started, but the signal is otherwise high. 
  • If there are pulses going to CH7 In then I observe a positive pulse on CH7 Out when counting starts, and the signal is otherwise low.  The width of that positive pulse is not completely reproducible, and is a function of the pulse rate on CH7 In.  

Ch7 In rate

Ch7 Out pulse width

100 Hz

20-30 ms

500 Hz

4-6 ms

1000 Hz

2-3 ms

2000 Hz

1-1.5 ms

It looks like the CH7 Out pulse width is 2-3 times the period of the CH7 In signal.  I never see it be high for the entire 1 second time that the scaler is counting.  This behavior is the same if I made CH7 a preset and have it stop the scaler sooner than CH0 does.

 

We are not yet using the USB-CTR08 for real data collection.  But we will be when the APS-U comes up next year.  I have removed all of the SIS3801 and SIS3820 VME scalers we previously used.  I just noticed a problem we will need to address.  We have used the LNE pulse output of the SIS3820 to trigger detectors like the Point Grey, Eiger, Pilatus, etc when doing on-the-fly scanning.  In principle the clock output (CLK0) of the USB-CTR08 is a similar signal.  However, CLK0 is always a 20 ns wide negative pulse, while the LNE on the SIS3820 had programmable width and polarity.  We used this to match the triggering requirements of detectors.  We will need another solution for that with the USB-CTR08.

 

Mark

 

 

From: Keith Surrena <ks2339 at cornell.edu>
Sent: Thursday, August 24, 2023 12:37 PM
To: Mark Rivers <rivers at cars.uchicago.edu>; tech-talk at aps.anl.gov
Subject: RE: USBCTR08 ch0 scaler counts missing

 

Ha it may be a bit of a niche scenario that I don’t think we even have in use at any of the beamlines. I guess it would be if a user wanted to count to monitor on one of said channels and synchronize some piece of hardware that accepted an external enable, on/off style without a set time parameter. My easiest method would be to tie in off whichever counter output channel was the monitor. I have all of my counter outputs going through a multi bit OR gate to simplify cabling.

 

Do you utilize the prescale mcs functionality with your boxes? If so, is ch0 the prescale counter if it’s the only available counter output?

 

From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: Thursday, August 24, 2023 11:43 AM
To: Keith Surrena <ks2339 at cornell.edu>; tech-talk at aps.anl.gov
Subject: RE: USBCTR08 ch0 scaler counts missing

 

Hi Keith,

 

  • Could you confirm another behavior for me? If I’m using the preset counters on ch 1-7 with the idle state low, the counter output waveform goes high and then stays high even when the count completes.

 

I will try to confirm that.  It may take a while, because the enclosures we have built for the USB-CTR08 do not provide connectors for the counter outputs on channels 1-7.  I am curious what you will be using those signals for?

 

Mark

 

 

From: Keith Surrena <ks2339 at cornell.edu>
Sent: Thursday, August 24, 2023 8:45 AM
To: Mark Rivers <rivers at cars.uchicago.edu>; tech-talk at aps.anl.gov
Subject: Re: USBCTR08 ch0 scaler counts missing

 

Thanks, Mark. I overlooked that my patch panel has all of the gates connected at a singular BNC node. Removing CG0 makes it function as expected now. I suspect you’re right that SPEC configures the USBCTR08 differently and allows for a different schematic. I noticed that the counter output waveform differs in that with the measComp driver the counter output waveform is a square pulse of a defined count time whereas with spec, there is usually a 150us initialization pulse that precedes the counter output timing pulse.

 

Could you confirm another behavior for me? If I’m using the preset counters on ch 1-7 with the idle state low, the counter output waveform goes high and then stays high even when the count completes. If I initiate another count sequence, it will dip low at the start, go high for the duration of the count, and then stay high until I once again doing another count. Is this typical or perhaps another incompatibility of my patch panel?

 

Keith Surrena

CHESS

 


From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: Wednesday, August 23, 2023 4:25 PM
To: Keith Surrena <
ks2339 at cornell.edu>; tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: RE: USBCTR08 ch0 scaler counts missing

 

Hi Keith,

 

  • I have TMR0 set at 1 MHz connected to my counter 0 input and my counter 0 output connected to the gate.

 

When you say “connected to the gate” what do you mean?  The EPICS driver assumes that the counter 0 output is connected to the gate of all channels except channel 0, i.e. channels 1-7.  That is documented here: https://epics-modules.github.io/measComp/measCompUSBCTRDoc.html#scaler-record-support

 

  • I can complete a count sequence by using the preset counters on counters 1-7 connected to TMR0 but not c0.

 

When you do preset counts on counters 1-7 that is done in software, not in hardware.  The driver reads a stream of  count values from the scalers and stops when any counter exceeds its present.  So it will always count a little bit more than the present counts.

 

Because counter 0 is used in preset mode, and is connected to the gate of all other counters it will count for exactly the requested number of counts and all other channels will stop at exactly the same time.

 

I just configured my USBCTR-08 as follows:

  • TMR0 set at 1e6 Hz and connected to CTR0.
  • TMR1 set at 1e5 Hz and connected to CTR1.
  • TMR2 set at 1e4 Hz and connected to CTR2.
  • TMR3 set at 1e3 Hz and connected to CTR3.

 

I set the scaler.TP field to 1.0 second and the scaler.FREQ field to 1e6 Hz.  The scaler.G1 field is 1 so it is a preset.  .G2-.G8 are 0 so they are not presets.

 

When I start the scaler record and let it finish counting I see the screen in the attached file.

 

Note that channels 1-4 have exactly the expected counts: 1000000, 100000, 10000, 1000.

 

I am not sure if SPEC and the measComp driver program the UCBCTR-08 in exactly the same way, and if SPEC expects the module to be wired the same way.

 

Mark

 

 

From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Keith Surrena via Tech-talk
Sent: Wednesday, August 23, 2023 2:27 PM
To: tech-talk at aps.anl.gov
Subject: USBCTR08 ch0 scaler counts missing

 

I’m having an issue where counter 0 of my USBCTR08 is not registering counts when I attempt to do a basic scaler count sequence with the MEDM (count time 1s, count preset 1000000). I have TMR0 set at 1 MHz connected to my counter 0 input and my counter 0 output connected to the gate. I can complete a count sequence by using the preset counters on counters 1-7 connected to TMR0 but not c0. I’ve verified my TMR0 signal with an oscope, the numbers and timing on the other preset counters makes sense, and this same hardware setup works at our beamlines that use the USBCTR with SPEC, so I’m fairly confident in the hardware and signal patching. Version info: scaler 4.0, measComp R4.1, and epics 7.0.7.

 

Keith Surrena

CHESS


References:
USBCTR08 ch0 scaler counts missing Keith Surrena via Tech-talk
RE: USBCTR08 ch0 scaler counts missing Mark Rivers via Tech-talk
Re: USBCTR08 ch0 scaler counts missing Keith Surrena via Tech-talk
RE: USBCTR08 ch0 scaler counts missing Mark Rivers via Tech-talk
RE: USBCTR08 ch0 scaler counts missing Keith Surrena via Tech-talk
RE: USBCTR08 ch0 scaler counts missing Mark Rivers via Tech-talk
RE: USBCTR08 ch0 scaler counts missing Keith Surrena via Tech-talk

Navigate by Date:
Prev: RE: USBCTR08 ch0 scaler counts missing Keith Surrena via Tech-talk
Next: sscan build error Vishnu Patel via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
Navigate by Thread:
Prev: RE: USBCTR08 ch0 scaler counts missing Keith Surrena via Tech-talk
Next: Phoebus configuration and PV connection 刘晓敏 via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
ANJ, 29 Aug 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·