From a5ed615270195fbdba75e4a6bcbea06f52035d95 Mon Sep 17 00:00:00 2001 From: Martin Vladic Date: Thu, 4 Nov 2021 11:45:43 +0100 Subject: [PATCH] #289 --- src/eez/flow/components/scpi.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/eez/flow/components/scpi.cpp b/src/eez/flow/components/scpi.cpp index dbfa91d08..725b8fc60 100644 --- a/src/eez/flow/components/scpi.cpp +++ b/src/eez/flow/components/scpi.cpp @@ -215,7 +215,13 @@ void executeScpiComponent(FlowState *flowState, unsigned componentIndex) { char *strEnd; long num = strtol(resultText, &strEnd, 10); if (*strEnd == 0) { - srcValue = Value(num); + if (num >= INT32_MIN && num <= INT32_MAX) { + srcValue = Value(num, VALUE_TYPE_INT32); + } else if (num >= 0 && num <= UINT32_MAX) { + srcValue = Value(num, VALUE_TYPE_UINT32); + } else { + srcValue = Value(num, VALUE_TYPE_INT64); + } } else { float fnum = strtof(resultText, &strEnd); if (*strEnd == 0) {