Hi,
über USB.PAR.is_connected[idx] findest du, welcher index verbunden ist - und dieser ist dann USB_DEVICE<idx>
device_name := ''; (* Clear for next run *)
FOR i := 0 TO SIZEOF(USB.PAR.is_connected) / SIZEOF(USB.PAR.is_connected[0]) DO
IF USB.PAR.is_connected[i] THEN
brsstrcpy(ADR(device_name), ADR('USB_DEVICE'));
brsitoa(idx, ADR(tmpSTR));
brsstrcat(ADR(device_name), ADR(tmpSTR));
END_IF
END_FOR
IF LEN(device_name) = 0 THEN
// no logging, exit early
EXIT
END_IF
(* Add your logging code here *)
Von der Verwendung der FileIO rate ich an der Stelle ab und empfehle mappData - das kann CSV schon und du musst dich um das Dateihandling nicht mehr selbst kümmern
Hoffe das hilft
Edit: @pavel.vavra he is already using a task that does the detection and linking, so this does not apply ![]()