I would like to add several custom measurements based on my Scope Channel 1 signal:
1. Current measurement through a 220 ohm resistor
2. Min and max Frequency measurement of the signal applied to the same 220 ohm resistor.
For number 1 I clicked "Add Channel" -> Custom, and added C1/220 to the textarea. This resulted in a new channel in the scope.channel column. I then went to Measurements column and did "Add" -> Custom Channel -> Math 1. This added an M1 measurement to my measurements. I modified the default Javascript to the code below, which (if I understand correctly) should average current through the resistor:
value = 0
Channel.data.forEach(function(sample){
value+=sample
})
value /= (Channel.data.length)
value *= 1000
Is there a cleaner, better way to do this?
Regarding #2, I wasn't able to figure out how to to obtain time measurements, which I assume I would have to do. My guess is I would have to diff two sequential times, and get their inverse to calculate the frequency. If someone could provide an example I would greatly appreciate it.
Question
myfinalstraw
Hi,
I would like to add several custom measurements based on my Scope Channel 1 signal:
1. Current measurement through a 220 ohm resistor
2. Min and max Frequency measurement of the signal applied to the same 220 ohm resistor.
For number 1 I clicked "Add Channel" -> Custom, and added C1/220 to the textarea. This resulted in a new channel in the scope.channel column. I then went to Measurements column and did "Add" -> Custom Channel -> Math 1. This added an M1 measurement to my measurements. I modified the default Javascript to the code below, which (if I understand correctly) should average current through the resistor:
value = 0
Channel.data.forEach(function(sample){
value+=sample
})
value /= (Channel.data.length)
value *= 1000
Is there a cleaner, better way to do this?
Regarding #2, I wasn't able to figure out how to to obtain time measurements, which I assume I would have to do. My guess is I would have to diff two sequential times, and get their inverse to calculate the frequency. If someone could provide an example I would greatly appreciate it.
Thank you in advance,
-Nathan
3 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.