HARSFEN0602
The BH command is used to upload the values recorder by the recorder to a host. The BH
command is designed to optimize the data transfer from the Harmonica to the host, assuming
that the host has the computing power to analyze the Harmonica message.
The basic condition for executing a BH command is that valid data is stored in the recorder
for uploading. In that case the fields of the RC variable define the variables that had been
recorded.
The command BH=n will upload the recorded variable defined by RC&n , where & is the
bit-wise AND operator. For example, if RC=7, the command BH=2 will bring the variable
that would be recorded by setting RC=2, since 7&2=2. BH=3 is illegal, since the binary
representation of BH includes more than one ‘1’ and the uploaded variable is not uniquely
defined. BH=16 will return an error since BH&RC=0.
It is convenient to use hexadecimal notation for the BH command.
BH=0x4000 may look more understandable then BH=32768.
The BH command may load an entire recorded signal, or a part thereof. If RP[8]=0 and
RP[9]=0, then BH=n will upload an entire uploaded signal.
Otherwise, BH will upload the recorded signal starting at the index RP[8], and until the
index of RP[9]. RP[9] must always equal or be less than the length of the recorded signal.
The data is uploaded in hexadecimal form. This is done in order to minimize the
transmission time (relative to ASCII formatted text), while adhering to the ASCII nature of
the transmissions.
Each data byte is parted to two nibbles, and the ASCII code of the nibbles is sent from the
controller to the Host. For example, the short integer number 43794 has the hexadecimal
representation AB12. It will be transmitted as ‘A’,’B’,’1’,’2’, with the most significant
nibble first and the least significant nibble last. The long integer number 1 will be sent as ‘0’
‘0’ ‘0’ ‘0’ ‘0’ ‘0’ ‘0’ ‘1’.
In order to analyze the BH record, one have to understand that the internal representation of
quantities inside the controller is not in user units. For example, the user desires the recorded
motor current in Amperes, but the controller represents currents internally by the bits of the
A/D that measures the current. The BH record uploads recorded currents (and other
variables as well) in their internal representation units-and it also provides the scaling
multiplier to bring it into user units.
That way, no multiplication inaccuracies are introduced to the BH records, and CPU load is
minimized.
The record transmitted by the controller in response to a BH=n command is described
below. The record includes 20 bytes of overhead, and numerical records data.
The values in the table are translated to ASCII as explained above.