¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Modifying part of a Serial String with an Analog Value #bestpractices #crestron #values


 

So here's what I'm looking to do.

I need to modify this part of a serial string (marked as bold):?
*1*31#VALUE#0*10##
The appropriate range is 1 to 100. So here's what I got (I'm using a slider/gauge to drive the change of the analog value):



That is modifying the serial string at the exact right place/position I want it, but is taking the 1 to 100 value and converting it to ASCII, so instead of putting a decimal value there, it's displaying different ASCII characters positioned 1 through 100 in the ASCII table:



What can I do? Any help would be greatly appreciated. Thanks!


 

Your going to want to do this in s+ if possible will be a lot easier in only a few lines of code?


On Mon, May 25, 2020, 1:16 PM David Chramcow <dchramcow@...> wrote:
So here's what I'm looking to do.

I need to modify this part of a serial string (marked as bold):?
*1*31#VALUE#0*10##
The appropriate range is 1 to 100. So here's what I got (I'm using a slider/gauge to drive the change of the analog value):



That is modifying the serial string at the exact right place/position I want it, but is taking the 1 to 100 value and converting it to ASCII, so instead of putting a decimal value there, it's displaying different ASCII characters positioned 1 through 100 in the ASCII table:



What can I do? Any help would be greatly appreciated. Thanks!


 

¿ªÔÆÌåÓý

Two DIVMODs (one to pull off the hundreds digit, the reminder from that one to get tens/units.

ASUM tens, hundreds, and units with 30h to convert the number to its ASCII equivalent (e.g. 30h = ASCII ¡®0¡¯, 35h = ASCII ¡®5¡¯, etc.

?

Those values go to your ATOS.

?

Instead of ASUMing with 30h you could use 3 ASCALELs instead (min in = 0d, mx in = 9d, min out = 30h, max out= 39h, format = 0d

?

If it¡¯s not frequently changing and you aren¡¯t worried about the performance penalty (or if it¡¯s critical that it¡¯s not 0-padded) S+ is easy but less elegant IMO

?

--

Lincoln King-Cliby, CTS, DMC-E-4K/T/D
Commercial Market Director
Sr. Systems Architect | Crestron Certified Master Programmer (Platinum)
ControlWorks Consulting, LLC |

D: (+1)440.771.4807 | O: (+1)440.449.1100? | F: (+1)440.449.1106
Crestron Services Provider | Biamp Audia Certified | Extron Qualified Independent Programmer

?

From: [email protected] [mailto:[email protected]] On Behalf Of David Chramcow
Sent: Monday, May 25, 2020 1:17 PM
To: [email protected]
Subject: [crestron] Modifying part of a Serial String with an Analog Value #bestpractices #crestron #values

?

So here's what I'm looking to do.

I need to modify this part of a serial string (marked as bold):?

*1*31#VALUE#0*10##

The appropriate range is 1 to 100. So here's what I got (I'm using a slider/gauge to drive the change of the analog value):



That is modifying the serial string at the exact right place/position I want it, but is taking the 1 to 100 value and converting it to ASCII, so instead of putting a decimal value there, it's displaying different ASCII characters positioned 1 through 100 in the ASCII table:



What can I do? Any help would be greatly appreciated. Thanks!


 

Thanks a lot @Lincoln King-Cliby

Unfortunately I had to move on from that in order to finish other parts of the project/program, but I will definitely revisit it later on.

Thanks again mate!