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.

Elapsed time since edge on C1 using TimerInput()


Anton Mar 17, 2024 02:53 PM

I have pulses arriving on C1, C2, C3 and C4, and I would like to measurer the delay of C2, C3, and C4 w.r.t. C1 on a CR1000x.

I tried the following code in my program: 

public elapsed(8)
TimerInput(elapsed(),C1, 1111, 4441, 0, msec)

 but unfortunately it fails to compile, and I haven't found a variation that works

[Version]C:\Campbellsci\Lib\Compilers\CR1000XComp.exe VERSION:CR1000X.Std.06.01 DATE:08/23/2022
test_timerinput.CR1X -- Compile Failed!

line 22: Invalid TimerInput function: 4 for channel C3.
line 22: Invalid TimerInput function: 4 for channel C4.
line 22: Invalid TimerInput function: 4 for channel C5.

Error(s) detected in the program. Double-click an error above to navigate to it.

 Can anyone suggest a solution? 


Sam May 7, 2024 07:08 PM

Anton,

It appears that we have some errors that need addressing.

Some background first: When transitioning from the CR1000 to the CR6/CR1000X, we lost the ability to time edges relative to the start channel. This is due to only passing two terminal inputs (C channels) to each "minion" (a processor sitting behind each port pair). Since there is no global timer to capture edges across minions, we can only measure relative to companion channels (i.e. C2 to C1, C4 to C3, C6 to C5. This means that mode 4 is not available in the CR1000X and we need to fix this error in our documentation.

If I understand your application correctly you will need to

  • You have 4 pulses.
  • Wire Pulse 1 to C1, C3, and C5
  • Wire Pulse 2 to C2
  • Wire Pulse 3 to C4
  • WIre Pulse 4 to C6
  • Use the CRBasic code:
Public elapsed(4)
TimerInput(elapsed,C1, 111111, 303030, 0, msec)
Log in or register to post/reply in the forum.