corrects how each channel should be cleared
Some checks failed
Example Action / Lint (push) Successful in 2s
Example Action / BuildAndTest (push) Failing after 9m40s

This commit is contained in:
2025-07-08 12:16:09 +02:00
parent ae20111e42
commit 2717b66fcd
2 changed files with 41 additions and 21 deletions

View File

@@ -40,11 +40,45 @@ record(bi, "$(INSTR)$(NAME):S$(CHANNEL)")
################################################################################
# Count Commands
# Unfortunately, clearing the channels is somewhat complicated as a result of
# the addition of more channels over time and minimal changes to the underlying interface
#
# Urs Greuter provided the following explanation:
#
# bei den Befehlen CC r und HC r ist der Parameter r als bit-Maske zu verstehen:
#
# Bit0: Zähler Channel 1
# Bit2: Zähler Channel 2
# Bit3: Zähler Channel 3
# Bit4: Zähler Channel 4
# Bit5: Zähler Channel Timer
# Bit6: Zähler Channel 5
# Bit7: Zähler Channel 6
# Bit8: Zähler Channel 7
# Bit9: Zähler Channel 8
#
# Beispiele:
# CC 1 setzt den Zähler des Channels 1 zurück
# CC 4 setzt den Zähler des Channels 3 zurück
# CC 5 setzt gleichzeitig die Zähler der Channels 1 und 3 zurück
# CC 16 ist gleichbedeutend wie CT (Timer zurücksetzen)
# CC 511 setzt gleichzeitig die Zähler aller Kanäle (auch des Timers) zurück.
record(calc, "$(INSTR)$(NAME):BM$(CHANNEL)")
{
field(DESC, "Bit Mask for Channel")
field(INPA, $(CHANNEL))
field(CALC, "A > 4 ? 2 ^ A : 2 ^ (A-1)")
field(PINI, "YES")
}
record(longout, "$(INSTR)$(NAME):C$(CHANNEL)")
{
field(DESC, "Clear the current channel count")
field(DTYP, "stream")
field(OUT, "@$(PROTO) clearChannel($(INSTR)$(NAME):, $(CHANNEL)) $(ASYN_PORT)")
field(OMSL, "closed_loop")
field(DOL, "$(INSTR)$(NAME):BM$(CHANNEL) NPP")
field(OUT, "@$(PROTO) clearChannel($(INSTR)$(NAME):) $(ASYN_PORT)")
field(FLNK, "$(INSTR)$(NAME):T$(CHANNEL)")
}

View File

@@ -5,8 +5,8 @@ OutTerminator = CR;
InTerminator = CR;
ReadTimeout = 100;
WriteTimeout = 100;
ReplyTimeout = 200;
LockTimeout = 450;
ReplyTimeout = 1000;
LockTimeout = 500;
initialise {
out "RMT 1"; # Turn on Remote Control
@@ -75,39 +75,25 @@ clearTimer{
}
clearChannel{
out "CC \$2";
out "CC %d";
in;
@mismatch{in "%(\$1MsgTxt)s";}
}
clearCounter4 {
out "CC 1";
in;
out "CC 2";
in;
out "CC 3";
in;
out "CC 4";
out "15";
in;
@mismatch{in "%(\$1MsgTxt)s";}
}
clearCounter8 {
out "CC 5";
in;
out "CC 6";
in;
out "CC 7";
in;
out "CC 8";
out "CC 480";
in;
@mismatch{in "%(\$1MsgTxt)s";}
}
clearCounter10 {
out "CC 9";
in;
out "CC 10";
out "CC 1536";
in;
@mismatch{in "%(\$1MsgTxt)s";}
}