Skip to content

SCPIPs: Check only first character of return string to ignore termination with CharDevCom.

Karol Krizka requested to merge kk_chardevcomopcfix into devel

There is a problem when using the CharDevCom with an SCPI power supply (ie: E36313A). The CharDevCom does not strip the termination characters (\n\r) from received messages. Thus one needs to account for them when doing string comparisons of status codes.

The bug is in checking the *OPC? status code which is compared against "1". This will always fail with CharDevCom due to the extra termination characters. This MR patches it by trimming space before the comparison.

Also adds a StringUtils.h containing a set of helper functions for strings to libUtils in a utils namespace. Currently contains the rtrim/ltrim/trim functions to trim whitespace.

Edited by Karol Krizka

Merge request reports