Anonymous - 2020-06-16

I am working on parsing/decoding data from a Magnasine Inverter with a PLC
To simulate that traffic, I would like to read a (variable length) line of Hex-encoded ASCII
data from a file, convert that to binary, and then some time later
do it again

a snapshot of data traffic looks like:
Length: 21 INVERTER => 400000F60002790001003311241E6B000001025800
Length: 21 REMOTE_A2 => 00003C04500F170601C8A5860100465000781478A2
Length: 18 BMK_81 => 81550991FFBC089B0C77FFC0E10F00390A01
Length: 21 INVERTER => 400000F60002790001003311241E6B000001025800
Length: 21 REMOTE_A3 => 00003C04500F170601C8A58601005E5F00240200A3
Length: 21 INVERTER => 400000F60002790001003311241E6B000001025800
Length: 21 REMOTE_A4 => 00003C04500F170601C8A58601001E1E00000000A4
Length: 6 AGS_A1 => A102343A007A
I can strip out the first part of each line up to "=> "
Ideally the file stays in ascii for ease of visual identification of data
pairs of chars are read, treated as 0xc1c2, assembled into a packet and sent when newline is encountered