Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

CRBasic Help For CR6


TomWind Mar 15, 2019 02:40 PM

Hi, I am new to Campbell Scientific. I need to write a program for the CR6 datalogger we've ordered to read in a fast PWM signal. According to forum posts and the CR6 manual, some functions I might need are TimerInput() and TimerIO(). However, I can't find any documentation for these functions. I looked on the CRBasic help page, but that appears to only be for the CR300, which I assume doesn't have these instructions available. I also Googled for documentation, but I couldn't find any. How can I find full documentation for CRBasic functions available on the CR6?

Thanks for your help


smile Mar 18, 2019 04:59 PM

Hi

what kind of signal do you need to measure? voltage or frequency? relationship between high time and low time? "fast" ? how fast?

Smile


TomWind Mar 18, 2019 05:35 PM

Hi Smile

I'm measuring a 10bit, approximately 1kHz PWM (digital) signal. This means that the discrete pulse interval length is roughly 1uS. I have to measure the high time and the low time for each duty cycle and make the calculation: high time / (low time + high time) = value. 

It was confirmed by a Campbell Scientific representative that the CR6 has the capability to measure this signal without error. According to the manual for the CR6, on page 226, it says the CR6 has a resolution of 83.33nS for PWM between 0 and 5mS. 

However, I am still not entirely convinced the datalogger has the ability to read the signal. I'm not sure if that 83.33nS resolution refers to the response time to an edge, or the error on the timer, or something else. Our datalogger is still being shipped and I can't order the sensors before I know this will work so I don't have a way to actually test it ahead of time.

From my research about making a PWM algorithm with the CR6, using the functions TimerInput() and TimerIO() was suggested to achieve my precise timing requirements. I hope that by reading the documentation for these I will be able to better understand if my program will work. Like I said earlier though, I can't find any documentation for CR6-specific functions.


smile Mar 18, 2019 05:56 PM

Hi

I am not convinced of the suggested instructions, but I have to document.

Besides ".......According to the manual for the CR6, on page 226, it says the CR6 has a resolution of 83.33nS for PWM between 0 and 5mS. " it seem an output from CR6 not for input.

Meanwhile, try to see the instruction "PeriodAvg ()".
Seen quickly it seems more suitable.

regards

Smile


TomWind Mar 18, 2019 06:15 PM

Do you know of any documentation for these functions, like PeriodAvg, TimerInput, TimerIO?


GaryTRoberts Mar 18, 2019 07:53 PM

Those instructions are documented in the CRBasic help. You might have to update your help files. To do so go to www.campbellsci.com/downloads and selection/download the latest CR6 operating system. Running the executable will update your CRBasic help files as well as put the latest version of CR6 datalogger operating system on hard disk.


TomWind Mar 18, 2019 08:07 PM

Hi Gary

That was the solution. The datalogger hasn't arrived yet, so I didn't think to install the editor since I thought I could find that information online like for the CR300.

Thanks!

Log in or register to post/reply in the forum.