Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: RBPLC on March 28, 2021, 07:13:46 AM

Title: ASCII Text to C-More
Post by: RBPLC on March 28, 2021, 07:13:46 AM
I am currently using BRX to Modbus read ASCII coded characters from one device. Characters come into BRX correctly and ASCII values are displayed correctly in BRX when choosing ASCII in the Data view. I'm try to combine several of these read characters into a string that can be sent to a C-More panel. For example, I'm trying to take ASCII coded characters in V100-V109, combine them together to form a word which is stored in ss100 and have this sent to C-More. I've tried STRPRINT but all I'm able to do is store the integer representations into ss100. What am I missing?
Title: Re: ASCII Text to C-More
Post by: Controls Guy on March 28, 2021, 12:10:43 PM
Can you target a string with MEMCOPY?   I don't think so.

Look at STRPUTB and STRGETB.
Title: Re: ASCII Text to C-More
Post by: Controls Guy on March 28, 2021, 12:12:18 PM
The other option would be to get everything lined up in contiguous numeric memory and tell the C-More to display as text.
Title: Re: ASCII Text to C-More
Post by: RBPLC on March 28, 2021, 12:22:44 PM
Figured it out. Within STRPRINT: Print to SS100, Raw(V100,1) Raw(V101,1)...
Title: Re: ASCII Text to C-More
Post by: Controls Guy on March 28, 2021, 12:24:58 PM
Figured it out. Within STRPRINT: Print to SS100, Raw(V100,1) Raw(V101,1)...

Thank you!  I have some places I'm  using STRxxxB, whichever it  is, and I think I might like that better!
Title: Re: ASCII Text to C-More
Post by: BobO on March 28, 2021, 01:45:25 PM
There's overlap, but STRXXXB was intended to move the entire string content in and out for comms, whereas Raw() was for building strings.
Title: Re: ASCII Text to C-More
Post by: Controls Guy on March 28, 2021, 03:25:06 PM
I'm squarely in the overlap.  STRxxxB is being used to import bytes from HMI MHR, but then they're used as building blocks for longer strings anyway, so I could go either way.  Will see which way feels cleaner.